Merged the JS from config.js and events.js into main.js
This commit is contained in:
parent
9b22dae624
commit
5c857029ce
|
@ -1,5 +0,0 @@
|
|||
$(document).ready(function() {
|
||||
$("#tabs").tabs();
|
||||
$(document).tooltip({ track:true });
|
||||
$('#tabs .row:even').addClass('highlight');
|
||||
});
|
|
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
|
@ -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 //
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue