diff --git a/src/components/DataForm/components/el-form-renderer/components/render-form-item.vue b/src/components/DataForm/components/el-form-renderer/components/render-form-item.vue
index dfe382357..c4df4b725 100755
--- a/src/components/DataForm/components/el-form-renderer/components/render-form-item.vue
+++ b/src/components/DataForm/components/el-form-renderer/components/render-form-item.vue
@@ -97,6 +97,7 @@ export default {
}
},
props: {
+ // eslint-disable-next-line vue/require-default-prop
data: Object,
prop: {
type: String,
@@ -104,10 +105,13 @@ export default {
return this.data.id
}
},
+ // eslint-disable-next-line vue/require-prop-types,vue/require-default-prop
itemValue: {},
+ // eslint-disable-next-line vue/require-default-prop
value: Object,
disabled: Boolean,
readonly: Boolean,
+ // eslint-disable-next-line vue/require-default-prop
options: Array
},
data() {
diff --git a/src/components/DataTable/index.vue b/src/components/DataTable/index.vue
index a1c1de300..2ed90098e 100644
--- a/src/components/DataTable/index.vue
+++ b/src/components/DataTable/index.vue
@@ -94,7 +94,12 @@ export default {
tableConfig() {
const tableDefaultConfig = this.defaultConfig
tableDefaultConfig.paginationSize = _.get(this.globalTableConfig, 'paginationSize', 15)
+ let tableAttrs = tableDefaultConfig.tableAttrs
+ if (this.config.tableAttrs) {
+ tableAttrs = Object.assign(tableAttrs, this.config.tableAttrs)
+ }
const config = Object.assign(tableDefaultConfig, this.config)
+ config.tableAttrs = tableAttrs
return config
},
iListeners() {
diff --git a/src/components/FormFields/Select2.vue b/src/components/FormFields/Select2.vue
index 6be32e9bb..8826bedfc 100644
--- a/src/components/FormFields/Select2.vue
+++ b/src/components/FormFields/Select2.vue
@@ -8,8 +8,8 @@
:remote="remote"
:remote-method="filterOptions"
:multiple="multiple"
- filterable
:clearable="clearable"
+ filterable
popper-append-to-body
class="select2"
v-bind="$attrs"
@@ -98,7 +98,6 @@ export default {
return {
loading: false,
initialized: false,
- iValue: this.multiple ? [] : '',
defaultParams: _.cloneDeep(defaultParams),
params: _.cloneDeep(defaultParams),
iOptions: this.options || [],
@@ -113,6 +112,14 @@ export default {
optionsValues() {
return this.iOptions.map((v) => v.value)
},
+ iValue: {
+ set(val) {
+ this.$emit('input', val)
+ },
+ get() {
+ return this.value
+ }
+ },
iAjax() {
const defaultPageSize = 10
const defaultMakeParams = (params) => {
diff --git a/src/components/ListTable/TableAction/ImportTable.vue b/src/components/ListTable/TableAction/ImportTable.vue
index b2206e6d3..2cc34f621 100644
--- a/src/components/ListTable/TableAction/ImportTable.vue
+++ b/src/components/ListTable/TableAction/ImportTable.vue
@@ -421,6 +421,7 @@ export default {
.importTable >>> .cell {
min-height: 20px;
height: 100%;
+ overflow: auto;
}
diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json
index 0f6ac9089..6ac21f005 100644
--- a/src/i18n/langs/cn.json
+++ b/src/i18n/langs/cn.json
@@ -551,7 +551,7 @@
"systemUserCount": "系统用户数量",
"upDownload": "上传下载",
"uploadFile": "上传文件",
- "clipboardCopyPaste":"复制粘贴",
+ "clipboardCopyPaste":"剪贴板复制粘贴",
"clipboardCopy":"剪切板复制",
"clipboardPaste":"剪切板粘贴",
"userCount": "用户数量",
@@ -567,6 +567,7 @@
"AssetAccount": "资产账号",
"ApplicationAccount": "应用账号",
"Ticket":"工单",
+ "SessionDetail": "会话详情",
"CommandConfirm": "命令复核",
"AdminUserCreate": "创建管理用户",
"AdminUserDetail": "管理用户详情",
@@ -576,6 +577,7 @@
"AssetCreate": "创建资产",
"AssetDetail": "资产详情",
"AssetList": "资产列表",
+ "Session": "会话",
"AssetPermission": "资产授权",
"AssetPermissionCreate": "创建资产授权规则",
"AssetPermissionDetail": "资产授权详情",
@@ -831,7 +833,8 @@
"authLdapSearchFilter": "用户过滤器",
"authLdapSearchOu": "用户OU",
"authLdapServerUri": "LDAP地址",
- "authLdapUserAttrMap": "LDAP属性映射",
+ "authLdapUserAttrMap": "用户属性映射",
+ "authCASAttrMap": "用户属性映射",
"SignaturesAndTemplates": "Signatures and Templates",
"unselectedUser": "没有选择用户",
"auto": "自动",
@@ -979,7 +982,7 @@
"user": "用户",
"Status": "状态",
"Open": "待处理",
- "OrgName":"组织名称",
+ "OrgName":"授权组织名称",
"AssignedInfo":"审批信息",
"OpenTicket": "创建工单",
"HandleTicket": "处理工单",
@@ -1036,6 +1039,10 @@
"DatePasswordUpdated": "密码更新日期",
"DescribeOfGuide": "欢迎使用JumpServer堡垒机系统,获取更多信息请点击",
"Email": "邮件",
+ "Phone": "手机号",
+ "WeCom": "企业微信",
+ "DingTalk": "钉钉",
+ "FeiShu": "飞书",
"FingerPrint": "指纹",
"FirstLogin": "首次登录",
"OrgUser": "组织用户",
diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json
index f275cf1f3..9b025f3b2 100644
--- a/src/i18n/langs/en.json
+++ b/src/i18n/langs/en.json
@@ -551,6 +551,7 @@
},
"route": {
"": "",
+ "SessionDetail": "SessionDetail",
"Accounts": "Accounts",
"AssetAccount": "Asset account",
"ApplicationAccount": "Application account",
@@ -813,6 +814,7 @@
"authLdapSearchOu": "User OU",
"authLdapServerUri": "LDAP server",
"authLdapUserAttrMap": "User attr map",
+ "authCASAttrMap": "User attr map",
"unselectedUser": "Unselected user",
"auto": "Auto",
"basicSetting": "Basic setting",
@@ -1006,6 +1008,10 @@
"DatePasswordUpdated": "Date password updated",
"DescribeOfGuide": "Welcome to JumpServer. Click here for more information",
"Email": "Email",
+ "Phone": "Phone",
+ "WeCom": "WeCom",
+ "DingTalk": "DingTalk",
+ "FeiShu": "FeiShu",
"FingerPrint": "Fingerprint",
"FirstLogin": "First login",
"InviteUser": "Invite user",
diff --git a/src/layout/components/GenericUpdateFormDialog/index.vue b/src/layout/components/GenericUpdateFormDialog/index.vue
index 01507abf3..075b1a27b 100644
--- a/src/layout/components/GenericUpdateFormDialog/index.vue
+++ b/src/layout/components/GenericUpdateFormDialog/index.vue
@@ -1,7 +1,7 @@
-
-
-
-
+
@@ -70,20 +54,18 @@ import GenericTreeListPage from '@/layout/components/GenericTreeListPage/index'
import { DetailFormatter, ActionsFormatter } from '@/components/TableFormatters'
import $ from '@/utils/jquery-vendor'
import Dialog from '@/components/Dialog'
-import TreeTable from '@/components/TreeTable'
-import { GenericUpdateFormDialog } from '@/layout/components'
-import rules from '@/components/DataForm/rules'
-import Protocols from '@/views/assets/Asset/components/Protocols/index'
import { mapGetters } from 'vuex'
import { connectivityMeta } from '@/components/AccountListTable/const'
import { openTaskPage } from '@/utils/jms'
+import AssetBulkUpdateDialog from './AssetBulkUpdateDialog'
+import NodeAssetsUpdateDialog from './NodeAssetsUpdateDialog'
export default {
components: {
GenericTreeListPage,
Dialog,
- TreeTable,
- GenericUpdateFormDialog
+ AssetBulkUpdateDialog,
+ NodeAssetsUpdateDialog
},
data() {
const vm = this
@@ -220,9 +202,9 @@ export default {
name: 'updateSelected',
title: this.$t('common.updateSelected'),
can: ({ selectedRows }) => selectedRows.length > 0 && !this.$store.getters.currentOrgIsRoot,
- callback: ({ selectedRows, reloadTable }) => {
- vm.updateSelectedDialogSetting.dialogSetting.dialogVisible = true
+ callback: ({ selectedRows }) => {
vm.updateSelectedDialogSetting.selectedRows = selectedRows
+ vm.updateSelectedDialogSetting.visible = true
}
},
{
@@ -259,125 +241,14 @@ export default {
dialogVisible: false,
items: []
},
- assetTreeTableDialogSetting: {
- dialogVisible: false,
- assetsSelected: [],
- action: '',
- treeSetting: {
- showMenu: false,
- showRefresh: true,
- showAssets: false,
- url: '/api/v1/assets/assets/?fields_size=mini',
- nodeUrl: '/api/v1/assets/nodes/',
- // ?assets=0不显示资产. =1显示资产
- treeUrl: '/api/v1/assets/nodes/children/tree/?assets=0'
- },
- tableConfig: {
- url: '/api/v1/assets/assets/',
- hasTree: true,
- columns: [
- {
- prop: 'hostname',
- label: this.$t('assets.Hostname'),
- sortable: true,
- formatter: DetailFormatter,
- formatterArgs: {
- route: 'AssetDetail'
- }
- },
- {
- prop: 'ip',
- label: this.$t('assets.ip'),
- sortable: 'custom'
- }
- ],
- listeners: {
- 'toggle-row-selection': (isSelected, row) => {
- if (isSelected) {
- this.addRowToAssetsSelected(row)
- } else {
- this.removeRowFromAssetsSelected(row)
- }
- }
- }
- },
- headerActions: {
- hasLeftActions: false,
- hasRightActions: false
- }
- },
updateSelectedDialogSetting: {
- selectedRows: [],
- dialogSetting: {
- dialogVisible: false
- },
- formSetting: {
- url: '/api/v1/assets/assets/',
- hasSaveContinue: false,
- initial: {
- platform: 'Linux',
- protocols: ['ssh/22']
- },
- fields: [
- 'platform', 'protocols', 'domain', 'admin_user', 'labels', 'comment'
- ],
- fieldsMeta: {
- platform: {
- label: this.$t('assets.Platform'),
- hidden: () => false,
- el: {
- multiple: false,
- ajax: {
- url: '/api/v1/assets/platforms/',
- transformOption: (item) => {
- return { label: `${item.name}`, value: item.name }
- }
- }
- }
- },
- protocols: {
- label: this.$t('assets.Protocols'),
- component: Protocols
- },
- domain: {
- label: this.$t('assets.Domain'),
- hidden: () => false,
- el: {
- multiple: false,
- ajax: {
- url: '/api/v1/assets/domains/'
- }
- }
- },
- admin_user: {
- rules: [rules.RequiredChange],
- label: this.$t('assets.AdminUser'),
- hidden: () => false,
- el: {
- multiple: false,
- ajax: {
- url: '/api/v1/assets/admin-users/',
- transformOption: (item) => {
- return { label: `${item.name}(${item.username})`, value: item.id }
- }
- }
- }
- },
- labels: {
- label: this.$t('assets.Label'),
- hidden: () => false,
- el: {
- ajax: {
- url: '/api/v1/assets/labels/'
- }
- }
- },
- comment: {
- label: this.$t('common.Comment'),
- hidden: () => false
- }
- }
- }
+ visible: false,
+ selectedRows: []
+ },
+ nodeAssetsUpdateDialog: {
+ visible: false,
+ action: 'add',
+ selectNode: null
}
}
},
@@ -405,13 +276,15 @@ export default {
getSelectedNodes() {
return this.$refs.TreeList.getSelectedNodes()
},
- rMenuAddAssetToNode: function() {
- this.assetTreeTableDialogSetting.dialogVisible = true
- this.assetTreeTableDialogSetting.action = 'add'
+ rMenuAddAssetToNode() {
+ this.nodeAssetsUpdateDialog.visible = true
+ this.nodeAssetsUpdateDialog.action = 'add'
+ this.nodeAssetsUpdateDialog.selectNode = this.getSelectedNodes()[0]
},
- rMenuMoveAssetToNode: function() {
- this.assetTreeTableDialogSetting.dialogVisible = true
- this.assetTreeTableDialogSetting.action = 'move'
+ rMenuMoveAssetToNode() {
+ this.nodeAssetsUpdateDialog.visible = true
+ this.nodeAssetsUpdateDialog.action = 'move'
+ this.nodeAssetsUpdateDialog.selectNode = this.getSelectedNodes()[0]
},
rMenuUpdateNodeAssetHardwareInfo: function() {
this.hideRMenu()
@@ -493,43 +366,6 @@ export default {
}).catch(error => {
this.$message.error(this.$t('common.getErrorMsg' + ' ' + error))
})
- },
- addRowToAssetsSelected(row) {
- const selectValueIndex = this.assetTreeTableDialogSetting.assetsSelected.indexOf(row.id)
- if (selectValueIndex === -1) {
- this.assetTreeTableDialogSetting.assetsSelected.push(row.id)
- }
- },
- removeRowFromAssetsSelected(row) {
- const selectValueIndex = this.assetTreeTableDialogSetting.assetsSelected.indexOf(row.id)
- if (selectValueIndex > -1) {
- this.assetTreeTableDialogSetting.assetsSelected.splice(selectValueIndex, 1)
- }
- },
- assetTreeTableDialogHandleConfirm() {
- const currentNode = this.getSelectedNodes()[0]
- const assetsSelected = this.assetTreeTableDialogSetting.assetsSelected
- if (!currentNode || assetsSelected.length === 0) {
- return
- }
- let url = `/api/v1/assets/nodes/${currentNode.meta.data.id}/assets/add/`
- if (this.assetTreeTableDialogSetting.action === 'move') {
- url = `/api/v1/assets/nodes/${currentNode.meta.data.id}/assets/replace/`
- }
- this.$axios.put(
- url, { assets: assetsSelected }
- ).then(res => {
- this.assetTreeTableDialogSetting.dialogVisible = false
- this.assetTreeTableDialogSetting.assetsSelected = []
- $('#tree-refresh').trigger('click')
- this.$message.success(this.$t('common.updateSuccessMsg'))
- }).catch(error => {
- this.$message.error(this.$t('common.updateErrorMsg' + ' ' + error))
- })
- },
- assetTreeTableDialogHandleCancel() {
- this.assetTreeTableDialogSetting.dialogVisible = false
- this.assetTreeTableDialogSetting.assetsSelected = []
}
}
}
diff --git a/src/views/assets/Asset/NodeAssetsUpdateDialog.vue b/src/views/assets/Asset/NodeAssetsUpdateDialog.vue
new file mode 100644
index 000000000..dc3e3ce41
--- /dev/null
+++ b/src/views/assets/Asset/NodeAssetsUpdateDialog.vue
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/views/assets/Domain/DomainDetail/GatewayCreateUpdate.vue b/src/views/assets/Domain/DomainDetail/GatewayCreateUpdate.vue
index 94d6bff03..90adae37d 100644
--- a/src/views/assets/Domain/DomainDetail/GatewayCreateUpdate.vue
+++ b/src/views/assets/Domain/DomainDetail/GatewayCreateUpdate.vue
@@ -52,7 +52,6 @@ export default {
}
},
password: {
- helpText: this.$t('assets.PasswordWithoutSpecialCharHelpText'),
hidden: (formValue) => {
if (!this.$route.params.id) {
return false
diff --git a/src/views/assets/SystemUser/SystemUserCreateUpdate/AdminUser/index.vue b/src/views/assets/SystemUser/SystemUserCreateUpdate/AdminUser/index.vue
index 94f291e48..92a5890e7 100644
--- a/src/views/assets/SystemUser/SystemUserCreateUpdate/AdminUser/index.vue
+++ b/src/views/assets/SystemUser/SystemUserCreateUpdate/AdminUser/index.vue
@@ -1,5 +1,5 @@
-
+