fix(ui): Inconsistent time values in UI (#1452)
* fix(ui): Truncate displayed time values * refactor(ui): Use util function * chore(ui): Regenerate static assets --------- Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
@@ -281,8 +281,8 @@ const pageResponseTimeRange = computed(() => {
|
||||
}
|
||||
|
||||
if (!hasData) return 'N/A'
|
||||
const minMs = Math.round(min / 1000000)
|
||||
const maxMs = Math.round(max / 1000000)
|
||||
const minMs = Math.trunc(min / 1000000)
|
||||
const maxMs = Math.trunc(max / 1000000)
|
||||
// If min and max are the same, show single value
|
||||
if (minMs === maxMs) {
|
||||
return `${minMs}ms`
|
||||
|
||||
@@ -153,6 +153,7 @@ import StepDetailsModal from '@/components/StepDetailsModal.vue'
|
||||
import Settings from '@/components/Settings.vue'
|
||||
import Loading from '@/components/Loading.vue'
|
||||
import { generatePrettyTimeAgo } from '@/utils/time'
|
||||
import { formatDuration } from '@/utils/format'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@@ -238,19 +239,6 @@ const formatTimestamp = (timestamp) => {
|
||||
return date.toLocaleString()
|
||||
}
|
||||
|
||||
const formatDuration = (duration) => {
|
||||
if (!duration && duration !== 0) return 'N/A'
|
||||
|
||||
// Convert nanoseconds to milliseconds
|
||||
const durationMs = duration / 1000000
|
||||
|
||||
if (durationMs < 1000) {
|
||||
return `${durationMs.toFixed(0)}ms`
|
||||
} else {
|
||||
return `${(durationMs / 1000).toFixed(2)}s`
|
||||
}
|
||||
}
|
||||
|
||||
const calculateSuccessRate = (result) => {
|
||||
if (!result || !result.endpointResults || result.endpointResults.length === 0) {
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user