@@ -11,16 +11,15 @@
diff --git a/ui/src/pages/chart/Edit.vue b/ui/src/pages/chart/Edit.vue
index 1d6d156..5470f4f 100644
--- a/ui/src/pages/chart/Edit.vue
+++ b/ui/src/pages/chart/Edit.vue
@@ -1,7 +1,7 @@
-
+
@@ -219,7 +219,7 @@ const rules: any = {
const form = ref();
const { submit, submiting } = useForm(form, () => chartApi.save(model.value), () => {
window.message.info(t('texts.action_success'));
- router.push("/system/charts")
+ router.push({ name: 'chart_list' })
})
function newMetric() {
diff --git a/ui/src/pages/chart/List.vue b/ui/src/pages/chart/List.vue
index 0087600..89f1ccf 100644
--- a/ui/src/pages/chart/List.vue
+++ b/ui/src/pages/chart/List.vue
@@ -9,18 +9,24 @@
{{ t('buttons.import') }}
-
+
- {{ t('buttons.new') }}
+
+ {{ t('buttons.new') }}
-
+
renderLink(`/system/charts/${c.id}`, c.title),
+ render: (c: Chart) => renderLink({ name: 'chart_detail', params: { id: c.id } }, c.title),
},
{
title: t('fields.type'),
@@ -136,7 +142,7 @@ const columns = [
{
type: 'warning',
text: t('buttons.edit'),
- action: () => router.push(`/system/charts/${c.id}/edit`),
+ action: () => router.push({ name: 'chart_edit', params: { id: c.id } }),
},
{
type: 'info',
diff --git a/ui/src/pages/chart/View.vue b/ui/src/pages/chart/View.vue
index 758652b..0b4ead3 100644
--- a/ui/src/pages/chart/View.vue
+++ b/ui/src/pages/chart/View.vue
@@ -1,7 +1,7 @@
-
+
@@ -12,7 +12,7 @@
{{ t('buttons.edit') }}
@@ -55,13 +55,19 @@
{{ model.dashboard }}
{{ model.type }}
- {{ model.createdBy?.name }}
+ {{ model.createdBy?.name }}
- {{ model.updatedBy?.name }}
+ {{ model.updatedBy?.name }}
diff --git a/ui/src/pages/event/List.vue b/ui/src/pages/event/List.vue
index 2842324..8d1b94d 100644
--- a/ui/src/pages/event/List.vue
+++ b/ui/src/pages/event/List.vue
@@ -153,7 +153,6 @@ const columns = [
key: "id",
width: 210,
fixed: "left" as const,
- // render: (e: Event) => renderLink(`/system/events/${e.id}`, e.id),
},
{
title: t('fields.type'),
@@ -172,15 +171,12 @@ const columns = [
{
title: t('fields.object'),
key: "name",
- render(e: Event) {
- const u = url(e)
- return u ? renderLink(u, e.name) : e.name
- },
+ render: renderObject,
},
{
title: t('fields.operator'),
key: "name",
- render: (e: Event) => renderLink(`/system/users/${e.userId}`, e.username),
+ render: (e: Event) => e.userId ? renderLink({ name: 'user_detail', params: { id: e.userId } }, e.username) : null,
},
{
title: t('fields.time'),
@@ -190,40 +186,40 @@ const columns = [
];
const { state, pagination, fetchData, changePageSize } = useDataTable(eventApi.search, filter)
-function url(e: Event): RouteLocationRaw | null {
- if (e.type === 'Setting') {
- return { name: 'setting' }
- } else if (!e.code) {
- return null
- }
-
+function renderObject(e: Event) {
switch (e.type) {
case "User":
- return { name: 'user_detail', params: { id: e.code } }
case "Role":
- return { name: 'role_detail', params: { id: e.code } }
case "Chart":
- return { name: 'chart_detail', params: { id: e.code } }
case "Registry":
- return { name: 'registry_detail', params: { id: e.code } }
case "Node":
- return { name: 'node_detail', params: { id: e.code } }
- case "Network":
- return { name: 'network_detail', params: { name: e.code } }
- case "Service":
- return { name: 'service_detail', params: { name: e.code } }
- case "Stack":
- return { name: 'stack_detail', params: { name: e.code } }
case "Config":
- return { name: 'config_detail', params: { id: e.code } }
case "Secret":
- return { name: 'secret_detail', params: { id: e.code } }
+ return renderLink({ name: e.type.toLowerCase() + '_detail', params: { id: e.args.id } }, e.args.name)
+ case "Network":
+ case "Service":
+ case "Stack":
+ return renderLink({ name: e.type.toLowerCase() + '_detail', params: { name: e.args.name } }, e.args.name)
case "Image":
- return { name: 'image_detail', params: { node: '-', id: e.code } }
+ if (e.args.id) {
+ return renderLink({ name: 'image_detail', params: { node: e.args.node || '-', id: e.args.id } }, e.args.id)
+ } else {
+ return renderLink({ name: 'image_list' }, t('objects.image'))
+ }
case "Container":
- return { name: 'container_detail', params: { node: '-', id: e.code } }
+ if (e.args.id) {
+ return renderLink({ name: 'container_detail', params: { node: e.args.node || '-', id: e.args.id } }, e.args.name)
+ } else {
+ return renderLink({ name: 'container_list' }, t('objects.container'))
+ }
case "Volume":
- return { name: 'volume_detail', params: { node: '-', name: e.code } }
+ if (e.args.name) {
+ return renderLink({ name: 'volume_detail', params: { node: e.args.node || '-', name: e.args.name } }, e.args.name)
+ } else {
+ return renderLink({ name: 'volume_list' }, t('objects.volume'))
+ }
+ case "Setting":
+ return renderLink({ name: 'setting' }, t('objects.setting'))
}
return null
}
diff --git a/ui/src/pages/registry/View.vue b/ui/src/pages/registry/View.vue
index 3af1e29..d21e116 100644
--- a/ui/src/pages/registry/View.vue
+++ b/ui/src/pages/registry/View.vue
@@ -23,13 +23,19 @@
{{ model.url }}
{{ model.username }}
- {{ model.createdBy?.name }}
+ {{ model.createdBy?.name }}
- {{ model.updatedBy?.name }}
+ {{ model.updatedBy?.name }}
diff --git a/ui/src/pages/role/Edit.vue b/ui/src/pages/role/Edit.vue
index 078ba63..05b1386 100644
--- a/ui/src/pages/role/Edit.vue
+++ b/ui/src/pages/role/Edit.vue
@@ -111,7 +111,7 @@ const rules: any = {
const form = ref();
const { submit, submiting } = useForm(form, () => roleApi.save(model.value), () => {
window.message.info(t('texts.action_success'));
- router.push("/system/roles")
+ router.push({ name: 'role_list' })
})
function checkGroup(key: string, checked: boolean = true) {
diff --git a/ui/src/pages/role/List.vue b/ui/src/pages/role/List.vue
index 621bef1..3d225e6 100644
--- a/ui/src/pages/role/List.vue
+++ b/ui/src/pages/role/List.vue
@@ -29,7 +29,7 @@
- {{ r.id }}
+ {{ r.id }}
|
{{ r.name }} |
{{ r.desc }} |
diff --git a/ui/src/pages/role/View.vue b/ui/src/pages/role/View.vue
index 5dd952c..0c38587 100644
--- a/ui/src/pages/role/View.vue
+++ b/ui/src/pages/role/View.vue
@@ -22,24 +22,30 @@
{{ model.name }}
{{ model.desc }}
- {{ model.createdBy?.name }}
+ {{ model.createdBy?.name }}
- {{ model.updatedBy?.name }}
+ {{ model.updatedBy?.name }}
-
-
-
-
-
+
+
+
+
+
diff --git a/ui/src/pages/service/Edit.vue b/ui/src/pages/service/Edit.vue
index b5b52bc..72127ed 100644
--- a/ui/src/pages/service/Edit.vue
+++ b/ui/src/pages/service/Edit.vue
@@ -70,7 +70,7 @@
=
-
+
diff --git a/ui/src/pages/stack/View.vue b/ui/src/pages/stack/View.vue
index d6be08a..4823f6e 100644
--- a/ui/src/pages/stack/View.vue
+++ b/ui/src/pages/stack/View.vue
@@ -21,13 +21,19 @@
{{ model.name }}
- {{ model.createdBy?.name }}
+ {{ model.createdBy?.name }}
- {{ model.updatedBy?.name }}
+ {{ model.updatedBy?.name }}
diff --git a/ui/src/pages/user/Edit.vue b/ui/src/pages/user/Edit.vue
index 1ce862f..8e461dd 100644
--- a/ui/src/pages/user/Edit.vue
+++ b/ui/src/pages/user/Edit.vue
@@ -1,7 +1,7 @@
-
+
@@ -18,16 +18,28 @@
-
+
-
+
-
-
+
+
-
+
@@ -47,7 +59,12 @@
LDAP
-
+
@@ -119,7 +136,7 @@ const rules: any = {
const form = ref();
const { submit, submiting } = useForm(form, () => userApi.save(user.value), () => {
window.message.info(t('texts.action_success'));
- router.push("/system/users")
+ router.push({ name: 'user_list' })
})
async function fetchData() {
diff --git a/ui/src/pages/user/List.vue b/ui/src/pages/user/List.vue
index 4b4cd68..d9c4c1b 100644
--- a/ui/src/pages/user/List.vue
+++ b/ui/src/pages/user/List.vue
@@ -1,7 +1,7 @@
-
+
@@ -13,19 +13,12 @@
- {{ t('fields.all') }}
+ {{ t('fields.all') }}
{{ t('fields.admins') }}
- {{ t('fields.active') }}
- {{ t('fields.blocked') }}
+ :href="{ name: 'user_list', query: { filter: tab } }"
+ :active="$route.query.filter === tab"
+ v-for="tab in ['admins', 'active', 'blocked']"
+ >{{ t('fields.' + tab) }}
@@ -84,7 +77,7 @@ const columns = [
{
title: t('fields.id'),
key: "id",
- render: (row: User) => renderLink(`/system/users/${row.id}`, row.id),
+ render: (row: User) => renderLink({ name: 'user_detail', params: { id: row.id } }, row.id),
},
{
title: t('fields.name'),
@@ -124,7 +117,7 @@ const columns = [
row.status ?
{ type: 'warning', text: t('buttons.block'), action: () => setStatus(row, 0), prompt: t('prompts.block'), } :
{ type: 'success', text: t('buttons.enable'), action: () => setStatus(row, 1) },
- { type: 'warning', text: t('buttons.edit'), action: () => router.push(`/system/users/${row.id}/edit`) },
+ { type: 'warning', text: t('buttons.edit'), action: () => router.push({ name: 'user_edit', params: { id: row.id } }) },
{ type: 'error', text: t('buttons.delete'), action: () => remove(row, index), prompt: t('prompts.delete') },
])
},
diff --git a/ui/src/pages/user/View.vue b/ui/src/pages/user/View.vue
index e6821f5..de608d1 100644
--- a/ui/src/pages/user/View.vue
+++ b/ui/src/pages/user/View.vue
@@ -1,7 +1,7 @@
-
+
@@ -12,7 +12,7 @@
{{ t('buttons.edit') }}
@@ -45,7 +45,8 @@
{{ model.user.createdBy?.name }}
@@ -53,7 +54,8 @@
{{ model.user.updatedBy?.name }}