Merge pull request #888 from jumpserver/dev

v2.12.0 rc2
This commit is contained in:
Jiangjie.Bai 2021-07-12 18:29:50 +08:00 committed by GitHub
commit c6cde723ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 14 deletions

View File

@ -29,7 +29,7 @@ export default {
},
data() {
return {
assetUserUrl: `/api/v1/assets/accounts/?asset_id=${this.object.id}&latest=1`,
assetUserUrl: `/api/v1/assets/accounts/?asset=${this.object.id}`,
quickActions: [
{
title: this.$t('assets.TestAssetsConnective'),
@ -40,7 +40,7 @@ export default {
callbacks: {
click: function() {
this.$axios.post(
`/api/v1/assets/accounts/tasks/?asset_id=${this.object.id}&latest=1`,
`/api/v1/assets/accounts/tasks/?asset=${this.object.id}`,
{ action: 'test' }
).then(res => {
window.open(`/#/ops/celery/task/${res.task}/log/`, '', 'width=900,height=600')

View File

@ -9,14 +9,14 @@
<script>
import { GenericDetailPage, TabPage } from '@/layout/components'
import Detail from './Detail.vue'
import AssetUserList from './AssetUserList.vue'
import Account from './Account.vue'
export default {
name: 'AssetListDetail',
components: {
GenericDetailPage,
TabPage,
Detail,
AssetUserList
Account
},
data() {
return {
@ -29,8 +29,8 @@ export default {
name: 'Detail'
},
{
title: this.$t('assets.AssetUserList'),
name: 'AssetUserList'
title: this.$t('assets.AccountList'),
name: 'Account'
}
],
hasRightSide: true,

View File

@ -147,8 +147,8 @@ export default {
formatter: ChoicesFormatter,
formatterArgs: {
iconChoices: {
ok: 'fa-times text-danger',
failed: 'fa-check text-primary',
ok: 'fa-check text-primary',
failed: 'fa-times text-danger',
unknown: 'fa-circle text-warning'
},
hasTips: true,

View File

@ -24,16 +24,18 @@ function getFields() {
},
rules: [Object.assign({}, Required)],
hidden: (form) => {
if (['mysql', 'postgresql', 'mariadb', 'oracle'].includes(form.protocol)) {
this.fieldsMeta.username.rules[0].required = true
} else if (['vnc'].includes(form.protocol)) {
if (['vnc'].includes(form.protocol)) {
this.fieldsMeta.username.rules[0].required = false
} else if (form.login_mode === 'manual') {
this.fieldsMeta.username.rules[0].required = false
} else if (form.username_same_with_user) {
this.fieldsMeta.username.rules[0].required = false
} else {
this.fieldsMeta.username.rules[0].required = !(form.login_mode === 'manual' || form.username_same_with_user)
this.fieldsMeta.username.rules[0].required = true
}
if (form.username_same_with_user) {
this.fieldsMeta.username.el.disabled = true
form.username = '*'
form.username = ''
} else {
this.fieldsMeta.username.el.disabled = false
}

View File

@ -35,7 +35,8 @@ export default {
},
actions: {
formatterArgs: {
updateRoute: { name: 'SystemUserUpdate', query: { type: 'admin' }}
updateRoute: { name: 'SystemUserUpdate', query: { type: 'admin' }},
cloneRoute: { name: 'SystemUserCreate', query: { type: 'admin' }}
}
}
}