befly-admin-ui 1.10.1 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/detailPanel.vue +52 -54
- package/components/pageDialog.vue +131 -117
- package/components/pageTableDetail.vue +381 -402
- package/layouts/default.vue +212 -215
- package/package.json +2 -2
- package/views/config/dict/components/edit.vue +83 -60
- package/views/config/dict/index.vue +51 -55
- package/views/config/dictType/components/edit.vue +81 -57
- package/views/config/dictType/index.vue +37 -39
- package/views/config/system/components/edit.vue +97 -86
- package/views/config/system/index.vue +35 -37
- package/views/index/components/addonList.vue +14 -11
- package/views/index/components/environmentInfo.vue +25 -22
- package/views/index/components/operationLogs.vue +20 -16
- package/views/index/components/performanceMetrics.vue +24 -21
- package/views/index/components/serviceStatus.vue +26 -22
- package/views/index/components/systemNotifications.vue +24 -19
- package/views/index/components/systemOverview.vue +368 -385
- package/views/index/components/systemResources.vue +22 -19
- package/views/index/components/userInfo.vue +56 -56
- package/views/log/email/index.vue +96 -85
- package/views/log/error/index.vue +111 -117
- package/views/log/login/index.vue +15 -13
- package/views/log/operate/index.vue +31 -31
- package/views/login_1/index.vue +50 -32
- package/views/people/admin/components/edit.vue +1 -1
- package/views/people/admin/index.vue +27 -28
- package/views/permission/api/index.vue +44 -45
- package/views/permission/menu/index.vue +35 -35
- package/views/permission/role/components/api.vue +143 -144
- package/views/permission/role/components/edit.vue +74 -52
- package/views/permission/role/components/menu.vue +119 -121
- package/views/permission/role/index.vue +47 -49
- package/views/resource/gallery/index.vue +77 -78
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
<div class="section-content">
|
|
8
8
|
<div class="config-grid">
|
|
9
|
-
<div v-for="service in services" :key="service.name" class="config-card" :class="`config-${service.status}`">
|
|
9
|
+
<div v-for="service in $Data.services" :key="service.name" class="config-card" :class="`config-${service.status}`">
|
|
10
10
|
<div class="config-info">
|
|
11
11
|
<div class="config-name">{{ service.name }}</div>
|
|
12
12
|
<div class="config-status">
|
|
13
|
-
{{ getStatusText(service.status) }}
|
|
13
|
+
{{ $Method.getStatusText(service.status) }}
|
|
14
14
|
<span v-if="service.responseTime && service.responseTime !== '-'" class="latency">{{ service.responseTime }}</span>
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
@@ -23,33 +23,37 @@
|
|
|
23
23
|
<script setup>
|
|
24
24
|
import { reactive } from "vue";
|
|
25
25
|
import { CheckCircleIcon } from "tdesign-icons-vue-next";
|
|
26
|
-
import { $Http } from "@/plugins/http";
|
|
26
|
+
import { $Http } from "@/plugins/http.js";
|
|
27
27
|
|
|
28
28
|
// 组件内部数据
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const fetchData = async () => {
|
|
33
|
-
try {
|
|
34
|
-
const res = await $Http("/core/dashboard/serviceStatus", {}, [""]);
|
|
35
|
-
const nextServices = Array.isArray(res.data?.services) ? res.data.services.filter((service) => service?.name !== "OSS存储") : [];
|
|
36
|
-
services.splice(0, services.length, ...nextServices);
|
|
37
|
-
} catch (_error) {
|
|
38
|
-
// 静默失败:不阻断页面展示
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
fetchData();
|
|
29
|
+
const $Data = reactive({
|
|
30
|
+
services: []
|
|
31
|
+
});
|
|
43
32
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const texts = {
|
|
33
|
+
const $Const = {
|
|
34
|
+
statusTextMap: {
|
|
47
35
|
running: "正常",
|
|
48
36
|
stopped: "停止",
|
|
49
37
|
unconfigured: "未配置"
|
|
50
|
-
}
|
|
51
|
-
return texts[status] || status;
|
|
38
|
+
}
|
|
52
39
|
};
|
|
40
|
+
|
|
41
|
+
const $Method = {
|
|
42
|
+
async fetchData() {
|
|
43
|
+
try {
|
|
44
|
+
const res = await $Http("/core/dashboard/serviceStatus", {}, [""]);
|
|
45
|
+
const nextServices = Array.isArray(res.data?.services) ? res.data.services.filter((service) => service?.name !== "OSS存储") : [];
|
|
46
|
+
$Data.services.splice(0, $Data.services.length, ...nextServices);
|
|
47
|
+
} catch (_error) {
|
|
48
|
+
// 静默失败:不阻断页面展示
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
getStatusText(status) {
|
|
52
|
+
return $Const.statusTextMap[status] || status;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
$Method.fetchData();
|
|
53
57
|
</script>
|
|
54
58
|
|
|
55
59
|
<style scoped lang="scss">
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
<div class="section-content">
|
|
8
8
|
<div class="notification-compact-list">
|
|
9
|
-
<div v-for="notification in notifications" :key="notification.id" class="notification-compact-item">
|
|
9
|
+
<div v-for="notification in $Const.notifications" :key="notification.id" class="notification-compact-item">
|
|
10
10
|
<div class="notification-icon" :class="`type-${notification.type}`">
|
|
11
11
|
<InfoCircleIcon v-if="notification.type === 'info'" />
|
|
12
12
|
<CheckCircleIcon v-else-if="notification.type === 'success'" />
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
</div>
|
|
17
17
|
<div class="notification-content">
|
|
18
18
|
<span class="notification-title">{{ notification.title }}</span>
|
|
19
|
-
<span class="notification-time">{{ formatTime(notification.createdAt) }}</span>
|
|
19
|
+
<span class="notification-time">{{ $Method.formatTime(notification.createdAt) }}</span>
|
|
20
20
|
</div>
|
|
21
21
|
<TTag v-if="!notification.isRead" type="primary" size="small">新</TTag>
|
|
22
22
|
</div>
|
|
@@ -31,23 +31,28 @@ import { Tag as TTag } from "tdesign-vue-next";
|
|
|
31
31
|
import { CheckCircleIcon, CloseCircleIcon, ErrorTriangleIcon, InfoCircleIcon, NotificationIcon } from "tdesign-icons-vue-next";
|
|
32
32
|
|
|
33
33
|
// 组件内部数据
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
const $Const = {
|
|
35
|
+
notifications: [
|
|
36
|
+
{ id: 1, type: "warning", title: "系统更新提醒 - v1.1.0 版本已发布", isRead: false, createdAt: Date.now() - 3600000 },
|
|
37
|
+
{ id: 2, type: "info", title: "数据备份完成 - 今日凌晨自动备份成功", isRead: true, createdAt: Date.now() - 21600000 },
|
|
38
|
+
{ id: 3, type: "error", title: "SSL证书即将过期 - 请及时更新证书", isRead: false, createdAt: Date.now() - 86400000 },
|
|
39
|
+
{ id: 4, type: "success", title: "性能优化完成 - 响应速度提升30%", isRead: true, createdAt: Date.now() - 172800000 }
|
|
40
|
+
]
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const $Method = {
|
|
44
|
+
formatTime(timestamp) {
|
|
45
|
+
const date = new Date(timestamp);
|
|
46
|
+
const now = Date.now();
|
|
47
|
+
const diff = now - timestamp;
|
|
48
|
+
|
|
49
|
+
if (diff < 3600000) {
|
|
50
|
+
return `${Math.floor(diff / 60000)}分钟前`;
|
|
51
|
+
}
|
|
52
|
+
if (diff < 86400000) {
|
|
53
|
+
return `${Math.floor(diff / 3600000)}小时前`;
|
|
54
|
+
}
|
|
55
|
+
|
|
51
56
|
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
52
57
|
const day = String(date.getDate()).padStart(2, "0");
|
|
53
58
|
return `${month}-${day}`;
|