aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-15 21:05:45 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-15 21:05:45 +0800
commitecb0d77684347c0a3985ffc18b38572220437d91 (patch)
tree50857260a1ccc61b3fe2d57a02eaf9dd0544ca34
parentb635a5d93d594d3cbcadb82b3d323f0396a7c92f (diff)
downloadfg21sim-ecb0d77684347c0a3985ffc18b38572220437d91.tar.bz2
webui: Some minor changes
* Change configuration status text from "Valid :)" to "OK" * Reduce maximum WS connection trials from 100 to 21 * Fix the wrong global name of "g_ws_reconnect" * Comment the Console "Stop" button, which is currently not implemented
-rw-r--r--fg21sim/webui/static/js/configs.js2
-rw-r--r--fg21sim/webui/static/js/websocket.js4
-rw-r--r--fg21sim/webui/templates/console.html2
3 files changed, 5 insertions, 3 deletions
diff --git a/fg21sim/webui/static/js/configs.js b/fg21sim/webui/static/js/configs.js
index d071be1..b39a43f 100644
--- a/fg21sim/webui/static/js/configs.js
+++ b/fg21sim/webui/static/js/configs.js
@@ -284,7 +284,7 @@ var updateFormConfigStatus = function () {
.addClass("label-success");
target.find(".icon").removeClass("fa-question-circle fa-warning")
.addClass("fa-check-circle");
- target.find(".text").text("Valid :)");
+ target.find(".text").text("OK");
target.data("validity", true);
}
};
diff --git a/fg21sim/webui/static/js/websocket.js b/fg21sim/webui/static/js/websocket.js
index 1d739ae..e446380 100644
--- a/fg21sim/webui/static/js/websocket.js
+++ b/fg21sim/webui/static/js/websocket.js
@@ -13,7 +13,7 @@
*/
var g_ws = null; /* WebSocket */
/* WebSocket reconnection settings */
-var g_ws_reconnect = {maxTry: 100, tried: 0, timeout: 3000};
+var g_ws_reconnect = {maxTry: 21, tried: 0, timeout: 3000};
/**
@@ -167,7 +167,7 @@ $(document).ready(function () {
// Manually reconnect the WebSocket after tried allowed maximum times
$("#ws-reconnect").on("click", function () {
console.log("WebSocket: reset the tried reconnection counter");
- ws_reconnect.tried = 0;
+ g_ws_reconnect.tried = 0;
console.log("Manually reconnect the WebSocket:", ws_url);
connectWebSocket(ws_url);
});
diff --git a/fg21sim/webui/templates/console.html b/fg21sim/webui/templates/console.html
index 54a6744..019f72a 100644
--- a/fg21sim/webui/templates/console.html
+++ b/fg21sim/webui/templates/console.html
@@ -23,7 +23,9 @@
<p class="button-group">
<button type="button" id="task-start"><span class="fa fa-play" aria-hidden="true"></span> Start</button>
+ <!-- TODO/FIXME: how to kill a running thread/process?
<button type="button" class="button button-warning" id="task-stop" disabled="disabled"><span class="fa fa-stop" aria-hidden="true"></span> Stop</button>
+ -->
</p>
<div class="panel panel-default">