diff --git a/webapp/frontend/src/views/MetricsHome.vue b/webapp/frontend/src/views/MetricsHome.vue
index 8d2a65b7..c3a04cda 100644
--- a/webapp/frontend/src/views/MetricsHome.vue
+++ b/webapp/frontend/src/views/MetricsHome.vue
@@ -8,6 +8,10 @@
:fields="reports.fields"
:select-mode="'single'"
@row-selected="loadMetrics">
+
+
+
+
Pending
@@ -56,6 +60,7 @@ export default {
return {
loadingReports: false,
confDeleteReportModal: null,
+ projects: {},
reports: {
items: [],
fields: [
@@ -63,7 +68,7 @@ export default {
{ key: 'report_name', label: 'Report Name' },
{ key: 'created_user', label: 'Created User' },
{ key: 'create_time', label: 'Create Time' },
- { key: 'projects', label: 'Projects' },
+ { key: 'projects', label: 'Projects', formatter: this.projectsFormatter },
{ key: 'status', label: 'Status' },
{ key: 'cleanup', label: 'Remove' }
]
@@ -80,13 +85,24 @@ export default {
this.loadingReports = false
this.reports.items = resp.data.reports.map(i => {
const item = {...i}
- item.projects = item.projects.join(', ')
item.report_name = item.report_name || item.report_name_generated
return item
})
+ this.fetchProjects()
setTimeout(this.pollReportStatus, 10000)
})
},
+ fetchProjects () {
+ this.reports.items.forEach(item => {
+ item.projects.forEach(projId => {
+ if (!Object.keys(this.projects).includes(projId)) {
+ this.$http.get(`/api/project-annotate-entities/${projId}/`).then(resp => {
+ this.projects[projId] = resp.data
+ })
+ }
+ })
+ })
+ },
loadMetrics (rows) {
this.$router.push({
name: 'metrics',
@@ -103,6 +119,17 @@ export default {
}).finally(err => {
this.confDeleteReportModal = null
})
+ },
+ projectsFormatter (value) {
+ let outEl = ''
+ value.forEach(i => {
+ if (this.projects[i]) {
+ outEl += `${this.projects[i].name}`
+ } else {
+ outEl += `${i}
`
+ }
+ })
+ return `${outEl}
`
}
}
}