mirror of
https://github.com/jumpserver/lina.git
synced 2025-07-30 22:35:56 +00:00
[Add] gathered user task
This commit is contained in:
parent
54fe95f938
commit
b895af5cfe
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<GenericTreeListPage :table-config="tableConfig" :tree-setting="treeSetting" />
|
||||
<GenericTreeListPage :table-config="tableConfig" :tree-setting="treeSetting" :header-actions="headerActions" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -28,8 +28,29 @@ export default {
|
||||
],
|
||||
columnsMeta: {
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasCreate: false,
|
||||
hasBulkDelete: false,
|
||||
hasImport: false,
|
||||
hasRefresh: false,
|
||||
extraActions: [
|
||||
{
|
||||
name: 'gather-user-tasks',
|
||||
title: '收集用户任务',
|
||||
type: 'primary',
|
||||
has: true,
|
||||
can: true,
|
||||
callback: this.onGatherUserTasks
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onGatherUserTasks() {
|
||||
this.$router.push({ name: 'GatherUserTaskList' })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
46
src/views/xpack/GatheredUser/TaskCreateUpdate.vue
Normal file
46
src/views/xpack/GatheredUser/TaskCreateUpdate.vue
Normal file
@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<GenericCreateUpdatePage v-bind="$data" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { GenericCreateUpdatePage } from '@/layout/components'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
GenericCreateUpdatePage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fields: [
|
||||
['收集用户任务', ['name', 'nodes', 'is_periodic', 'crontab', 'interval', 'comment']]
|
||||
],
|
||||
url: '/api/v1/xpack/gathered-user/tasks/',
|
||||
fieldsMeta: {
|
||||
nodes: {
|
||||
el: {
|
||||
multiple: true,
|
||||
value: [],
|
||||
ajax: {
|
||||
url: '/api/v1/assets/nodes/',
|
||||
processResults(data) {
|
||||
const results = data.results.map((item) => {
|
||||
return { label: item.name, value: item.id }
|
||||
})
|
||||
const more = !!data.next
|
||||
return { results: results, pagination: more, total: data.count }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'is_periodic': {
|
||||
type: 'switch'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
35
src/views/xpack/GatheredUser/TaskList.vue
Normal file
35
src/views/xpack/GatheredUser/TaskList.vue
Normal file
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import GenericListPage from '@/layout/components/GenericListPage'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
GenericListPage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableConfig: {
|
||||
url: '/api/v1/xpack/gathered-user/tasks/',
|
||||
columns: [
|
||||
'name', 'nodes', 'periodic_display', 'executed_times', 'actions'
|
||||
],
|
||||
columnsMeta: {}
|
||||
},
|
||||
headerActions: {
|
||||
hasBulkDelete: false,
|
||||
hasImport: false,
|
||||
hasRefresh: false,
|
||||
hasExport: false,
|
||||
createRoute: 'GatherUserTaskCreate'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
@ -21,9 +21,30 @@ export default {
|
||||
},
|
||||
{
|
||||
path: 'gathered-users',
|
||||
component: () => import('@/views/xpack/GatherUser'),
|
||||
name: 'GatherUser',
|
||||
meta: { title: 'GatherUser' }
|
||||
component: () => import('@/views/xpack/GatheredUser/GatheredUserList'),
|
||||
name: 'GatherUserList',
|
||||
meta: { title: 'GatherUserList' }
|
||||
},
|
||||
{
|
||||
path: 'gathered-users/tasks',
|
||||
component: () => import('@/views/xpack/GatheredUser/TaskList'),
|
||||
name: 'GatherUserTaskList',
|
||||
meta: { title: 'GatherUserTask' },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'gathered-users/tasks/create',
|
||||
component: () => import('@/views/xpack/GatheredUser/TaskCreateUpdate'),
|
||||
name: 'GatherUserTaskCreate',
|
||||
meta: { title: 'GatherUserTaskCreate', action: 'create' },
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'gathered-users/tasks/update',
|
||||
component: () => import('@/views/xpack/GatheredUser/TaskCreateUpdate'),
|
||||
name: 'GatherUserTaskUpdate',
|
||||
meta: { title: 'GatherUserTaskUpdate', action: 'update' },
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user