aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/static/js/websocket.js
diff options
context:
space:
mode:
Diffstat (limited to 'fg21sim/webui/static/js/websocket.js')
-rw-r--r--fg21sim/webui/static/js/websocket.js26
1 files changed, 24 insertions, 2 deletions
diff --git a/fg21sim/webui/static/js/websocket.js b/fg21sim/webui/static/js/websocket.js
index 0c566c6..8f726b8 100644
--- a/fg21sim/webui/static/js/websocket.js
+++ b/fg21sim/webui/static/js/websocket.js
@@ -135,8 +135,7 @@ var connectWebSocket = function (url) {
handleMsgConfigs(msg);
}
else if (msg.type === "console") {
- console.error("NotImplementedError");
- // handleMsgConsole(msg);
+ handleMsgConsole(msg);
}
else if (msg.type === "results") {
console.error("NotImplementedError");
@@ -173,6 +172,18 @@ $(document).ready(function () {
connectWebSocket(ws_url);
});
+ /**********************************************************************
+ * Configuration form
+ */
+
+ // Re-check/validate the whole form configurations
+ $("#conf-recheck").on("click", function () {
+ // TODO:
+ // * collect all current form configurations
+ // * sync to the server and validate
+ // * update the form errors
+ });
+
// Reset the configurations to the defaults
$("#reset-defaults").on("click", function () {
// TODO:
@@ -212,6 +223,17 @@ $(document).ready(function () {
setServerConfigs(g_ws, {[name]: value});
});
+ /**********************************************************************
+ * Console operations
+ */
+
+ // Start the task on the server
+ $("#task-start").on("click", function () {
+ updateTaskStatus({running: true, finished: false});
+ startServerTask(g_ws);
+ getServerTaskStatus(g_ws);
+ });
+
} else {
// WebSocket NOT supported
console.error("Oops, WebSocket is NOT supported!");