From eb57d6f4a4574287921bf975be8ea627724958f9 Mon Sep 17 00:00:00 2001 From: cat Date: Wed, 16 Jan 2013 12:17:04 +0100 Subject: [PATCH] LSP bugfixes - mostly about status displays for protocols and streams --- lsp/functions.js | 10 +- lsp/main.js | 361 ++++++++++++++++++++++++----------------------- lsp/server.html | 2 +- lsp/style.css | 10 +- 4 files changed, 198 insertions(+), 185 deletions(-) diff --git a/lsp/functions.js b/lsp/functions.js index 9f3cd4cf..d984bd08 100644 --- a/lsp/functions.js +++ b/lsp/functions.js @@ -187,7 +187,7 @@ for(var stream in data.streams) { - streams[stream] = [data.streams[stream].online, 0]; + streams[stream] = [data.streams[stream].online, 0, data.streams[stream].error]; cnt++; } @@ -339,7 +339,7 @@ delete data.statistics; // same goes for the stats //IE breaks if the console isn't opened, so keep commented when committing - console.log('[763] SEND', data); + //console.log('[763] SEND', data); $.ajax( { @@ -363,7 +363,7 @@ $('#shield').remove(); // remove loading display //IE breaks if the console isn't opened, so keep commented when committing - console.log('[785] RECV', d); + //console.log('[785] RECV', d); if(d && d['authorize'] && d['authorize']['challenge']) { @@ -435,12 +435,12 @@ { return "Unknown, checking..."; } - switch(status) { case 1: return "Running"; break; case 0: return "Offline"; break; - default: return "" + status + ""; break; + case -1: return "Unknown, checking..."; break; + default: return "" + status + ""; break; } } diff --git a/lsp/main.js b/lsp/main.js index 8eda23ec..04f92a66 100644 --- a/lsp/main.js +++ b/lsp/main.js @@ -79,8 +79,8 @@ // what kind of streams should be displayed? Format is [recorded, live]; var streamsdisplay = [true, true]; - // used on the overview page to decide then to ask the controller for an update check - var updatelastchecked; + // used on the overview page to decide then to ask the controller for an update check + var updatelastchecked; /** * Display a certain page. It contains a (giant) switch-statement, that builds a page depending on the tab requested @@ -174,117 +174,117 @@ case 'overview': - - loadSettings(function(){ - - $uptodate = null; - if (settings.settings.LTS == 1) - { - if ((settings.settings.update == undefined) || (updatelastchecked == undefined) || ((new Date()).getTime() - updatelastchecked > 3600000)) - { - settings.settings.checkupdate = true; - settings.settings.update = {}; - updatelastchecked = (new Date()).getTime(); - loadSettings(function() - { - showTab('overview'); - }); - } - else - { - if (settings.settings.update.uptodate == 0) - { - $uptodate = $('