mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-01-13 18:44:14 +08:00
feat: support custom extension sources for PHP runtime (#10539)
This commit is contained in:
parent
464ca8d272
commit
f4a649dc2f
2 changed files with 24 additions and 25 deletions
|
|
@ -381,6 +381,9 @@ func (r *RuntimeService) Get(id uint) (*response.RuntimeDTO, error) {
|
|||
appParam.Value = []string{}
|
||||
} else {
|
||||
appParam.Value = strings.Split(v, ",")
|
||||
if strSlice, ok := appParam.Value.([]string); ok && len(strSlice) > 0 && strSlice[0] == "" {
|
||||
appParam.Value = strSlice[1:]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for _, fv := range form.Values {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@
|
|||
:rules="rules.params.CONTAINER_PACKAGE_URL"
|
||||
v-if="runtime.params['PHP_VERSION'] != '5.6.40' && formFields['CONTAINER_PACKAGE_URL']"
|
||||
>
|
||||
<el-select v-model="runtime.source" filterable default-first-option>
|
||||
<el-select v-model="runtime.source" filterable default-first-option allow-create>
|
||||
<el-option
|
||||
v-for="source in phpSources"
|
||||
:key="source.label"
|
||||
|
|
@ -391,32 +391,26 @@ const getApp = (appkey: string, mode: string) => {
|
|||
|
||||
const submit = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return;
|
||||
await formEl.validate((valid) => {
|
||||
await formEl.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
if (mode.value == 'create') {
|
||||
loading.value = true;
|
||||
CreateRuntime(runtime)
|
||||
.then((res) => {
|
||||
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
||||
handleClose();
|
||||
em('submit', res.data.id);
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
} else {
|
||||
loading.value = true;
|
||||
UpdateRuntime(runtime)
|
||||
.then(() => {
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
handleClose();
|
||||
em('submit', runtime.id);
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
try {
|
||||
let res;
|
||||
if (mode.value == 'create') {
|
||||
loading.value = true;
|
||||
res = await CreateRuntime(runtime);
|
||||
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
||||
} else {
|
||||
loading.value = true;
|
||||
res = await UpdateRuntime(runtime);
|
||||
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
||||
}
|
||||
handleClose();
|
||||
em('submit', res.data.id);
|
||||
} catch (error) {
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -447,7 +441,9 @@ const getRuntime = async (id: number) => {
|
|||
}
|
||||
formFields.value = forms;
|
||||
if (data.params['PHP_EXTENSIONS'] != '') {
|
||||
runtime.params['PHP_EXTENSIONS'] = runtime.params['PHP_EXTENSIONS'].split(',');
|
||||
runtime.params['PHP_EXTENSIONS'] = runtime.params['PHP_EXTENSIONS']
|
||||
.split(',')
|
||||
.filter((item) => item !== '');
|
||||
}
|
||||
initParam.value = true;
|
||||
} catch (error) {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue