diff --git a/lsp/main.js b/lsp/main.js index 3a94d10d..3d9ef43f 100644 --- a/lsp/main.js +++ b/lsp/main.js @@ -1100,15 +1100,27 @@ $('#page').append($table); //tooltip - $('.limits_type').add('.limits_name').hover(function(e){ - removeTooltip(); - showTooltip(e,undefined,$(this).children(':selected').data('desc')); - },function(){ - removeTooltip(); + $('.limits_type').live({ + "mouseover": function(e){ + removeTooltip(); + showTooltip(e,undefined,$(this).children(':selected').data('desc')); + }, + "mouseout": function(){ + removeTooltip(); + } + }); + $('.limits_name').live({ + "mouseover": function(e){ + removeTooltip(); + showTooltip(e,undefined,$(this).children(':selected').data('desc')); + }, + "mouseout": function(){ + removeTooltip(); + } }); //change limit value box on type change - $('.limits_name').change(function(){ + $('.limits_name').live("change", function(){ var value = $(this).parents('.limits_row').find(".limits_val").val(); $(this).parents('.limits_row').children('.limit_input_container').html(''); BuildLimitRowInput( @@ -1138,38 +1150,36 @@ $tbody.children('tr').each(function(){ var newval = null; switch ($(this).find(".limits_name").val()) { - case 'geo': - var entries = Array(); - $(this).find('.limit_listentry').each(function(){ - var t = $(this).children(':selected').val(); - if (t != ''){ - entries.push(t); - } - }); - if (entries.length > 0) { + case 'geo': + var entries = Array(); + $(this).find('.limit_listentry').each(function(){ + var t = $(this).children(':selected').val(); + if (t != ''){ + entries.push(t); + } + }); newval = $(this).find('.limit_listtype').children(':selected').val() + entries.join(' '); - } - break; - case 'host': - case 'time': - var t = $(this).find('.limit_listentry').val(); - if ((t != undefined) && (t.toString().split(' ').length > 0)) { - newval = $(this).find('.limit_listtype').children(':selected').val() + t; - } - break; - default: - newval = $(this).find(".limits_val").val(); - break; + break; + case 'host': + case 'time': + var t = $(this).find('.limit_listentry').val(); + if ((t != undefined) && (t.toString().split(' ').length > 0)) { + newval = $(this).find('.limit_listtype').children(':selected').val() + t; + } + break; + default: + newval = $(this).find(".limits_val").val(); + break; } if (newval){ - obj = {"type": $(this).find(".limits_type").val(), "name":$(this).find(".limits_name").val(), "val":newval}; - } - if($(this).find('.new-limit-appliesto').val() == 'server') { - settings.settings.config.limits.push(obj); - console.log('new server limit',obj); - }else{ - settings.settings.streams[$(this).find('.new-limit-appliesto').val()].limits.push(obj); - console.log('new stream limit',$(this).find('.new-limit-appliesto').val(),obj); + obj = {"type": $(this).find(".limits_type").val(), "name":$(this).find(".limits_name").val(), "val":newval}; + if($(this).find('.new-limit-appliesto').val() == 'server') { + settings.settings.config.limits.push(obj); + //console.log('new server limit',obj); + }else{ + settings.settings.streams[$(this).find('.new-limit-appliesto').val()].limits.push(obj); + //console.log('new stream limit',$(this).find('.new-limit-appliesto').val(),obj); + } } }); loadSettings(function(){ @@ -1181,44 +1191,25 @@ break; case 'logs': - $table = $(''); - $table.html(""); - $tbody = $(''); - - if(!settings.settings.log) - { - return; // no logs, so just bail - } - var i, cur, $tr, - logs = settings.settings.log, - len = logs.length; - - if(len >= 2 && settings.settings.log[0][0] < settings.settings.log[len - 1][0]) - { - logs.reverse(); - } - - $tbody.html(''); - - for(i = 0; i < len; i++) - { - cur = settings.settings.log[i]; - - $tr = $('').append( - $('
Date(MM/DD/YYYY)TypeMessage
').text(formatDate(cur[0])) - ).append( - $('').text(cur[1]) - ).append( - $('').text(cur[2]) - ); - - $tbody.append($tr); - } - - $table.append($tbody); - $('#page').append($table); - $('#page').append( + $('').attr('type','checkbox').addClass('logs_refresh') + ).append( + $('').text(' Refresh logs every ') + ).append( + $(''); + $table.html(""); + $tbody = $(''); + + if(!settings.settings.log) + { + return; // no logs, so just bail + } + var i, cur, $tr, + logs = settings.settings.log, + len = logs.length; + + if(len >= 2 && settings.settings.log[0][0] < settings.settings.log[len - 1][0]) + { + logs.reverse(); + } + + $tbody.html(''); + + for(i = 0; i < len; i++) + { + cur = settings.settings.log[i]; + + $tr = $('').append( + $('
Date(MM/DD/YYYY)TypeMessage
').text(formatDate(cur[0])) + ).append( + $('').text(cur[1]) + ).append( + $('').text(cur[2]) + ); + + $tbody.append($tr); + } + + $table.append($tbody); + return $table; + } + break; case 'server stats': diff --git a/lsp/style.css b/lsp/style.css index 7801aa0b..9b958275 100644 --- a/lsp/style.css +++ b/lsp/style.css @@ -295,6 +295,7 @@ thead th .theadinfo th, #login > button, p, +span, label, button, #page label input,