Skip to content

Commit

Permalink
Query parameter can select ActiveTab
Browse files Browse the repository at this point in the history
`/detection/{id}?tab=[summary|comments|source|tuning|history]`

Also added the tab names to i18n.
  • Loading branch information
coreyogburn committed Feb 14, 2024
1 parent 95fd327 commit a603daf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
14 changes: 7 additions & 7 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1048,27 +1048,27 @@ <h2 id="detection-title" @click="startEdit('detection-title', 'title')" v-if="!i
<v-tabs grow v-model="activeTab" v-else>
<v-tab id="detection_summaryTab" href="#summary">
<v-icon left>fa-comments</v-icon>
<div class="d-none d-lg-block">Overview</div>
<div class="d-none d-lg-block">{{ i18n.overview }}</div>
</v-tab>
<v-tab id="detection_commentsTab" href="#comments">
<v-icon left>fa-paperclip</v-icon>
<div class="d-none d-lg-block">Comments</div>
<div class="d-none d-lg-block">{{ i18n.comments }}</div>
</v-tab>
<v-tab id="detection_signatureTab" href="#signature">
<v-tab id="detection_signatureTab" href="#source">
<v-icon left>fa-eye</v-icon>
<div class="d-none d-lg-block">Detection Source</div>
<div class="d-none d-lg-block">{{ i18n.detectionSource }}</div>
</v-tab>
<!-- <v-tab id="detection_playbookTab" href="#playbook">
<v-icon left>fa-book-bookmark</v-icon>
<div class="d-none d-lg-block">Investigative Playbook</div>
</v-tab> -->
<v-tab id="detection_tuningTab" href="#tuning">
<v-icon left>fa-link</v-icon>
<div class="d-none d-lg-block">Tuning</div>
<div class="d-none d-lg-block">{{ i18n.tuning }}</div>
</v-tab>
<v-tab id="detection_historyTab" href="#history">
<v-icon left>fa-history</v-icon>
<div class="d-none d-lg-block">History</div>
<div class="d-none d-lg-block">{{ i18n.history }}</div>
</v-tab>

<v-tab-item value="summary">
Expand Down Expand Up @@ -4767,7 +4767,7 @@ <h4 v-if="!$root.loading">{{ i18n.settingsCustomized }} {{ settingsCustomized }}
<li>
{{i18n.configQLSigmaHeader}}
<ul>
<li>
<li>
<router-link :to="{name: 'config', query: {s: 'soc.config.server.modules.elastalertengine.sigmaRulePackages'}}">{{i18n.configQLSigmaRuleset}}</router-link>
</li>
</ul>
Expand Down
3 changes: 3 additions & 0 deletions html/js/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ const i18n = {
detectionId: 'Detection Id',
detectionLogic: 'Detection Logic',
detectionSeverity: 'Severity',
detectionSource: 'Detection Source',
detectionTitle: 'Detection Title',
detectionType: 'Detection Type',
disable: 'Disable',
Expand Down Expand Up @@ -575,6 +576,7 @@ const i18n = {
osUptime: 'OS Uptime',
other: 'Other',
overrideExpand: 'Show all override fields',
overview: 'Overview',
owner: 'Owner',
packages: 'Packages',
packets: 'Captured Packets',
Expand Down Expand Up @@ -819,6 +821,7 @@ const i18n = {
trafficManOutAbbr: 'Mgmt Out',
transcriptCyberChefHelp: 'Send the transcript to CyberChef',
ttr: 'Time Tracking',
tuning: 'Tuning',
type: 'Type',
unaccepted: 'Pending',
unassigned: 'unassigned',
Expand Down
6 changes: 5 additions & 1 deletion html/js/routes/detection.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ routes.push({ path: '/detection/:id', name: 'detection', component: {
this.loadUrlParameters();
},
loadUrlParameters() {

this.$nextTick(() => {
if (this.$route.query.tab) {
this.activeTab = this.$route.query.tab;
}
});
},
newDetection() {
let author = [this.$root.user.firstName, this.$root.user.lastName].filter(x => x).join(' ');
Expand Down

0 comments on commit a603daf

Please sign in to comment.