fix dashboards

This commit is contained in:
Qiuxia Fan 2022-04-02 00:05:44 +08:00
parent f57fdf9312
commit f3c8a3a9db
2 changed files with 9 additions and 4 deletions

View File

@ -53,6 +53,9 @@ const available = computed(
(Array.isArray(props.option.series.data) && props.option.series.data[0])
);
onMounted(async () => {
if (!available.value) {
return;
}
await setOptions(props.option);
chartRef.value && addResizeListener(unref(chartRef), resize);
setTimeout(() => {
@ -70,6 +73,9 @@ onMounted(async () => {
watch(
() => props.option,
(newVal, oldVal) => {
if (!available.value) {
return;
}
if (JSON.stringify(newVal) === JSON.stringify(oldVal)) {
return;
}

View File

@ -169,7 +169,6 @@ const key = computed(() => {
const type = EntityType.find(
(d: Option) => d.value === dashboardStore.entity
);
return (type && type.key) || 0;
});
@ -268,9 +267,9 @@ async function setDestSelector() {
return;
}
const destPod = params.destPodId || selectorStore.destPods[0].id;
const currentDestPod = selectorStore.destPods.filter(
const currentDestPod = selectorStore.destPods.find(
(d: { id: string }) => d.id === destPod
)[0];
);
if (currentDestPod) {
selectorStore.setCurrentDestPod(currentDestPod);
states.currentDestPod = currentDestPod.label;
@ -278,7 +277,7 @@ async function setDestSelector() {
}
async function getServices() {
if (key.value === 10 || key.value === 0) {
if (key.value === 10) {
return;
}
if (!dashboardStore.layerId) {