-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1998c9b
commit e3a70aa
Showing
31 changed files
with
2,585 additions
and
1,531 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
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,151 @@ | ||
<template> | ||
<div> | ||
<v-tabs | ||
left | ||
background-color="white" | ||
color="deep-orange accent-4" | ||
> | ||
|
||
<!-- Summary --> | ||
<v-tab>Summary</v-tab> | ||
<v-tab> | ||
<v-badge | ||
:color = getNumberColor(this.counter.count_exploit) | ||
:content='this.count_exploit' | ||
> | ||
Exploits | ||
</v-badge> | ||
</v-tab> | ||
<v-tab> | ||
<v-badge | ||
:color = getNumberColor(this.counter.count_threat) | ||
:content='this.count_threat' | ||
> | ||
Threat activities | ||
</v-badge> | ||
</v-tab> | ||
|
||
|
||
<!-- Information Vulnerability --> | ||
<v-tab-item> | ||
<VulnDetails | ||
:vuln_id = this.vuln_id | ||
@OpenSnackBar = this.modifySnackBar | ||
/> | ||
</v-tab-item> | ||
|
||
<!-- Exploits --> | ||
<v-tab-item> | ||
<VulnerabilityExploit | ||
:vuln_id = this.vuln_id | ||
@OpenSnackBar = this.modifySnackBar | ||
@UpdateCounter = this.getCountThreatsExploits | ||
/> | ||
</v-tab-item> | ||
|
||
<!-- Threat --> | ||
<v-tab-item> | ||
<VulnerabilityThreat | ||
:vuln_id = this.vuln_id | ||
@OpenSnackBar = this.modifySnackBar | ||
@UpdateCounter = this.getCountThreatsExploits | ||
/> | ||
</v-tab-item> | ||
|
||
|
||
</v-tabs> | ||
<SnackBar | ||
:snack = snack | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import VulnDetails from "@/components/vulnerability/vulnerabilityDetails/VulnDetails.vue"; | ||
import VulnerabilityExploit from "@/components/vulnerability/exploit/VulnerabilityExploit.vue"; | ||
import VulnerabilityThreat from "@/components/vulnerability/threat/VulnerabilityThreat.vue"; | ||
import Colors from "@/common/colors"; | ||
import SnackBar from "@/components/vulnerability/snackBar/SnackBar.vue" | ||
export default { | ||
mixins: [ | ||
Colors, | ||
], | ||
components: { | ||
VulnDetails, | ||
VulnerabilityExploit, | ||
VulnerabilityThreat, | ||
SnackBar | ||
}, | ||
data: () => ({ | ||
vuln_id: "", | ||
snack: { | ||
open: false, | ||
color: '', | ||
text: '', | ||
}, | ||
counter: { | ||
count_exploit: 0, | ||
count_threat: 0, | ||
} | ||
}), | ||
beforeRouteUpdate(to) { | ||
this.vuln_id = to.params.vuln_id; | ||
}, | ||
mounted() { | ||
this.vuln_id = this.$router.currentRoute.params.vuln_id; | ||
this.getDataFromApi(this.vuln_id) | ||
}, | ||
computed: { | ||
count_exploit(){ | ||
return this.counter.count_exploit === 0 ? "0" : this.counter.count_exploit | ||
}, | ||
count_threat(){ | ||
return this.counter.count_threat === 0 ? "0" : this.counter.count_threat | ||
} | ||
}, | ||
methods: { | ||
modifySnackBar(value) { | ||
this.snack = value | ||
}, | ||
getDataFromApi(vuln_id) { | ||
return new Promise((resolve, reject) => { | ||
let counter = this.getCountThreatsExploits(vuln_id); | ||
setTimeout(() => { | ||
this.loading = false; | ||
resolve({ counter }); | ||
}, 300); | ||
}); | ||
}, | ||
getCountThreatsExploits(vuln_id) { | ||
this.loading = true; | ||
this.$api.get('/api/vulns/'+vuln_id+'/counter').then(res => { | ||
if (res && res.status === 200) { | ||
this.counter = res.data; | ||
} | ||
return this.counter; | ||
}).catch(e => { | ||
this.counter = { | ||
count_exploit: 0, | ||
count_threat: 0, | ||
}; | ||
this.loading = false; | ||
swal.fire({ | ||
title: 'Error', | ||
text: 'Unable to get counter', | ||
showConfirmButton: false, | ||
showCloseButton: false, | ||
timer: 3000 | ||
}); | ||
}); | ||
this.loading = false; | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
Oops, something went wrong.