From 07027036bc14ebbb75e54f81b3134ec2b9dc0783 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sun, 29 Jan 2017 03:43:04 +0000 Subject: Add notifydevices param and add it to all actions that modify devices (not yet implemented) Modify HTML views to display confirm warning about possible reboot when notifying devices Split several get_ functions so notifydevices would not appear for new objects Cleaned up some get_ functions to use handle_clientdata Do not display filecontent in createtemplate HTML view (or write it in model) Fix exception if bulkcreatedevices called with empty list Modify 'device' provisioning_groups seq from 1 to 5 to allow notifydevices to display first --- provisioning-editdevice-html.lsp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'provisioning-editdevice-html.lsp') diff --git a/provisioning-editdevice-html.lsp b/provisioning-editdevice-html.lsp index fe375aa..85161b7 100644 --- a/provisioning-editdevice-html.lsp +++ b/provisioning-editdevice-html.lsp @@ -29,6 +29,12 @@ html = require("acf.html") $(document).ready(function() { $(".deletedevice").click(function(){ return confirm("Are you sure you want to delete this device?")}); + $("[id=<%= page_info.action %>]").submit(function(event){ + if ($(this).find("#notifydevices").is(":checked")) { + return confirm("Are you sure you want to notify affected devices? This might cause a reboot."); + } + return true; + }); }); @@ -50,7 +56,9 @@ html = require("acf.html") form.value.device_id.readonly = "true" elseif page_info.action == "duplicatedevice" then form.value.classes = nil - else + form.value.notifydevices.value = false + form.value.notifydevices.type = "hidden" + elseif form.value.device_id then form.value.device_id.type = "hidden" end htmlviewfunctions.displayitem(form, page_info) -- cgit v1.2.3