Skip to content

Commit 4b231f2

Browse files
committed
fix(NativeClusterForm): fix server/agent-config-file-content has not be encoded/decoded
1 parent 3259d79 commit 4b231f2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/views/components/providerForm/NativeClusterForm.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ import useFormManage from '@/composables/useFormManage.js'
103103
import useFormRegist from '@/composables/useFormRegist.js'
104104
import AddonForm from '../baseForm/AddonsForm.vue'
105105
import BooleanForm from '../baseForm/BooleanForm.vue'
106+
import { Base64 } from 'js-base64'
107+
108+
const needDecodeConfigKeys = ['server-config-file-content', 'agent-config-file-content']
106109
107110
const props = defineProps({
108111
desc: {
@@ -139,6 +142,12 @@ watch(
139142
dashboardUI.value = true
140143
}
141144
// Compatible with older versions end
145+
needDecodeConfigKeys.forEach((k) => {
146+
const v = form.config[k]
147+
if (v) {
148+
form.config[k] = Base64.decode(v)
149+
}
150+
})
142151
},
143152
{ immediate: true }
144153
)
@@ -166,6 +175,12 @@ const getForm = () => {
166175
if (dashboardUI.value) {
167176
f.config.enable.push('explorer')
168177
}
178+
needDecodeConfigKeys.forEach((k) => {
179+
const v = f.config[k]?.trim()
180+
if (v) {
181+
f.config[k] = Base64.encode(v)
182+
}
183+
})
169184
return [
170185
{ path: 'config', value: f.config },
171186
{ path: 'options', value: f.options }

0 commit comments

Comments
 (0)