diff --git a/packages/ui/certd-client/src/views/framework/home/dashboard/index.vue b/packages/ui/certd-client/src/views/framework/home/dashboard/index.vue
index e5b459e1..6b018e07 100644
--- a/packages/ui/certd-client/src/views/framework/home/dashboard/index.vue
+++ b/packages/ui/certd-client/src/views/framework/home/dashboard/index.vue
@@ -14,7 +14,12 @@
您好,{{ userInfo.nickName || userInfo.username }}, 欢迎使用 【{{ siteInfo.title }}】
-
{{ now }}
+
+
+ {{ now }}
+
+
+
@@ -138,11 +143,11 @@ import { GetStatisticCount } from "/@/views/framework/home/dashboard/api";
import { useRouter } from "vue-router";
import * as api from "./api";
defineOptions({
- name: "DashboardUser"
+ name: "DashboardUser",
});
const version = ref(import.meta.env.VITE_APP_VERSION);
-const latestVersion = ref();
+const latestVersion = ref("");
const hasNewVersion = computed(() => {
if (!latestVersion.value) {
return false;
@@ -174,7 +179,16 @@ const userInfo: ComputedRef = computed(() => {
return userStore.getUserInfo;
});
const now = computed(() => {
- return dayjs().format("YYYY-MM-DD HH:mm:ss");
+ const serverTime = settingStore.app.deltaTime + Date.now();
+ return dayjs(serverTime).format("YYYY-MM-DD HH:mm:ss");
+});
+
+const deltaTimeWarning = computed(() => {
+ return Math.abs(settingStore.app.deltaTime) > 1000 * 60 * 4;
+});
+const deltaTimeTip = computed(() => {
+ const deltaMin = (Math.abs(settingStore.app.deltaTime) / 1000 / 60).toFixed(2);
+ return `服务器时间相差:${deltaMin}分钟${deltaTimeWarning.value ? ",请检查服务器时间是否正确" : ""}`;
});
const router = useRouter();
function goPipeline() {
@@ -189,7 +203,7 @@ function transformStatusCount() {
{ name: "start", label: "运行中" },
{ name: "error", label: "失败" },
{ name: "canceled", label: "已取消" },
- { name: null, label: "未执行" }
+ { name: null, label: "未执行" },
];
const result = [];
for (const item of sorted) {
@@ -208,7 +222,7 @@ async function loadCount() {
count.value.historyCountPerDay = count.value.historyCountPerDay.map((item: any) => {
return {
name: item.date,
- value: item.count
+ value: item.count,
};
});
}
diff --git a/packages/ui/certd-client/src/views/framework/home/index.vue b/packages/ui/certd-client/src/views/framework/home/index.vue
index 16967f09..c57c23f8 100644
--- a/packages/ui/certd-client/src/views/framework/home/index.vue
+++ b/packages/ui/certd-client/src/views/framework/home/index.vue
@@ -22,10 +22,10 @@ onMounted(() => {
content: "为了您的账户安全,请立即修改密码",
onOk: () => {
changePasswordButtonRef.value.open({
- password: "123456"
+ password: "123456",
});
},
- okText: "立即修改"
+ okText: "立即修改",
});
}
});