This commit is contained in:
Fine 2023-04-06 19:14:58 +08:00
parent b11e1331bc
commit 2c573d6a81
5 changed files with 8 additions and 8 deletions

View File

@ -38,7 +38,7 @@ export function useQueryProcessor(config: Indexable) {
if (!selectorStore.currentService && dashboardStore.entity !== "All") {
return;
}
const conditions: { [key: string]: unknown } = {
const conditions: Recordable = {
duration: appStore.durationTime,
};
const variables: string[] = [`$duration: Duration!`];
@ -424,14 +424,14 @@ export function aggregation(val: number, config: { calculation?: string }): numb
return data;
}
export async function useGetMetricEntity(metric: string, metricType: MetricQueryTypes) {
export async function useGetMetricEntity(metric: string, metricType: string[]) {
if (!metric || !metricType) {
return;
}
let catalog = "";
const dashboardStore = useDashboardStore();
if (
[MetricQueryTypes.ReadSampledRecords, MetricQueryTypes.SortMetrics, MetricQueryTypes.ReadRecords].includes(
([MetricQueryTypes.ReadSampledRecords, MetricQueryTypes.SortMetrics, MetricQueryTypes.ReadRecords] as any).includes(
metricType,
)
) {

View File

@ -113,7 +113,7 @@ limitations under the License. -->
}
async function queryMetrics() {
const metricTypes = props.data.metricTypes || [];
const metricTypes: string[] = props.data.metricTypes || [];
const metrics = props.data.metrics || [];
const catalog = await useGetMetricEntity(metrics[0], metricTypes[0]);
const params = await useQueryProcessor({ ...props.data, catalog });

View File

@ -65,6 +65,7 @@ limitations under the License. -->
import { TextColors } from "@/views/dashboard/data";
import Trace from "@/views/dashboard/related/trace/Index.vue";
import { QueryOrders, Status, RefIdTypes, ProtocolTypes } from "../data";
/*global defineProps */
const props = defineProps({
data: {

View File

@ -85,7 +85,6 @@ limitations under the License. -->
import ConditionTags from "@/views/components/ConditionTags.vue";
import { ElMessage } from "element-plus";
import { EntityType, QueryOrders, Status } from "../../data";
import type { LayoutConfig } from "@/types/dashboard";
const FiltersKeys: { [key: string]: string } = {
status: "traceState",
@ -98,7 +97,7 @@ limitations under the License. -->
const props = defineProps({
needQuery: { type: Boolean, default: true },
data: {
type: Object as PropType<LayoutConfig>,
type: Object as PropType<Recordable>,
default: () => ({ graph: {} }),
},
});

View File

@ -30,10 +30,10 @@ limitations under the License. -->
import TraceList from "./TraceList.vue";
import TraceDetail from "./Detail.vue";
import type { LayoutConfig } from "@/types/dashboard";
/*global defineProps */
/*global defineProps, Recordable */
const props = defineProps({
data: {
type: Object as PropType<LayoutConfig>,
type: Object as PropType<LayoutConfig | Recordable>,
default: () => ({ graph: {} }),
},
});