mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-15 04:09:14 +00:00
test: implement unit tests for hooks and refactor some types (#493)
This commit is contained in:
@@ -165,7 +165,7 @@ limitations under the License. -->
|
||||
{ metricConfig: metricConfig.value || [], expressions, subExpressions },
|
||||
EntityType[2].value,
|
||||
);
|
||||
currentEndpoints.value = params.data;
|
||||
currentEndpoints.value = params.data as Endpoint[];
|
||||
colMetrics.value = params.names;
|
||||
colSubMetrics.value = params.subNames;
|
||||
metricConfig.value = params.metricConfigArr;
|
||||
|
@@ -91,6 +91,7 @@ limitations under the License. -->
|
||||
import getDashboard from "@/hooks/useDashboardsSession";
|
||||
import type { MetricConfigOpt } from "@/types/dashboard";
|
||||
import ColumnGraph from "./components/ColumnGraph.vue";
|
||||
import type { PodWithMetrics } from "@/hooks/useExpressionsProcessor";
|
||||
|
||||
/*global defineProps */
|
||||
const props = defineProps({
|
||||
@@ -176,11 +177,11 @@ limitations under the License. -->
|
||||
|
||||
if (expressions.length && expressions[0]) {
|
||||
const params = await useExpressionsQueryPodsMetrics(
|
||||
currentInstances,
|
||||
currentInstances as PodWithMetrics[],
|
||||
{ metricConfig: metricConfig.value || [], expressions, subExpressions },
|
||||
EntityType[3].value,
|
||||
);
|
||||
instances.value = params.data;
|
||||
instances.value = params.data as Instance[];
|
||||
colMetrics.value = params.names;
|
||||
colSubMetrics.value = params.subNames;
|
||||
typesOfMQE.value = params.metricTypesArr;
|
||||
|
@@ -78,14 +78,14 @@ limitations under the License. -->
|
||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||
import type { Service } from "@/types/selector";
|
||||
import { useExpressionsQueryPodsMetrics } from "@/hooks/useExpressionsProcessor";
|
||||
import { useExpressionsQueryPodsMetrics, PodWithMetrics } from "@/hooks/useExpressionsProcessor";
|
||||
import { EntityType } from "../data";
|
||||
import router from "@/router";
|
||||
import getDashboard from "@/hooks/useDashboardsSession";
|
||||
import type { MetricConfigOpt } from "@/types/dashboard";
|
||||
import ColumnGraph from "./components/ColumnGraph.vue";
|
||||
|
||||
interface ServiceWithGroup extends Service {
|
||||
export interface ServiceWithGroup extends Service {
|
||||
merge: boolean;
|
||||
group: string;
|
||||
}
|
||||
@@ -219,11 +219,11 @@ limitations under the License. -->
|
||||
|
||||
if (expressions.length && expressions[0]) {
|
||||
const params = await useExpressionsQueryPodsMetrics(
|
||||
currentServices,
|
||||
currentServices as PodWithMetrics[],
|
||||
{ metricConfig: metricConfig.value || [], expressions, subExpressions },
|
||||
EntityType[0].value,
|
||||
);
|
||||
services.value = params.data;
|
||||
services.value = params.data as ServiceWithGroup[];
|
||||
colMetrics.value = params.names;
|
||||
colSubMetrics.value = params.subNames;
|
||||
metricConfig.value = params.metricConfigArr;
|
||||
|
Reference in New Issue
Block a user