feat: support creating databases with custom charset and collation during app installation (#11092)

This commit is contained in:
CityFun 2025-11-27 11:21:23 +08:00 committed by GitHub
parent 747a0c45ee
commit 35c946a064
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -118,12 +118,20 @@
</div> </div>
<span class="input-help" v-if="p.description">{{ getDescription(p) }}</span> <span class="input-help" v-if="p.description">{{ getDescription(p) }}</span>
</el-form-item> </el-form-item>
<el-form-item v-if="form[p.envKey] == 'mysql'" :label="$t('database.format')" prop="format"> <el-form-item
v-if="form[p.envKey] == 'mysql' || form[p.envKey] == 'mariadb'"
:label="$t('database.format')"
prop="format"
>
<el-select filterable v-model="form.format" @change="loadCollations()"> <el-select filterable v-model="form.format" @change="loadCollations()">
<el-option v-for="item of formatOptions" :key="item.format" :label="item.format" :value="item.format" /> <el-option v-for="item of formatOptions" :key="item.format" :label="item.format" :value="item.format" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="form[p.envKey] == 'mysql'" :label="$t('database.collation')" prop="collation"> <el-form-item
v-if="form[p.envKey] == 'mysql' || form[p.envKey] == 'mariadb'"
:label="$t('database.collation')"
prop="collation"
>
<el-select filterable v-model="form.collation"> <el-select filterable v-model="form.collation">
<el-option v-for="item of collationOptions" :key="item" :label="item" :value="item" /> <el-option v-for="item of collationOptions" :key="item" :label="item" :value="item" />
</el-select> </el-select>
@ -256,7 +264,7 @@ const handleParams = () => {
const getServices = async (childKey: string, key: string | undefined, pObj: ParamObj | undefined) => { const getServices = async (childKey: string, key: string | undefined, pObj: ParamObj | undefined) => {
pObj.services = []; pObj.services = [];
appKey.value = key || ''; appKey.value = key || '';
if (appKey.value == 'mysql') { if (appKey.value == 'mysql' || appKey.value == 'mariadb') {
form.format = 'utf8mb4'; form.format = 'utf8mb4';
} }
await getAppService(key).then((res) => { await getAppService(key).then((res) => {
@ -286,7 +294,7 @@ const changeService = (value: string, services: App.AppService[]) => {
}); });
} }
}); });
if (appKey.value == 'mysql') { if (appKey.value == 'mysql' || appKey.value == 'mariadb') {
loadOptions(value); loadOptions(value);
} }
updateParam(); updateParam();