Move static dir and fix eslint issues
This commit is contained in:
+2
-1
@@ -1,4 +1,5 @@
|
||||
members/static/js/lib
|
||||
infoscreen/static/js/lib
|
||||
webapp/static/js/lib
|
||||
global_static/js/lib
|
||||
static/js/lib
|
||||
collected_static
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true
|
||||
"browser": true,
|
||||
"jquery": true
|
||||
},
|
||||
"globals": {
|
||||
"angular": 1,
|
||||
|
||||
+1
-1
@@ -9,9 +9,9 @@ infoscreen/static/js/hsl.json
|
||||
members/logs/*
|
||||
.idea/
|
||||
logs/
|
||||
/static/
|
||||
/media/
|
||||
node_modules/
|
||||
/.coverage
|
||||
db.sqlite3
|
||||
requirements_henu.txt
|
||||
/collected_static/
|
||||
|
||||
@@ -12,22 +12,13 @@ $(document).ready(function(){
|
||||
|
||||
$(window).resize(resize);
|
||||
|
||||
var defaultBackoffTime = 1000;
|
||||
var modified = 0;
|
||||
|
||||
function fetchdata(data, status){
|
||||
var backoffTime = defaultBackoffTime;
|
||||
modified = 1;
|
||||
if (typeof status !== 'undefined'){
|
||||
if (status == "success"){
|
||||
backoffTime = defaultBackoffTime;
|
||||
parseData(data);
|
||||
}
|
||||
else if (status == "error"){
|
||||
backoffTime *= 2;
|
||||
modified = 0
|
||||
handleError();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,20 +29,21 @@ setInterval(function() {
|
||||
}, 2000);
|
||||
|
||||
function formatBrewTime(){
|
||||
if(!brewtext && lastBrew instanceof Date){
|
||||
if (!brewtext && lastBrew instanceof Date){
|
||||
var now = new Date();
|
||||
var timeDiff = Math.max(now.getTime()-lastBrew.getTime(),0);
|
||||
if(timeDiff < 3600000)
|
||||
tmp = Math.round(timeDiff/60000) + ' min';
|
||||
else
|
||||
tmp = '~' + Math.round(timeDiff/3600000*2)/2 + ' h';
|
||||
var timeDiff = Math.max(now.getTime() - lastBrew.getTime(), 0);
|
||||
var tmp = (timeDiff < 3600000)
|
||||
? Math.round(timeDiff / 60000) + ' min'
|
||||
: '~' + Math.round(timeDiff / 3600000 * 2) / 2 + ' h';
|
||||
|
||||
$("#brewtime").html(tmp);
|
||||
}else
|
||||
} else {
|
||||
$("#brewtime").html(brewtext);
|
||||
}
|
||||
}
|
||||
|
||||
function handleError(){
|
||||
setData("?",0,0,Number.MAX_VALUE,Number.MAX_VALUE);
|
||||
function handleError() {
|
||||
setData("?", 0, 0, Number.MAX_VALUE, Number.MAX_VALUE);
|
||||
}
|
||||
|
||||
function parseData(data) {
|
||||
@@ -62,7 +54,7 @@ function parseData(data) {
|
||||
var cups = data.cups;
|
||||
var brewing = data.brewing;
|
||||
var timeDiff = Math.max(now.getTime() - lastBrew.getTime(),0);
|
||||
var opa = Math.max(100-timeDiff/90000,0);
|
||||
var opa = Math.max(100 - timeDiff / 90000,0);
|
||||
setData(cups, data.temp, opa,now.getTime()-date.getTime(), timeDiff, brewing);
|
||||
}
|
||||
else{
|
||||
@@ -71,9 +63,9 @@ function parseData(data) {
|
||||
}
|
||||
|
||||
function setData(cups, temp, opa, timeFromUpdate, timeFromBrew, brewing){
|
||||
var now = new Date();
|
||||
if(cups == 0)
|
||||
if (cups == 0) {
|
||||
opa = 0;
|
||||
}
|
||||
brewtext = "";
|
||||
$("#upper").css({opacity: opa/100});
|
||||
$("#scale2").css({width: Math.min(cups/9*100,100) + '%'});
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
+2
-2
@@ -237,9 +237,9 @@ STATICFILES_FINDERS = (
|
||||
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||
)
|
||||
STATIC_URL = '/static/'
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, 'collected_static')
|
||||
STATICFILES_DIRS = (
|
||||
os.path.join(BASE_DIR, 'global_static'),
|
||||
os.path.join(BASE_DIR, 'static'),
|
||||
)
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||
MEDIA_URL = '/media/'
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 267 B After Width: | Height: | Size: 267 B |
Reference in New Issue
Block a user