From 18b4dcb136113132220f5006d9d1bbfc723a8097 Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 13 Apr 2015 17:48:49 +0100 Subject: [PATCH] More work on maintenance --- html/forms/schedule-maintenance.inc.php | 15 +++++++ html/pages/alert-schedule.inc.php | 56 +++++++++++++++++++++---- html/pages/graphs.inc.php | 4 +- 3 files changed, 66 insertions(+), 9 deletions(-) create mode 100644 html/forms/schedule-maintenance.inc.php diff --git a/html/forms/schedule-maintenance.inc.php b/html/forms/schedule-maintenance.inc.php new file mode 100644 index 000000000..b3be48c0f --- /dev/null +++ b/html/forms/schedule-maintenance.inc.php @@ -0,0 +1,15 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + + diff --git a/html/pages/alert-schedule.inc.php b/html/pages/alert-schedule.inc.php index 5c54d8bc1..b9c62c809 100644 --- a/html/pages/alert-schedule.inc.php +++ b/html/pages/alert-schedule.inc.php @@ -13,6 +13,7 @@ */ $pagetitle[] = "Alert Schedule"; +$no_refresh = TRUE; ?> @@ -34,19 +35,35 @@ $pagetitle[] = "Alert Schedule";
- - -
-
-
+ +
-
+
+
+ +
@@ -61,6 +78,11 @@ $pagetitle[] = "Alert Schedule";
+
+
+ +
+
@@ -98,7 +120,27 @@ var grid = $("#alert-schedule").bootgrid({ $('#sched-submit').click('', function(e) { e.preventDefault(); - alert($('form.schedule-maintenance-form').serialize()); + var device = $("#device").val(); + var start = $("#start").val(); + var end = $("#end").val(); + $.ajax({ + type: "POST", + url: "/ajax_form.php", + data: { type: "schedule-maintenance", subtype: "add", device: device, start: start, end: end }, + dataType: "json", + success: function(data){ + if(data.status == 'ok') { + $("#message").html('
'+data.message+'
'); + $("#schedule-maintenance").modal('hide'); + } else { + $("#response").html('
'+data.message+'
'); + } + }, + error: function(){ + $("#response").html('
An error occurred.
'); + } + }); + }); $(function () { diff --git a/html/pages/graphs.inc.php b/html/pages/graphs.inc.php index 960733cdd..2996766c7 100644 --- a/html/pages/graphs.inc.php +++ b/html/pages/graphs.inc.php @@ -156,8 +156,8 @@ if (!$auth)