@origen-ui/admin-cli 1.0.3 → 1.1.0
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/package.json +3 -3
- package/templates/current/clean/CHANGELOG.md +34 -0
- package/templates/current/clean/component-catalog.json +9 -9
- package/templates/current/clean/package.json +41 -41
- package/templates/current/clean/scaffold.lock.json +2 -2
- package/templates/current/clean/scripts/vite-build-policy.spec.ts +71 -0
- package/templates/current/clean/src/App.vue +10 -3
- package/templates/current/clean/src/api/client.ts +90 -10
- package/templates/current/clean/src/api/generated/data-contracts.ts +3 -3
- package/templates/current/clean/src/api/generated/http-client.ts +1 -1
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +1 -1
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +1 -1
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +1 -1
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +2 -3
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +3 -5
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +2 -3
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +2 -3
- package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +1 -1
- package/templates/current/clean/src/app/adminLocale.ts +90 -0
- package/templates/current/clean/src/app/createAdminUi.spec.ts +65 -9
- package/templates/current/clean/src/app/createAdminUi.ts +14 -29
- package/templates/current/clean/src/app/embedded-token.spec.ts +40 -0
- package/templates/current/clean/src/app/embedded.spec.ts +135 -0
- package/templates/current/clean/src/app/embedded.ts +255 -0
- package/templates/current/clean/src/app/localeFormat.ts +52 -0
- package/templates/current/clean/src/app/menu.spec.ts +26 -0
- package/templates/current/clean/src/app/menu.ts +4 -0
- package/templates/current/clean/src/app/menuTypes.ts +1 -0
- package/templates/current/clean/src/app/origenUiLocale.spec.ts +6 -5
- package/templates/current/clean/src/app/origenUiLocale.ts +3 -58
- package/templates/current/clean/src/app/permission.spec.ts +26 -0
- package/templates/current/clean/src/app/runtimeConfig.ts +8 -7
- package/templates/current/clean/src/env.d.ts +18 -0
- package/templates/current/clean/src/features/appearance/components/ThemePanel.vue +21 -17
- package/templates/current/clean/src/features/appearance/store/theme.ts +2 -1
- package/templates/current/clean/src/features/auth/pages/Login.vue +15 -11
- package/templates/current/clean/src/features/auth/store/auth.ts +13 -3
- package/templates/current/clean/src/features/security/components/DevtoolsProtectionOverlay.vue +5 -2
- package/templates/current/clean/src/features/security/devtoolsProtection.spec.ts +7 -10
- package/templates/current/clean/src/features/security/devtoolsProtection.ts +2 -1
- package/templates/current/clean/src/features/system/access/api/admin-repository.spec.ts +14 -0
- package/templates/current/clean/src/features/system/access/api/admin-repository.ts +38 -15
- package/templates/current/clean/src/features/system/access/api/rbac.ts +37 -27
- package/templates/current/clean/src/features/workspace/pages/Empty.vue +4 -1
- package/templates/current/clean/src/features/workspace/pages/Profile.vue +13 -11
- package/templates/current/clean/src/layouts/AdminLayout.vue +3 -1
- package/templates/current/clean/src/layouts/TopBar.vue +26 -8
- package/templates/current/clean/src/locales/en-US.json +490 -0
- package/templates/current/clean/src/locales/en-US.runtime.ts +20 -0
- package/templates/current/clean/src/locales/index.ts +129 -45
- package/templates/current/clean/src/locales/messages-types.ts +62 -0
- package/templates/current/clean/src/locales/messages.spec.ts +113 -6
- package/templates/current/clean/src/locales/vue-i18n.d.ts +5 -0
- package/templates/current/clean/src/locales/zh-CN.json +490 -0
- package/templates/current/clean/src/locales/zh-CN.runtime.ts +20 -0
- package/templates/current/clean/src/locales/zh-TW.json +490 -0
- package/templates/current/clean/src/locales/zh-TW.runtime.ts +20 -0
- package/templates/current/clean/src/router/bootstrap.ts +22 -7
- package/templates/current/clean/src/router/dynamicRoutes.ts +5 -1
- package/templates/current/clean/src/router/queryEncryption.spec.ts +30 -4
- package/templates/current/clean/src/router/queryEncryption.ts +48 -44
- package/templates/current/clean/src/router/useRouteQueryDefaults.spec.ts +2 -1
- package/templates/current/clean/src/router/useRouteQueryDefaults.types.ts +2 -1
- package/templates/current/clean/src/templates/og-table.ts +81 -37
- package/templates/current/clean/src/templates/templates.spec.ts +19 -0
- package/templates/current/clean/vite.build-policy.ts +114 -289
- package/templates/current/clean/vite.config.ts +4 -5
- package/templates/current/examples/CHANGELOG.md +34 -0
- package/templates/current/examples/component-catalog.json +9 -9
- package/templates/current/examples/package.json +41 -41
- package/templates/current/examples/scaffold.lock.json +2 -2
- package/templates/current/examples/scripts/vite-build-policy.spec.ts +71 -0
- package/templates/current/examples/src/App.vue +10 -3
- package/templates/current/examples/src/api/client.ts +90 -10
- package/templates/current/examples/src/api/generated/data-contracts.ts +3 -3
- package/templates/current/examples/src/api/generated/http-client.ts +1 -1
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +1 -1
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +1 -1
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +1 -1
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +2 -3
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +3 -5
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +2 -3
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +2 -3
- package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +1 -1
- package/templates/current/examples/src/app/adminLocale.ts +90 -0
- package/templates/current/examples/src/app/createAdminUi.spec.ts +65 -9
- package/templates/current/examples/src/app/createAdminUi.ts +14 -29
- package/templates/current/examples/src/app/embedded-token.spec.ts +40 -0
- package/templates/current/examples/src/app/embedded.spec.ts +135 -0
- package/templates/current/examples/src/app/embedded.ts +255 -0
- package/templates/current/examples/src/app/localeFormat.ts +52 -0
- package/templates/current/examples/src/app/menu.spec.ts +26 -0
- package/templates/current/examples/src/app/menu.ts +4 -0
- package/templates/current/examples/src/app/menuTypes.ts +1 -0
- package/templates/current/examples/src/app/origenUiLocale.spec.ts +6 -5
- package/templates/current/examples/src/app/origenUiLocale.ts +3 -58
- package/templates/current/examples/src/app/permission.spec.ts +26 -0
- package/templates/current/examples/src/app/runtimeConfig.ts +8 -7
- package/templates/current/examples/src/env.d.ts +18 -0
- package/templates/current/examples/src/features/appearance/components/ThemePanel.vue +21 -17
- package/templates/current/examples/src/features/appearance/store/theme.ts +2 -1
- package/templates/current/examples/src/features/auth/pages/Login.vue +15 -11
- package/templates/current/examples/src/features/auth/store/auth.ts +13 -3
- package/templates/current/examples/src/features/errors/pages/Forbidden.vue +6 -2
- package/templates/current/examples/src/features/errors/pages/NotFound.vue +6 -2
- package/templates/current/examples/src/features/errors/pages/ServerError.vue +6 -2
- package/templates/current/examples/src/features/errors/pages/error-pages.spec.ts +9 -1
- package/templates/current/examples/src/features/feature-composables.spec.ts +36 -9
- package/templates/current/examples/src/features/security/components/DevtoolsProtectionOverlay.vue +5 -2
- package/templates/current/examples/src/features/security/devtoolsProtection.spec.ts +7 -10
- package/templates/current/examples/src/features/security/devtoolsProtection.ts +2 -1
- package/templates/current/examples/src/features/system/access/api/admin-repository.spec.ts +14 -0
- package/templates/current/examples/src/features/system/access/api/admin-repository.ts +38 -15
- package/templates/current/examples/src/features/system/access/api/rbac.ts +37 -27
- package/templates/current/examples/src/features/system/audit/composables/useAuditManagement.ts +43 -38
- package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +33 -30
- package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +81 -69
- package/templates/current/examples/src/features/system/menus/pages/MenuList.vue +3 -1
- package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +18 -15
- package/templates/current/examples/src/features/system/roles/composables/useRoleManagement.ts +49 -53
- package/templates/current/examples/src/features/system/roles/pages/RoleList.vue +3 -1
- package/templates/current/examples/src/features/system/users/components/UserEditorForm.vue +22 -19
- package/templates/current/examples/src/features/system/users/composables/useUserManagement.ts +59 -64
- package/templates/current/examples/src/features/system/users/pages/UserList.vue +3 -1
- package/templates/current/examples/src/features/workspace/pages/Dashboard.spec.ts +9 -0
- package/templates/current/examples/src/features/workspace/pages/Dashboard.vue +54 -26
- package/templates/current/examples/src/features/workspace/pages/Empty.vue +4 -1
- package/templates/current/examples/src/features/workspace/pages/Profile.vue +13 -11
- package/templates/current/examples/src/layouts/AdminLayout.vue +3 -1
- package/templates/current/examples/src/layouts/TopBar.vue +26 -8
- package/templates/current/examples/src/locales/en-US.json +490 -0
- package/templates/current/examples/src/locales/en-US.runtime.ts +20 -0
- package/templates/current/examples/src/locales/index.ts +129 -45
- package/templates/current/examples/src/locales/messages-types.ts +62 -0
- package/templates/current/examples/src/locales/messages.spec.ts +113 -6
- package/templates/current/examples/src/locales/vue-i18n.d.ts +5 -0
- package/templates/current/examples/src/locales/zh-CN.json +490 -0
- package/templates/current/examples/src/locales/zh-CN.runtime.ts +20 -0
- package/templates/current/examples/src/locales/zh-TW.json +490 -0
- package/templates/current/examples/src/locales/zh-TW.runtime.ts +20 -0
- package/templates/current/examples/src/main.ts +31 -5
- package/templates/current/examples/src/router/bootstrap.ts +22 -7
- package/templates/current/examples/src/router/dynamicRoutes.spec.ts +17 -0
- package/templates/current/examples/src/router/dynamicRoutes.ts +5 -1
- package/templates/current/examples/src/router/queryEncryption.spec.ts +30 -4
- package/templates/current/examples/src/router/queryEncryption.ts +48 -44
- package/templates/current/examples/src/router/staticRoutes.ts +1 -1
- package/templates/current/examples/src/router/useRouteQueryDefaults.spec.ts +2 -1
- package/templates/current/examples/src/router/useRouteQueryDefaults.types.ts +2 -1
- package/templates/current/examples/src/templates/og-table.ts +81 -37
- package/templates/current/examples/src/templates/templates.spec.ts +19 -0
- package/templates/current/examples/vite.build-policy.ts +114 -289
- package/templates/current/examples/vite.config.ts +4 -5
- package/templates/current/clean/scripts/check-admin-bundle.mjs +0 -214
- package/templates/current/clean/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +0 -38
- package/templates/current/clean/src/locales/en-US.ts +0 -55
- package/templates/current/clean/src/locales/zh-CN.ts +0 -55
- package/templates/current/clean/src/locales/zh-TW.ts +0 -44
- package/templates/current/examples/scripts/check-admin-bundle.mjs +0 -214
- package/templates/current/examples/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +0 -38
- package/templates/current/examples/src/locales/en-US.ts +0 -55
- package/templates/current/examples/src/locales/zh-CN.ts +0 -55
- package/templates/current/examples/src/locales/zh-TW.ts +0 -44
|
@@ -1,41 +1,69 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ArrowRight, UserFilled } from '@element-plus/icons-vue'
|
|
3
3
|
import { ElButton, ElCard, ElIcon, ElStatistic } from 'element-plus'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
import { useI18n } from 'vue-i18n'
|
|
4
6
|
import { RouterLink } from 'vue-router'
|
|
5
7
|
|
|
6
8
|
defineOptions({ name: 'DashboardPage' })
|
|
7
9
|
|
|
8
|
-
const
|
|
9
|
-
{ label: '今日访问', value: 12680, suffix: '', delta: '+18.2%', tone: 'positive' },
|
|
10
|
-
{ label: '活跃成员', value: 3842, suffix: '', delta: '+8.7%', tone: 'positive' },
|
|
11
|
-
{ label: '待处理事项', value: 28, suffix: ' 项', delta: '需关注', tone: 'attention' },
|
|
12
|
-
{ label: '服务可用性', value: 99.99, suffix: '%', delta: '运行稳定', tone: 'neutral' },
|
|
13
|
-
] as const
|
|
10
|
+
const { t } = useI18n()
|
|
14
11
|
|
|
15
|
-
const
|
|
16
|
-
{
|
|
17
|
-
{
|
|
18
|
-
{
|
|
19
|
-
|
|
12
|
+
const stats = computed(() => [
|
|
13
|
+
{ label: t('workspace.dashboard.visits'), value: 12680, suffix: '', delta: '+18.2%', tone: 'positive' },
|
|
14
|
+
{ label: t('workspace.dashboard.activeMembers'), value: 3842, suffix: '', delta: '+8.7%', tone: 'positive' },
|
|
15
|
+
{
|
|
16
|
+
label: t('workspace.dashboard.pendingItems'),
|
|
17
|
+
value: 28,
|
|
18
|
+
suffix: t('workspace.dashboard.pendingSuffix'),
|
|
19
|
+
delta: t('workspace.dashboard.attention'),
|
|
20
|
+
tone: 'attention',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: t('workspace.dashboard.serviceAvailability'),
|
|
24
|
+
value: 99.99,
|
|
25
|
+
suffix: '%',
|
|
26
|
+
delta: t('workspace.dashboard.stable'),
|
|
27
|
+
tone: 'neutral',
|
|
28
|
+
},
|
|
29
|
+
])
|
|
30
|
+
|
|
31
|
+
const activities = computed(() => [
|
|
32
|
+
{
|
|
33
|
+
title: t('workspace.dashboard.activityWorkspaceInit'),
|
|
34
|
+
meta: t('workspace.dashboard.activityWorkspaceInitMeta'),
|
|
35
|
+
tone: 'success',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: t('workspace.dashboard.activityContractEnabled'),
|
|
39
|
+
meta: t('workspace.dashboard.activityContractEnabledMeta'),
|
|
40
|
+
tone: 'primary',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: t('workspace.dashboard.activityRemoteMenu'),
|
|
44
|
+
meta: t('workspace.dashboard.activityRemoteMenuMeta'),
|
|
45
|
+
tone: 'warning',
|
|
46
|
+
},
|
|
47
|
+
])
|
|
20
48
|
|
|
21
|
-
const tasks = [
|
|
22
|
-
{ label: '
|
|
49
|
+
const tasks = computed(() => [
|
|
50
|
+
{ label: t('workspace.dashboard.taskConfigureAuth'), value: 1, to: '/profile' },
|
|
23
51
|
{
|
|
24
|
-
label: '
|
|
52
|
+
label: t('workspace.dashboard.taskCheckUsers'),
|
|
25
53
|
value: 2,
|
|
26
54
|
to: { path: '/system/users', query: { status: 'suspended' } },
|
|
27
55
|
},
|
|
28
56
|
{
|
|
29
|
-
label: '
|
|
57
|
+
label: t('workspace.dashboard.taskPublishMenus'),
|
|
30
58
|
value: 3,
|
|
31
59
|
to: { path: '/system/menus', query: { status: 'suspended' } },
|
|
32
60
|
},
|
|
33
|
-
]
|
|
61
|
+
])
|
|
34
62
|
</script>
|
|
35
63
|
|
|
36
64
|
<template>
|
|
37
65
|
<main class="dashboard-page">
|
|
38
|
-
<section class="dashboard-page__metrics" aria-label="
|
|
66
|
+
<section class="dashboard-page__metrics" :aria-label="t('workspace.dashboard.metricsLabel')">
|
|
39
67
|
<article v-for="stat in stats" :key="stat.label" class="metric-card og-card">
|
|
40
68
|
<p class="metric-card__label">
|
|
41
69
|
{{ stat.label }}
|
|
@@ -52,8 +80,8 @@ const tasks = [
|
|
|
52
80
|
<template #header>
|
|
53
81
|
<div class="dashboard-panel__header">
|
|
54
82
|
<div>
|
|
55
|
-
<h2
|
|
56
|
-
<p
|
|
83
|
+
<h2>{{ t('workspace.dashboard.activityTitle') }}</h2>
|
|
84
|
+
<p>{{ t('workspace.dashboard.activitySubtitle') }}</p>
|
|
57
85
|
</div>
|
|
58
86
|
</div>
|
|
59
87
|
</template>
|
|
@@ -76,8 +104,8 @@ const tasks = [
|
|
|
76
104
|
<template #header>
|
|
77
105
|
<div class="dashboard-panel__header">
|
|
78
106
|
<div>
|
|
79
|
-
<h2
|
|
80
|
-
<p
|
|
107
|
+
<h2>{{ t('workspace.dashboard.tasksTitle') }}</h2>
|
|
108
|
+
<p>{{ t('workspace.dashboard.tasksSubtitle') }}</p>
|
|
81
109
|
</div>
|
|
82
110
|
<ElIcon class="dashboard-panel__header-icon">
|
|
83
111
|
<UserFilled />
|
|
@@ -92,17 +120,17 @@ const tasks = [
|
|
|
92
120
|
</ElCard>
|
|
93
121
|
</section>
|
|
94
122
|
|
|
95
|
-
<section class="dashboard-page__commands og-card" aria-label="
|
|
123
|
+
<section class="dashboard-page__commands og-card" :aria-label="t('workspace.dashboard.quickActionsLabel')">
|
|
96
124
|
<div>
|
|
97
|
-
<p class="dashboard-page__commands-eyebrow"
|
|
98
|
-
<h2
|
|
125
|
+
<p class="dashboard-page__commands-eyebrow">{{ t('workspace.dashboard.quickActionsLabel') }}</p>
|
|
126
|
+
<h2>{{ t('workspace.dashboard.buildCta') }}</h2>
|
|
99
127
|
</div>
|
|
100
128
|
<div class="dashboard-page__command-actions">
|
|
101
129
|
<RouterLink to="/system/users">
|
|
102
|
-
<ElButton type="primary">
|
|
130
|
+
<ElButton type="primary"> {{ t('workspace.dashboard.manageUsers') }} </ElButton>
|
|
103
131
|
</RouterLink>
|
|
104
132
|
<RouterLink to="/profile">
|
|
105
|
-
<ElButton plain>
|
|
133
|
+
<ElButton plain> {{ t('workspace.dashboard.completeProfile') }} </ElButton>
|
|
106
134
|
</RouterLink>
|
|
107
135
|
</div>
|
|
108
136
|
</section>
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ElCard, ElEmpty } from 'element-plus'
|
|
3
|
+
import { useI18n } from 'vue-i18n'
|
|
3
4
|
|
|
4
5
|
defineOptions({ name: 'EmptyPage' })
|
|
6
|
+
|
|
7
|
+
const { t } = useI18n()
|
|
5
8
|
</script>
|
|
6
9
|
|
|
7
10
|
<template>
|
|
8
11
|
<ElCard shadow="never" class="empty-page">
|
|
9
|
-
<ElEmpty description="
|
|
12
|
+
<ElEmpty :description="t('workspace.empty.description')" />
|
|
10
13
|
</ElCard>
|
|
11
14
|
</template>
|
|
12
15
|
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
import { CircleCheckFilled, Key, Lock, Monitor } from '@element-plus/icons-vue'
|
|
3
3
|
import { ElAvatar, ElCard, ElDescriptions, ElDescriptionsItem, ElIcon, ElTag } from 'element-plus'
|
|
4
4
|
import { computed } from 'vue'
|
|
5
|
+
import { useI18n } from 'vue-i18n'
|
|
5
6
|
import { useAuthStore } from '../../auth/store/auth'
|
|
6
7
|
|
|
7
8
|
defineOptions({ name: 'ProfilePage' })
|
|
8
9
|
|
|
9
10
|
const auth = useAuthStore()
|
|
11
|
+
const { t } = useI18n()
|
|
10
12
|
const user = computed(() => auth.session?.user)
|
|
11
13
|
const permissions = computed(() => auth.session?.permissions ?? [])
|
|
12
14
|
const sessionId = computed(() =>
|
|
13
|
-
auth.session?.token ? `${auth.session.token.slice(0, 8)}••••` : '
|
|
15
|
+
auth.session?.token ? `${auth.session.token.slice(0, 8)}••••` : t('workspace.profile.noSession'),
|
|
14
16
|
)
|
|
15
17
|
</script>
|
|
16
18
|
|
|
@@ -22,21 +24,21 @@ const sessionId = computed(() =>
|
|
|
22
24
|
{{ user?.displayName.slice(0, 1) }}
|
|
23
25
|
</ElAvatar>
|
|
24
26
|
<div>
|
|
25
|
-
<h2>{{ user?.displayName ?? '
|
|
27
|
+
<h2>{{ user?.displayName ?? t('workspace.profile.admin') }}</h2>
|
|
26
28
|
<p>{{ user?.email ?? 'admin@example.com' }}</p>
|
|
27
29
|
</div>
|
|
28
30
|
<ElTag type="success" effect="plain">
|
|
29
|
-
<ElIcon><CircleCheckFilled /></ElIcon>
|
|
31
|
+
<ElIcon><CircleCheckFilled /></ElIcon> {{ t('workspace.profile.online') }}
|
|
30
32
|
</ElTag>
|
|
31
33
|
</div>
|
|
32
34
|
<ElDescriptions :column="1" class="profile-card__details">
|
|
33
|
-
<ElDescriptionsItem label="
|
|
35
|
+
<ElDescriptionsItem :label="t('workspace.profile.loginAccount')">
|
|
34
36
|
{{ user?.username ?? '-' }}
|
|
35
37
|
</ElDescriptionsItem>
|
|
36
|
-
<ElDescriptionsItem label="
|
|
38
|
+
<ElDescriptionsItem :label="t('workspace.profile.userId')">
|
|
37
39
|
{{ user?.id ?? '-' }}
|
|
38
40
|
</ElDescriptionsItem>
|
|
39
|
-
<ElDescriptionsItem label="
|
|
41
|
+
<ElDescriptionsItem :label="t('workspace.profile.sessionId')">
|
|
40
42
|
{{ sessionId }}
|
|
41
43
|
</ElDescriptionsItem>
|
|
42
44
|
</ElDescriptions>
|
|
@@ -46,9 +48,9 @@ const sessionId = computed(() =>
|
|
|
46
48
|
<template #header>
|
|
47
49
|
<div class="profile-card__heading">
|
|
48
50
|
<div>
|
|
49
|
-
<ElIcon><Key /></ElIcon><strong
|
|
51
|
+
<ElIcon><Key /></ElIcon><strong>{{ t('workspace.profile.accessGrant') }}</strong>
|
|
50
52
|
</div>
|
|
51
|
-
<span>{{ permissions.length }}
|
|
53
|
+
<span>{{ permissions.length }} {{ t('workspace.profile.permissionItems') }}</span>
|
|
52
54
|
</div>
|
|
53
55
|
</template>
|
|
54
56
|
<div class="permission-list">
|
|
@@ -58,13 +60,13 @@ const sessionId = computed(() =>
|
|
|
58
60
|
</div>
|
|
59
61
|
</ElCard>
|
|
60
62
|
|
|
61
|
-
<section class="profile-page__sessions og-card" aria-label="
|
|
63
|
+
<section class="profile-page__sessions og-card" :aria-label="t('workspace.profile.securityStatus')">
|
|
62
64
|
<div class="profile-page__session-icon">
|
|
63
65
|
<ElIcon><Monitor /></ElIcon>
|
|
64
66
|
</div>
|
|
65
67
|
<div>
|
|
66
|
-
<h2
|
|
67
|
-
<p
|
|
68
|
+
<h2>{{ t('workspace.profile.currentSession') }}</h2>
|
|
69
|
+
<p>{{ t('workspace.profile.sessionDescription') }}</p>
|
|
68
70
|
</div>
|
|
69
71
|
<ElIcon class="profile-page__session-lock">
|
|
70
72
|
<Lock />
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { OgDialogHost } from '@origen-ui/dialog'
|
|
3
3
|
import { RouterViewHost } from '@origen-ui/router'
|
|
4
4
|
import { ElDrawer } from 'element-plus'
|
|
5
|
+
import { useI18n } from 'vue-i18n'
|
|
5
6
|
import AdminWatermark from '../features/shell/components/AdminWatermark.vue'
|
|
6
7
|
import { useSidebarStore } from '../features/shell/store/sidebar'
|
|
7
8
|
import BreadcrumbBar from './BreadcrumbBar.vue'
|
|
@@ -11,6 +12,7 @@ import WorkspaceTabs from './WorkspaceTabs.vue'
|
|
|
11
12
|
|
|
12
13
|
defineOptions({ name: 'AdminLayout' })
|
|
13
14
|
const sidebar = useSidebarStore()
|
|
15
|
+
const { t } = useI18n()
|
|
14
16
|
</script>
|
|
15
17
|
|
|
16
18
|
<template>
|
|
@@ -18,7 +20,7 @@ const sidebar = useSidebarStore()
|
|
|
18
20
|
<div class="admin-shell">
|
|
19
21
|
<TopBar />
|
|
20
22
|
<div class="admin-shell__body" :class="{ 'is-collapsed': sidebar.collapsed }">
|
|
21
|
-
<aside class="admin-shell__sidebar" aria-label="
|
|
23
|
+
<aside class="admin-shell__sidebar" :aria-label="t('shell.applicationNavigation')">
|
|
22
24
|
<SideMenu />
|
|
23
25
|
</aside>
|
|
24
26
|
<main class="admin-shell__main">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Expand, Fold, Search, Setting } from '@element-plus/icons-vue'
|
|
2
|
+
import { Expand, Fold, Refresh, Search, Setting } from '@element-plus/icons-vue'
|
|
3
3
|
import {
|
|
4
4
|
ElAvatar,
|
|
5
5
|
ElButton,
|
|
@@ -32,21 +32,35 @@ const { t } = useI18n()
|
|
|
32
32
|
const auth = useAuthStore()
|
|
33
33
|
const user = computed(() => auth.session?.user)
|
|
34
34
|
const menuSearchValue = shallowRef<string>()
|
|
35
|
+
const menuRefreshFailed = shallowRef(false)
|
|
35
36
|
const language = useOrigenUiLanguage()!
|
|
36
|
-
const languageOptions = [
|
|
37
|
-
{ value: 'zh-CN', label: '
|
|
38
|
-
{ value: 'en-US', label: '
|
|
39
|
-
{ value: 'zh-TW', label: '
|
|
40
|
-
]
|
|
37
|
+
const languageOptions = computed(() => [
|
|
38
|
+
{ value: 'zh-CN', label: t('shell.languageZhCN') },
|
|
39
|
+
{ value: 'en-US', label: t('shell.languageEnUS') },
|
|
40
|
+
{ value: 'zh-TW', label: t('shell.languageZhTW') },
|
|
41
|
+
])
|
|
41
42
|
const menuSearchOptions = computed(() => flattenMenuSearchOptions(getRouting().menu.value))
|
|
42
43
|
|
|
44
|
+
async function refreshLocalizedMenus(): Promise<void> {
|
|
45
|
+
try {
|
|
46
|
+
await getRouting().replaceDynamicRoutes(undefined, { fallback: '/dashboard' })
|
|
47
|
+
menuRefreshFailed.value = false
|
|
48
|
+
} catch {
|
|
49
|
+
menuRefreshFailed.value = true
|
|
50
|
+
ElMessage.error({ message: t('shell.menuRefreshFailed'), showClose: true })
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
43
54
|
async function switchLanguage(locale: string): Promise<void> {
|
|
44
55
|
if (!language || language.current.value === locale) return
|
|
45
56
|
try {
|
|
46
|
-
await language.setLocale(locale)
|
|
57
|
+
const result = await language.setLocale(locale)
|
|
58
|
+
if (!result.applied) return
|
|
47
59
|
} catch {
|
|
48
|
-
ElMessage.error(t('shell.languageLoadFailed'))
|
|
60
|
+
ElMessage.error({ message: t('shell.languageLoadFailed'), showClose: true })
|
|
61
|
+
return
|
|
49
62
|
}
|
|
63
|
+
await refreshLocalizedMenus()
|
|
50
64
|
}
|
|
51
65
|
|
|
52
66
|
function navigateToMenu(id: string | undefined): void {
|
|
@@ -131,6 +145,10 @@ async function logout(): Promise<void> {
|
|
|
131
145
|
>
|
|
132
146
|
{{ item.label }}
|
|
133
147
|
</ElDropdownItem>
|
|
148
|
+
<ElDropdownItem v-if="menuRefreshFailed" divided @click="refreshLocalizedMenus">
|
|
149
|
+
<ElIcon><Refresh /></ElIcon>
|
|
150
|
+
{{ t('shell.retryMenuRefresh') }}
|
|
151
|
+
</ElDropdownItem>
|
|
134
152
|
</ElDropdownMenu>
|
|
135
153
|
</template>
|
|
136
154
|
</ElDropdown>
|