Cleaned source code.

This commit is contained in:
mdtrooper 2016-01-27 13:08:11 +01:00
parent ab64f9100c
commit fe8300655d
5 changed files with 15 additions and 15 deletions

View File

@ -34,7 +34,7 @@ var data = [];
var id = $('.graph').attr('id'); var id = $('.graph').attr('id');
var plot = $.plot("#" + id, data, options); var plot = $.plot("#" + id, data, options);
var refresh = parseInt($('#refresh').val()); var refresh = parseInt($('#refresh').val());
var incremental = $('#checkbox-incremental').is(':checked'); var incremental = $('#checkbox-incremental').is(':checked');
@ -67,7 +67,7 @@ function refresh_graph () {
success: function(serie) { success: function(serie) {
var timestamp = serie.data[0][0]; var timestamp = serie.data[0][0];
data = plot.getData(); data = plot.getData();
if (data.length == 0) { if (data.length == 0) {
for(i = 0; i < max_data_plot; i ++) { for(i = 0; i < max_data_plot; i ++) {
step = i * (refresh/1000); step = i * (refresh/1000);
serie.data.unshift([timestamp-step, 0]); serie.data.unshift([timestamp-step, 0]);
@ -84,12 +84,12 @@ function refresh_graph () {
if (incremental) { if (incremental) {
var last_item = parseInt(data[0].data.length)-1; var last_item = parseInt(data[0].data.length)-1;
var last_value = data[0].data[last_item][1]; var last_value = data[0].data[last_item][1];
var current_value = serie.data[0][1]; var current_value = serie.data[0][1];
serie.data[0][1] = current_value - last_inc; serie.data[0][1] = current_value - last_inc;
last_inc = current_value; last_inc = current_value;
// Incremental is always positive // Incremental is always positive
@ -111,7 +111,7 @@ $('#graph').change(function() {
$('#refresh').change(function() { $('#refresh').change(function() {
var refresh = parseInt($('#refresh').val()); var refresh = parseInt($('#refresh').val());
// Stop and start the Timeout // Stop and start the Timeout
clearTimeout(to); clearTimeout(to);
to = window.setTimeout(refresh_graph, refresh); to = window.setTimeout(refresh_graph, refresh);
@ -153,7 +153,7 @@ function setOID () {
$('.ui-dialog-titlebar-close').trigger('click'); $('.ui-dialog-titlebar-close').trigger('click');
} }
$('#checkbox-incremental').change(function() { $('#checkbox-incremental').change(function() {
incremental = $('#checkbox-incremental').is(':checked'); incremental = $('#checkbox-incremental').is(':checked');
clearGraph(); clearGraph();
}); });
@ -173,13 +173,13 @@ function setOnIncremental() {
function clearGraph() { function clearGraph() {
data = plot.getData(); data = plot.getData();
if (data.length == 0) { if (data.length == 0) {
return; return;
} }
for(i = 0; i < data[0].data.length; i ++) { for(i = 0; i < data[0].data.length; i ++) {
data[0].data[i][1] = 0; data[0].data[i][1] = 0;
} }
$.plot("#" + id, data, options); $.plot("#" + id, data, options);
} }

View File

@ -318,7 +318,7 @@ $(document).ready( function() {
$('li.menu_icon').removeClass( " no_hidden_menu"); $('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px'); $('ul.submenu').css('left', '44px');
$('div#title_menu').hide(); $('div#title_menu').hide();
}); });
$('div.menu>ul>li>ul>li>ul>li>a').click(function() { $('div.menu>ul>li>ul>li>ul>li>a').click(function() {
openTime = 4000; openTime = 4000;
if( typeof(table_hover) != 'undefined') if( typeof(table_hover) != 'undefined')
@ -329,7 +329,7 @@ $(document).ready( function() {
$('li.menu_icon').removeClass( " no_hidden_menu"); $('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px'); $('ul.submenu').css('left', '44px');
$('div#title_menu').hide(); $('div#title_menu').hide();
}); });
}); });

View File

@ -1226,7 +1226,7 @@ function api_get_custom_field_id($t1, $t2, $other, $returnType) {
} }
$name = $other["data"][0]; $name = $other["data"][0];
$id = db_get_value ('id_field', 'tagent_custom_fields', 'name', $name); $id = db_get_value ('id_field', 'tagent_custom_fields', 'name', $name);
$data['type'] = "string"; $data['type'] = "string";
$data["data"] = $id; $data["data"] = $id;
@ -1734,7 +1734,7 @@ function api_get_policy_modules($thrash1, $thrash2, $other, $thrash3) {
if ($other['data'][0] == "") { if ($other['data'][0] == "") {
returnError('error_policy_modules', 'Error retrieving policy modules. Id_policy cannot be left blank.'); returnError('error_policy_modules', 'Error retrieving policy modules. Id_policy cannot be left blank.');
return; return;
} }
$policies = enterprise_hook('policies_get_modules_api', $policies = enterprise_hook('policies_get_modules_api',

View File

@ -632,7 +632,7 @@ function events_comment ($id_event, $comment = '', $action = 'Added comment', $m
case 'oracle': case 'oracle':
$sql_validation = "UPDATE $event_table $sql_validation = "UPDATE $event_table
SET user_comment='" . $comment . "' || user_comment) SET user_comment='" . $comment . "' || user_comment)
WHERE id_evento in (" . implode(',', $id_event) . ")"; WHERE id_evento in (" . implode(',', $id_event) . ")";
$ret = db_process_sql($sql_validation); $ret = db_process_sql($sql_validation);
break; break;

View File

@ -1093,7 +1093,7 @@ function Gauge(placeholderName, configuration)
} }
var point1 = this.valueToPoint(major, 0.7); var point1 = this.valueToPoint(major, 0.7);
var point2 = this.valueToPoint(major, 0.85); var point2 = this.valueToPoint(major, 0.85);
this.body.append("svg:line") this.body.append("svg:line")
.attr("x1", point1.x) .attr("x1", point1.x)
@ -1249,5 +1249,5 @@ function Gauge(placeholderName, configuration)
} }
// initialization // initialization
this.configure(configuration); this.configure(configuration);
} }