befly-admin 3.4.6 → 3.4.7

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.
Files changed (65) hide show
  1. package/.gitignore +2 -0
  2. package/index.html +2 -2
  3. package/package.json +8 -8
  4. package/src/config/{internal/index.ts → index.ts} +1 -1
  5. package/src/layouts/{internal/0.vue → default.vue} +49 -20
  6. package/src/main.ts +3 -5
  7. package/src/plugins/{internal/global.ts → global.ts} +1 -11
  8. package/src/plugins/{internal/http.ts → http.ts} +1 -1
  9. package/src/{plugins/internal/router.ts → router/index.ts} +22 -15
  10. package/src/styles/{internal/index.scss → global.scss} +29 -29
  11. package/src/types/auto-imports.d.ts +90 -645
  12. package/src/types/components.d.ts +5 -23
  13. package/src/types/typed-router.d.ts +32 -0
  14. package/src/utils/index.ts +21 -9
  15. package/src/views/index.vue +27 -0
  16. package/src/views/internal/login.vue +73 -0
  17. package/src/views/test.vue +60 -0
  18. package/tsconfig.json +4 -4
  19. package/vite.config.ts +123 -44
  20. package/src/components/internal/README.md +0 -27
  21. package/src/layouts/4.vue +0 -17
  22. package/src/layouts/internal/1.vue +0 -22
  23. package/src/layouts/internal/2.vue +0 -169
  24. package/src/layouts/internal/README.md +0 -27
  25. package/src/plugins/internal/README.md +0 -36
  26. package/src/styles/internal/README.md +0 -27
  27. package/src/styles/internal/mixins.scss +0 -98
  28. package/src/types/env.d.ts +0 -23
  29. package/src/utils/README.md +0 -37
  30. package/src/utils/internal/README.md +0 -21
  31. package/src/utils/internal/index.ts +0 -30
  32. package/src/views/internal/403/403.vue +0 -66
  33. package/src/views/internal/README.md +0 -27
  34. package/src/views/internal/admin/components/edit.vue +0 -147
  35. package/src/views/internal/admin/components/role.vue +0 -135
  36. package/src/views/internal/admin/index.vue +0 -176
  37. package/src/views/internal/dict/components/edit.vue +0 -156
  38. package/src/views/internal/dict/index.vue +0 -159
  39. package/src/views/internal/index/components/addonList.vue +0 -125
  40. package/src/views/internal/index/components/environmentInfo.vue +0 -97
  41. package/src/views/internal/index/components/operationLogs.vue +0 -112
  42. package/src/views/internal/index/components/performanceMetrics.vue +0 -148
  43. package/src/views/internal/index/components/quickActions.vue +0 -27
  44. package/src/views/internal/index/components/serviceStatus.vue +0 -181
  45. package/src/views/internal/index/components/systemNotifications.vue +0 -130
  46. package/src/views/internal/index/components/systemOverview.vue +0 -188
  47. package/src/views/internal/index/components/systemResources.vue +0 -104
  48. package/src/views/internal/index/components/userInfo.vue +0 -202
  49. package/src/views/internal/index/index.vue +0 -62
  50. package/src/views/internal/login/components/emailLoginForm.vue +0 -163
  51. package/src/views/internal/login/components/registerForm.vue +0 -168
  52. package/src/views/internal/login/components/welcomePanel.vue +0 -61
  53. package/src/views/internal/login/index_1.vue +0 -189
  54. package/src/views/internal/menu/components/edit.vue +0 -150
  55. package/src/views/internal/menu/index.vue +0 -168
  56. package/src/views/internal/news/detail/detail_2.vue +0 -26
  57. package/src/views/internal/news/detail/index.vue +0 -26
  58. package/src/views/internal/news/news.vue +0 -26
  59. package/src/views/internal/role/components/api.vue +0 -280
  60. package/src/views/internal/role/components/edit.vue +0 -129
  61. package/src/views/internal/role/components/menu.vue +0 -143
  62. package/src/views/internal/role/index.vue +0 -179
  63. package/src/views/internal/user/user.vue +0 -320
  64. /package/src/plugins/{internal/storage.ts → storage.ts} +0 -0
  65. /package/src/styles/{internal/variables.scss → variables.scss} +0 -0
@@ -1,181 +0,0 @@
1
- <template>
2
- <div class="section-block">
3
- <div class="section-header">
4
- <i-lucide:settings style="width: 20px; height: 20px" />
5
- <h2>服务状态</h2>
6
- </div>
7
- <div class="section-content">
8
- <div class="config-grid">
9
- <div v-for="service in services" :key="service.name" class="config-card" :class="`config-${service.status}`">
10
- <div class="config-icon">
11
- <i-lucide:database v-if="service.name === '数据库'" style="width: 20px; height: 20px" />
12
- <i-lucide:zap v-else-if="service.name === 'Redis'" style="width: 20px; height: 20px" />
13
- <i-lucide:hard-drive v-else-if="service.name === '文件系统'" style="width: 20px; height: 20px" />
14
- <i-lucide:mail v-else-if="service.name === '邮件服务'" style="width: 20px; height: 20px" />
15
- <i-lucide:cloud v-else-if="service.name === 'OSS存储'" style="width: 20px; height: 20px" />
16
- <i-lucide:circle v-else style="width: 20px; height: 20px" />
17
- </div>
18
- <div class="config-info">
19
- <div class="config-name">{{ service.name }}</div>
20
- <div class="config-status">
21
- {{ getStatusText(service.status) }}
22
- <span v-if="service.responseTime && service.responseTime !== '-'" class="latency">{{ service.responseTime }}</span>
23
- </div>
24
- </div>
25
- <div class="config-badge">
26
- <i-lucide:check-circle v-if="service.status === 'running'" style="width: 32px; height: 32px" />
27
- <i-lucide:x-circle v-else-if="service.status === 'stopped'" style="width: 32px; height: 32px" />
28
- <i-lucide:alert-circle v-else-if="service.status === 'unconfigured'" style="width: 32px; height: 32px" />
29
- <i-lucide:circle v-else style="width: 32px; height: 32px" />
30
- </div>
31
- </div>
32
- </div>
33
- </div>
34
- </div>
35
- </template>
36
-
37
- <script setup>
38
- // 组件内部数据
39
- const services = $ref([]);
40
-
41
- // 获取数据
42
- const fetchData = async () => {
43
- try {
44
- const { data } = await $Http('/addon/admin/dashboard/serviceStatus');
45
- services.splice(0, services.length, ...data.services);
46
- } catch (error) {
47
- console.error('获取服务状态失败:', error);
48
- }
49
- };
50
-
51
- fetchData();
52
-
53
- // 工具函数
54
- const getStatusColor = (status) => {
55
- const colors = {
56
- running: 'success',
57
- stopped: 'error',
58
- unconfigured: 'warning'
59
- };
60
- return colors[status] || 'default';
61
- };
62
-
63
- const getStatusText = (status) => {
64
- const texts = {
65
- running: '正常',
66
- stopped: '停止',
67
- unconfigured: '未配置'
68
- };
69
- return texts[status] || status;
70
- };
71
- </script>
72
-
73
- <style scoped lang="scss">
74
- .config-grid {
75
- display: grid;
76
- grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
77
- gap: 10px;
78
-
79
- .config-card {
80
- background: rgba($primary-color, 0.02);
81
- border: 1px solid $border-color;
82
- border-radius: 6px;
83
- padding: 12px;
84
- display: flex;
85
- align-items: center;
86
- gap: 10px;
87
- position: relative;
88
- overflow: hidden;
89
- transition: all 0.3s;
90
-
91
- &:hover {
92
- background: rgba($primary-color, 0.05);
93
- border-color: $primary-color;
94
- transform: translateY(-2px);
95
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
96
- }
97
-
98
- .config-icon {
99
- width: 40px;
100
- height: 40px;
101
- display: flex;
102
- align-items: center;
103
- justify-content: center;
104
- border-radius: 6px;
105
- flex-shrink: 0;
106
- }
107
-
108
- .config-info {
109
- flex: 1;
110
- min-width: 0;
111
-
112
- .config-name {
113
- font-size: 14px;
114
- font-weight: 600;
115
- margin-bottom: 2px;
116
- }
117
-
118
- .config-status {
119
- font-size: 14px;
120
- display: flex;
121
- align-items: center;
122
- gap: 4px;
123
-
124
- .latency {
125
- margin-left: 4px;
126
- color: $text-placeholder;
127
- }
128
- }
129
- }
130
-
131
- .config-badge {
132
- position: absolute;
133
- top: 6px;
134
- right: 6px;
135
- opacity: 0.2;
136
- }
137
-
138
- &.config-running {
139
- border-color: $success-color;
140
- background: linear-gradient(135deg, rgba(82, 196, 26, 0.05), white);
141
-
142
- .config-icon {
143
- background: rgba(82, 196, 26, 0.1);
144
- color: $success-color;
145
- }
146
-
147
- .config-name {
148
- color: $success-color;
149
- }
150
- }
151
-
152
- &.config-unconfigured {
153
- border-color: $warning-color;
154
- background: linear-gradient(135deg, rgba(250, 173, 20, 0.05), white);
155
-
156
- .config-icon {
157
- background: rgba(250, 173, 20, 0.1);
158
- color: $warning-color;
159
- }
160
-
161
- .config-name {
162
- color: $warning-color;
163
- }
164
- }
165
-
166
- &.config-stopped {
167
- border-color: $error-color;
168
- background: linear-gradient(135deg, rgba(255, 77, 79, 0.05), white);
169
-
170
- .config-icon {
171
- background: rgba(255, 77, 79, 0.1);
172
- color: $error-color;
173
- }
174
-
175
- .config-name {
176
- color: $error-color;
177
- }
178
- }
179
- }
180
- }
181
- </style>
@@ -1,130 +0,0 @@
1
- <template>
2
- <div class="section-block">
3
- <div class="section-header">
4
- <i-lucide:bell style="width: 20px; height: 20px" />
5
- <h2>系统通知</h2>
6
- </div>
7
- <div class="section-content">
8
- <div class="notification-compact-list">
9
- <div v-for="notification in notifications" :key="notification.id" class="notification-compact-item">
10
- <div class="notification-icon" :class="`type-${notification.type}`">
11
- <i-lucide:info v-if="notification.type === 'info'" style="width: 16px; height: 16px" />
12
- <i-lucide:check-circle v-else-if="notification.type === 'success'" style="width: 16px; height: 16px" />
13
- <i-lucide:alert-triangle v-else-if="notification.type === 'warning'" style="width: 16px; height: 16px" />
14
- <i-lucide:x-circle v-else-if="notification.type === 'error'" style="width: 16px; height: 16px" />
15
- <i-lucide:bell v-else style="width: 16px; height: 16px" />
16
- </div>
17
- <div class="notification-content">
18
- <span class="notification-title">{{ notification.title }}</span>
19
- <span class="notification-time">{{ formatTime(notification.createdAt) }}</span>
20
- </div>
21
- <tiny-tag v-if="!notification.isRead" type="primary" size="small">新</tiny-tag>
22
- </div>
23
- </div>
24
- </div>
25
- </div>
26
- </template>
27
-
28
- <script setup>
29
- // 组件内部数据
30
- const notifications = $ref([
31
- { id: 1, type: 'warning', title: '系统更新提醒 - v1.1.0 版本已发布', isRead: false, createdAt: Date.now() - 3600000 },
32
- { id: 2, type: 'info', title: '数据备份完成 - 今日凌晨自动备份成功', isRead: true, createdAt: Date.now() - 21600000 },
33
- { id: 3, type: 'error', title: 'SSL证书即将过期 - 请及时更新证书', isRead: false, createdAt: Date.now() - 86400000 },
34
- { id: 4, type: 'success', title: '性能优化完成 - 响应速度提升30%', isRead: true, createdAt: Date.now() - 172800000 }
35
- ]);
36
-
37
- const formatTime = (timestamp) => {
38
- const date = new Date(timestamp);
39
- const now = Date.now();
40
- const diff = now - timestamp;
41
-
42
- if (diff < 3600000) {
43
- return `${Math.floor(diff / 60000)}分钟前`;
44
- } else if (diff < 86400000) {
45
- return `${Math.floor(diff / 3600000)}小时前`;
46
- } else {
47
- const month = String(date.getMonth() + 1).padStart(2, '0');
48
- const day = String(date.getDate()).padStart(2, '0');
49
- return `${month}-${day}`;
50
- }
51
- };
52
- </script>
53
-
54
- <style scoped lang="scss">
55
- .notification-compact-list {
56
- display: flex;
57
- flex-direction: column;
58
- gap: $spacing-xs;
59
-
60
- .notification-compact-item {
61
- display: flex;
62
- align-items: center;
63
- gap: $spacing-sm;
64
- padding: $spacing-sm $spacing-md;
65
- background: rgba($primary-color, 0.02);
66
- border-radius: $border-radius-small;
67
- border: 1px solid $border-color;
68
- transition: all 0.2s ease;
69
-
70
- &:hover {
71
- background: rgba($primary-color, 0.05);
72
- border-color: $primary-color;
73
- }
74
-
75
- .notification-icon {
76
- display: flex;
77
- align-items: center;
78
- justify-content: center;
79
- width: 32px;
80
- height: 32px;
81
- border-radius: $border-radius-small;
82
- flex-shrink: 0;
83
-
84
- &.type-info {
85
- background: rgba($primary-color, 0.1);
86
- color: $primary-color;
87
- }
88
-
89
- &.type-success {
90
- background: rgba($success-color, 0.1);
91
- color: $success-color;
92
- }
93
-
94
- &.type-warning {
95
- background: rgba($warning-color, 0.1);
96
- color: $warning-color;
97
- }
98
-
99
- &.type-error {
100
- background: rgba($error-color, 0.1);
101
- color: $error-color;
102
- }
103
- }
104
-
105
- .notification-content {
106
- display: flex;
107
- align-items: center;
108
- gap: $spacing-sm;
109
- flex: 1;
110
- min-width: 0;
111
-
112
- .notification-title {
113
- font-size: 14px;
114
- color: $text-primary;
115
- font-weight: 500;
116
- overflow: hidden;
117
- text-overflow: ellipsis;
118
- white-space: nowrap;
119
- flex: 1;
120
- }
121
-
122
- .notification-time {
123
- font-size: 14px;
124
- color: $text-placeholder;
125
- flex-shrink: 0;
126
- }
127
- }
128
- }
129
- }
130
- </style>
@@ -1,188 +0,0 @@
1
- <template>
2
- <div class="section-block">
3
- <div class="section-header">
4
- <i-lucide:info style="width: 20px; height: 20px" />
5
- <h2>系统概览</h2>
6
- </div>
7
- <div class="section-content">
8
- <tiny-row :flex="true" :gap="12">
9
- <tiny-col :xs="24" :sm="12" :md="12" :lg="12">
10
- <div class="info-block">
11
- <div class="stats-grid">
12
- <div class="stat-box stat-primary">
13
- <i-lucide:menu style="width: 24px; height: 24px" />
14
- <div class="stat-content">
15
- <div class="stat-value">{{ permissionStats.menuCount }}</div>
16
- <div class="stat-label">菜单总数</div>
17
- </div>
18
- </div>
19
- <div class="stat-box stat-success">
20
- <i-lucide:webhook style="width: 24px; height: 24px" />
21
- <div class="stat-content">
22
- <div class="stat-value">{{ permissionStats.apiCount }}</div>
23
- <div class="stat-label">接口总数</div>
24
- </div>
25
- </div>
26
- <div class="stat-box stat-warning">
27
- <i-lucide:users style="width: 24px; height: 24px" />
28
- <div class="stat-content">
29
- <div class="stat-value">{{ permissionStats.roleCount }}</div>
30
- <div class="stat-label">角色总数</div>
31
- </div>
32
- </div>
33
- </div>
34
- </div>
35
- </tiny-col>
36
- </tiny-row>
37
- </div>
38
- </div>
39
- </template>
40
-
41
- <script setup>
42
- // 组件内部数据
43
- const permissionStats = $ref({
44
- menuCount: 0,
45
- apiCount: 0,
46
- roleCount: 0
47
- });
48
-
49
- // 获取数据
50
- const fetchData = async () => {
51
- try {
52
- const { data } = await $Http('/addon/admin/dashboard/systemOverview');
53
- Object.assign(permissionStats, data);
54
- } catch (error) {
55
- console.error('获取系统概览失败:', error);
56
- }
57
- };
58
-
59
- fetchData();
60
- </script>
61
-
62
- <style scoped lang="scss">
63
- .info-block {
64
- background: transparent;
65
- border: none;
66
- padding: 0;
67
- height: 100%;
68
-
69
- .info-header {
70
- display: flex;
71
- align-items: center;
72
- gap: 6px;
73
- padding-bottom: 8px;
74
- margin-bottom: 12px;
75
- border-bottom: 2px solid $primary-color;
76
-
77
- .info-title {
78
- font-size: 14px;
79
- font-weight: 600;
80
- color: $text-primary;
81
- }
82
- }
83
-
84
- .info-grid-compact {
85
- display: grid;
86
- grid-template-columns: repeat(3, 1fr);
87
- gap: 10px;
88
-
89
- .info-grid-item {
90
- display: flex;
91
- justify-content: space-between;
92
- align-items: center;
93
- padding: 10px 12px;
94
- background: rgba($primary-color, 0.02);
95
- border-radius: $border-radius-small;
96
- border: 1px solid $border-color;
97
- transition: all 0.2s ease;
98
-
99
- &:hover {
100
- background: rgba($primary-color, 0.05);
101
- border-color: $primary-color;
102
- }
103
-
104
- .label {
105
- font-size: 14px;
106
- color: $text-secondary;
107
- font-weight: 500;
108
- }
109
-
110
- .value {
111
- font-size: 14px;
112
- color: $text-primary;
113
- font-weight: 600;
114
-
115
- &.highlight {
116
- color: $primary-color;
117
- }
118
- }
119
- }
120
- }
121
- }
122
-
123
- .stats-grid {
124
- display: grid;
125
- grid-template-columns: repeat(3, 1fr);
126
- gap: 10px;
127
-
128
- .stat-box {
129
- background: rgba($primary-color, 0.02);
130
- border: 1px solid $border-color;
131
- border-radius: 6px;
132
- padding: 12px;
133
- display: flex;
134
- align-items: center;
135
- gap: 10px;
136
- transition: all 0.3s;
137
-
138
- &:hover {
139
- background: rgba($primary-color, 0.05);
140
- border-color: $primary-color;
141
- transform: translateY(-2px);
142
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
143
- }
144
-
145
- .stat-content {
146
- flex: 1;
147
-
148
- .stat-value {
149
- font-size: 20px;
150
- font-weight: 700;
151
- margin-bottom: 2px;
152
- }
153
-
154
- .stat-label {
155
- font-size: 14px;
156
- color: $text-secondary;
157
- }
158
- }
159
-
160
- &.stat-primary {
161
- border-color: $primary-color;
162
- background: linear-gradient(135deg, rgba(0, 82, 217, 0.05), white);
163
-
164
- .stat-value {
165
- color: $primary-color;
166
- }
167
- }
168
-
169
- &.stat-success {
170
- border-color: $success-color;
171
- background: linear-gradient(135deg, rgba(82, 196, 26, 0.05), white);
172
-
173
- .stat-value {
174
- color: $success-color;
175
- }
176
- }
177
-
178
- &.stat-warning {
179
- border-color: $warning-color;
180
- background: linear-gradient(135deg, rgba(250, 173, 20, 0.05), white);
181
-
182
- .stat-value {
183
- color: $warning-color;
184
- }
185
- }
186
- }
187
- }
188
- </style>
@@ -1,104 +0,0 @@
1
- <template>
2
- <div class="section-block">
3
- <div class="section-header">
4
- <i-lucide:activity style="width: 20px; height: 20px" />
5
- <h2>系统资源</h2>
6
- </div>
7
- <div class="section-content">
8
- <div class="resource-compact-list">
9
- <div class="resource-compact-item">
10
- <div class="resource-compact-header">
11
- <i-lucide:cpu style="width: 16px; height: 16px" />
12
- <span class="resource-label">CPU</span>
13
- <span class="resource-value">{{ systemResources.cpu.usage }}%</span>
14
- <span class="resource-desc">{{ systemResources.cpu.cores }}核心</span>
15
- </div>
16
- <tiny-progress :percentage="systemResources.cpu.usage" :status="getProgressColor(systemResources.cpu.usage)" />
17
- </div>
18
- <div class="resource-compact-item">
19
- <div class="resource-compact-header">
20
- <i-lucide:hard-drive style="width: 16px; height: 16px" />
21
- <span class="resource-label">内存</span>
22
- <span class="resource-value">{{ systemResources.memory.percentage }}%</span>
23
- <span class="resource-desc">{{ systemResources.memory.used }}GB / {{ systemResources.memory.total }}GB</span>
24
- </div>
25
- <tiny-progress :percentage="systemResources.memory.percentage" :status="getProgressColor(systemResources.memory.percentage)" />
26
- </div>
27
- <div class="resource-compact-item">
28
- <div class="resource-compact-header">
29
- <i-lucide:disc style="width: 16px; height: 16px" />
30
- <span class="resource-label">磁盘</span>
31
- <span class="resource-value">{{ systemResources.disk.percentage }}%</span>
32
- <span class="resource-desc">{{ systemResources.disk.used }}GB / {{ systemResources.disk.total }}GB</span>
33
- </div>
34
- <tiny-progress :percentage="systemResources.disk.percentage" :status="getProgressColor(systemResources.disk.percentage)" />
35
- </div>
36
- </div>
37
- </div>
38
- </div>
39
- </template>
40
-
41
- <script setup>
42
- // 组件内部数据
43
- const systemResources = $ref({
44
- cpu: { usage: 0, cores: 0 },
45
- memory: { used: 0, total: 0, percentage: 0 },
46
- disk: { used: 0, total: 0, percentage: 0 }
47
- });
48
-
49
- // 获取数据
50
- const fetchData = async () => {
51
- try {
52
- const { data } = await $Http('/addon/admin/dashboard/systemResources');
53
- Object.assign(systemResources, data);
54
- } catch (error) {
55
- console.error('获取系统资源失败:', error);
56
- }
57
- };
58
-
59
- fetchData();
60
-
61
- // 工具函数
62
- const getProgressColor = (percentage) => {
63
- if (percentage < 50) return 'success';
64
- if (percentage < 80) return 'warning';
65
- return 'danger';
66
- };
67
- </script>
68
-
69
- <style scoped lang="scss">
70
- .resource-compact-list {
71
- display: grid;
72
- grid-template-columns: repeat(3, 1fr);
73
- gap: $spacing-md;
74
-
75
- .resource-compact-item {
76
- .resource-compact-header {
77
- display: flex;
78
- align-items: center;
79
- gap: 10px;
80
- margin-bottom: 8px;
81
-
82
- .resource-label {
83
- font-size: 14px;
84
- font-weight: 600;
85
- color: $text-secondary;
86
- min-width: 50px;
87
- }
88
-
89
- .resource-value {
90
- font-size: 16px;
91
- font-weight: 700;
92
- color: $primary-color;
93
- min-width: 60px;
94
- }
95
-
96
- .resource-desc {
97
- font-size: 14px;
98
- color: $text-placeholder;
99
- flex: 1;
100
- }
101
- }
102
- }
103
- }
104
- </style>