-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #411 from rbt-mm/master-global-audit-view-vulnerab…
…ilities Global Audit View: Vulnerabilities
- Loading branch information
Showing
7 changed files
with
1,011 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div class="animated fadeIn" v-model="tabIndex" v-permission="'VIEW_VULNERABILITY'"> | ||
<b-tabs class="body-bg-color" style="border-left: 0; border-right:0; border-top:0 "> | ||
<b-tab ref="occurrences" style="border-left: 0; border-right:0; border-top:0 " @click="routeTo()" :active="tabIndex === 0" :lazy="!visitedTabs.has(0)"> | ||
<template v-slot:title><i class="fa fa-shield"></i> {{ $t('message.vulnerabilities_by_occurrence') }}</template> | ||
<VulnerabilityAuditByOccurrence /> | ||
</b-tab> | ||
<b-tab ref="grouped" style="border-left: 0; border-right:0; border-top:0 " @click="routeTo('grouped')" :active="tabIndex === 1" :lazy="!visitedTabs.has(1)"> | ||
<template v-slot:title><i class="fa fa-shield"></i> {{ $t('message.grouped_vulnerabilities') }}</template> | ||
<VulnerabilityAuditGroupedByVulnerability /> | ||
</b-tab> | ||
</b-tabs> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import permissionsMixin from "@/mixins/permissionsMixin"; | ||
import VulnerabilityAuditGroupedByVulnerability from "@/views/globalAudit/VulnerabilityAuditGroupedByVulnerability"; | ||
import VulnerabilityAuditByOccurrence from "@/views/globalAudit/VulnerabilityAuditByOccurrence"; | ||
export default { | ||
mixins: [permissionsMixin], | ||
components: { | ||
VulnerabilityAuditByOccurrence, | ||
VulnerabilityAuditGroupedByVulnerability, | ||
}, | ||
methods: { | ||
routeTo(path) { | ||
if (path) { | ||
this.visitedTabs.add(path === 'grouped' ? 1 : 0); | ||
if (!this.$route.fullPath.toLowerCase().includes('/' + path.toLowerCase())) { | ||
this.$router.push({path: '/vulnerabilityAudit/' + path}); | ||
} | ||
} else if (this.$route.fullPath !== '/audit' && this.$route.fullPath !== '/vulnerabilityAudit/') { | ||
this.visitedTabs.add(0) | ||
this.$router.push({path: '/vulnerabilityAudit/'}); | ||
} | ||
}, | ||
getTabFromRoute: function () { | ||
let pattern = new RegExp("/vulnerabilityAudit\\/([^\\/]*)", "gi"); | ||
let tab = pattern.exec(this.$route.fullPath.toLowerCase()); | ||
(tab && tab[1] && tab[1].toLowerCase() === 'grouped') ? this.tabIndex = 1 : this.tabIndex = 0; | ||
return this.$refs[(tab && tab[1]) ? tab[1].toLowerCase() : 'occurrences'] | ||
} | ||
}, | ||
beforeMount() { | ||
this.getTabFromRoute(); | ||
this.visitedTabs.add(this.tabIndex); | ||
}, | ||
watch:{ | ||
$route (to, from){ | ||
this.getTabFromRoute().activate(); | ||
} | ||
}, | ||
data() { | ||
return { | ||
tabIndex: 0, | ||
visitedTabs: new Set() | ||
} | ||
}, | ||
}; | ||
</script> |
Oops, something went wrong.