aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/static/js/websocket.js
Commit message (Collapse)AuthorAgeFilesLines
* webui: configs.js: Re-implement using AJAX instead of WebSocketAaron LI2016-11-161-50/+1
| | | | | | | | | | * Interact with server-side configurations using AJAX GET and POST, instead of sending and receiving messages through the WebSocket. * Add callbacks on both AJAX success and error, to show a modal box displaying the operation results/errors, achieving better user experiences. * Use jQuery deferred and promises to achieve sequential operations. * Also move the binding function from "websocket.js" to "configs.js"
* webui: Some minor changesAaron LI2016-11-151-2/+2
| | | | | | | * 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
* webui: Change log toggle icons opacity according to toggle statusAaron LI2016-11-151-4/+9
|
* webui: Show a modal box indicating there are invalid configsAaron LI2016-11-131-0/+1
|
* webui: Store config validity; Check before start taskAaron LI2016-11-131-3/+7
| | | | | | | * "updateFormConfigStatus()": Store the configuration validity as a custom data attribute. * Check the current configuration validity before start the task on the server.
* webui: Fix various bugs with get/set configurationsAaron LI2016-11-111-4/+2
| | | | | | | | | | | | * Fix bug with getting value of the configuration form. "null" is returned if the requested configuration field does not exist or has empty value. Boolean "true/false" is returned if the requested field is a single checkbox with "data-type=boolean". * Improve the "setFormConfigSingle()" to support the boolean single checkbox field. * Improve the "joinPath()" to validate the two input paths to be joined, and return "null" if both paths are empty. * Implement "updateFormConfigStatus()" and enable "#conf-recheck" button.
* webui: Allow to toggle and delete the logging messagesAaron LI2016-11-091-0/+18
|
* webui: Implement status updating functionAaron LI2016-11-091-2/+24
| | | | | | | Add "updateTaskStatus()" to update the "#task-status" element. Also add function "getServerTaskStatus()" to get the task status from the server.
* webui: websocket.js: Fix the bug for sending data to the serverAaron LI2016-11-081-1/+2
|
* webui: Add validation errors supportAaron LI2016-11-081-4/+13
| | | | | | | When the configuration form changed, the changed values are synced to the server and validated. The validation errors are then sent back to the client, which set the custom error messages on the corresponding fields.
* webui: Implement reset form and load configuration files functionsAaron LI2016-11-071-19/+65
| | | | | | | | | * Rewrite "configs.js" to be more modular and generic * Bind functions to button click event * Implement the function to set form fields to given configuration data * Implement the function to reset server-side configurations * Implement the function to load user configuration file on server * Implement get the configuration data from the server
* webui: Update server & client sides WebSocket handlersAaron LI2016-11-041-3/+4
| | | | | | | | | | | | * Server side: + Update the "on_message()" method to support 3 types of message requests (i.e., "configs", "console", and "results"); + Add messages stub handlers: "_handle_{configs,console,results}()"; + Reorder the methods + Client side: + Change timeout before reconnection to 3000 ms; + Parse the received JSON message to JS object;
* webui: Add a manual reconnection button to the header bannerAaron LI2016-11-031-6/+53
| | | | | Also add a global variable "ws_reconnect" to control the timeout between reconnection and the maximum reconnection times (default: 100).
* webui: Rewrite and reconnect to WebSocket when closedAaron LI2016-11-021-32/+97
|
* webui: Add preliminary WebSocket support to front-end UIAaron LI2016-11-021-0/+51
Add a label to the header banner to show the WebSocket support status and connection status.