diff --git a/ui/src/components/dashboard/Dashboard.vue b/ui/src/components/dashboard/Dashboard.vue index e3563639bbc..6c22e1adf89 100644 --- a/ui/src/components/dashboard/Dashboard.vue +++ b/ui/src/components/dashboard/Dashboard.vue @@ -499,7 +499,8 @@ watch( route, - () => { + async () => { + await handleCustomUpdate(route.params?.id ? {id: route.params?.id} : undefined); fetchAll(); }, {immediate: true, deep: true}, diff --git a/ui/src/components/dashboard/components/DashboardCreate.vue b/ui/src/components/dashboard/components/DashboardCreate.vue index 2b259c40b90..c8db9cd399b 100644 --- a/ui/src/components/dashboard/components/DashboardCreate.vue +++ b/ui/src/components/dashboard/components/DashboardCreate.vue @@ -153,8 +153,11 @@ charts: methods: { async save(input) { const dashboard = await this.$store.dispatch("dashboard/create", input); + + this.$toast().saved(dashboard.title); + this.$store.dispatch("core/isUnsaved", false); - this.$router.push({name: "dashboards/update", params: {id: dashboard.id}}); + this.$router.push({name: "home", params: {id: dashboard.id}}); } }, computed: { diff --git a/ui/src/components/dashboard/components/DashboardEdit.vue b/ui/src/components/dashboard/components/DashboardEdit.vue index 0519097cbb3..fcee855cdee 100644 --- a/ui/src/components/dashboard/components/DashboardEdit.vue +++ b/ui/src/components/dashboard/components/DashboardEdit.vue @@ -3,8 +3,8 @@
@@ -22,30 +22,34 @@ }, methods: { async save(input) { - await this.$store.dispatch("dashboard/update", { + const response = await this.$store.dispatch("dashboard/update", { id: this.$route.params.id, source: input, }); + + this.$toast().saved(response.title); + this.$store.dispatch("core/isUnsaved", false); }, }, data() { return { - dashboardSource: undefined, + item: undefined, }; }, beforeMount() { this.$store .dispatch("dashboard/load", this.$route.params.id) .then((dashboard) => { - this.dashboardSource = dashboard.sourceCode; + this.item = dashboard; }); }, computed: { routeInfo() { const id = this.$route.params.id; + return { - title: id, + title: this.item?.title || id, breadcrumb: [ { label: this.$t("custom_dashboard"), diff --git a/ui/src/components/filter/segments/Dashboards.vue b/ui/src/components/filter/segments/Dashboards.vue index f1acd2165b0..0f01cf7df1c 100644 --- a/ui/src/components/filter/segments/Dashboards.vue +++ b/ui/src/components/filter/segments/Dashboards.vue @@ -47,7 +47,7 @@
@@ -65,28 +65,26 @@