mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-26 09:22:50 +08:00
fix: Fixed issue with edit runtime failed (#10631)
This commit is contained in:
parent
5ca02a1dcf
commit
2a97b0a9de
4 changed files with 24 additions and 1 deletions
|
|
@ -232,6 +232,14 @@ func (r *RuntimeService) Page(req request.RuntimeSearch) (int64, []response.Runt
|
|||
if err != nil {
|
||||
return 0, nil, err
|
||||
}
|
||||
detail, _ := appDetailRepo.GetFirst(repo.WithByID(runtime.AppDetailID))
|
||||
if detail.AppId == 0 {
|
||||
appID, appDetailID := handleRuntimeDetailID(runtime)
|
||||
runtimeDTO.AppDetailID = appDetailID
|
||||
runtimeDTO.AppID = appID
|
||||
} else {
|
||||
runtimeDTO.AppID = detail.AppId
|
||||
}
|
||||
for k, v := range envs {
|
||||
runtimeDTO.Params[k] = v
|
||||
if strings.Contains(k, "CONTAINER_PORT") || strings.Contains(k, "HOST_PORT") {
|
||||
|
|
|
|||
|
|
@ -1059,3 +1059,17 @@ func getOperation(operate, pkgManager string) string {
|
|||
}
|
||||
return ops[1]
|
||||
}
|
||||
|
||||
func handleRuntimeDetailID(runtime model.Runtime) (uint, uint) {
|
||||
app, _ := appRepo.GetFirst(appRepo.WithKey(runtime.Type))
|
||||
if app.ID == 0 {
|
||||
return 0, 0
|
||||
}
|
||||
appDetail, _ := appDetailRepo.GetFirst(appDetailRepo.WithVersion(runtime.Version), appDetailRepo.WithAppId(app.ID))
|
||||
if appDetail.ID == 0 {
|
||||
return 0, 0
|
||||
}
|
||||
runtime.AppDetailID = appDetail.ID
|
||||
_ = runtimeRepo.Save(&runtime)
|
||||
return app.ID, appDetail.ID
|
||||
}
|
||||
|
|
|
|||
|
|
@ -478,6 +478,7 @@ const acceptParams = async (props: OperateRrops) => {
|
|||
searchAppList(null);
|
||||
}
|
||||
} else {
|
||||
console.log(props);
|
||||
searchAppList(props.appID);
|
||||
getRuntime(props.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<el-row :gutter="20" v-loading="loading">
|
||||
<el-col :xs="24" :sm="18" :md="8" :lg="8" :xl="8">
|
||||
<el-form ref="websiteForm" label-position="right" label-width="80px" :model="form" :rules="rules">
|
||||
<el-form-item :label="$t('website.primaryDomain')" prop="primaryDomain">
|
||||
<el-form-item :label="$t('commons.table.name')" prop="primaryDomain">
|
||||
<el-input v-model="form.primaryDomain"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('website.alias')" prop="primaryDomain">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue