diff --git a/src/views/dashboard/configuration/widget/metric/Index.vue b/src/views/dashboard/configuration/widget/metric/Index.vue index 6c66f056..2d3bc28f 100644 --- a/src/views/dashboard/configuration/widget/metric/Index.vue +++ b/src/views/dashboard/configuration/widget/metric/Index.vue @@ -60,7 +60,10 @@ limitations under the License. --> /> { const graph = dashboardStore.selectedGrid.graph || {}; return ( ListChartTypes.includes(graph.type) || - ["readLabeledMetricsValues", "readMetricsValues"].includes(metricType.value) + [ + ProtocolTypes.ReadLabeledMetricsValues, + ProtocolTypes.ReadMetricsValues, + ].includes(metricType.value) ); }); const isTopn = computed(() => - ["sortMetrics", "readSampledRecords"].includes(metricTypes[props.index]) + [ + ProtocolTypes.SortMetrics, + ProtocolTypes.ReadSampledRecords, + ProtocolTypes.ReadRecords, + ].includes(metricTypes[props.index]) ); function updateConfig(index: number, param: { [key: string]: string }) { const key = Object.keys(param)[0]; diff --git a/src/views/dashboard/data.ts b/src/views/dashboard/data.ts index b386e28a..f5a0a05d 100644 --- a/src/views/dashboard/data.ts +++ b/src/views/dashboard/data.ts @@ -47,6 +47,15 @@ export const MetricChartType: any = { readSampledRecords: [{ label: "Top List", value: "TopList" }], readRecords: [{ label: "Top List", value: "TopList" }], }; +export enum ProtocolTypes { + ReadRecords = "readRecords", + ReadSampledRecords = "readSampledRecords", + SortMetrics = "sortMetrics", + ReadLabeledMetricsValues = "readLabeledMetricsValues", + ReadHeatMap = "readHeatMap", + ReadMetricsValues = "readMetricsValues", + ReadMetricsValue = "readMetricsValue", +} export const DefaultGraphConfig: { [key: string]: any } = { Bar: { type: "Bar",