fix: query process metrics (#284)

This commit is contained in:
Fine0830 2023-06-13 20:11:38 +08:00 committed by GitHub
parent 8c9c339417
commit 7fe3257c32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -51,7 +51,7 @@ export async function useExpressionsQueryProcessor(config: Indexable) {
const entity = { const entity = {
serviceName: dashboardStore.entity === "All" ? undefined : selectorStore.currentService.value, serviceName: dashboardStore.entity === "All" ? undefined : selectorStore.currentService.value,
normal: dashboardStore.entity === "All" ? undefined : selectorStore.currentService.normal, normal: dashboardStore.entity === "All" ? undefined : selectorStore.currentService.normal,
serviceInstanceName: ["ServiceInstance", "ServiceInstanceRelation", "ProcessRelation"].includes( serviceInstanceName: ["ServiceInstance", "ServiceInstanceRelation", "ProcessRelation", "Process"].includes(
dashboardStore.entity, dashboardStore.entity,
) )
? selectorStore.currentPod && selectorStore.currentPod.value ? selectorStore.currentPod && selectorStore.currentPod.value

View File

@ -121,6 +121,7 @@ limitations under the License. -->
async function queryMetrics() { async function queryMetrics() {
const isExpression = props.data.metricMode === MetricModes.Expression; const isExpression = props.data.metricMode === MetricModes.Expression;
if (isExpression) { if (isExpression) {
loading.value = true; loading.value = true;
const e = { const e = {
@ -206,7 +207,7 @@ limitations under the License. -->
if (isList.value) { if (isList.value) {
return; return;
} }
if (dashboardStore.entity === EntityType[0].value || dashboardStore.entity === EntityType[4].value) { if ([EntityType[0].value, EntityType[4].value].includes(dashboardStore.entity)) {
queryMetrics(); queryMetrics();
} }
}, },
@ -214,7 +215,7 @@ limitations under the License. -->
watch( watch(
() => [selectorStore.currentPod, selectorStore.currentDestPod], () => [selectorStore.currentPod, selectorStore.currentDestPod],
() => { () => {
if (dashboardStore.entity === EntityType[0].value || dashboardStore.entity === EntityType[7].value) { if ([EntityType[0].value, EntityType[7].value, EntityType[8].value].includes(dashboardStore.entity)) {
return; return;
} }
if (isList.value) { if (isList.value) {
@ -226,10 +227,10 @@ limitations under the License. -->
watch( watch(
() => [selectorStore.currentProcess, selectorStore.currentDestProcess], () => [selectorStore.currentProcess, selectorStore.currentDestProcess],
() => { () => {
if (!(selectorStore.currentDestProcess && selectorStore.currentProcess)) { if (isList.value) {
return; return;
} }
if (dashboardStore.entity === EntityType[7].value) { if ([EntityType[7].value, EntityType[8].value].includes(dashboardStore.entity)) {
queryMetrics(); queryMetrics();
} }
}, },