mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
feat: query expressions
This commit is contained in:
parent
57f13f2ac5
commit
16decafa1c
2
src/types/dashboard.d.ts
vendored
2
src/types/dashboard.d.ts
vendored
@ -36,7 +36,7 @@ export interface LayoutConfig {
|
||||
expressions?: string[];
|
||||
metricTypes?: string[];
|
||||
typesOfMQE?: string[];
|
||||
children?: { name: string; children: LayoutConfig[]; expression?: string }[];
|
||||
children?: { name: string; children: LayoutConfig[]; expression?: string; enable: boolean }[];
|
||||
activedTabIndex?: number;
|
||||
metricConfig?: MetricConfigOpt[];
|
||||
id?: string;
|
||||
|
@ -149,7 +149,6 @@ limitations under the License. -->
|
||||
dashboardStore.setCurrentTabItems(dashboardStore.layout[l].children[activeTabIndex.value].children);
|
||||
dashboardStore.setActiveTabIndex(activeTabIndex.value, props.data.i);
|
||||
}
|
||||
console.log(props.data);
|
||||
|
||||
// if (props.needQuery || !dashboardStore.currentDashboard.id) {
|
||||
// queryExpressions();
|
||||
@ -241,12 +240,21 @@ limitations under the License. -->
|
||||
}
|
||||
|
||||
async function queryExpressions() {
|
||||
const tabsProps = props.data;
|
||||
const metrics = [];
|
||||
for (const child of props.data.children || []) {
|
||||
for (const child of tabsProps.children || []) {
|
||||
child.expression && metrics.push(child.expression);
|
||||
}
|
||||
const params = (await useExpressionsQueryProcessor({ metrics })) || {};
|
||||
console.log(params);
|
||||
const params: { [key: string]: any } = (await useExpressionsQueryProcessor({ metrics })) || {};
|
||||
|
||||
for (const child of tabsProps.children || []) {
|
||||
if (params.source[child.expression || ""]) {
|
||||
child.enable = !!Number(params.source[child.expression || ""]) || true;
|
||||
} else {
|
||||
child.enable = true;
|
||||
}
|
||||
}
|
||||
console.log(tabsProps);
|
||||
}
|
||||
|
||||
watch(
|
||||
|
Loading…
Reference in New Issue
Block a user