fix: update function name

This commit is contained in:
Fine 2023-08-21 17:33:20 +08:00
parent 01fa56014f
commit 4d032d96ac
4 changed files with 10 additions and 13 deletions

View File

@ -318,7 +318,7 @@ export async function useExpressionsQueryPodsMetrics(
export function useQueryTopologyExpressionsProcessor(metrics: string[], instances: any[]) { export function useQueryTopologyExpressionsProcessor(metrics: string[], instances: any[]) {
const appStore = useAppStoreWithOut(); const appStore = useAppStoreWithOut();
function getNodeExpressionQuery() { function getExpressionQuery() {
const conditions: { [key: string]: unknown } = { const conditions: { [key: string]: unknown } = {
duration: appStore.durationTime, duration: appStore.durationTime,
}; };
@ -364,5 +364,5 @@ export function useQueryTopologyExpressionsProcessor(metrics: string[], instance
return obj; return obj;
} }
return { getNodeExpressionQuery, handleExpressionValues }; return { getExpressionQuery, handleExpressionValues };
} }

View File

@ -382,11 +382,8 @@ export const topologyStore = defineStore({
if (!calls.length) { if (!calls.length) {
return; return;
} }
const { getNodeExpressionQuery, handleExpressionValues } = useQueryTopologyExpressionsProcessor( const { getExpressionQuery, handleExpressionValues } = useQueryTopologyExpressionsProcessor(expressions, calls);
expressions, const param = getExpressionQuery();
calls,
);
const param = getNodeExpressionQuery();
const res = await this.getNodeExpressionValue(param); const res = await this.getNodeExpressionValue(param);
if (res.errors) { if (res.errors) {
ElMessage.error(res.errors); ElMessage.error(res.errors);
@ -424,11 +421,11 @@ export const topologyStore = defineStore({
this.setNodeMetricValue({}); this.setNodeMetricValue({});
return; return;
} }
const { getNodeExpressionQuery, handleExpressionValues } = useQueryTopologyExpressionsProcessor( const { getExpressionQuery, handleExpressionValues } = useQueryTopologyExpressionsProcessor(
expressions, expressions,
this.nodes, this.nodes,
); );
const param = getNodeExpressionQuery(); const param = getExpressionQuery();
const res = await this.getNodeExpressionValue(param); const res = await this.getNodeExpressionValue(param);
if (res.errors) { if (res.errors) {
ElMessage.error(res.errors); ElMessage.error(res.errors);

View File

@ -369,8 +369,8 @@ limitations under the License. -->
if (!topologyStore.nodes.length) { if (!topologyStore.nodes.length) {
return; return;
} }
const { getNodeExpressionQuery } = useQueryTopologyExpressionsProcessor(names, topologyStore.nodes); const { getExpressionQuery } = useQueryTopologyExpressionsProcessor(names, topologyStore.nodes);
const param = getNodeExpressionQuery(); const param = getExpressionQuery();
const res = await topologyStore.getNodeExpressionValue(param); const res = await topologyStore.getNodeExpressionValue(param);
if (res.errors) { if (res.errors) {
ElMessage.error(res.errors); ElMessage.error(res.errors);

View File

@ -378,8 +378,8 @@ limitations under the License. -->
return; return;
} }
if (isExpression.value) { if (isExpression.value) {
const { getNodeExpressionQuery } = useQueryTopologyExpressionsProcessor(names, topologyStore.nodes); const { getExpressionQuery } = useQueryTopologyExpressionsProcessor(names, topologyStore.nodes);
const param = getNodeExpressionQuery(); const param = getExpressionQuery();
const res = await topologyStore.getNodeExpressionValue(param); const res = await topologyStore.getNodeExpressionValue(param);
if (res.errors) { if (res.errors) {
ElMessage.error(res.errors); ElMessage.error(res.errors);