WIP: System settings and configuration management #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is some initial code for system settings and configuration management so that the concept can be discussed
With the current code the IP settings of the device can be changed with the new System tab and the initial idea for how to manage writing the configuration into Flash is started in code.
The idea for persisting the configuration to flash is as follows:
mirrorr offoverwrites a mirror config command and nothing is stored in persistent configuration because no mirror is the default stateThis means, that when e.g. the VLAN is configured, the tab will create/update all the VLAN settings in the SessionStore client-side storage in addition to sending the relevant commands to the device. The session store will therefore reflect all the currently un-applied but active settings on the device which can be commonly edited by all setting tabs in the web-client. That structure is then persisted in the System tab after it is applied on top of the current configuration file of the device.
The SessionStore will store a JSON structure of the settings.
The SessionStore JSON will have the same format as the temporary parsed data from the current configuration file.
The JSON will be an ordered list/array of entries for a configuration that should make it easy to verify whether a new command/setting obsoletes or modifies a current one.
There is currently a hard limit of about 2.2kB on the size of a single file served by the device (e.g. a .js file). It should be possible to implement chunking of these files (not the dynamic ones, i.e. the .json!) in order to support more complex .js needed on the client side for the tabs.