From 13e3ff04aa1d2a2dbedac6a261c35588b5d93547 Mon Sep 17 00:00:00 2001 From: laf Date: Sat, 10 Oct 2015 13:49:09 +0000 Subject: [PATCH] Moved some files around --- html/js/librenms.js | 26 ++++++++++++++++++++++++++ html/pages/device/edit.inc.php | 2 ++ html/pages/device/edit/misc.inc.php | 28 ---------------------------- 3 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 html/js/librenms.js diff --git a/html/js/librenms.js b/html/js/librenms.js new file mode 100644 index 0000000000..cd9af4fd6d --- /dev/null +++ b/html/js/librenms.js @@ -0,0 +1,26 @@ +$(document).ready(function() { + $("[name='override_config']").bootstrapSwitch('offColor','danger'); + $('input[name="override_config"]').on('switchChange.bootstrapSwitch', function(event, state) { + event.preventDefault(); + var $this = $(this); + var attrib = $this.data('attrib'); + var device_id = $this.data('device_id'); + $.ajax({ + type: 'POST', + url: 'ajax_form.php', + data: { type: 'override-config', device_id: device_id, attrib: attrib, state: state }, + dataType: 'json', + success: function(data) { + if (data.status == 'ok') { + toastr.success(data.message); + } + else { + toastr.error(data.message); + } + }, + error: function() { + toastr.error('Could not set this override'); + } + }); + }); +}); diff --git a/html/pages/device/edit.inc.php b/html/pages/device/edit.inc.php index fe8a9c2593..47d61d8fcd 100644 --- a/html/pages/device/edit.inc.php +++ b/html/pages/device/edit.inc.php @@ -65,6 +65,8 @@ else { print_optionbar_end(); + echo ''; + if (is_file("pages/device/edit/".mres($vars['section']).".inc.php")) { require "pages/device/edit/".mres($vars['section']).".inc.php"; } diff --git a/html/pages/device/edit/misc.inc.php b/html/pages/device/edit/misc.inc.php index 612af03cdd..5f66c88fd7 100644 --- a/html/pages/device/edit/misc.inc.php +++ b/html/pages/device/edit/misc.inc.php @@ -11,31 +11,3 @@ echo ' '; -?> - -