diff --git a/web/app/webroot/js/config.js b/web/app/webroot/js/config.js deleted file mode 100644 index 3d9768007..000000000 --- a/web/app/webroot/js/config.js +++ /dev/null @@ -1,5 +0,0 @@ -$(document).ready(function() { - $("#tabs").tabs(); - $(document).tooltip({ track:true }); - $('#tabs .row:even').addClass('highlight'); -}); diff --git a/web/app/webroot/js/events.js b/web/app/webroot/js/events.js deleted file mode 100644 index ac3fe32d2..000000000 --- a/web/app/webroot/js/events.js +++ /dev/null @@ -1,13 +0,0 @@ -$(document).ready(function() { - $( "#selectable" ).selectable({ - stop: function() { - $base_url = '/events/index/'; - $( ".ui-selected", this ).each(function() { - var index = $( "#selectable li" ).index( this ); - $monitor_id = $(this).attr('id').split('_'); - $base_url = $base_url + 'MonitorId:'+$monitor_id[1]+'/'; - }); - $('#Events').load($base_url + ' #Events'); - } - }); -}); diff --git a/web/app/webroot/js/main.js b/web/app/webroot/js/main.js index 99ce758fd..fe5eddcce 100644 --- a/web/app/webroot/js/main.js +++ b/web/app/webroot/js/main.js @@ -155,5 +155,40 @@ $(document).ready(function() { $('#loadingDiv').hide(); }); // Global // + + // Monitors // + $(".functions").buttonset(); + $(".status").button() + .click(function() { + if ( $(this).text() == 'Enabled' ) { + $status = 0; + } else { + $status = 1; + } + $mid = $(this).attr('id').split("_")[0]; + $.post("/Monitors/index/", { status: $status, mid: $mid }, function(data) { + console.log(data); + }); + }); + + $("#ConfigIndexForm").submit(function() { + var formData = $(this).serialize(); + var formUrl = $(this).attr('action'); + + $.ajax({ + type: 'POST', + url: formUrl, + data: formData, + success: function(data){ + console.log(data); + }, + error: function(xhr, textStatus, error){ + console.log(textStatus); + } + }); + }); + return false; + + // Monitors // });