mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-14 11:59:51 +03:00
Add and option to flush settings cache
This commit is contained in:
parent
e1c302438b
commit
6d25fbb8b8
4 changed files with 21 additions and 0 deletions
|
@ -24,6 +24,7 @@ const update = require('./globalUpdates');
|
|||
const appUpdater = require('./appUpdater');
|
||||
const CliAutoComplete = require('./CliAutoComplete');
|
||||
const { SITLProcess } = require('./sitl');
|
||||
const settingsCache = require('./settingsCache');
|
||||
|
||||
process.on('uncaughtException', function (error) {
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
|
@ -385,6 +386,9 @@ $(function() {
|
|||
$('#demoModeReset').on('click', function () {
|
||||
SITLProcess.deleteEepromFile('demo.bin');
|
||||
});
|
||||
$('#maintenanceFlushSettingsCache').on('click', function () {
|
||||
settingsCache.flush();
|
||||
});
|
||||
function close_and_cleanup(e) {
|
||||
if (e.type == 'click' && !$.contains($('div#options-window')[0], e.target) || e.type == 'keyup' && e.keyCode == 27) {
|
||||
$(document).unbind('click keyup', close_and_cleanup);
|
||||
|
|
|
@ -17,6 +17,7 @@ var settingsCache = (function() {
|
|||
|
||||
publicScope.flush = function() {
|
||||
store.delete(SETTINGS_KEY);
|
||||
console.log('Settings cache flushed');
|
||||
};
|
||||
|
||||
publicScope.get = function(settingName) {
|
||||
|
|
|
@ -5812,5 +5812,11 @@
|
|||
},
|
||||
"gsTelemetrySpeed": {
|
||||
"message": "Speed"
|
||||
},
|
||||
"maintenance": {
|
||||
"message": "Maintenance"
|
||||
},
|
||||
"maintenanceFlushSettingsCache": {
|
||||
"message": "Flush settings cache"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,5 +87,15 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="options-section gui_box grey">
|
||||
<div class="gui_box_titlebar">
|
||||
<div class="spacer_box_title" data-i18n="maintenance"></div>
|
||||
</div>
|
||||
<div class="spacer_box settings">
|
||||
<div class="default_btn" style="float: none; width: 200px;">
|
||||
<a id="maintenanceFlushSettingsCache" href="#" i18n="maintenanceFlushSettingsCache"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue