Skip to content

Commit

Permalink
Test Advanced Still Toggled After Reload
Browse files Browse the repository at this point in the history
When toggled, save advanced setting state to local settings and restore on page load. Affects Alerts and Cases.

Changed the advanced toggle's label to remove the word "Temporarily" as it sticks until toggled off.
  • Loading branch information
coreyogburn committed Mar 5, 2025
1 parent cac051d commit 3952f7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion html/js/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const i18n = {
addObservable: 'Add as new observable...',
addSuccessful: 'Added successfully!',
address: 'Address',
advanced: 'Temporarily enable advanced interface features',
advanced: 'Enable advanced interface features',
ago: 'ago',
aiGenSummary: 'AI-Generated Summary',
aiSummaryStale: 'This AI summary was generated for a previous version of the detection and may not be accurate.',
Expand Down
3 changes: 3 additions & 0 deletions html/js/routes/hunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ const huntComponent = {
'autohunt': 'saveLocalSettings',
'autoRefreshInterval': 'resetRefreshTimer',
'showDetailsPanel': 'saveLocalSettings',
'advanced': 'saveLocalSettings',
},
methods: {
moment: moment,
Expand Down Expand Up @@ -2204,6 +2205,7 @@ const huntComponent = {
this.saveSetting('relativeTimeUnit', this.relativeTimeUnit, this.params['relativeTimeUnit']);
this.saveSetting('autohunt', this.autohunt, true);
this.saveSetting('showDetailsPanel', this.showDetailsPanel, this.isCategory('alerts'));
this.saveSetting('advanced', this.advanced, false);
},
loadLocalSettings() {
// Global settings
Expand All @@ -2224,6 +2226,7 @@ const huntComponent = {
if (localStorage[prefix + '.relativeTimeUnit']) this.relativeTimeUnit = parseInt(localStorage[prefix + '.relativeTimeUnit']);
if (localStorage[prefix + '.autohunt']) this.autohunt = localStorage[prefix + '.autohunt'] == 'true';
if (localStorage[prefix + '.showDetailsPanel']) this.showDetailsPanel = localStorage[prefix + '.showDetailsPanel'] == 'true';
if (localStorage[prefix + '.advanced']) this.advanced = localStorage[prefix + '.advanced'] == 'true';

if (localStorage['settings.case.mruCases']) this.mruCases = JSON.parse(localStorage['settings.case.mruCases']);
},
Expand Down

0 comments on commit 3952f7f

Please sign in to comment.