mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-02 07:27:01 +00:00
feat: 命令过滤器支持多维度绑定
This commit is contained in:
parent
3eff78817b
commit
90adcaf843
@ -243,6 +243,7 @@
|
||||
"ReLogin": "重新登录"
|
||||
},
|
||||
"common": {
|
||||
"Correlation": "关联",
|
||||
"UserLoginLimit": "用户登录限制",
|
||||
"IPLoginLimit": "IP 登录限制",
|
||||
"Setting": "设置",
|
||||
|
@ -237,6 +237,7 @@
|
||||
"ReLogin": "Re-Login"
|
||||
},
|
||||
"common": {
|
||||
"Correlation": "Correlation",
|
||||
"UserLoginLimit": "User login limit",
|
||||
"IPLoginLimit": "IP login limit",
|
||||
"Setting": "Setting",
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
<script>
|
||||
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
|
||||
import AssetSelect from '@/components/AssetSelect/index'
|
||||
export default {
|
||||
name: 'CommandFilterCreateUpdate',
|
||||
components: { GenericCreateUpdatePage },
|
||||
@ -13,9 +14,66 @@ export default {
|
||||
|
||||
},
|
||||
fields: [
|
||||
[this.$t('common.Basic'), ['name', 'comment']]
|
||||
[this.$t('common.Basic'), ['name']],
|
||||
[this.$t('common.Correlation'), ['users', 'user_groups', 'assets', 'applications', 'system_users']],
|
||||
[this.$t('common.Other'), ['is_active', 'comment']]
|
||||
],
|
||||
fieldsMeta: {
|
||||
users: {
|
||||
el: {
|
||||
value: [],
|
||||
ajax: {
|
||||
url: '/api/v1/users/users/?fields_size=mini',
|
||||
transformOption: (item) => {
|
||||
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
user_groups: {
|
||||
el: {
|
||||
value: [],
|
||||
url: '/api/v1/users/groups/'
|
||||
}
|
||||
},
|
||||
assets: {
|
||||
type: 'assetSelect',
|
||||
component: AssetSelect,
|
||||
label: this.$t('perms.Asset'),
|
||||
rules: [{
|
||||
required: false
|
||||
}],
|
||||
el: {
|
||||
value: []
|
||||
}
|
||||
},
|
||||
applications: {
|
||||
label: this.$t('assets.Applications'),
|
||||
el: {
|
||||
value: [],
|
||||
ajax: {
|
||||
url: `/api/v1/applications/applications/?category=db`,
|
||||
transformOption: (item) => {
|
||||
return { label: item.name + ' (' + item.type_display + ')', value: item.id }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
system_users: {
|
||||
el: {
|
||||
value: [],
|
||||
ajax: {
|
||||
url: `/api/v1/assets/system-users/?protocol__in=ssh,telnet,mysql,postgresql,mariadb,oracle,sqlserver,k8s`,
|
||||
transformOption: (item) => {
|
||||
if (this.$route.query.type === 'k8s') {
|
||||
return { label: item.name, value: item.id }
|
||||
}
|
||||
const username = item.username || '*'
|
||||
return { label: item.name + '(' + username + ')', value: item.id }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
url: '/api/v1/assets/cmd-filters/'
|
||||
|
@ -20,7 +20,7 @@ export default {
|
||||
return {
|
||||
tableConfig: {
|
||||
url: `/api/v1/assets/cmd-filters/${this.object.id}/rules/`,
|
||||
columns: ['type', 'content', 'priority', 'action', 'comment', 'actions'],
|
||||
columns: ['type', 'content', 'priority', 'action', 'comment', 'pattern', 'actions'],
|
||||
columnsMeta: {
|
||||
type: {
|
||||
width: '100px'
|
||||
|
@ -15,12 +15,12 @@ export default {
|
||||
tableConfig: {
|
||||
url: '/api/v1/assets/cmd-filters/',
|
||||
columns: [
|
||||
'name', 'rules', 'system_users', 'is_active',
|
||||
'name', 'rules', 'users', 'user_groups', 'assets', 'applications', 'system_users', 'is_active',
|
||||
'created_by', 'date_created', 'comment', 'org_name', 'actions'
|
||||
],
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: ['name', 'rules', 'system_users', 'comment', 'actions']
|
||||
default: ['name', 'rules', 'comment', 'actions']
|
||||
},
|
||||
columnsMeta: {
|
||||
rules: {
|
||||
@ -38,6 +38,26 @@ export default {
|
||||
date_created: {
|
||||
label: this.$t('users.DateJoined')
|
||||
},
|
||||
users: {
|
||||
formatter: function(row, col, cell) {
|
||||
return cell.length
|
||||
}
|
||||
},
|
||||
user_groups: {
|
||||
formatter: function(row, col, cell) {
|
||||
return cell.length
|
||||
}
|
||||
},
|
||||
assets: {
|
||||
formatter: function(row, col, cell) {
|
||||
return cell.length
|
||||
}
|
||||
},
|
||||
applications: {
|
||||
formatter: function(row, col, cell) {
|
||||
return cell.length
|
||||
}
|
||||
},
|
||||
system_users: {
|
||||
label: this.$t('assets.SystemUsers'),
|
||||
formatter: DetailFormatter,
|
||||
|
@ -6,7 +6,6 @@
|
||||
<el-col :span="10">
|
||||
<QuickActions type="primary" :actions="quickActions" />
|
||||
<RelationCard
|
||||
v-if="object.protocol === 'ssh'"
|
||||
ref="RelationCard"
|
||||
v-bind="nodeRelationConfig"
|
||||
type="info"
|
||||
|
Loading…
Reference in New Issue
Block a user