mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-13 11:24:17 +00:00
fix: 修复作业中心-任务列表路由权限不准确问题
This commit is contained in:
@@ -28,14 +28,22 @@ export default [
|
||||
component: () => import('@/views/ops/TaskDetail/AdhocDetail'),
|
||||
name: 'AdhocDetail',
|
||||
hidden: true,
|
||||
meta: { title: i18n.t('route.TaskDetail'), activeMenu: '/console/ops/tasks' }
|
||||
meta: {
|
||||
title: i18n.t('route.TaskDetail'),
|
||||
permissions: ['ops.view_adhoc'],
|
||||
activeMenu: '/ops/tasks'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'executions/:id',
|
||||
component: () => import('@/views/ops/TaskDetail/HistoryExecutionDetail'),
|
||||
name: 'HistoryExecutionDetail',
|
||||
hidden: true,
|
||||
meta: { title: i18n.t('route.TaskDetail'), activeMenu: '/console/ops/tasks' }
|
||||
meta: {
|
||||
title: i18n.t('route.TaskDetail'),
|
||||
permissions: ['ops.view_adhocexecution'],
|
||||
activeMenu: '/console/ops/tasks'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'command-executions/create',
|
||||
@@ -43,6 +51,7 @@ export default [
|
||||
component: () => import('@/views/ops/CommandExecution'),
|
||||
meta: {
|
||||
title: i18n.t('route.BatchCommand'),
|
||||
permissions: ['ops.add_adhocexecution'],
|
||||
hidden: ({ settings }) => !settings['SECURITY_COMMAND_EXECUTION']
|
||||
}
|
||||
},
|
||||
|
||||
@@ -67,6 +67,9 @@ export default {
|
||||
value: this.object.latest_execution,
|
||||
formatter: function(row, data) {
|
||||
const route = { to: { name: 'AdhocDetail', params: { id: data.adhoc }}}
|
||||
if (!this.$hasPerm('ops.ops.view_adhoc')) {
|
||||
return <span>{ data.adhoc_short_id }</span>
|
||||
}
|
||||
return <router-link {...{ attrs: route }}>{ data.adhoc_short_id }</router-link>
|
||||
}
|
||||
},
|
||||
|
||||
@@ -34,12 +34,12 @@ export default {
|
||||
{
|
||||
title: this.$t('ops.taskVersions'),
|
||||
name: 'TaskAdhoc',
|
||||
hidden: () => !this.$hasPerm('ops.view_task')
|
||||
hidden: () => !this.$hasPerm('ops.view_adhoc')
|
||||
},
|
||||
{
|
||||
title: this.$t('ops.execution'),
|
||||
name: 'TaskHistory',
|
||||
hidden: () => !this.$hasPerm('ops.view_taskmonitor')
|
||||
hidden: () => !this.$hasPerm('ops.view_adhocexecution')
|
||||
}
|
||||
],
|
||||
hasRightSide: false
|
||||
|
||||
Reference in New Issue
Block a user