mirror of
https://github.com/jumpserver/lina.git
synced 2025-06-23 13:48:36 +00:00
[Update] 增加资产节点树
This commit is contained in:
parent
23c4050a8e
commit
83f80f4a6c
@ -317,7 +317,7 @@ export const constantRoutes = [
|
||||
{
|
||||
path: 'command-executions/create',
|
||||
name: 'BatchCommand',
|
||||
component: () => import('@/views/tree/index'),
|
||||
component: () => import('@/views/jobcenter/CommandExecution'),
|
||||
meta: { title: 'BatchCommand' }
|
||||
},
|
||||
{
|
||||
|
60
src/views/jobcenter/CommandExecution.vue
Normal file
60
src/views/jobcenter/CommandExecution.vue
Normal file
@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<Page>
|
||||
<el-alert v-if="helpMessage" type="success"> {{ helpMessage }} </el-alert>
|
||||
<el-collapse-transition>
|
||||
<el-row>
|
||||
<el-col v-show="ShowTree" :span="4" class="transition-box">
|
||||
<TreeNode :url="treeurl" @urlChanged="handleUrlChange" />
|
||||
</el-col>
|
||||
<el-col :span="1" class="mini"><div style="display:block" class="mini-button" @click="ShowTree=!ShowTree"><i v-show="ShowTree" id="toggle-icon" class="fa fa-angle-left fa-x" /><i v-show="!ShowTree" id="toggle-icon" class="fa fa-angle-right fa-x" /></div></el-col>
|
||||
<el-col :span="ShowTree?19:23" class="transition-box">
|
||||
这里其它东西
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-collapse-transition>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Page } from '@/layout/components'
|
||||
import TreeNode from '@/components/TreeNode'
|
||||
export default {
|
||||
components: {
|
||||
Page,
|
||||
TreeNode
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
helpMessage: '',
|
||||
ShowTree: true,
|
||||
treeurl: '/api/v1/assets/nodes/children/tree/'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleUrlChange(_url) {
|
||||
console.log(_url)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.mini-button{
|
||||
width: 12px;
|
||||
float: right;
|
||||
text-align: center;
|
||||
padding: 5px 0;
|
||||
background-color: #1ab394;
|
||||
border-color: #1ab394;
|
||||
color: #FFFFFF;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.el-tree{
|
||||
background-color: inherit !important;
|
||||
}
|
||||
.mini{
|
||||
margin-right: 5px;
|
||||
width: 12px !important;
|
||||
}
|
||||
|
||||
</style>
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<GenericCreateUpdatePage :fields="fields" :form="form" :fields-meta="fieldsMeta" :url="url" />
|
||||
<GenericCreateUpdatePage :fields="fields" :initial="initial" :fields-meta="fieldsMeta" :url="url" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -10,7 +10,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
initial: {
|
||||
is_active: true,
|
||||
actions: ['all', 'connect', 'updownload', 'upload_file', 'download_file'],
|
||||
date_expired: '2099-12-31 00:00:00 +0800'
|
||||
|
@ -1,19 +1,20 @@
|
||||
<template>
|
||||
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" />
|
||||
<TreeTable :table-config="tableConfig" :header-actions="headerActions" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { GenericListPage } from '@/layout/components'
|
||||
import TreeTable from '@/components/TreeTable'
|
||||
import { LengthFormatter, ExpandAssetPermissionFormatter } from '@/components/ListTable/formatters/index'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
GenericListPage
|
||||
TreeTable
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableConfig: {
|
||||
url: '/api/v1/perms/asset-permissions/',
|
||||
treeurl: '/api/v1/assets/nodes/children/tree/',
|
||||
hasSelection: false,
|
||||
columns: ['expand', 'name', 'users', 'user_groups', 'assets', 'nodes', 'system_users', 'is_active', 'actions'],
|
||||
columnsMeta: {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<GenericCreateUpdatePage :fields="fields" :form="form" :fields-meta="fieldsMeta" :url="url" />
|
||||
<GenericCreateUpdatePage :fields="fields" :initial="initial" :fields-meta="fieldsMeta" :url="url" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -10,7 +10,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
initial: {
|
||||
is_active: true,
|
||||
date_expired: '2099-12-31 00:00:00 +0800'
|
||||
},
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<GenericCreateUpdatePage :fields="fields" :form="form" :fields-meta="fieldsMeta" :url="url" />
|
||||
<GenericCreateUpdatePage :fields="fields" :initial="initial" :fields-meta="fieldsMeta" :url="url" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -10,7 +10,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
initial: {
|
||||
is_active: true,
|
||||
date_expired: '2099-12-31 00:00:00 +0800'
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user