aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/static/js/configs.js
Commit message (Collapse)AuthorAgeFilesLines
* webui: Some JavaScript cleanups and refactorsAaron LI2016-11-281-106/+114
| | | | | Credit: "JavaScript: The Good Parts" by Douglas Crockford
* webui: Replace jQuery.when() with jQuery.Deferred's .then()Aaron LI2016-11-241-5/+5
| | | | | | | | | | Note that jQuery.when() can NOT promise the ordering of the passed Deferred's. Therefore, chain multiple AJAX requests using ".then()" and ".done()" to keep them ordered. This fixes the configurations loading problem on IE (v11), which calls the "when()" arguments in different orders as Firefox and Chromium, thus leads to the wrong results.
* webui: Use new ".getJSONUncached()" instead of ".getJSON()"Aaron LI2016-11-241-3/+3
|
* webui: configs.js: Trigger "Enter keypress" event after field updatedAaron LI2016-11-241-6/+9
| | | | | | | | When the value of a configuration field is updated by jQuery ".val()", trigger the "Enter keypress" event to update its related contents, e.g., the resolution note for "common/nside". Remove the wrong "Enter keypress" event triggering on page loading.
* webui: configs.js: Trigger "Enter" after page load on "common/nside"Aaron LI2016-11-231-14/+15
| | | | | Refactor the "click" event handler on "common/nside" to avoid the duplicated code on resolution calculation.
* webui: Update against the improved "showModal()"Aaron LI2016-11-221-11/+11
|
* webui: Move several generic functions from "configs.js" to "main.js"Aaron LI2016-11-221-47/+1
|
* webui: configs: Some minor fixesAaron LI2016-11-221-6/+11
| | | | | | | | * configs.py/_set_configs(): Also return the original data if the input values failed the validation; * setServerConfigs(): Success callback also reset value if the input value failed pass the server-side validation; * getServerConfigs(): Return "undefined" if key does not exists.
* webui: configs: Add pixel resolution note for "common/nside"Aaron LI2016-11-191-0/+24
| | | | | | * Calculate pixel resolution note on pressing "Enter" in "common/nside" * Update the pixel resolution note as well as "common/lmax" when "common/nside" changed.
* webui: configs.js: Fix two bugsAaron LI2016-11-181-2/+2
| | | | | * Fix the wrong "action=reset" in "setServerConfigs()" * Add the missing "return" in the jQuery AJAX chain
* webui: Rename jQuery ".fail()" callback argument "error" to "jqxhr"Aaron LI2016-11-181-15/+15
|
* webui: Support IE11; Fix a missing quotation.Aaron LI2016-11-171-2/+7
| | | | | | | * IE11 does NOT support most of the ECMAScript 6 features, such as the "computed property names" which used in "configs.js". * Do not use the "computed property names" feature to support IE11 * Fix a missing quotation in "index.html"
* webui: configs.js: Rename "showConfigsModal" to "showModalConfigs()"Aaron LI2016-11-171-11/+11
|
* webui: Implement "showModal()" in "main.js" allowing use in othersAaron LI2016-11-171-43/+2
|
* webui: configs.js: Confirm before reset the configurationsAaron LI2016-11-171-2/+20
|
* webui: configs.js: Confirm before overwrite the configuration fileAaron LI2016-11-171-18/+74
| | | | Also improve the "showConfigsModal()" to support buttons.
* webui: configs.js: Re-implement using AJAX instead of WebSocketAaron LI2016-11-161-42/+220
| | | | | | | | | | * 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-1/+1
| | | | | | | * 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: Fix the wrong value "galactic/freefree" to "galactic/snr"Aaron LI2016-11-151-1/+2
| | | | configs.js: Update "workdir" and "configfile" to be sync with server.
* webui: Show a modal box indicating there are invalid configsAaron LI2016-11-131-6/+3
|
* webui: Store config validity; Check before start taskAaron LI2016-11-131-6/+10
| | | | | | | * "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-5/+74
| | | | | | | | | | | | * 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: Some minor updatesAaron LI2016-11-091-1/+11
|
* webui: Add validation errors supportAaron LI2016-11-081-27/+63
| | | | | | | 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: configs.js: Split out functions "{g,s}etFormConfigSingle()"Aaron LI2016-11-071-73/+90
| | | | | | | | * Split out functions "{g,s}etFormConfigSingle()" from "setConfigForm()"; * Rename original "setConfigForm()" to "setFormConfigs()", and uses "{g,s}etFormConfigSingle()" to simplify; * Update other places accordingly.
* webui: Implement reset form and load configuration files functionsAaron LI2016-11-071-14/+137
| | | | | | | | | * 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: Add "configs.js" with basic support with interact with serverAaron LI2016-11-051-0/+127
NOTE: Still missing important client-side functions to be usable, e.g., set the configuration form according to the received data from the server, and mark the error states on the fields with invalid values.