diff --git a/lsp/main.js b/lsp/main.js
index 1e921a54..e2b0c471 100755
--- a/lsp/main.js
+++ b/lsp/main.js
@@ -1266,19 +1266,19 @@ function fillServerstatsTables(data) {
$('
').html(
$('').text('1 minute:')
).append(
- $(' ').text(settings.settings.capabilities.load.one/100+'%').css('text-align','right')
+ $(' ').text(settings.settings.capabilities.load.one/100).css('text-align','right')
)
).append(
$(' ').html(
$('').text('5 minutes:')
).append(
- $(' ').text(settings.settings.capabilities.load.five/100+'%').css('text-align','right')
+ $(' ').text(settings.settings.capabilities.load.five/100).css('text-align','right')
)
).append(
$(' ').html(
$('').text('15 minutes:')
).append(
- $(' ').text(settings.settings.capabilities.load.fifteen/100+'%').css('text-align','right')
+ $(' ').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. ').append(
+ $('').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;
diff --git a/lsp/pages.js b/lsp/pages.js
index 8eca216a..6a7dbf7d 100755
--- a/lsp/pages.js
+++ b/lsp/pages.js
@@ -1511,53 +1511,57 @@ function showTab(tabName,streamName) {
case 'server stats':
var $cont = $('').addClass('input_container');
- $cont.append(
- $('
').text('CPU')
- );
- for (var index in settings.settings.capabilities.cpu) {
- if (settings.settings.capabilities.cpu.length > 1) {
- $cont.append(
- $('').text('CPU '+index+1)
- );
+ getData(function(d){
+ settings.settings.capabilities = d.capabilities;
+
+ $cont.append(
+ $('').text('CPU')
+ );
+ for (var index in settings.settings.capabilities.cpu) {
+ if (settings.settings.capabilities.cpu.length > 1) {
+ $cont.append(
+ $('').text('CPU '+index+1)
+ );
+ }
+ for (var property in settings.settings.capabilities.cpu[index]) {
+ $cont.append(
+ $('').text(property.charAt(0).toUpperCase()+property.slice(1)+':').append(
+ $('').text(seperateThousands(settings.settings.capabilities.cpu[index][property],' '))
+ )
+ );
+ }
}
- for (var property in settings.settings.capabilities.cpu[index]) {
+
+ if (settings.settings.capabilities.mem) {
$cont.append(
- $('').text(property.charAt(0).toUpperCase()+property.slice(1)+':').append(
- $('').text(seperateThousands(settings.settings.capabilities.cpu[index][property],' '))
+ $('').text('Memory')
+ ).append(
+ $('').text('Physical memory:').append(
+ $('').attr('id','stats-physical-memory')
+ )
+ ).append(
+ $('').text('Swap memory:').append(
+ $('').attr('id','stats-swap-memory')
)
);
}
- }
-
- if (settings.settings.capabilities.mem) {
- $cont.append(
- $('').text('Memory')
- ).append(
- $('').text('Physical memory:').append(
- $('').attr('id','stats-physical-memory')
- )
- ).append(
- $('').text('Swap memory:').append(
- $('').attr('id','stats-swap-memory')
- )
- );
- }
-
- if (settings.settings.capabilities.load) {
- $cont.append(
- $('').text('CPU Load')
- ).append(
- $('').text('Loading averages:').append(
- $('').attr('id','stats-loading')
- )
- );
- }
- fillServerstatsTables(settings.settings);
-
- theInterval = setInterval(function(){
+
+ if (settings.settings.capabilities.load) {
+ $cont.append(
+ $('').text('Loading average')
+ ).append(
+ $('').text('Loading averages:').append(
+ $('').attr('id','stats-loading')
+ )
+ );
+ }
+ fillServerstatsTables(settings.settings);
+
+ theInterval = setInterval(function(){
+ updateServerstats();
+ },10000);
updateServerstats();
- },10000);
- updateServerstats();
+ },{capabilities:{}});
$('#page').html($cont);
break;