config change

This commit is contained in:
manuel83 2019-01-07 22:34:11 +01:00
parent dcc82d4bd8
commit c984bc1adf
8 changed files with 613 additions and 369 deletions

3
.gitignore vendored
View file

@ -5,4 +5,5 @@ dist
.idea .idea
*.log *.log
cbpi.egg-info cbpi.egg-info
logs logs
cbpi/extension/ui

View file

@ -1,4 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="JSX" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7.1 virtualenv at ~/cbp42" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7.1 virtualenv at ~/cbp42" project-jdk-type="Python SDK" />
</project> </project>

File diff suppressed because it is too large Load diff

View file

@ -6,6 +6,7 @@ index_url: /api/doc
port: 8080 port: 8080
# login data
username: cbpi username: cbpi
password: 123 password: 123

Binary file not shown.

View file

@ -8,4 +8,4 @@ aiojobs==0.2.2
aiosqlite==0.7.0 aiosqlite==0.7.0
cryptography==2.3.1 cryptography==2.3.1
voluptuous==0.11.5 voluptuous==0.11.5
pyfigle==0.7.6 pyfiglet==0.7.6

51
samples.txt Normal file
View file

@ -0,0 +1,51 @@
function noop() {}
export default function (url, opts) {
opts = opts || {};
var ws, num=0, $={};
var max = opts.maxAttempts || Infinity;
$.open = function () {
ws = new WebSocket(url, opts.protocols || []);
ws.onmessage = opts.onmessage || noop;
ws.onopen = function (e) {
(opts.onopen || noop)(e);
num = 0;
};
ws.onclose = function (e) {
e.code === 1e3 || e.code === 1005 || $.reconnect(e);
(opts.onclose || noop)(e);
};
ws.onerror = function (e) {
(e && e.code==='ECONNREFUSED') ? $.reconnect(e) : (opts.onerror || noop)(e);
};
};
$.reconnect = function (e) {
(num++ < max) ? setTimeout(function () {
(opts.onreconnect || noop)(e);
$.open();
}, opts.timeout || 1e3) : (opts.onmaximum || noop)(e);
};
$.json = function (x) {
ws.send(JSON.stringify(x));
};
$.send = function (x) {
ws.send(x);
};
$.close = function (x, y) {
ws.close(x || 1e3, y);
};
$.open(); // init
return $;
}

View file

@ -1,7 +1,7 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
setup(name='cbpi', setup(name='cbpi',
version='4.0.3', version='4.0.4',
description='CraftBeerPi API', description='CraftBeerPi API',
author='Manuel Fritsch', author='Manuel Fritsch',
author_email='manuel@craftbeerpi.com', author_email='manuel@craftbeerpi.com',