lsp status fix
This commit is contained in:
parent
0c6cba0237
commit
643afc879d
2 changed files with 41 additions and 3 deletions
|
@ -370,3 +370,35 @@
|
||||||
$('#header-host').text(settings.server.replace('HTTP://', ''));
|
$('#header-host').text(settings.server.replace('HTTP://', ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formats the status property to a string (with colors!)
|
||||||
|
* @param status, the status property of a stream
|
||||||
|
*/
|
||||||
|
function formatStatus(status)
|
||||||
|
{
|
||||||
|
if(status == undefined)
|
||||||
|
{
|
||||||
|
return "<span>Unknown, checking...</span>";
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(status)
|
||||||
|
{
|
||||||
|
case 1: return "<span class='green'>Running</span>"; break;
|
||||||
|
case 0: return "<span class='red'>Offline</span>"; break;
|
||||||
|
default: return "<span class='green'>" + status + "</span>"; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
if(status == 1)
|
||||||
|
{
|
||||||
|
$(row.children()[3]).html("<span class='green'>Running</span>");
|
||||||
|
}
|
||||||
|
$(row.children()[3]).html("<span class='red'>" + (status == 0 ? 'Offline' : (!status ? 'Unknown, checking...' : status) ) + "</span>");
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
12
lsp/main.js
12
lsp/main.js
|
@ -438,13 +438,15 @@ TODO als server het stuurt
|
||||||
{
|
{
|
||||||
var row = $('#stream-' + stream);
|
var row = $('#stream-' + stream);
|
||||||
var status = streams[stream][0];
|
var status = streams[stream][0];
|
||||||
|
/*
|
||||||
if(status == 1)
|
if(status == 1)
|
||||||
{
|
{
|
||||||
$(row.children()[3]).html("<span class='green'>Running</span>");
|
$(row.children()[3]).html("<span class='green'>Running</span>");
|
||||||
}else{
|
|
||||||
$(row.children()[3]).html("<span class='red'>" + (status == 0 ? 'Offline' : (!status ? 'Unknown, checking...' : status) ) + "</span>");
|
|
||||||
}
|
}
|
||||||
|
$(row.children()[3]).html("<span class='red'>" + (status == 0 ? 'Offline' : (!status ? 'Unknown, checking...' : status) ) + "</span>");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
$row.children()[3]).html( formatStatus(status) );
|
||||||
|
|
||||||
$(row.children()[4]).text(streams[stream][1]);
|
$(row.children()[4]).text(streams[stream][1]);
|
||||||
}
|
}
|
||||||
|
@ -483,12 +485,16 @@ TODO als server het stuurt
|
||||||
|
|
||||||
$tr.append( $('<td>').text(cstr.name) );
|
$tr.append( $('<td>').text(cstr.name) );
|
||||||
|
|
||||||
|
/*
|
||||||
if(cstr.online && cstr.online == 1)
|
if(cstr.online && cstr.online == 1)
|
||||||
{
|
{
|
||||||
$tr.append( $('<td>').html("<span class='green'>Running</span>") );
|
$tr.append( $('<td>').html("<span class='green'>Running</span>") );
|
||||||
}else{
|
}else{
|
||||||
$tr.append( $('<td>').html("<span class='red'>" + (cstr.online == 0 ? 'Offline' : 'Unknown, checking...') + "</span>") );
|
$tr.append( $('<td>').html("<span class='red'>" + (cstr.online == 0 ? 'Offline' : 'Unknown, checking...') + "</span>") );
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
$tr.append( $('<td>').html( formatStatus(status) );
|
||||||
|
|
||||||
|
|
||||||
var cviewers = 0;
|
var cviewers = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue