Merge pull request #1230 from jumpserver/dev

v2.17.0 rc2
This commit is contained in:
Jiangjie.Bai 2021-12-13 19:48:49 +08:00 committed by GitHub
commit 01e6367196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 72 additions and 22 deletions

View File

@ -51,6 +51,10 @@ export default {
type: Array,
default: () => []
},
getUrlQuery: {
type: Boolean,
default: () => true
},
default: {
type: Object,
default: null
@ -132,7 +136,7 @@ export default {
methods: {
// url
checkInTableColumns() {
const routeQuery = this.$route?.query
const routeQuery = this.getUrlQuery ? this.$route?.query : {}
const routeQueryKeys = Object.keys(routeQuery)
const keys = {}
if (routeQueryKeys.length < 1) return keys
@ -208,9 +212,11 @@ export default {
this.$set(this.filterTags, this.filterKey, tag)
this.$emit('tagSearch', this.filterMaps)
let newQuery = _.cloneDeep(this.$route.query)
newQuery = { ...newQuery, [this.filterKey]: encodeURI(this.filterValue) }
this.$router.replace({ query: newQuery })
if (this.getUrlQuery) {
let newQuery = _.cloneDeep(this.$route.query)
newQuery = { ...newQuery, [this.filterKey]: encodeURI(this.filterValue) }
this.$router.replace({ query: newQuery })
}
this.filterKey = ''
this.filterValue = ''

View File

@ -914,6 +914,8 @@
"SAML2Auth": "SAML2 认证",
"authSAML2Xml": "IDP metadata XML",
"authSAML2MetadataUrl": "IDP metadata URL",
"authSAML2AdvancedSettings": "高级配置",
"IdpMetadataHelpText": "IDP metadata URL 和 IDP metadata XML参数二选一即可IDP metadata URL的优先级高",
"authCASAttrMap": "用户属性映射",
"SignaturesAndTemplates": "Signatures and Templates",
"unselectedUser": "没有选择用户",
@ -1227,8 +1229,8 @@
"HasRead": "是否已读",
"Sender": "发送人",
"MarkAsRead": "标记已读",
"OneClickRead": "一键已读",
"OneClickReadMsg": "你确定要将已加载的信息标记为已读吗?",
"OneClickRead": "当前已读",
"OneClickReadMsg": "你确定要将当前信息标记为已读吗?",
"NoUnreadMsg": "暂无未读消息",
"SiteMessage": "站内信",
"SMS": "短信"

View File

@ -892,6 +892,8 @@
"SAML2Auth": "SAML2 Auth",
"authSAML2Xml": "IDP metadata XML",
"authSAML2MetadataUrl": "IDP metadata URL",
"IdpMetadataHelpText": "Choose one of IDP metadata URL and IDP metadata XML parameters. IDP metadata URL has high priority",
"authSAML2AdvancedSettings": "Advanced Settings",
"unselectedUser": "Unselected user",
"auto": "Auto",
"basicSetting": "Basic setting",
@ -1187,8 +1189,8 @@
"HasRead": "Has read",
"Sender": "Sender",
"MarkAsRead": "Mark as read",
"OneClickRead": "One Click Read",
"OneClickReadMsg": "Are you sure you want to mark the loaded information as read?",
"OneClickRead": "Currently read",
"OneClickReadMsg": "Are you sure you want to mark the current information as read?",
"NoUnreadMsg": "No unread messages",
"SiteMessage": "Site messages",
"SMS": "SMS"

View File

@ -270,8 +270,8 @@ export default {
overflow: hidden;
color: #000;
padding: 4px 0 0;
line-height: 21px;
max-height: 21px;
line-height: 25px;
max-height: 25px;
display: -webkit-box;
font-size: 12px;
display: block;

View File

@ -116,6 +116,9 @@ export default {
hasExport: false,
hasImport: false,
hasMoreActions: false,
searchConfig: {
getUrlQuery: false
},
moreCreates: {
callback: (option) => {
vm.$router.push({ name: 'AppChangeAuthPlanCreate', query: {

View File

@ -91,7 +91,10 @@ export default {
hasExport: false,
hasMoreActions: false,
createRoute: 'GatherUserTaskCreate',
hasColumnSetting: false
hasColumnSetting: false,
searchConfig: {
getUrlQuery: false
}
}
}
}

View File

@ -34,7 +34,7 @@ export default {
type: {
type: 'select',
options: [{
label: appType,
label: appTypeMeta.title,
value: appType
}],
disabled: true

View File

@ -357,8 +357,7 @@ export default {
this.nodeInfoDialogSetting.items = [
{ key: 'id', label: 'ID', value: res.id },
{ key: 'name', label: this.$t('assets.Name'), value: res.name },
{ key: 'fullName', label: this.$t('assets.FullName'), value: res.full_value },
{ key: 'key', label: this.$t('assets.Key'), value: res.key }
{ key: 'fullName', label: this.$t('assets.FullName'), value: res.full_value }
]
}).catch(error => {
this.$message.error(this.$t('common.getErrorMsg' + ' ' + error))

View File

@ -20,7 +20,7 @@ export default {
return {
tableConfig: {
url: `/api/v1/assets/cmd-filters/${this.object.id}/rules/`,
columns: ['type', 'content', 'priority', 'action', 'comment', 'pattern', 'actions'],
columns: ['type', 'content', 'action', 'priority', 'pattern', 'comment', 'actions'],
columnsMeta: {
type: {
width: '100px'

View File

@ -6,6 +6,7 @@
<el-col :span="10">
<QuickActions type="primary" :actions="quickActions" />
<RelationCard
v-if="!(object.protocol === 'rdp' || object.protocol === 'vnc')"
ref="RelationCard"
v-bind="nodeRelationConfig"
type="info"

View File

@ -54,6 +54,9 @@ export default {
}
},
headerActions: {
searchConfig: {
getUrlQuery: false
},
createRoute: () => {
return {
name: 'SystemUserCreate',

View File

@ -169,7 +169,6 @@ export default {
{ label: this.$t('perms.UserGroups'), value: 'user_group' },
{ label: this.$t('perms.IP'), value: 'ip' },
{ label: this.$t('perms.hostName'), value: 'hostname' },
{ label: this.$t('perms.Node'), value: 'node' },
{ label: this.$t('perms.SystemUser'), value: 'system_user' },
{
label: this.$t('perms.Inherit'), value: 'all',

View File

@ -120,6 +120,9 @@ export default {
datePicker: {
dateEnd: dateTo,
dateStart: dateFrom
},
searchConfig: {
getUrlQuery: false
}
}
}

View File

@ -29,7 +29,7 @@ export default {
url: '/api/v1/settings/setting/?category=saml2',
fields: [
[this.$t('common.Basic'), ['AUTH_SAML2']],
[this.$t('common.Params'), ['SAML2_IDP_METADATA_URL', 'SAML2_IDP_METADATA_XML']],
[this.$t('common.Params'), ['SAML2_IDP_METADATA_URL', 'SAML2_IDP_METADATA_XML', 'SAML2_SP_ADVANCED_SETTINGS']],
[this.$t('common.Certificate'), ['SAML2_SP_CERT_CONTENT', 'SAML2_SP_KEY_CONTENT']],
[this.$t('common.Other'), [
'SAML2_LOGOUT_COMPLETELY', 'AUTH_SAML2_ALWAYS_UPDATE_USER',
@ -42,7 +42,8 @@ export default {
},
SAML2_IDP_METADATA_URL: {
component: 'el-input',
label: this.$t('setting.authSAML2MetadataUrl')
label: this.$t('setting.authSAML2MetadataUrl'),
helpText: this.$t('setting.IdpMetadataHelpText')
},
SAML2_IDP_METADATA_XML: {
component: 'el-input',
@ -52,6 +53,15 @@ export default {
},
label: this.$t('setting.authSAML2Xml')
},
SAML2_SP_ADVANCED_SETTINGS: {
component: 'el-input',
el: {
type: 'textarea',
rows: 3
},
label: this.$t('setting.authSAML2AdvancedSettings'),
rules: [JsonRequired]
},
SAML2_SP_CERT_CONTENT: {
component: UploadKey
},
@ -71,10 +81,12 @@ export default {
submitMethod: () => 'patch',
afterGetFormValue(obj) {
obj.SAML2_RENAME_ATTRIBUTES = JSON.stringify(obj.SAML2_RENAME_ATTRIBUTES)
obj.SAML2_SP_ADVANCED_SETTINGS = JSON.stringify(obj.SAML2_SP_ADVANCED_SETTINGS)
return obj
},
cleanFormValue(data) {
if (data['SAML2_RENAME_ATTRIBUTES']) {
data['SAML2_SP_ADVANCED_SETTINGS'] = JSON.parse(data['SAML2_SP_ADVANCED_SETTINGS'])
data['SAML2_RENAME_ATTRIBUTES'] = JSON.parse(data['SAML2_RENAME_ATTRIBUTES'])
}
return data

View File

@ -218,8 +218,15 @@ export default {
}
},
mounted() {
if (this.$store.state.users.profile.user_all_orgs.length > 0) {
this.initial.org_id = this.$store.state.users.profile.user_all_orgs[0].id
let userAllOrgIds = this.$store.state.users.profile['user_all_orgs']
const currentOrgId = this.$store.getters.currentOrg.id
userAllOrgIds = userAllOrgIds ? userAllOrgIds.map(i => i.id) : []
if (userAllOrgIds.length > 0) {
if (userAllOrgIds.includes(currentOrgId)) {
this.initial.org_id = currentOrgId
} else {
this.initial.org_id = userAllOrgIds[0]
}
}
this.loading = false
},

View File

@ -130,8 +130,15 @@ export default {
}
},
mounted() {
if (this.$store.state.users.profile['user_all_orgs'].length > 0) {
this.initial.org_id = this.$store.state.users.profile['user_all_orgs'][0].id
let userAllOrgIds = this.$store.state.users.profile['user_all_orgs']
const currentOrgId = this.$store.getters.currentOrg.id
userAllOrgIds = userAllOrgIds ? userAllOrgIds.map(i => i.id) : []
if (userAllOrgIds.length > 0) {
if (userAllOrgIds.includes(currentOrgId)) {
this.initial.org_id = currentOrgId
} else {
this.initial.org_id = userAllOrgIds[0]
}
}
this.loading = false
},

View File

@ -55,6 +55,9 @@ export default {
hasBulkDelete: false,
hasImport: false,
hasMoreActions: false,
searchConfig: {
getUrlQuery: false
},
moreCreates: {
callback: (option) => {
vm.$router.push({ name: 'AccountCreate', query: { provider: option.name }})