watch list

This commit is contained in:
Qiuxia Fan 2022-03-22 18:52:13 +08:00
parent 583b8fca50
commit 0b27ff7aa2
3 changed files with 22 additions and 2 deletions

View File

@ -105,8 +105,9 @@ export default defineComponent({
const appStore = useAppStoreWithOut();
const dashboardStore = useDashboardStore();
const selectorStore = useSelectorStore();
const isList = ListChartTypes.includes(props.data.graph.type || "");
if (props.needQuery || !dashboardStore.currentDashboard.id) {
if ((props.needQuery || !dashboardStore.currentDashboard.id) && !isList) {
queryMetrics();
}
@ -152,7 +153,10 @@ export default defineComponent({
if (props.data.i !== dashboardStore.selectedGrid.i) {
return;
}
if (ListChartTypes.includes(dashboardStore.selectedGrid.graph.type)) {
if (
ListChartTypes.includes(dashboardStore.selectedGrid.graph.type) ||
isList
) {
return;
}
queryMetrics();
@ -161,6 +165,9 @@ export default defineComponent({
watch(
() => [selectorStore.currentService, selectorStore.currentDestService],
() => {
if (isList) {
return;
}
if (
dashboardStore.entity === EntityType[0].value ||
dashboardStore.entity === EntityType[4].value

View File

@ -191,6 +191,12 @@ watch(
}
}
);
watch(
() => [selectorStore.currentService],
() => {
queryEndpoints();
}
);
</script>
<style lang="scss" scoped>
@import "./style.scss";

View File

@ -182,6 +182,7 @@ function clickInstance(scope: any) {
function changePage(pageIndex: number) {
instances.value = searchInstances.value.splice(pageIndex - 1, pageSize);
}
function searchList() {
searchInstances.value = selectorStore.pods.filter((d: { label: string }) =>
d.label.includes(searchText.value)
@ -197,6 +198,12 @@ watch(
}
}
);
watch(
() => [selectorStore.currentService],
() => {
queryInstance();
}
);
</script>
<style lang="scss" scoped>
@import "./style.scss";