mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-15 12:49:17 +00:00
feat: add a calculation for cpm5d
(#239)
This commit is contained in:
@@ -471,7 +471,7 @@ limitations under the License. -->
|
||||
.dashboard-list {
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.input-with-search {
|
||||
|
@@ -309,7 +309,7 @@ export const CalculationOpts = [
|
||||
value: "convertMilliseconds",
|
||||
},
|
||||
{ label: "Seconds to YYYY-MM-DD HH:mm:ss", value: "convertSeconds" },
|
||||
{ label: "Precision is 2", value: "precision" },
|
||||
{ label: "CPM5D", value: "cpm5d" },
|
||||
{ label: "Milliseconds to seconds", value: "msTos" },
|
||||
{ label: "Seconds to days", value: "secondToDay" },
|
||||
{ label: "Nanoseconds to milliseconds", value: "nanosecondToMillisecond" },
|
||||
|
@@ -22,7 +22,7 @@ limitations under the License. -->
|
||||
justifyContent: config.textAlign || 'center',
|
||||
}"
|
||||
>
|
||||
{{ singleVal.toFixed(2) }}
|
||||
{{ singleVal }}
|
||||
<span class="unit" v-show="config.showUnit && unit">
|
||||
{{ decodeURIComponent(unit) }}
|
||||
</span>
|
||||
@@ -38,7 +38,7 @@ limitations under the License. -->
|
||||
/*global defineProps */
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object as PropType<{ [key: string]: number }>,
|
||||
type: Object as PropType<{ [key: string]: any }>,
|
||||
default: () => ({}),
|
||||
},
|
||||
config: {
|
||||
@@ -54,7 +54,9 @@ limitations under the License. -->
|
||||
const { t } = useI18n();
|
||||
const metricConfig = computed(() => props.config.metricConfig || []);
|
||||
const key = computed(() => Object.keys(props.data)[0]);
|
||||
const singleVal = computed(() => Number(props.data[key.value]));
|
||||
const singleVal = computed(() =>
|
||||
Array.isArray(props.data[key.value]) ? props.data[key.value][0] : props.data[key.value],
|
||||
);
|
||||
const unit = computed(() => metricConfig.value[0] && encodeURIComponent(metricConfig.value[0].unit || ""));
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
Reference in New Issue
Block a user