diff --git a/src/hooks/useProcessor.ts b/src/hooks/useProcessor.ts index 54732cc8..b50ffb46 100644 --- a/src/hooks/useProcessor.ts +++ b/src/hooks/useProcessor.ts @@ -19,7 +19,7 @@ import { ElMessage } from "element-plus"; import { useDashboardStore } from "@/store/modules/dashboard"; import { useSelectorStore } from "@/store/modules/selectors"; import { useAppStoreWithOut } from "@/store/modules/app"; -import { Instance } from "@/types/selector"; +import { Instance, Endpoint } from "@/types/selector"; export function useQueryProcessor(config: any) { if (!(config.metrics && config.metrics.length)) { @@ -194,7 +194,7 @@ function aggregation(json: { } export function useQueryPodsMetrics( - pods: Instance[], + pods: Array, config: { metrics: string[]; metricTypes: string[] } ) { const appStore = useAppStoreWithOut(); @@ -205,7 +205,7 @@ export function useQueryPodsMetrics( const variables: string[] = [`$duration: Duration!`]; const { currentService } = selectorStore; - const fragmentList = pods.map((d: Instance, index: number) => { + const fragmentList = pods.map((d: Instance | Endpoint, index: number) => { const param = { scope: "ServiceInstance", serviceName: currentService.label, @@ -229,7 +229,7 @@ export function useQueryPodsMetrics( return { queryStr, conditions }; } export function usePodsSource( - instances: Instance[], + pods: Array, resp: { errors: string; data: { [key: string]: any } }, config: { metrics: string[]; metricTypes: string[] } ): any { @@ -237,7 +237,7 @@ export function usePodsSource( ElMessage.error(resp.errors); return {}; } - const data = instances.map((d: Instance | any, idx: number) => { + const data = pods.map((d: Instance | any, idx: number) => { config.metrics.map((name: string, index: number) => { const key = name + idx + index; diff --git a/src/types/selector.d.ts b/src/types/selector.d.ts index 2c5c1d7b..f968d544 100644 --- a/src/types/selector.d.ts +++ b/src/types/selector.d.ts @@ -31,3 +31,9 @@ export type Instance = { instanceUUID: string; attributes: { name: string; value: string }[]; }; + +export type Endpoint = { + id: string; + label: string; + value: string; +}; diff --git a/src/views/dashboard/graphs/EndpointList.vue b/src/views/dashboard/graphs/EndpointList.vue index 2dd7a162..eff152f9 100644 --- a/src/views/dashboard/graphs/EndpointList.vue +++ b/src/views/dashboard/graphs/EndpointList.vue @@ -46,6 +46,21 @@ limitations under the License. --> + + + diff --git a/src/views/dashboard/graphs/MinLine.vue b/src/views/dashboard/graphs/MinLine.vue deleted file mode 100644 index e69de29b..00000000