mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-07 18:08:50 +00:00
Compare commits
49 Commits
pr@v3@fixe
...
v3.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ccfe6a18a | ||
|
|
955dabb02f | ||
|
|
f7901fcdf8 | ||
|
|
6650ec8da0 | ||
|
|
cb75a1620a | ||
|
|
8f9d1f4ddf | ||
|
|
44da5da8b6 | ||
|
|
b8326ef880 | ||
|
|
45448513cb | ||
|
|
3117046342 | ||
|
|
b68aecb5cc | ||
|
|
1c9b155d97 | ||
|
|
75b1be9864 | ||
|
|
615c3c1cf4 | ||
|
|
4d82231af4 | ||
|
|
c6cf6571b6 | ||
|
|
8ea990d070 | ||
|
|
f4a32170d5 | ||
|
|
073508675e | ||
|
|
1d6ca0a93a | ||
|
|
36aea652d6 | ||
|
|
1a42ce90ab | ||
|
|
31a401b55d | ||
|
|
582a84178d | ||
|
|
9b9f7c936c | ||
|
|
2a6100957f | ||
|
|
16606d6a27 | ||
|
|
0a612f50e6 | ||
|
|
fe36fa9390 | ||
|
|
ba109900ec | ||
|
|
ec7768267f | ||
|
|
cc58b374ab | ||
|
|
04ffbb8fd6 | ||
|
|
49880f6739 | ||
|
|
e6f98d58c4 | ||
|
|
fd1f16d43c | ||
|
|
968b2415b1 | ||
|
|
776090d6ba | ||
|
|
3a37952288 | ||
|
|
62b8fc0e3b | ||
|
|
b2028869cb | ||
|
|
5277a725f8 | ||
|
|
f137788c1a | ||
|
|
f7d17c8de7 | ||
|
|
feea70b0be | ||
|
|
04696ef3d6 | ||
|
|
1731f4f788 | ||
|
|
6f25d93909 | ||
|
|
46461ec324 |
@@ -204,7 +204,10 @@ export default {
|
||||
helpText: this.$t('accounts.AccountPush.WindowsPushHelpText'),
|
||||
hidden: () => {
|
||||
const automation = this.iPlatform.automation || {}
|
||||
return !automation.push_account_enabled || !automation.ansible_enabled || !this.$hasPerm('accounts.push_account') || this.addTemplate
|
||||
return !automation.push_account_enabled ||
|
||||
!automation.ansible_enabled ||
|
||||
!this.$hasPerm('accounts.push_account') ||
|
||||
this.addTemplate
|
||||
}
|
||||
},
|
||||
params: {
|
||||
@@ -280,16 +283,6 @@ export default {
|
||||
return secretTypes.indexOf(item.value) > -1
|
||||
})
|
||||
},
|
||||
controlShowField() {
|
||||
const privileged = ['privileged']
|
||||
let suFrom = ['su_from']
|
||||
const filterSuFrom = ['database', 'device', 'cloud', 'web', 'windows']
|
||||
const asset = this?.asset || {}
|
||||
if (filterSuFrom.includes(asset?.category?.value) || filterSuFrom.includes(asset?.type?.value)) {
|
||||
suFrom = []
|
||||
}
|
||||
return [...privileged, ...suFrom]
|
||||
},
|
||||
confirm(form) {
|
||||
const secretType = form.secret_type || ''
|
||||
if (secretType !== 'password') {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button
|
||||
v-show="!isShow"
|
||||
type="text"
|
||||
class="button-text"
|
||||
v-show="!iShowSelect"
|
||||
:disabled="disabled"
|
||||
@click="isShow=true"
|
||||
class="button-text"
|
||||
type="text"
|
||||
@click="iShowSelect=true"
|
||||
>
|
||||
{{ iLabel }}
|
||||
<svg-icon class-name="icon" icon-class="switch" />
|
||||
</el-button>
|
||||
<Select2
|
||||
v-show="isShow"
|
||||
v-show="iShowSelect"
|
||||
ref="select2"
|
||||
v-model="iValue"
|
||||
:disabled="disabled"
|
||||
@@ -41,7 +41,7 @@ export default {
|
||||
},
|
||||
showSelect: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: false
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
@@ -50,8 +50,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShow: this.showSelect,
|
||||
iLabel: this.label
|
||||
iShowSelect: this.showSelect,
|
||||
iLabel: this.label || '-'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -67,14 +67,14 @@ export default {
|
||||
created() {
|
||||
const { path } = this.$route
|
||||
if (hasUUID(path) && this.value) {
|
||||
this.isShow = false
|
||||
this.iShowSelect = false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSelectChange(val) {
|
||||
const options = this.$refs.select2.options.filter(item => item.value === val)
|
||||
const label = options.length > 0 ? options[0].label : ''
|
||||
this.isShow = false
|
||||
this.iShowSelect = false
|
||||
this.iLabel = val ? label : '-'
|
||||
}
|
||||
}
|
||||
@@ -84,8 +84,7 @@ export default {
|
||||
<style scoped>
|
||||
.button-text {
|
||||
color: #676a6c;
|
||||
padding-left: 0!important;
|
||||
padding-right: 0!important;
|
||||
padding: 5px!important;
|
||||
}
|
||||
.icon {
|
||||
color: #676a6c!important;
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
"AssetTree": "资产树",
|
||||
"CustomTree": "自定义树",
|
||||
"BuiltinTree": "类型树",
|
||||
"UserSwitchFrom": "用户切换自",
|
||||
"UserSwitchFrom": "切换自",
|
||||
"sshkeyAccount": "密钥账号",
|
||||
"passwordAccount": "密码账号",
|
||||
"Category": "类别",
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
:visible.sync="showViewSecretDialog"
|
||||
/>
|
||||
<AutomationParamsForm
|
||||
:visible.sync="autoPushVisible"
|
||||
:has-button="false"
|
||||
:method="pushAccountMethod"
|
||||
:visible.sync="autoPushVisible"
|
||||
@canSetting="onCanSetting"
|
||||
@submit="onSubmit"
|
||||
/>
|
||||
@@ -45,8 +45,6 @@ export default {
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
const filterSuFrom = ['database', 'device', 'cloud', 'web', 'windows']
|
||||
|
||||
return {
|
||||
needSetAutoPushParams: false,
|
||||
autoPushVisible: false,
|
||||
@@ -64,7 +62,7 @@ export default {
|
||||
change: (val) => {
|
||||
this.$axios.patch(
|
||||
`/api/v1/accounts/accounts/${this.object.id}/`,
|
||||
{ is_active: val }
|
||||
{ is_active: val, name: this.object.name }
|
||||
).then(res => {
|
||||
this.$message.success(this.$tc('common.updateSuccessMsg'))
|
||||
})
|
||||
@@ -184,14 +182,15 @@ export default {
|
||||
multiple: false,
|
||||
clearable: true,
|
||||
model: vm.object.su_from?.id || '',
|
||||
label: vm.object.su_from?.name ? vm.object.su_from?.name + `(${vm.object.su_from?.username})` : '',
|
||||
label: vm.object.su_from?.name ? vm.object.su_from?.name + `(${vm.object.su_from?.username})` : '-',
|
||||
ajax: {
|
||||
url: `/api/v1/accounts/accounts/su-from-accounts/?account=${vm.object.id}&fields_size=mini`,
|
||||
transformOption: (item) => {
|
||||
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||
}
|
||||
},
|
||||
disabled: !vm.$hasPerm('accounts.verify_account') || filterSuFrom.includes(vm.object?.asset?.category?.value) || filterSuFrom.includes(vm.object?.asset?.type?.value)
|
||||
disabled: !vm.$hasPerm('accounts.change_account') ||
|
||||
!vm.object.asset.auto_config?.su_enabled
|
||||
},
|
||||
callbacks: Object.freeze({
|
||||
change: (value) => {
|
||||
|
||||
@@ -19,7 +19,7 @@ export default {
|
||||
is_periodic: true,
|
||||
interval: 24,
|
||||
hostname_strategy: 'instance_name_partial_ip',
|
||||
ip_network_segment_group: '*'
|
||||
ip_network_segment_group: ['*']
|
||||
},
|
||||
fields: [
|
||||
[this.$t('common.Basic'), ['name']],
|
||||
@@ -123,7 +123,7 @@ export default {
|
||||
const [name, port] = i.split('/')
|
||||
return { name, port }
|
||||
})
|
||||
formValue.ip_network_segment_group = formValue.ip_network_segment_group.toString()
|
||||
|
||||
return formValue
|
||||
},
|
||||
cleanFormValue(value) {
|
||||
|
||||
@@ -24,23 +24,6 @@ export default {
|
||||
const vm = this
|
||||
return {
|
||||
loading: true,
|
||||
nameComponentMap: {
|
||||
host: {
|
||||
icon: 'fa-inbox'
|
||||
},
|
||||
device: {
|
||||
icon: 'fa-microchip'
|
||||
},
|
||||
database: {
|
||||
icon: 'fa-database'
|
||||
},
|
||||
cloud: {
|
||||
icon: 'fa-cloud'
|
||||
},
|
||||
web: {
|
||||
icon: 'fa-globe'
|
||||
}
|
||||
},
|
||||
tab: {
|
||||
submenu: [],
|
||||
activeMenu: 'host'
|
||||
@@ -106,9 +89,7 @@ export default {
|
||||
hasBulkDelete: false,
|
||||
hasRightActions: true,
|
||||
createRoute: 'PlatformCreate',
|
||||
canCreate: () => {
|
||||
return this.$hasPerm('assets.add_platform')
|
||||
},
|
||||
canCreate: () => this.$hasPerm('assets.add_platform'),
|
||||
handleImportClick: ({ selectedRows }) => {
|
||||
this.$eventBus.$emit('showImportDialog', {
|
||||
selectedRows,
|
||||
@@ -135,7 +116,7 @@ export default {
|
||||
},
|
||||
async mounted() {
|
||||
try {
|
||||
await this.setCategories()
|
||||
await this.setCategoriesTab()
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
@@ -150,15 +131,23 @@ export default {
|
||||
return item.category === this.tab.activeMenu
|
||||
})
|
||||
},
|
||||
async setCategories() {
|
||||
async setCategoriesTab() {
|
||||
const categoryIcon = {
|
||||
host: 'fa-inbox',
|
||||
device: 'fa-microchip',
|
||||
database: 'fa-database',
|
||||
cloud: 'fa-cloud',
|
||||
web: 'fa-globe',
|
||||
custom: 'fa-th'
|
||||
}
|
||||
const state = await this.$store.dispatch('assets/getAssetCategories')
|
||||
for (const item of state.assetCategories) {
|
||||
const name = item.value
|
||||
this.nameComponentMap[name]['name'] = name
|
||||
this.nameComponentMap[name]['title'] = item.label
|
||||
this.tab.submenu.push({
|
||||
name: item.value,
|
||||
title: item.label,
|
||||
icon: categoryIcon[item.value]
|
||||
})
|
||||
}
|
||||
|
||||
this.tab.submenu = _.toArray(this.nameComponentMap)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user