feat(sj_1.2.0-beta1): 新增文档路由

This commit is contained in:
xlsea 2024-07-19 09:16:51 +08:00
parent 3b7c089abc
commit 127dd182ed
7 changed files with 66 additions and 24 deletions

View File

@ -9,7 +9,7 @@ export function setupElegantRouter() {
blank: 'src/layouts/blank-layout/index.vue'
},
customRoutes: {
names: []
names: ['document']
},
routePathTransformer(routeName, routePath) {
const key = routeName as RouteKey;

View File

@ -16,6 +16,9 @@
},
"format-horizontal-align-left": {
"body": "<path fill=\"currentColor\" d=\"M11 16v-3h10v-2H11V8l-4 4zm-8 4h2V4H3z\"/>"
},
"file-document-multiple-outline": {
"body": "<path fill=\"currentColor\" d=\"M16 0H8C6.9 0 6 .9 6 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6zm4 18H8V2h7v5h5zM4 4v18h16v2H4c-1.1 0-2-.9-2-2V4zm6 6v2h8v-2zm0 4v2h5v-2z\"/>"
}
}
}

View File

@ -317,6 +317,7 @@ const local: App.I18n.Schema = {
log: 'Log',
home: 'Home',
about: 'About',
document: 'Document',
pods: 'Online Machine',
namespace: 'Namespace',
notify: 'Notify',

View File

@ -317,6 +317,7 @@ const local: App.I18n.Schema = {
log: '日志',
home: '首页',
about: '关于',
document: '文档',
pods: '在线机器',
namespace: '命名空间',
group: '组管理',

View File

@ -1,4 +1,4 @@
import { addAPIProvider } from '@iconify/vue';
import { addAPIProvider, enableCache } from '@iconify/vue';
/** Setup the iconify offline */
export function setupIconifyOffline() {
@ -6,5 +6,7 @@ export function setupIconifyOffline() {
if (VITE_ICONIFY_URL) {
addAPIProvider('', { resources: [VITE_ICONIFY_URL] });
enableCache('all');
}
}

View File

@ -46,7 +46,7 @@ export const generatedRoutes: GeneratedRoute[] = [
meta: {
title: 'about',
i18nKey: 'route.about',
order: 1000,
order: 999,
icon: 'material-symbols:help-outline-rounded'
}
},
@ -58,7 +58,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'group',
i18nKey: 'route.group',
order: 30,
icon: 'material-symbols:group-work-outline'
icon: 'material-symbols:group-work-outline',
keepAlive: true
}
},
{
@ -69,7 +70,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'home',
i18nKey: 'route.home',
icon: 'material-symbols:dashboard-outline-rounded',
order: 1
order: 1,
keepAlive: true
}
},
{
@ -93,7 +95,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'job',
i18nKey: 'route.job',
order: 50,
icon: 'eos-icons:cronjob'
icon: 'eos-icons:cronjob',
keepAlive: true
},
children: [
{
@ -104,7 +107,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'job_batch',
i18nKey: 'route.job_batch',
icon: 'carbon:batch-job',
order: 20
order: 20,
keepAlive: true
}
},
{
@ -115,7 +119,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'job_task',
i18nKey: 'route.job_task',
icon: 'octicon:tasklist',
order: 10
order: 10,
keepAlive: true
}
}
]
@ -152,7 +157,8 @@ export const generatedRoutes: GeneratedRoute[] = [
i18nKey: 'route.namespace',
icon: 'eos-icons:namespace',
order: 20,
roles: ['R_ADMIN']
roles: ['R_ADMIN'],
keepAlive: true
}
},
{
@ -163,7 +169,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'notify',
i18nKey: 'route.notify',
order: 100,
icon: 'material-symbols:notifications-active-outline-rounded'
icon: 'material-symbols:notifications-active-outline-rounded',
keepAlive: true
},
children: [
{
@ -173,7 +180,8 @@ export const generatedRoutes: GeneratedRoute[] = [
meta: {
title: 'notify_config',
i18nKey: 'route.notify_config',
icon: 'cbi:scene-dynamic'
icon: 'cbi:scene-dynamic',
keepAlive: true
}
},
{
@ -183,7 +191,8 @@ export const generatedRoutes: GeneratedRoute[] = [
meta: {
title: 'notify_recipient',
i18nKey: 'route.notify_recipient',
icon: 'fluent:people-call-20-filled'
icon: 'fluent:people-call-20-filled',
keepAlive: true
}
}
]
@ -196,7 +205,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'pods',
i18nKey: 'route.pods',
icon: 'ant-design:database-outlined',
order: 10
order: 10,
keepAlive: true
}
},
{
@ -207,7 +217,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'retry',
i18nKey: 'route.retry',
order: 70,
icon: 'carbon:retry-failed'
icon: 'carbon:retry-failed',
keepAlive: true
},
children: [
{
@ -218,7 +229,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'retry_dead-letter',
i18nKey: 'route.retry_dead-letter',
icon: 'streamline:interface-arrows-synchronize-warning-arrow-fail-notification-sync-warning-failure-synchronize-error',
order: 30
order: 30,
keepAlive: true
}
},
{
@ -229,7 +241,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'retry_log',
i18nKey: 'route.retry_log',
icon: 'tabler:logs',
order: 20
order: 20,
keepAlive: true
}
},
{
@ -240,7 +253,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'retry_scene',
i18nKey: 'route.retry_scene',
icon: 'cbi:scene-dynamic',
order: 1
order: 1,
keepAlive: true
}
},
{
@ -251,7 +265,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'retry_task',
i18nKey: 'route.retry_task',
icon: 'octicon:tasklist',
order: 10
order: 10,
keepAlive: true
}
}
]
@ -265,7 +280,8 @@ export const generatedRoutes: GeneratedRoute[] = [
i18nKey: 'route.user',
order: 900,
icon: 'material-symbols:manage-accounts',
roles: ['R_ADMIN']
roles: ['R_ADMIN'],
keepAlive: true
},
children: [
{
@ -277,7 +293,8 @@ export const generatedRoutes: GeneratedRoute[] = [
i18nKey: 'route.user_manager',
icon: 'streamline:interface-user-multiple-close-geometric-human-multiple-person-up-user',
order: 900,
roles: ['R_ADMIN']
roles: ['R_ADMIN'],
keepAlive: true
}
}
]
@ -290,7 +307,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'workflow',
i18nKey: 'route.workflow',
order: 60,
icon: 'lucide:workflow'
icon: 'lucide:workflow',
keepAlive: true
},
children: [
{
@ -301,7 +319,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'workflow_batch',
i18nKey: 'route.workflow_batch',
icon: 'carbon:batch-job',
order: 10
order: 10,
keepAlive: true
}
},
{
@ -373,7 +392,8 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'workflow_task',
i18nKey: 'route.workflow_task',
icon: 'octicon:tasklist',
order: 1
order: 1,
keepAlive: true
}
}
]

View File

@ -12,7 +12,22 @@ const customRoutes: CustomRoute[] = [];
/** create routes when the auth route mode is static */
export function createStaticRoutes() {
const constantRoutes: ElegantRoute[] = [];
const constantRoutes: ElegantRoute[] = [
{
name: 'document',
path: '/document',
component: 'layout.blank$view.iframe-page',
props: {
url: 'https://snailjob.opensnail.com/'
},
meta: {
title: 'document',
i18nKey: 'route.document',
order: 1000,
icon: 'mdi:file-document-multiple-outline'
}
}
];
const authRoutes: ElegantRoute[] = [];