fix dashboards

This commit is contained in:
Qiuxia Fan 2022-03-19 11:33:10 +08:00
parent aa73338e47
commit eea641d8ce
3 changed files with 6 additions and 3 deletions

View File

@ -78,7 +78,7 @@ async function setTemplate() {
dashboardStore.setCurrentDashboard({
layer: p.layerId,
entity: p.entity,
name: p.name,
name: String(p.name).split("-").join(" "),
id: c.id,
isRoot: layout.isRoot,
});

View File

@ -214,8 +214,7 @@ function handleView(row: DashboardItem) {
}
async function setRoot(row: DashboardItem) {
console.log(row);
const items: any[] = [];
const items: DashboardItem[] = [];
loading.value = true;
for (const d of dashboardStore.dashboards) {
if (d.id === row.id) {

View File

@ -42,6 +42,7 @@ limitations under the License. -->
import { defineComponent, onBeforeUnmount } from "vue";
import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard";
import { useSelectorStore } from "@/store/modules/selectors";
import { LayoutConfig } from "@/types/dashboard";
import controls from "../controls/index";
@ -51,6 +52,7 @@ export default defineComponent({
setup() {
const { t } = useI18n();
const dashboardStore = useDashboardStore();
const selectorStore = useSelectorStore();
function layoutUpdatedEvent(newLayout: LayoutConfig[]) {
dashboardStore.setLayout(newLayout);
}
@ -60,6 +62,8 @@ export default defineComponent({
}
onBeforeUnmount(() => {
dashboardStore.setLayout([]);
selectorStore.setCurrentService(null);
selectorStore.setCurrentPod(null);
});
return {
dashboardStore,