diff --git a/agent/app/service/runtime.go b/agent/app/service/runtime.go index b0cb85c68..7f647543e 100644 --- a/agent/app/service/runtime.go +++ b/agent/app/service/runtime.go @@ -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") { diff --git a/agent/app/service/runtime_utils.go b/agent/app/service/runtime_utils.go index 07f0d1e60..5e3e14df1 100644 --- a/agent/app/service/runtime_utils.go +++ b/agent/app/service/runtime_utils.go @@ -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 +} diff --git a/frontend/src/views/website/runtime/php/create/index.vue b/frontend/src/views/website/runtime/php/create/index.vue index 3a8ccadb9..aa26fdb75 100644 --- a/frontend/src/views/website/runtime/php/create/index.vue +++ b/frontend/src/views/website/runtime/php/create/index.vue @@ -478,6 +478,7 @@ const acceptParams = async (props: OperateRrops) => { searchAppList(null); } } else { + console.log(props); searchAppList(props.appID); getRuntime(props.id); } diff --git a/frontend/src/views/website/website/config/basic/other/index.vue b/frontend/src/views/website/website/config/basic/other/index.vue index ff282f448..129c73e04 100644 --- a/frontend/src/views/website/website/config/basic/other/index.vue +++ b/frontend/src/views/website/website/config/basic/other/index.vue @@ -2,7 +2,7 @@ - +