aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/static/js/websocket.js
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-13 15:02:17 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-13 15:02:17 +0800
commit2db6464949e65df55396640dda598ffcdd27420c (patch)
treee8e4e114eddc3e6394314954ec16622d7e96b202 /fg21sim/webui/static/js/websocket.js
parentbb0ee7f9f713a4371f3837486293f85aa0fbaec8 (diff)
downloadfg21sim-2db6464949e65df55396640dda598ffcdd27420c.tar.bz2
webui: Store config validity; Check before start task
* "updateFormConfigStatus()": Store the configuration validity as a custom data attribute. * Check the current configuration validity before start the task on the server.
Diffstat (limited to 'fg21sim/webui/static/js/websocket.js')
-rw-r--r--fg21sim/webui/static/js/websocket.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/fg21sim/webui/static/js/websocket.js b/fg21sim/webui/static/js/websocket.js
index fdca619..26d7fce 100644
--- a/fg21sim/webui/static/js/websocket.js
+++ b/fg21sim/webui/static/js/websocket.js
@@ -227,9 +227,13 @@ $(document).ready(function () {
// Start the task on the server
$("#task-start").on("click", function () {
- updateTaskStatus({running: true, finished: false});
- startServerTask(g_ws);
- getServerTaskStatus(g_ws);
+ if ($("#conf-status").data("validity")) {
+ updateTaskStatus({running: true, finished: false});
+ startServerTask(g_ws);
+ getServerTaskStatus(g_ws);
+ } else {
+ console.error("Exist invalid configuration values!");
+ }
});
/* Logging messages controls */