diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 94b0fb8c6..0f21d0a92 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -228,8 +228,12 @@ "inventory_with_vulnerabilities": "Inventory with Vulnerabilities", "vex_long_desc": "Vulnerability Exploitability Exchange (VEX)", "apply_vex": "Apply VEX", + "apply_vex_tooltip": "Apply analyses from a Vulnerability Exploitability eXchange (VEX) document to this project.", "export_vex": "Export VEX", + "export_vex_tooltip": "Export a Vulnerability Exploitability eXchange (VEX) document.", "upload_vex": "Upload VEX", + "export_vdr": "Export VDR", + "export_vdr_tooltip": "Export a Vulnerability Disclosure Report (VDR), as defined in NIST SP 800-161.", "project_reanalyze": "Reanalyze", "project_reanalyze_tooltip": "Runs configured analyzers to detect vulnerabilities in this project's components. Will use any cached results that haven't expired yet", "project_reanalyze_requested": "A Project Vulnerability Analysis has been requested. Project vulnerability data will be updated when the reanalysis task has completed.", diff --git a/src/views/portfolio/projects/ProjectFindings.vue b/src/views/portfolio/projects/ProjectFindings.vue index 043e3767c..b52404a69 100644 --- a/src/views/portfolio/projects/ProjectFindings.vue +++ b/src/views/portfolio/projects/ProjectFindings.vue @@ -5,17 +5,26 @@ dropdown for version is changes, the table will not update. For whatever reason, adding the toolbar fixes it. -->
- {{ $t('message.apply_vex') }} + {{ $t('message.apply_vex_tooltip') }} - {{ $t('message.export_vex') }} + {{ $t('message.export_vex_tooltip') }} + + + {{ $t('message.export_vdr') }} + + {{ $t('message.export_vdr_tooltip') }} { + const url = window.URL.createObjectURL(new Blob([response.data])); + const link = document.createElement('a'); + link.href = url; + let filename = "bom.json"; + let disposition = response.headers["content-disposition"] + if (disposition && disposition.indexOf('attachment') !== -1) { + let filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; + let matches = filenameRegex.exec(disposition); + if (matches != null && matches[1]) { + filename = matches[1].replace(/['"]/g, ''); + } + } + link.setAttribute('download', filename); + document.body.appendChild(link); + link.click(); + }); + }, reAnalyze: function (data) { let analyzeUrl = `${this.$api.BASE_URL}/${this.$api.URL_FINDING}/project/${this.uuid}/analyze` this.axios.post(analyzeUrl).then((response) => {