LSP - bugfix "preview crashes LSP if you dont have any streams yet"
This commit is contained in:
parent
c927170ea2
commit
a52fd35a57
2 changed files with 58 additions and 44 deletions
16
lsp/main.js
16
lsp/main.js
|
@ -1266,19 +1266,19 @@ function fillServerstatsTables(data) {
|
|||
$('<tr>').html(
|
||||
$('<td>').text('1 minute:')
|
||||
).append(
|
||||
$('<td>').text(settings.settings.capabilities.load.one/100+'%').css('text-align','right')
|
||||
$('<td>').text(settings.settings.capabilities.load.one/100).css('text-align','right')
|
||||
)
|
||||
).append(
|
||||
$('<tr>').html(
|
||||
$('<td>').text('5 minutes:')
|
||||
).append(
|
||||
$('<td>').text(settings.settings.capabilities.load.five/100+'%').css('text-align','right')
|
||||
$('<td>').text(settings.settings.capabilities.load.five/100).css('text-align','right')
|
||||
)
|
||||
).append(
|
||||
$('<tr>').html(
|
||||
$('<td>').text('15 minutes:')
|
||||
).append(
|
||||
$('<td>').text(settings.settings.capabilities.load.fifteen/100+'%').css('text-align','right')
|
||||
$('<td>').text(settings.settings.capabilities.load.fifteen/100).css('text-align','right')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -1292,6 +1292,15 @@ function updateServerstats() {
|
|||
}
|
||||
|
||||
function buildstreamembed(streamName,embedbase) {
|
||||
if (typeof streamName == 'undefined') {
|
||||
$('#subpage').html('You\'ll have to setup a stream before you can view it.<br>').append(
|
||||
$('<button>').text('New stream').css('float','left').click(function(){
|
||||
showTab('edit stream','_new_');
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$('#liststreams .button.current').removeClass('current')
|
||||
$('#liststreams .button').filter(function(){
|
||||
return $(this).text() == streamName;
|
||||
|
@ -1456,6 +1465,7 @@ function buildstreamembed(streamName,embedbase) {
|
|||
}
|
||||
document.getElementById('preview-container').appendChild( script );
|
||||
|
||||
|
||||
// stream info
|
||||
getData(function(returnedData){
|
||||
settings.settings.streams = returnedData.streams;
|
||||
|
|
|
@ -1511,6 +1511,9 @@ function showTab(tabName,streamName) {
|
|||
case 'server stats':
|
||||
var $cont = $('<div>').addClass('input_container');
|
||||
|
||||
getData(function(d){
|
||||
settings.settings.capabilities = d.capabilities;
|
||||
|
||||
$cont.append(
|
||||
$('<p>').text('CPU')
|
||||
);
|
||||
|
@ -1545,7 +1548,7 @@ function showTab(tabName,streamName) {
|
|||
|
||||
if (settings.settings.capabilities.load) {
|
||||
$cont.append(
|
||||
$('<p>').text('CPU Load')
|
||||
$('<p>').text('Loading average')
|
||||
).append(
|
||||
$('<label>').text('Loading averages:').append(
|
||||
$('<table>').attr('id','stats-loading')
|
||||
|
@ -1558,6 +1561,7 @@ function showTab(tabName,streamName) {
|
|||
updateServerstats();
|
||||
},10000);
|
||||
updateServerstats();
|
||||
},{capabilities:{}});
|
||||
|
||||
$('#page').html($cont);
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue