diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-11-09 23:38:28 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-11-09 23:38:28 +0800 |
commit | 20a0b986c84ccddd5e71e278e2d0b9be81f60f50 (patch) | |
tree | 38dcd910ee868a17250ab77368587527f835ec1e /fg21sim/webui/static | |
parent | e5a05c8e3c77aa292b7dd9bc4a2682148be873ac (diff) | |
download | fg21sim-20a0b986c84ccddd5e71e278e2d0b9be81f60f50.tar.bz2 |
webui: Add the foreground simulation task to ConsoleHandler
* The original sleep test task "_task()" renamed to "_task_test()"
* Also add the new "startServerTaskTest()" to trigger the "_task_test()"
NOTE/XXX:
The foregrounds simulation requires the configurations, which is
currently obtained from "self.websocket.configs", which I think is a
HACK. How to better solve this??
Diffstat (limited to 'fg21sim/webui/static')
-rw-r--r-- | fg21sim/webui/static/js/console.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fg21sim/webui/static/js/console.js b/fg21sim/webui/static/js/console.js index 86ea90c..14e0ad7 100644 --- a/fg21sim/webui/static/js/console.js +++ b/fg21sim/webui/static/js/console.js @@ -144,7 +144,18 @@ var getServerTaskStatus = function (ws) { */ var startServerTask = function (ws, time) { time = typeof time !== "undefined" ? time : 5; - var msg = {type: "console", action: "start", time: time}; + var msg = {type: "console", action: "start"}; + ws.send(JSON.stringify(msg)); +}; + +/** + * Request to start the test task on the server. + * + * @param {Number} time - Time in seconds for the sleep test task on server + */ +var startServerTaskTest = function (ws, time) { + time = typeof time !== "undefined" ? time : 5; + var msg = {type: "console", action: "start_test", time: time}; ws.send(JSON.stringify(msg)); }; |