mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:49:24 +00:00
feat: use useDashboardQueryProcessor
This commit is contained in:
parent
e73537ebdc
commit
a196eea960
@ -46,7 +46,7 @@ limitations under the License. -->
|
|||||||
import type { LayoutConfig } from "@/types/dashboard";
|
import type { LayoutConfig } from "@/types/dashboard";
|
||||||
import controls from "../controls/index";
|
import controls from "../controls/index";
|
||||||
import { dragIgnoreFrom } from "../data";
|
import { dragIgnoreFrom } from "../data";
|
||||||
// import { useDashboardQueryProcessor } from "@/hooks/useExpressionsProcessor";
|
import { useDashboardQueryProcessor } from "@/hooks/useExpressionsProcessor";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "Layout",
|
name: "Layout",
|
||||||
@ -55,6 +55,7 @@ limitations under the License. -->
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const dashboardStore = useDashboardStore();
|
const dashboardStore = useDashboardStore();
|
||||||
const selectorStore = useSelectorStore();
|
const selectorStore = useSelectorStore();
|
||||||
|
console.log(dashboardStore.layout);
|
||||||
|
|
||||||
function clickGrid(item: LayoutConfig, event: Event) {
|
function clickGrid(item: LayoutConfig, event: Event) {
|
||||||
dashboardStore.activeGridItem(item.i);
|
dashboardStore.activeGridItem(item.i);
|
||||||
@ -68,13 +69,23 @@ limitations under the License. -->
|
|||||||
dashboardStore.setActiveTabIndex(0);
|
dashboardStore.setActiveTabIndex(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// async function queryMetrics() {
|
async function queryMetrics() {
|
||||||
// const e = {
|
const widgets = [];
|
||||||
// metrics: props.data.expressions || [],
|
for (const item of dashboardStore.layout) {
|
||||||
// metricConfig: props.data.metricConfig || [],
|
if (item.type === "Widget") {
|
||||||
// };
|
widgets.push(item);
|
||||||
// const params = (await useDashboardQueryProcessor(e)) || {};
|
}
|
||||||
// }
|
if (item.type === "Tab") {
|
||||||
|
widgets.push(...item.children[item.activedTabIndex].children);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const configList = widgets.map((d: any) => ({
|
||||||
|
metrics: d.expressions || [],
|
||||||
|
metricConfig: d.data.metricConfig || [],
|
||||||
|
}));
|
||||||
|
const params = (await useDashboardQueryProcessor(configList)) || {};
|
||||||
|
console.log(params);
|
||||||
|
}
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
dashboardStore.setLayout([]);
|
dashboardStore.setLayout([]);
|
||||||
selectorStore.setCurrentService(null);
|
selectorStore.setCurrentService(null);
|
||||||
|
Loading…
Reference in New Issue
Block a user