mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-19 17:54:37 +00:00
[update]完善平台列表
This commit is contained in:
@@ -134,6 +134,12 @@ export const constantRoutes = [
|
|||||||
component: () => import('@/views/assets/DomainList.vue'),
|
component: () => import('@/views/assets/DomainList.vue'),
|
||||||
meta: { title: 'DomainList' }
|
meta: { title: 'DomainList' }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'domains/create',
|
||||||
|
name: 'DomainCreate',
|
||||||
|
component: () => import('@/views/assets/DomainCreateUpdate.vue'),
|
||||||
|
meta: { title: 'DomainList' }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'domains/:id/gateway',
|
path: 'domains/:id/gateway',
|
||||||
name: 'GatewayList',
|
name: 'GatewayList',
|
||||||
@@ -147,6 +153,48 @@ export const constantRoutes = [
|
|||||||
component: () => import('@/views/assets/AdminUserList'),
|
component: () => import('@/views/assets/AdminUserList'),
|
||||||
meta: { title: 'AdminUserList' }
|
meta: { title: 'AdminUserList' }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'admin-users/create',
|
||||||
|
component: () => import('@/views/assets/AdminUserCreateUpdate.vue'), // Parent router-view
|
||||||
|
name: 'AdminUserCreateUpdate',
|
||||||
|
meta: { title: 'AdminUserCreate' },
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'platform/update/:id',
|
||||||
|
component: () => import('@/views/assets/PlatformCreateUpdate.vue'), // Parent router-view
|
||||||
|
name: 'PlatformUpdate',
|
||||||
|
meta: { title: 'PlatformUpdate' },
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'platform/create',
|
||||||
|
component: () => import('@/views/assets/PlatformCreateUpdate.vue'), // Parent router-view
|
||||||
|
name: 'PlatformCreate',
|
||||||
|
meta: { title: 'PlatformCreate' },
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'cmd-filters/update/:id',
|
||||||
|
component: () => import('@/views/assets/CommandFilterCreateUpdate.vue'), // Parent router-view
|
||||||
|
name: 'PlatformUpdate',
|
||||||
|
meta: { title: 'PlatformUpdate' },
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'cmd-filters/create',
|
||||||
|
component: () => import('@/views/assets/CommandFilterCreateUpdate.vue'), // Parent router-view
|
||||||
|
name: 'PlatformCreate',
|
||||||
|
meta: { title: 'PlatformCreate' },
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'platform/:id',
|
||||||
|
component: () => import('@/views/assets/PlatformDetail.vue'), // Parent router-view
|
||||||
|
name: 'PlatformDetail',
|
||||||
|
meta: { title: 'PlatformDetail' },
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'admin-users/:id',
|
path: 'admin-users/:id',
|
||||||
component: () => import('@/views/assets/AdminUserDetail.vue'), // Parent router-view
|
component: () => import('@/views/assets/AdminUserDetail.vue'), // Parent router-view
|
||||||
@@ -154,6 +202,7 @@ export const constantRoutes = [
|
|||||||
meta: { title: 'AdminUserDetail' },
|
meta: { title: 'AdminUserDetail' },
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: 'system-users',
|
path: 'system-users',
|
||||||
name: 'SystemUserList',
|
name: 'SystemUserList',
|
||||||
|
33
src/views/assets/AdminUserCreateUpdate.vue
Normal file
33
src/views/assets/AdminUserCreateUpdate.vue
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
<template>
|
||||||
|
<GenericCreateUpdatePage :fields="fields" :initial="initial" :fields-meta="fieldsMeta" :url="url" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
|
||||||
|
export default {
|
||||||
|
name: 'AdminUserCreateUpdate',
|
||||||
|
components: {
|
||||||
|
GenericCreateUpdatePage
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
initial: {
|
||||||
|
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
[this.$t('perms.' + 'Basic'), ['name', 'username', 'password', 'private_key', 'comment']]
|
||||||
|
],
|
||||||
|
fieldsMeta: {
|
||||||
|
private_key: {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
url: '/api/v1/assets/admin-users/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
@@ -54,7 +54,7 @@ export default {
|
|||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
hasBulkDelete: false,
|
hasBulkDelete: false,
|
||||||
createRoute: 'AdminUserCreate'
|
createRoute: 'AdminUserCreateUpdate'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
52
src/views/assets/CommandFilterCreateUpdate.vue
Normal file
52
src/views/assets/CommandFilterCreateUpdate.vue
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<template>
|
||||||
|
<GenericCreateUpdatePage :fields="fields" :initial="initial" :fields-meta="fieldsMeta" :url="url" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
|
||||||
|
export default {
|
||||||
|
name: 'CommandFilterCreateUpdate',
|
||||||
|
components: { GenericCreateUpdatePage },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
initial: {
|
||||||
|
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
// [this.$t('perms.' + 'Basic'), ['name', 'base', 'security', 'console', 'comment']]
|
||||||
|
],
|
||||||
|
fieldsMeta: {
|
||||||
|
|
||||||
|
},
|
||||||
|
performSubmit: function(formdata) {
|
||||||
|
console.log(formdata)
|
||||||
|
var postData = {}
|
||||||
|
if (formdata.base === 'Windows') {
|
||||||
|
postData.meta = {}
|
||||||
|
postData.meta.security = formdata.security
|
||||||
|
postData.meta.console = (formdata.console === 'true')
|
||||||
|
}
|
||||||
|
postData.name = formdata.name
|
||||||
|
postData.base = formdata.base
|
||||||
|
postData.comment = formdata.comment || ''
|
||||||
|
|
||||||
|
const params = this.$route.params
|
||||||
|
if (params.id) {
|
||||||
|
return this.$axios.put(
|
||||||
|
`${this.url}${params.id}/`, postData
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return this.$axios.post(
|
||||||
|
this.url, postData
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
url: '/api/v1/assets/cmd-filters/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='less' scoped>
|
||||||
|
|
||||||
|
</style>
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" />
|
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" :help-message="title" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -52,10 +52,20 @@ export default {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
|
hasRightActions: false,
|
||||||
|
hasExport: false,
|
||||||
|
hasImport: false,
|
||||||
|
hasRefresh: true,
|
||||||
hasBulkDelete: false,
|
hasBulkDelete: false,
|
||||||
|
hasSearch: true,
|
||||||
createRoute: 'CommandFilterCreate'
|
createRoute: 'CommandFilterCreate'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
title() {
|
||||||
|
return this.$t('系统用户可以绑定一些命令过滤器,一个过滤器可以定义一些规则 当用户使用这个系统用户登录资产,然后执行一个命令 这个命令需要被绑定过滤器的所有规则匹配,高优先级先被匹配, 当一个规则匹配到了,如果规则的动作是允许,这个命令会被放行, 如果规则的动作是禁止,命令将会被禁止执行, 否则就匹配下一个规则,如果最后没有匹配到规则,则允许执行\n')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
31
src/views/assets/DomainCreateUpdate.vue
Normal file
31
src/views/assets/DomainCreateUpdate.vue
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<template>
|
||||||
|
<GenericCreateUpdatePage :fields="fields" :initial="initial" :fields-meta="fieldsMeta" :url="url" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
|
||||||
|
export default {
|
||||||
|
name: 'GatewayCreate',
|
||||||
|
components: {
|
||||||
|
GenericCreateUpdatePage
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
initial: {
|
||||||
|
|
||||||
|
},
|
||||||
|
fields: {
|
||||||
|
|
||||||
|
},
|
||||||
|
fieldsMeta: {
|
||||||
|
|
||||||
|
},
|
||||||
|
url: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" />
|
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" :help-message="notice" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -54,9 +54,15 @@ export default {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
|
hasRightActions: false,
|
||||||
|
hasExport: false,
|
||||||
|
hasImport: false,
|
||||||
|
hasRefresh: false,
|
||||||
hasBulkDelete: false,
|
hasBulkDelete: false,
|
||||||
|
hasSearch: false,
|
||||||
createRoute: 'DomainCreate'
|
createRoute: 'DomainCreate'
|
||||||
}
|
},
|
||||||
|
notice: this.$t('网域功能是为了解决部分环境(如:混合云)无法直接连接而新增的功能,原理是通过网关服务器进行跳转登录。JMS => 网域网关 => 目标资产')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,6 +21,7 @@ export default {
|
|||||||
sortable: 'custom'
|
sortable: 'custom'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
||||||
prop: 'ip',
|
prop: 'ip',
|
||||||
label: this.$t('assets.ip'),
|
label: this.$t('assets.ip'),
|
||||||
sortable: 'custom'
|
sortable: 'custom'
|
||||||
@@ -67,14 +68,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
headerActions: {
|
|
||||||
hasRightActions: false,
|
|
||||||
hasExport: false,
|
|
||||||
hasImport: false,
|
|
||||||
hasRefresh: false,
|
|
||||||
hasBulkDelete: false,
|
|
||||||
createRoute: 'GatewayCreate'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
87
src/views/assets/PlatformCreateUpdate.vue
Normal file
87
src/views/assets/PlatformCreateUpdate.vue
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<template>
|
||||||
|
<GenericCreateUpdatePage :fields="fields" :initial="initial" :fields-meta="fieldsMeta" :url="url" :perform-submit="performSubmit.bind(this)" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
|
||||||
|
export default {
|
||||||
|
name: 'PlatformCreateUpdate',
|
||||||
|
components: { GenericCreateUpdatePage },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
initial: {
|
||||||
|
base: 'Linux',
|
||||||
|
console: 'true',
|
||||||
|
security: 'RDP',
|
||||||
|
comment: ''
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
[this.$t('perms.' + 'Basic'), ['name', 'base', 'security', 'console', 'comment']]
|
||||||
|
],
|
||||||
|
fieldsMeta: {
|
||||||
|
security: {
|
||||||
|
type: 'select',
|
||||||
|
label: 'RDP security',
|
||||||
|
options: [{
|
||||||
|
label: 'RDP',
|
||||||
|
value: 'rdp'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'NLA',
|
||||||
|
value: 'nla'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TLS',
|
||||||
|
value: 'tls'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Any',
|
||||||
|
value: 'any'
|
||||||
|
}],
|
||||||
|
hidden: form => form.base !== 'Windows'
|
||||||
|
},
|
||||||
|
console: {
|
||||||
|
type: 'select',
|
||||||
|
label: 'RDP console',
|
||||||
|
options: [{
|
||||||
|
label: '是',
|
||||||
|
value: 'true'
|
||||||
|
}, {
|
||||||
|
label: '否',
|
||||||
|
value: 'false'
|
||||||
|
}],
|
||||||
|
hidden: form => form.base !== 'Windows'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
performSubmit: function(formdata) {
|
||||||
|
console.log(formdata)
|
||||||
|
var postData = {}
|
||||||
|
if (formdata.base === 'Windows') {
|
||||||
|
postData.meta = {}
|
||||||
|
postData.meta.security = formdata.security
|
||||||
|
postData.meta.console = (formdata.console === 'true')
|
||||||
|
}
|
||||||
|
postData.name = formdata.name
|
||||||
|
postData.base = formdata.base
|
||||||
|
postData.comment = formdata.comment || ''
|
||||||
|
|
||||||
|
const params = this.$route.params
|
||||||
|
if (params.id) {
|
||||||
|
return this.$axios.put(
|
||||||
|
`${this.url}${params.id}/`, postData
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return this.$axios.post(
|
||||||
|
this.url, postData
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
url: '/api/v1/assets/platforms/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='less' scoped>
|
||||||
|
|
||||||
|
</style>
|
34
src/views/assets/PlatformDetail.vue
Normal file
34
src/views/assets/PlatformDetail.vue
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<GenericDetailPage :submenu="submenu" :active-menu="activeSubMenu" :title="title" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { GenericDetailPage } from '@/layout/components'
|
||||||
|
export default {
|
||||||
|
name: 'PlatformDetail',
|
||||||
|
components: {
|
||||||
|
GenericDetailPage
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
title: this.$t('perms.AssetPermissionDetail'),
|
||||||
|
name: 'detail'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
activeSubMenu: 'detail'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
title() {
|
||||||
|
return this.$t('perms.AssetPermissionDetail')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang='less' scoped>
|
||||||
|
|
||||||
|
</style>
|
@@ -39,6 +39,12 @@ export default {
|
|||||||
formatter: ActionsFormatter,
|
formatter: ActionsFormatter,
|
||||||
width: '200px',
|
width: '200px',
|
||||||
actions: {
|
actions: {
|
||||||
|
canDelete: (row, vaule) => {
|
||||||
|
return !row.internal
|
||||||
|
},
|
||||||
|
canUpdate: (row, vaule) => {
|
||||||
|
return !row.internal
|
||||||
|
},
|
||||||
performDelete: ({ row, col }) => {
|
performDelete: ({ row, col }) => {
|
||||||
const id = row.id
|
const id = row.id
|
||||||
const url = `/api/v1/assets/platforms/${id}/`
|
const url = `/api/v1/assets/platforms/${id}/`
|
||||||
@@ -49,7 +55,12 @@ export default {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
|
hasRightActions: false,
|
||||||
|
hasExport: false,
|
||||||
|
hasImport: false,
|
||||||
|
hasRefresh: false,
|
||||||
hasBulkDelete: false,
|
hasBulkDelete: false,
|
||||||
|
hasSearch: false,
|
||||||
createRoute: 'PlatformCreate'
|
createRoute: 'PlatformCreate'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user