feat: update metric config

This commit is contained in:
Qiuxia Fan
2021-12-29 16:22:23 +08:00
parent 809fcff859
commit 4b9d1dd362
4 changed files with 45 additions and 12 deletions

View File

@@ -17,6 +17,8 @@
import { defineStore } from "pinia";
import { store } from "@/store";
import { LayoutConfig } from "@/types/dashboard";
import graph from "@/graph";
import { AxiosResponse } from "axios";
interface DashboardState {
showConfig: boolean;
@@ -53,6 +55,13 @@ export const dashboardStore = defineStore({
setConfigPanel(show: boolean) {
this.showConfig = show;
},
async fetchMetricType(item: string) {
const res: AxiosResponse = await graph
.query("queryTypeOfMetrics")
.params({ name: item });
return res.data;
},
},
});