mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-19 06:29:54 +00:00
Compare commits
56 Commits
pr@dev@k8s
...
v3.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35ac740a60 | ||
|
|
f031760d81 | ||
|
|
b902ba26be | ||
|
|
7b61a4314c | ||
|
|
6039e240ac | ||
|
|
adb10b014f | ||
|
|
5de84a2681 | ||
|
|
d43b43ade7 | ||
|
|
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') {
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ export default {
|
|||||||
customTreeHeaderName: this.$t('assets.AssetTree'),
|
customTreeHeaderName: this.$t('assets.AssetTree'),
|
||||||
async: {
|
async: {
|
||||||
enable: true,
|
enable: true,
|
||||||
url: (process.env.VUE_APP_ENV === 'production') ? (`${this.setting.treeUrl}`) : (`${process.env.VUE_APP_BASE_API}${this.setting.treeUrl}`),
|
url: (process.env.VUE_APP_ENV === 'production')
|
||||||
|
? (`${this.setting.treeUrl}`)
|
||||||
|
: (`${process.env.VUE_APP_BASE_API}${this.setting.treeUrl}`),
|
||||||
autoParam: ['id=key', 'name=n', 'level=lv'],
|
autoParam: ['id=key', 'name=n', 'level=lv'],
|
||||||
type: 'get',
|
type: 'get',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -206,7 +208,9 @@ export default {
|
|||||||
this.showRMenu('root', event.clientX, event.clientY)
|
this.showRMenu('root', event.clientX, event.clientY)
|
||||||
} else if (treeNode && !treeNode.noR) {
|
} else if (treeNode && !treeNode.noR) {
|
||||||
this.zTree.selectNode(treeNode)
|
this.zTree.selectNode(treeNode)
|
||||||
|
if (treeNode.meta?.data?.id) {
|
||||||
this.currentNodeId = treeNode.meta.data.id
|
this.currentNodeId = treeNode.meta.data.id
|
||||||
|
}
|
||||||
this.showRMenu('node', event.clientX, event.clientY)
|
this.showRMenu('node', event.clientX, event.clientY)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -284,7 +288,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.rmenu {
|
.rmenu {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -296,20 +300,20 @@ export default {
|
|||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rmenu > a:hover, .dropdown-menu > a:focus {
|
.rmenu > a:hover, .dropdown-menu > a:focus {
|
||||||
color: #262626;
|
color: #262626;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rmenu:hover {
|
.rmenu:hover {
|
||||||
background-color: #f5f7fa;
|
background-color: #f5f7fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.data-z-tree >>> .fa {
|
.data-z-tree >>> .fa {
|
||||||
width: 10px;
|
width: 10px;
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -88,10 +88,12 @@ export default {
|
|||||||
default: () => ([])
|
default: () => ([])
|
||||||
},
|
},
|
||||||
readonly: {
|
readonly: {
|
||||||
|
// 这个是在详情中,不可编辑,包括所有
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
settingReadonly: {
|
settingReadonly: {
|
||||||
|
// 这个是在资产添加时设置协议使用,不能修改 setting
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
@@ -144,6 +146,11 @@ export default {
|
|||||||
},
|
},
|
||||||
items: {
|
items: {
|
||||||
handler(value) {
|
handler(value) {
|
||||||
|
if (this.settingReadonly) {
|
||||||
|
value = value.map(i => {
|
||||||
|
return { name: i.name, port: i.port }
|
||||||
|
})
|
||||||
|
}
|
||||||
this.$emit('input', value)
|
this.$emit('input', value)
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
@@ -152,6 +152,8 @@ export default {
|
|||||||
if (i.name === 'http') {
|
if (i.name === 'http') {
|
||||||
i.display_name = 'http(s)'
|
i.display_name = 'http(s)'
|
||||||
}
|
}
|
||||||
|
// 这个不删除会导致时,把 platform id 提交成 asset 的
|
||||||
|
delete i['id']
|
||||||
return i
|
return i
|
||||||
})
|
})
|
||||||
const protocolChoices = this.defaultConfig.fieldsMeta.protocols.el.choices
|
const protocolChoices = this.defaultConfig.fieldsMeta.protocols.el.choices
|
||||||
|
|||||||
@@ -123,17 +123,8 @@ export default {
|
|||||||
}
|
}
|
||||||
attrs[item] = encryptPassword(value)
|
attrs[item] = encryptPassword(value)
|
||||||
}
|
}
|
||||||
const toListFields = ['ip_group']
|
if (Array.isArray(attrs.ip_group)) {
|
||||||
for (const item of toListFields) {
|
values.attrs.ip_group = attrs.ip_group.filter(Boolean)
|
||||||
let value = attrs[item]
|
|
||||||
if (!value) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
value = value?.split(',') || []
|
|
||||||
value = value.filter((value, index) => {
|
|
||||||
if (value) return true
|
|
||||||
})
|
|
||||||
attrs[item] = value
|
|
||||||
}
|
}
|
||||||
return values
|
return values
|
||||||
},
|
},
|
||||||
@@ -141,9 +132,6 @@ export default {
|
|||||||
if (!formValue.attrs) {
|
if (!formValue.attrs) {
|
||||||
return formValue
|
return formValue
|
||||||
}
|
}
|
||||||
if (Array.isArray(formValue.attrs.ip_group)) {
|
|
||||||
formValue.attrs.ip_group = formValue.attrs.ip_group.toString()
|
|
||||||
}
|
|
||||||
return formValue
|
return formValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,19 +70,14 @@ export default {
|
|||||||
],
|
],
|
||||||
successUrl: { name: 'Settings', params: { activeMenu: 'EmailContent' }},
|
successUrl: { name: 'Settings', params: { activeMenu: 'EmailContent' }},
|
||||||
fieldsMeta: {},
|
fieldsMeta: {},
|
||||||
afterGetFormValue(validValues) {
|
|
||||||
validValues.SECURITY_LOGIN_IP_BLACK_LIST = validValues.SECURITY_LOGIN_IP_BLACK_LIST.toString()
|
|
||||||
validValues.SECURITY_LOGIN_IP_WHITE_LIST = validValues.SECURITY_LOGIN_IP_WHITE_LIST.toString()
|
|
||||||
return validValues
|
|
||||||
},
|
|
||||||
cleanFormValue(value) {
|
cleanFormValue(value) {
|
||||||
const ipBlackList = value.SECURITY_LOGIN_IP_BLACK_LIST
|
const ipBlackList = value.SECURITY_LOGIN_IP_BLACK_LIST
|
||||||
const ipWhiltList = value.SECURITY_LOGIN_IP_WHITE_LIST
|
const ipWhiltList = value.SECURITY_LOGIN_IP_WHITE_LIST
|
||||||
if (!Array.isArray(ipBlackList)) {
|
if (Array.isArray(ipBlackList)) {
|
||||||
value.SECURITY_LOGIN_IP_BLACK_LIST = ipBlackList ? ipBlackList.split(',') : []
|
value.SECURITY_LOGIN_IP_BLACK_LIST = ipBlackList.filter(Boolean)
|
||||||
}
|
}
|
||||||
if (!Array.isArray(ipWhiltList)) {
|
if (Array.isArray(ipWhiltList)) {
|
||||||
value.SECURITY_LOGIN_IP_WHITE_LIST = ipWhiltList ? ipWhiltList.split(',') : []
|
value.SECURITY_LOGIN_IP_WHITE_LIST = ipWhiltList.filter(Boolean)
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
v-bind="$data"
|
v-bind="$data"
|
||||||
:create-success-next-route="successUrl"
|
:create-success-next-route="successUrl"
|
||||||
:update-success-next-route="successUrl"
|
:update-success-next-route="successUrl"
|
||||||
:after-get-form-value="afterGetFormValue"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -18,7 +17,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
url: '/api/v1/terminal/endpoint-rules/',
|
url: '/api/v1/terminal/endpoint-rules/',
|
||||||
initial: {
|
initial: {
|
||||||
ip_group: '*'
|
ip_group: ['*']
|
||||||
},
|
},
|
||||||
successUrl: { name: 'TerminalSetting', params: { activeMenu: 'EndpointRuleList' }},
|
successUrl: { name: 'TerminalSetting', params: { activeMenu: 'EndpointRuleList' }},
|
||||||
fields: [
|
fields: [
|
||||||
@@ -41,14 +40,10 @@ export default {
|
|||||||
},
|
},
|
||||||
hasDetailInMsg: false,
|
hasDetailInMsg: false,
|
||||||
cleanFormValue(value) {
|
cleanFormValue(value) {
|
||||||
if (!Array.isArray(value.ip_group)) {
|
if (Array.isArray(value.ip_group)) {
|
||||||
value.ip_group = value.ip_group ? value.ip_group.split(',') : []
|
value.ip_group = value.ip_group.filter(Boolean)
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
},
|
|
||||||
afterGetFormValue(formValue) {
|
|
||||||
formValue.ip_group = formValue.ip_group?.toString()
|
|
||||||
return formValue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ export default {
|
|||||||
if (!validValues?.meta?.HOSTS) {
|
if (!validValues?.meta?.HOSTS) {
|
||||||
return validValues
|
return validValues
|
||||||
}
|
}
|
||||||
validValues.meta.HOSTS = validValues.meta.HOSTS.toString()
|
|
||||||
return validValues
|
return validValues
|
||||||
},
|
},
|
||||||
cleanFormValue(value) {
|
cleanFormValue(value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user