diff --git a/frontend/src/api/application.js b/frontend/src/api/application.js index 96483c3a34..b19c4d9a3d 100644 --- a/frontend/src/api/application.js +++ b/frontend/src/api/application.js @@ -64,6 +64,21 @@ const getApplication = (applicationId) => { }) } +/** + * Get the instances within an application that have a dashboard installed + * @param {string} applicationId + */ +const getApplicationDashboards = async (applicationId) => { + const res = await client.get(`/api/v1/applications/${applicationId}/dashboard-instances`) + res.data.projects = res.data.projects.map(r => { + r.createdSince = daysSince(r.createdAt) + r.updatedSince = daysSince(r.updatedAt) + r.flowLastUpdatedSince = daysSince(r.flowLastUpdatedAt) + return r + }) + return res.data +} + /** * Get the audit log for an application * @param {string} applicationId @@ -371,6 +386,7 @@ export default { deleteApplication, getSnapshots, getApplication, + getApplicationDashboards, getApplicationAuditLog, getApplicationDevices, getApplicationInstances, diff --git a/frontend/src/components/dashboard/DashboardList.vue b/frontend/src/components/dashboard/DashboardList.vue new file mode 100644 index 0000000000..d74aaec145 --- /dev/null +++ b/frontend/src/components/dashboard/DashboardList.vue @@ -0,0 +1,76 @@ + + + diff --git a/frontend/src/pages/team/Dashboards/Viewer.vue b/frontend/src/components/dashboard/DashboardViewer.vue similarity index 74% rename from frontend/src/pages/team/Dashboards/Viewer.vue rename to frontend/src/components/dashboard/DashboardViewer.vue index 4b5a21e0df..cdd4621668 100644 --- a/frontend/src/pages/team/Dashboards/Viewer.vue +++ b/frontend/src/components/dashboard/DashboardViewer.vue @@ -1,23 +1,23 @@