mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 16:27:33 +00:00
refactor
This commit is contained in:
parent
5be106fc4f
commit
538287b539
@ -60,7 +60,10 @@ limitations under the License. -->
|
||||
/>
|
||||
</el-popover>
|
||||
<span
|
||||
v-show="states.isList || states.metricTypes[0] === 'readMetricsValues'"
|
||||
v-show="
|
||||
states.isList ||
|
||||
states.metricTypes[0] === ProtocolTypes.ReadMetricsValues
|
||||
"
|
||||
>
|
||||
<Icon
|
||||
class="cp mr-5"
|
||||
@ -106,6 +109,7 @@ import {
|
||||
ChartTypes,
|
||||
PodsChartTypes,
|
||||
MetricsType,
|
||||
ProtocolTypes,
|
||||
} from "../../../data";
|
||||
import { ElMessage } from "element-plus";
|
||||
import Icon from "@/components/Icon.vue";
|
||||
@ -425,13 +429,7 @@ function setMetricTypeList(type: string) {
|
||||
return MetricTypes[type];
|
||||
}
|
||||
if (states.isList || graph.value.type === "Table") {
|
||||
return [
|
||||
{ label: "read all values in the duration", value: "readMetricsValues" },
|
||||
{
|
||||
label: "read the single value in the duration",
|
||||
value: "readMetricsValue",
|
||||
},
|
||||
];
|
||||
return [MetricTypes.REGULAR_VALUE[0], MetricTypes.REGULAR_VALUE[1]];
|
||||
}
|
||||
return MetricTypes[type];
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ import { useI18n } from "vue-i18n";
|
||||
import { SortOrder, CalculationOpts } from "../../../data";
|
||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||
import { MetricConfigOpt } from "@/types/dashboard";
|
||||
import { ListChartTypes } from "../../../data";
|
||||
import { ListChartTypes, ProtocolTypes } from "../../../data";
|
||||
|
||||
/*global defineEmits, defineProps */
|
||||
const props = defineProps({
|
||||
@ -122,11 +122,18 @@ const hasLabel = computed(() => {
|
||||
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];
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user