mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 11:21:29 +00:00
fix: set different scope for topN metrics (#40)
This commit is contained in:
@@ -111,7 +111,11 @@ import {
|
||||
} from "../../../data";
|
||||
import { ElMessage } from "element-plus";
|
||||
import Icon from "@/components/Icon.vue";
|
||||
import { useQueryProcessor, useSourceProcessor } from "@/hooks/useProcessor";
|
||||
import {
|
||||
useQueryProcessor,
|
||||
useSourceProcessor,
|
||||
useGetMetricEntity,
|
||||
} from "@/hooks/useProcessor";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { DashboardItem, MetricConfigOpt } from "@/types/dashboard";
|
||||
import Standard from "./Standard.vue";
|
||||
@@ -343,8 +347,9 @@ async function queryMetrics() {
|
||||
if (states.isList) {
|
||||
return;
|
||||
}
|
||||
const { metricConfig } = dashboardStore.selectedGrid;
|
||||
const params = useQueryProcessor({ ...states, metricConfig });
|
||||
const { metricConfig, metricTypes, metrics } = dashboardStore.selectedGrid;
|
||||
const catalog = await useGetMetricEntity(metrics[0], metricTypes[0]);
|
||||
const params = useQueryProcessor({ ...states, metricConfig, catalog });
|
||||
if (!params) {
|
||||
emit("update", {});
|
||||
return;
|
||||
|
@@ -81,7 +81,11 @@ import { useAppStoreWithOut } from "@/store/modules/app";
|
||||
import { useSelectorStore } from "@/store/modules/selectors";
|
||||
import graphs from "../graphs";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useQueryProcessor, useSourceProcessor } from "@/hooks/useProcessor";
|
||||
import {
|
||||
useQueryProcessor,
|
||||
useSourceProcessor,
|
||||
useGetMetricEntity,
|
||||
} from "@/hooks/useProcessor";
|
||||
import { EntityType, ListChartTypes } from "../data";
|
||||
|
||||
const props = {
|
||||
@@ -113,7 +117,9 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
async function queryMetrics() {
|
||||
const params = await useQueryProcessor(props.data);
|
||||
const { metricTypes, metrics } = props.data;
|
||||
const catalog = await useGetMetricEntity(metrics[0], metricTypes[0]);
|
||||
const params = await useQueryProcessor({ ...props.data, catalog });
|
||||
|
||||
if (!params) {
|
||||
state.source = {};
|
||||
|
@@ -106,11 +106,12 @@ const getMetricConfig = computed(() => {
|
||||
});
|
||||
|
||||
function changeConfigs(param: { [key: string]: string }) {
|
||||
const metricConfig = getMetricConfig.value;
|
||||
const metricConfig = getMetricConfig.value || [];
|
||||
metricConfig[currentIndex.value] = {
|
||||
...metricConfig[currentIndex.value],
|
||||
...param,
|
||||
};
|
||||
currentConfig.value = metricConfig[currentIndex.value];
|
||||
emit("update", { [props.type]: metricConfig });
|
||||
}
|
||||
function changeMetric(val: string) {
|
||||
|
Reference in New Issue
Block a user