Skip to content

Commit

Permalink
Show tip when Bulk Action starts
Browse files Browse the repository at this point in the history
Now shows a tip when a Bulk Action starts showing the number of detections being updated/deleted and with update/delete specific verbiage.
  • Loading branch information
coreyogburn committed Jun 11, 2024
1 parent 3e1c59a commit ed95521
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
10 changes: 6 additions & 4 deletions html/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,12 @@ $(document).ready(function() {
},
updateEditorTheme() {
var link = $('link[href^="css/external/prism-custom-"]')[0];
if (this.$vuetify.theme.dark) {
link.href = "css/external/prism-custom-dark-v1.29.0.css";
} else {
link.href = "css/external/prism-custom-light-v1.29.0.css";
if (link) {
if (this.$vuetify.theme.dark) {
link.href = "css/external/prism-custom-dark-v1.29.0.css";
} else {
link.href = "css/external/prism-custom-light-v1.29.0.css";
}
}
},
subscribe(kind, fn) {
Expand Down
2 changes: 2 additions & 0 deletions html/js/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ const i18n = {
betweenOp: 'Between',
blog: 'Blog',
bulkAction: 'Bulk Action:',
bulkActionStarted: 'Updating {total} detections. This may take awhile.',
bulkActionDeleteStarted: 'Deleting {total} detections. This may take awhile.',
bulkError: '',
bulkSuccessUpdate: 'Bulk update successfully updated {modified} of {total} events. ({time})',
bulkSuccessDelete: 'Bulk delete successfully deleted {modified} of {total} events. ({time})',
Expand Down
10 changes: 10 additions & 0 deletions html/js/routes/hunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,16 @@ const huntComponent = {

try {
await this.$root.papi.post('detection/bulk/' + this.selectedAction, payload);

let msg = this.i18n.bulkActionStarted;
if (this.selectedAction === 'delete') {
msg = this.i18n.bulkActionDeleteStarted;
}

msg = msg.replace('{total}', this.selectedCount.toLocaleString());

this.$root.showTip(msg);

this.selectAllState = false;
this.selectedCount = 0;
this.hunt(false);
Expand Down

0 comments on commit ed95521

Please sign in to comment.