mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Moved some files around
This commit is contained in:
26
html/js/librenms.js
Normal file
26
html/js/librenms.js
Normal file
@@ -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');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@@ -65,6 +65,8 @@ else {
|
|||||||
|
|
||||||
print_optionbar_end();
|
print_optionbar_end();
|
||||||
|
|
||||||
|
echo '<script src="js/librenms.js"></script>';
|
||||||
|
|
||||||
if (is_file("pages/device/edit/".mres($vars['section']).".inc.php")) {
|
if (is_file("pages/device/edit/".mres($vars['section']).".inc.php")) {
|
||||||
require "pages/device/edit/".mres($vars['section']).".inc.php";
|
require "pages/device/edit/".mres($vars['section']).".inc.php";
|
||||||
}
|
}
|
||||||
|
@@ -11,31 +11,3 @@ echo '
|
|||||||
</form>
|
</form>
|
||||||
';
|
';
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
$("[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');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
Reference in New Issue
Block a user