aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-17 10:41:36 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-17 10:41:36 +0800
commitf34766376b6a77b740f2d218de901062b6de4cf6 (patch)
tree2c1030dfcc9506b7789209462eece598496bad61 /fg21sim/webui
parent3898a31047c218c43959593bbe738a1424882aa8 (diff)
downloadfg21sim-f34766376b6a77b740f2d218de901062b6de4cf6.tar.bz2
webui: configs.js: Confirm before reset the configurations
Diffstat (limited to 'fg21sim/webui')
-rw-r--r--fg21sim/webui/static/js/configs.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/fg21sim/webui/static/js/configs.js b/fg21sim/webui/static/js/configs.js
index 80c218c..4b01ca3 100644
--- a/fg21sim/webui/static/js/configs.js
+++ b/fg21sim/webui/static/js/configs.js
@@ -549,8 +549,26 @@ $(document).ready(function () {
// Reset both server-side and client-side configurations to the defaults
$("#reset-defaults").on("click", function () {
- // TODO: add a confirmation dialog
- resetConfigs(ajax_url);
+ var modalData = {};
+ modalData.icon = "warning";
+ modalData.message = ("Are you sure to reset the configurations?");
+ modalData.buttons = [
+ {
+ text: "Cancel",
+ rel: "modal:close",
+ click: function () { $.modal.close(); }
+ },
+ {
+ text: "Reset!",
+ "class": "button-warning",
+ rel: "modal:close",
+ click: function () {
+ $.modal.close();
+ resetConfigs(ajax_url);
+ }
+ },
+ ];
+ showConfigsModal(modalData);
});
// Load the configurations from the specified user configuration file