Skip to content

Commit

Permalink
fix(ui): fix use button for dashboard blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
fhussonnois committed Jan 23, 2025
1 parent c994762 commit 699e232
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ui/src/components/dashboard/components/DashboardCreate.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<top-nav-bar :title="routeInfo.title" />
<section class="full-container">
<dashboard-editor allow-save-unchanged @save="save" :initial-source="initialSource" />
<dashboard-editor v-if="initialSource" allow-save-unchanged @save="save" :initial-source="initialSource" />
</section>
</template>

Expand All @@ -18,7 +18,15 @@
},
data() {
return {
initialSource: `title: Overview
initialSource: undefined
}
},
async beforeMount() {
const blueprintId = this.$route.query.blueprintId;
if (blueprintId !== undefined) {
this.initialSource = await this.$store.dispatch("blueprints/getBlueprintSource", {type: "community", kind: "dashboard", id: blueprintId});
} else {
this.initialSource = `title: Overview
description: Default overview dashboard
timeWindow:
default: P30D # P30DT30H
Expand Down Expand Up @@ -139,7 +147,7 @@ charts:
total:
displayName: Total Executions
agg: COUNT
graphStyle: BARS`
graphStyle: BARS`;
}
},
methods: {
Expand Down

0 comments on commit 699e232

Please sign in to comment.