mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-16 11:26:14 +00:00
Compare commits
49 Commits
pr@dev@k8s
...
v3.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e52c37ae1 | ||
|
|
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'),
|
helpText: this.$t('accounts.AccountPush.WindowsPushHelpText'),
|
||||||
hidden: () => {
|
hidden: () => {
|
||||||
const automation = this.iPlatform.automation || {}
|
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: {
|
params: {
|
||||||
@@ -280,16 +283,6 @@ export default {
|
|||||||
return secretTypes.indexOf(item.value) > -1
|
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) {
|
confirm(form) {
|
||||||
const secretType = form.secret_type || ''
|
const secretType = form.secret_type || ''
|
||||||
if (secretType !== 'password') {
|
if (secretType !== 'password') {
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-button
|
<el-button
|
||||||
v-show="!isShow"
|
v-show="!iShowSelect"
|
||||||
type="text"
|
|
||||||
class="button-text"
|
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
@click="isShow=true"
|
class="button-text"
|
||||||
|
type="text"
|
||||||
|
@click="iShowSelect=true"
|
||||||
>
|
>
|
||||||
{{ iLabel }}
|
{{ iLabel }}
|
||||||
<svg-icon class-name="icon" icon-class="switch" />
|
<svg-icon class-name="icon" icon-class="switch" />
|
||||||
</el-button>
|
</el-button>
|
||||||
<Select2
|
<Select2
|
||||||
v-show="isShow"
|
v-show="iShowSelect"
|
||||||
ref="select2"
|
ref="select2"
|
||||||
v-model="iValue"
|
v-model="iValue"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
@@ -41,7 +41,7 @@ export default {
|
|||||||
},
|
},
|
||||||
showSelect: {
|
showSelect: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: false
|
||||||
},
|
},
|
||||||
disabled: {
|
disabled: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -50,8 +50,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isShow: this.showSelect,
|
iShowSelect: this.showSelect,
|
||||||
iLabel: this.label
|
iLabel: this.label || '-'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -67,14 +67,14 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
const { path } = this.$route
|
const { path } = this.$route
|
||||||
if (hasUUID(path) && this.value) {
|
if (hasUUID(path) && this.value) {
|
||||||
this.isShow = false
|
this.iShowSelect = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onSelectChange(val) {
|
onSelectChange(val) {
|
||||||
const options = this.$refs.select2.options.filter(item => item.value === val)
|
const options = this.$refs.select2.options.filter(item => item.value === val)
|
||||||
const label = options.length > 0 ? options[0].label : ''
|
const label = options.length > 0 ? options[0].label : ''
|
||||||
this.isShow = false
|
this.iShowSelect = false
|
||||||
this.iLabel = val ? label : '-'
|
this.iLabel = val ? label : '-'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,8 +84,7 @@ export default {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.button-text {
|
.button-text {
|
||||||
color: #676a6c;
|
color: #676a6c;
|
||||||
padding-left: 0!important;
|
padding: 5px!important;
|
||||||
padding-right: 0!important;
|
|
||||||
}
|
}
|
||||||
.icon {
|
.icon {
|
||||||
color: #676a6c!important;
|
color: #676a6c!important;
|
||||||
|
|||||||
@@ -229,7 +229,7 @@
|
|||||||
"AssetTree": "资产树",
|
"AssetTree": "资产树",
|
||||||
"CustomTree": "自定义树",
|
"CustomTree": "自定义树",
|
||||||
"BuiltinTree": "类型树",
|
"BuiltinTree": "类型树",
|
||||||
"UserSwitchFrom": "用户切换自",
|
"UserSwitchFrom": "切换自",
|
||||||
"sshkeyAccount": "密钥账号",
|
"sshkeyAccount": "密钥账号",
|
||||||
"passwordAccount": "密码账号",
|
"passwordAccount": "密码账号",
|
||||||
"Category": "类别",
|
"Category": "类别",
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
:visible.sync="showViewSecretDialog"
|
:visible.sync="showViewSecretDialog"
|
||||||
/>
|
/>
|
||||||
<AutomationParamsForm
|
<AutomationParamsForm
|
||||||
:visible.sync="autoPushVisible"
|
|
||||||
:has-button="false"
|
:has-button="false"
|
||||||
:method="pushAccountMethod"
|
:method="pushAccountMethod"
|
||||||
|
:visible.sync="autoPushVisible"
|
||||||
@canSetting="onCanSetting"
|
@canSetting="onCanSetting"
|
||||||
@submit="onSubmit"
|
@submit="onSubmit"
|
||||||
/>
|
/>
|
||||||
@@ -45,8 +45,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const vm = this
|
const vm = this
|
||||||
const filterSuFrom = ['database', 'device', 'cloud', 'web', 'windows']
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
needSetAutoPushParams: false,
|
needSetAutoPushParams: false,
|
||||||
autoPushVisible: false,
|
autoPushVisible: false,
|
||||||
@@ -64,7 +62,7 @@ export default {
|
|||||||
change: (val) => {
|
change: (val) => {
|
||||||
this.$axios.patch(
|
this.$axios.patch(
|
||||||
`/api/v1/accounts/accounts/${this.object.id}/`,
|
`/api/v1/accounts/accounts/${this.object.id}/`,
|
||||||
{ is_active: val }
|
{ is_active: val, name: this.object.name }
|
||||||
).then(res => {
|
).then(res => {
|
||||||
this.$message.success(this.$tc('common.updateSuccessMsg'))
|
this.$message.success(this.$tc('common.updateSuccessMsg'))
|
||||||
})
|
})
|
||||||
@@ -184,14 +182,15 @@ export default {
|
|||||||
multiple: false,
|
multiple: false,
|
||||||
clearable: true,
|
clearable: true,
|
||||||
model: vm.object.su_from?.id || '',
|
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: {
|
ajax: {
|
||||||
url: `/api/v1/accounts/accounts/su-from-accounts/?account=${vm.object.id}&fields_size=mini`,
|
url: `/api/v1/accounts/accounts/su-from-accounts/?account=${vm.object.id}&fields_size=mini`,
|
||||||
transformOption: (item) => {
|
transformOption: (item) => {
|
||||||
return { label: item.name + '(' + item.username + ')', value: item.id }
|
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({
|
callbacks: Object.freeze({
|
||||||
change: (value) => {
|
change: (value) => {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default {
|
|||||||
is_periodic: true,
|
is_periodic: true,
|
||||||
interval: 24,
|
interval: 24,
|
||||||
hostname_strategy: 'instance_name_partial_ip',
|
hostname_strategy: 'instance_name_partial_ip',
|
||||||
ip_network_segment_group: '*'
|
ip_network_segment_group: ['*']
|
||||||
},
|
},
|
||||||
fields: [
|
fields: [
|
||||||
[this.$t('common.Basic'), ['name']],
|
[this.$t('common.Basic'), ['name']],
|
||||||
@@ -123,7 +123,7 @@ export default {
|
|||||||
const [name, port] = i.split('/')
|
const [name, port] = i.split('/')
|
||||||
return { name, port }
|
return { name, port }
|
||||||
})
|
})
|
||||||
formValue.ip_network_segment_group = formValue.ip_network_segment_group.toString()
|
|
||||||
return formValue
|
return formValue
|
||||||
},
|
},
|
||||||
cleanFormValue(value) {
|
cleanFormValue(value) {
|
||||||
|
|||||||
@@ -24,23 +24,6 @@ export default {
|
|||||||
const vm = this
|
const vm = this
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
nameComponentMap: {
|
|
||||||
host: {
|
|
||||||
icon: 'fa-inbox'
|
|
||||||
},
|
|
||||||
device: {
|
|
||||||
icon: 'fa-microchip'
|
|
||||||
},
|
|
||||||
database: {
|
|
||||||
icon: 'fa-database'
|
|
||||||
},
|
|
||||||
cloud: {
|
|
||||||
icon: 'fa-cloud'
|
|
||||||
},
|
|
||||||
web: {
|
|
||||||
icon: 'fa-globe'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
tab: {
|
tab: {
|
||||||
submenu: [],
|
submenu: [],
|
||||||
activeMenu: 'host'
|
activeMenu: 'host'
|
||||||
@@ -106,9 +89,7 @@ export default {
|
|||||||
hasBulkDelete: false,
|
hasBulkDelete: false,
|
||||||
hasRightActions: true,
|
hasRightActions: true,
|
||||||
createRoute: 'PlatformCreate',
|
createRoute: 'PlatformCreate',
|
||||||
canCreate: () => {
|
canCreate: () => this.$hasPerm('assets.add_platform'),
|
||||||
return this.$hasPerm('assets.add_platform')
|
|
||||||
},
|
|
||||||
handleImportClick: ({ selectedRows }) => {
|
handleImportClick: ({ selectedRows }) => {
|
||||||
this.$eventBus.$emit('showImportDialog', {
|
this.$eventBus.$emit('showImportDialog', {
|
||||||
selectedRows,
|
selectedRows,
|
||||||
@@ -135,7 +116,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
try {
|
try {
|
||||||
await this.setCategories()
|
await this.setCategoriesTab()
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
@@ -150,15 +131,23 @@ export default {
|
|||||||
return item.category === this.tab.activeMenu
|
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')
|
const state = await this.$store.dispatch('assets/getAssetCategories')
|
||||||
for (const item of state.assetCategories) {
|
for (const item of state.assetCategories) {
|
||||||
const name = item.value
|
this.tab.submenu.push({
|
||||||
this.nameComponentMap[name]['name'] = name
|
name: item.value,
|
||||||
this.nameComponentMap[name]['title'] = item.label
|
title: item.label,
|
||||||
|
icon: categoryIcon[item.value]
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tab.submenu = _.toArray(this.nameComponentMap)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user