mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 15:52:57 +00:00
feat: update tabs
This commit is contained in:
parent
16decafa1c
commit
2a9fde6805
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; enable: boolean }[];
|
children?: { name: string; children: LayoutConfig[]; expression?: string; enable?: boolean }[];
|
||||||
activedTabIndex?: number;
|
activedTabIndex?: number;
|
||||||
metricConfig?: MetricConfigOpt[];
|
metricConfig?: MetricConfigOpt[];
|
||||||
id?: string;
|
id?: string;
|
||||||
|
@ -20,6 +20,7 @@ limitations under the License. -->
|
|||||||
:key="idx"
|
:key="idx"
|
||||||
:class="{ active: activeTabIndex === idx }"
|
:class="{ active: activeTabIndex === idx }"
|
||||||
@click="clickTabs($event, idx)"
|
@click="clickTabs($event, idx)"
|
||||||
|
v-show="child.enable !== false"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
@click="editTabName($event, idx)"
|
@click="editTabName($event, idx)"
|
||||||
@ -249,17 +250,20 @@ limitations under the License. -->
|
|||||||
|
|
||||||
for (const child of tabsProps.children || []) {
|
for (const child of tabsProps.children || []) {
|
||||||
if (params.source[child.expression || ""]) {
|
if (params.source[child.expression || ""]) {
|
||||||
child.enable = !!Number(params.source[child.expression || ""]) || true;
|
child.enable = !!Number(params.source[child.expression || ""]);
|
||||||
} else {
|
} else {
|
||||||
child.enable = true;
|
child.enable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(tabsProps);
|
dashboardStore.setConfigs(tabsProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => (props.data.children || []).map((d: { name: string }) => d.name),
|
() => (props.data.children || []).map((d: any) => d.expression),
|
||||||
() => {
|
(old: string[], data: string[]) => {
|
||||||
|
if (JSON.stringify(data) === JSON.stringify(old)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
queryExpressions();
|
queryExpressions();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user