This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-fence.git
The following commit(s) were added to refs/heads/master by this push:
new 95e674f 修改时间显示时区问题 (#72)
95e674f is described below
commit 95e674f99c6b98355b03e421a077d5ac46a5ac53
Author: tianxin <[email protected]>
AuthorDate: Thu Jun 6 18:53:20 2024 -0700
修改时间显示时区问题 (#72)
---
admin-website/src/main/web/src/api/problems.ts | 2 --
admin-website/src/main/web/src/utils/time.ts | 4 ++--
.../web/src/views/cloud/problems/components/call-chain-list.vue | 2 +-
.../src/main/web/src/views/cloud/problems/components/main.vue | 7 ++++---
4 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/admin-website/src/main/web/src/api/problems.ts
b/admin-website/src/main/web/src/api/problems.ts
index 83fae89..d41ee93 100644
--- a/admin-website/src/main/web/src/api/problems.ts
+++ b/admin-website/src/main/web/src/api/problems.ts
@@ -48,7 +48,5 @@ export function searchLog(data: SearchTraceRequest) {
timestamp: data.timestamp,
traceId: data.traceId
},
- }).then(response => {
- return response.data
})
}
diff --git a/admin-website/src/main/web/src/utils/time.ts
b/admin-website/src/main/web/src/utils/time.ts
index cdaee55..7ba711a 100644
--- a/admin-website/src/main/web/src/utils/time.ts
+++ b/admin-website/src/main/web/src/utils/time.ts
@@ -19,7 +19,7 @@ export function sortTime(property: string | number | any) {
}
// 时间处理特定格式
-export function timesHandle(times: any) {
+export function timesHandle(times: any, isCovert:boolean) {
const date = new Date(times)
const year = date.getFullYear();
@@ -29,5 +29,5 @@ export function timesHandle(times: any) {
const minutes = String(date.getMinutes())
const seconds = String(date.getSeconds())
- return `${year}-${month}-${day}
${Number(hours)<10?`0${hours}`:hours}:${Number(minutes)<10?`0${minutes}`:minutes}:${Number(seconds)<10?`0${seconds}`:seconds}`
+ return
`${year}-${month}-${day}${isCovert?'T':''}${Number(hours)<10?`0${hours}`:hours}:${Number(minutes)<10?`0${minutes}`:minutes}:${Number(seconds)<10?`0${seconds}`:seconds}`
}
diff --git
a/admin-website/src/main/web/src/views/cloud/problems/components/call-chain-list.vue
b/admin-website/src/main/web/src/views/cloud/problems/components/call-chain-list.vue
index 5856982..c1f44dc 100644
---
a/admin-website/src/main/web/src/views/cloud/problems/components/call-chain-list.vue
+++
b/admin-website/src/main/web/src/views/cloud/problems/components/call-chain-list.vue
@@ -20,7 +20,7 @@
<tiny-grid-column field="timestamp" title="timestamp">
<template #default="data">
<div>
- {{ timesHandle(data.row.timestamp/1000) }}
+ {{ timesHandle(data.row.timestamp/1000, false) }}
</div>
</template>
</tiny-grid-column>
diff --git
a/admin-website/src/main/web/src/views/cloud/problems/components/main.vue
b/admin-website/src/main/web/src/views/cloud/problems/components/main.vue
index 6443dd4..ddfa082 100644
--- a/admin-website/src/main/web/src/views/cloud/problems/components/main.vue
+++ b/admin-website/src/main/web/src/views/cloud/problems/components/main.vue
@@ -55,6 +55,7 @@ import {
} from '@opentiny/vue';
import { searchTrace, searchLog } from '@/api/problems';
import { ListType } from '@/types/roleType';
+import { timesHandle } from '@/utils/time';
import callChainList from './call-chain-list.vue';
interface FilterType {
@@ -97,17 +98,17 @@ const searchCallChain = () => {
searchForm.value.validate((valid: any) => {
if (valid) {
- const date = new
Date(state.filterOptions.startTime).toISOString().slice(0, 19)
+ const date = new Date(state.filterOptions.startTime)
// 获取调用链列表
searchTrace({
- timestamp: date,
+ timestamp: timesHandle(date,true),
traceId: state.filterOptions.traceId,
}).then(response => {
state.traceData = response as any
});
// 获取日志列表
searchLog({
- timestamp: date,
+ timestamp: timesHandle(date,true),
traceId: state.filterOptions.traceId,
}).then(response => {
state.listData = response as any