Merge pull request #1940 from jumpserver/dev

v2.24.0-rc2
This commit is contained in:
Jiangjie.Bai
2022-07-15 18:07:37 +08:00
committed by GitHub
14 changed files with 49 additions and 27 deletions

View File

@@ -14,7 +14,7 @@
<slot v-for="item in fields" :slot="`$id:${item.id}`" :name="`$id:${item.id}`" />
<el-form-item v-if="hasButtons" class="form-buttons">
<el-button v-for="button in moreButtons" :key="button.title" size="small" v-bind="button" @click="handleClick(button)">{{ button.title }}</el-button>
<el-button v-for="button in moreButtons" :key="button.title" size="small" v-bind="button" :loading="button.loading" @click="handleClick(button)">{{ button.title }}</el-button>
<el-button v-if="defaultButton && hasReset" size="small" @click="resetForm('form')">{{ $t('common.Reset') }}</el-button>
<el-button v-if="defaultButton && hasSaveContinue" size="small" @click="submitForm('form', true)">{{ $t('common.SaveAndAddAnother') }}</el-button>
<el-button v-if="defaultButton" size="small" :loading="isSubmitting" type="primary" @click="submitForm('form')">{{ $t('common.Submit') }}</el-button>
@@ -101,7 +101,7 @@ export default {
}
const form = this.$refs['form']
const values = form.getFormValue()
callback(values, form)
callback(values, form, button)
}
}
}

View File

@@ -154,6 +154,9 @@ export default {
}
if (this.ConfirmType === 'mfa') {
this.Select = this.Content.filter(item => !item.disabled)[0].name
if (this.Select === 'sms') {
this.smsWidth = 6
}
this.HelpText = this.Content.filter(item => !item.disabled)[0].placeholder
} else if (this.ConfirmType === 'password') {
this.Select = this.$t('setting.password')

View File

@@ -309,6 +309,9 @@ export default {
.msg-detail-txt {
margin-bottom: 20px;
line-height: 25px;
&>>> a {
color: var(--color-success)!important;
}
}
}

View File

@@ -9,6 +9,7 @@
--menu-hover: #293846;
--submenu-bg: #1f2d3d;
--submenu-hover: #001528;
--menu-active-text: white;
--menu-active-left: #1ab394;
}
@@ -23,5 +24,6 @@
--menu-hover: #293846;
--submenu-bg: #1f2d3d;
--submenu-hover: #001528;
--menu-active-text: white;
--menu-active-left: #1ab394;
}

View File

@@ -23,15 +23,17 @@ export default {
moreButtons: [
{
title: this.$t('setting.dingTalkTest'),
callback: function(value, form) {
loading: false,
callback: function(value, form, btn) {
btn.loading = true
vm.$axios.post(
'/api/v1/settings/dingtalk/testing/',
value
).then(res => {
vm.$message.success(res['msg'])
}).catch(() => {
this.$log.error('err occur')
})
vm.$log.error('err occur')
}).finally(() => { btn.loading = false })
}
}
],

View File

@@ -25,15 +25,17 @@ export default {
moreButtons: [
{
title: this.$t('setting.feiShuTest'),
callback: function(value, form) {
loading: false,
callback: function(value, form, btn) {
btn.loading = true
vm.$axios.post(
'/api/v1/settings/feishu/testing/',
value
).then(res => {
vm.$message.success(res['msg'])
}).catch(() => {
this.$log.error('err occur')
})
vm.$log.error('err occur')
}).finally(() => { btn.loading = false })
}
}
],

View File

@@ -24,15 +24,17 @@ export default {
moreButtons: [
{
title: this.$t('setting.weComTest'),
callback: function(value, form) {
loading: false,
callback: function(value, form, btn) {
btn.loading = true
vm.$axios.post(
'/api/v1/settings/wecom/testing/',
value
).then(res => {
vm.$message.success(res['msg'])
}).catch(() => {
this.$log.error('err occur')
})
vm.$log.error('err occur')
}).finally(() => { btn.loading = false })
}
}
],

View File

@@ -79,15 +79,17 @@ export default {
moreButtons: [
{
title: this.$t('setting.emailTest'),
callback: function(value, form) {
loading: false,
callback: function(value, form, btn) {
const testValue = {}
testValue['EMAIL_FROM'] = value['EMAIL_FROM']
testValue['EMAIL_RECIPIENT'] = value['EMAIL_RECIPIENT']
btn.loading = true
testEmailSetting(value).then(res => {
vm.$message.success(res['msg'])
}).catch(res => {
vm.$message.error(res['response']['data']['error'])
})
}).finally(() => { btn.loading = false })
}
}
],

View File

@@ -77,16 +77,18 @@ export default {
moreButtons: [
{
title: this.$t('setting.ldapConnectTest'),
callback: function(value, form) {
loading: false,
callback: function(value, form, btn) {
if (value['AUTH_LDAP_BIND_PASSWORD'] === undefined) {
value['AUTH_LDAP_BIND_PASSWORD'] = ''
}
btn.loading = true
testLdapSetting(value).then(resp => {
this.$message.success(resp)
}).catch(err => {
const response = err.response
this.$message.error(response.data)
})
}).finally(() => { btn.loading = false })
}.bind(this)
},
{

View File

@@ -20,15 +20,17 @@ export default {
moreButtons: [
{
title: this.$t('common.Test'),
callback: function(value, form) {
loading: false,
callback: function(value, form, btn) {
btn.loading = true
vm.$axios.post(
`/api/v1/settings/alibaba/testing/`,
value
).then(res => {
vm.$message.success(res['msg'])
}).catch(() => {
this.$log.error('err occur')
})
vm.$log.error('err occur')
}).finally(() => { btn.loading = false })
}
}
],

View File

@@ -20,15 +20,17 @@ export default {
moreButtons: [
{
title: this.$t('common.Test'),
callback: function(value, form) {
loading: false,
callback: function(value, form, btn) {
btn.loading = true
vm.$axios.post(
`/api/v1/settings/tencent/testing/`,
value
).then(res => {
vm.$message.success(res['msg'])
}).catch(() => {
this.$log.error('err occur')
})
vm.$log.error('err occur')
}).finally(() => { btn.loading = false })
}
}
],

View File

@@ -68,7 +68,7 @@ export default {
value: this.object.apply_applications,
ajax: {
url: function() {
const oid = this.object.org_id === '' ? 'DEFAULT' : this.object.org_id
const oid = this.object.org_id
return `/api/v1/applications/applications/?oid=${oid}&type=${this.object.apply_type}`
}.bind(this)(),
transformOption: (item) => {
@@ -81,7 +81,7 @@ export default {
value: this.object.apply_system_users,
ajax: {
url: function() {
const oid = this.object.org_id === '' ? 'DEFAULT' : this.object.org_id
const oid = this.object.org_id
const protocol = this.object.apply_category === 'remote_app' ? 'rdp' : this.object.apply_type
return `/api/v1/assets/system-users/?oid=${oid}&protocol=${protocol}`
}.bind(this)(),

View File

@@ -77,7 +77,7 @@ export default {
value: this.object.apply_nodes,
ajax: {
url: (function(object) {
const oid = object.org_id === '' ? 'DEFAULT' : object.org_id
const oid = object.org_id
return `/api/v1/assets/nodes/?oid=${oid}&protocol__in=rdp,vnc,ssh,telnet`
}(this.object)),
transformOption: (item) => {
@@ -90,7 +90,7 @@ export default {
value: this.object.apply_assets,
ajax: {
url: (function(object) {
const oid = object.org_id === '' ? 'DEFAULT' : object.org_id
const oid = object.org_id
return `/api/v1/assets/assets/?oid=${oid}&protocol__in=rdp,vnc,ssh,telnet`
}(this.object)),
transformOption: (item) => {
@@ -103,7 +103,7 @@ export default {
value: this.object.apply_system_users,
ajax: {
url: (function(object) {
const oid = object.org_id === '' ? 'DEFAULT' : object.org_id
const oid = object.org_id
return `/api/v1/assets/system-users/?oid=${oid}&protocol__in=rdp,vnc,ssh,telnet`
}(this.object)),
transformOption: (item) => {

View File

@@ -101,7 +101,7 @@ module.exports = {
},
chainWebpack(config) {
// it can improve the speed of the first screen, it is recommended to turn on preload
// config.plugins.delete('preload')
config.plugins.delete('preload')
// when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch')