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[];
|
expressions?: string[];
|
||||||
metricTypes?: string[];
|
metricTypes?: string[];
|
||||||
typesOfMQE?: string[];
|
typesOfMQE?: string[];
|
||||||
children?: { name: string; children: LayoutConfig[]; expression?: string }[];
|
children?: { name: string; children: LayoutConfig[]; expression?: string; enable: boolean }[];
|
||||||
activedTabIndex?: number;
|
activedTabIndex?: number;
|
||||||
metricConfig?: MetricConfigOpt[];
|
metricConfig?: MetricConfigOpt[];
|
||||||
id?: string;
|
id?: string;
|
||||||
|
@ -149,7 +149,6 @@ limitations under the License. -->
|
|||||||
dashboardStore.setCurrentTabItems(dashboardStore.layout[l].children[activeTabIndex.value].children);
|
dashboardStore.setCurrentTabItems(dashboardStore.layout[l].children[activeTabIndex.value].children);
|
||||||
dashboardStore.setActiveTabIndex(activeTabIndex.value, props.data.i);
|
dashboardStore.setActiveTabIndex(activeTabIndex.value, props.data.i);
|
||||||
}
|
}
|
||||||
console.log(props.data);
|
|
||||||
|
|
||||||
// if (props.needQuery || !dashboardStore.currentDashboard.id) {
|
// if (props.needQuery || !dashboardStore.currentDashboard.id) {
|
||||||
// queryExpressions();
|
// queryExpressions();
|
||||||
@ -241,12 +240,21 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function queryExpressions() {
|
async function queryExpressions() {
|
||||||
|
const tabsProps = props.data;
|
||||||
const metrics = [];
|
const metrics = [];
|
||||||
for (const child of props.data.children || []) {
|
for (const child of tabsProps.children || []) {
|
||||||
child.expression && metrics.push(child.expression);
|
child.expression && metrics.push(child.expression);
|
||||||
}
|
}
|
||||||
const params = (await useExpressionsQueryProcessor({ metrics })) || {};
|
const params: { [key: string]: any } = (await useExpressionsQueryProcessor({ metrics })) || {};
|
||||||
console.log(params);
|
|
||||||
|
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(
|
watch(
|
||||||
|
Loading…
Reference in New Issue
Block a user