From ae03b85a97a0b891f8ffeb811031a95a2c59cd7f Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:26:38 +0800 Subject: [PATCH] fix(website): Fix Issue with Switching PHP Runtime Environment (#7203) Refs https://github.com/1Panel-dev/1Panel/issues/7097 --- backend/app/service/website.go | 8 ++++++++ .../website/config/php/config/index.vue | 1 - .../website/config/php/function/index.vue | 2 +- .../website/website/config/php/index.vue | 2 +- .../website/config/php/upload/index.vue | 2 +- .../website/config/php/version/index.vue | 19 +++++++++++-------- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/backend/app/service/website.go b/backend/app/service/website.go index c80527c18..648914cb2 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -1343,6 +1343,14 @@ func (w WebsiteService) ChangePHPVersion(req request.WebsitePHPVersionReq) error if runtime.Resource == constant.ResourceLocal || oldRuntime.Resource == constant.ResourceLocal { return buserr.New("ErrPHPResource") } + client, err := docker.NewDockerClient() + if err != nil { + return err + } + defer client.Close() + if !checkImageExist(client, runtime.Image) { + return buserr.WithName("ErrImageNotExist", runtime.Name) + } appInstall, err := appInstallRepo.GetFirst(commonRepo.WithByID(website.AppInstallID)) if err != nil { return err diff --git a/frontend/src/views/website/website/config/php/config/index.vue b/frontend/src/views/website/website/config/php/config/index.vue index 190c7cca8..6e3c5a71d 100644 --- a/frontend/src/views/website/website/config/php/config/index.vue +++ b/frontend/src/views/website/website/config/php/config/index.vue @@ -2,7 +2,6 @@
-
diff --git a/frontend/src/views/website/website/config/php/function/index.vue b/frontend/src/views/website/website/config/php/function/index.vue index 62eba6e8f..caa14039b 100644 --- a/frontend/src/views/website/website/config/php/function/index.vue +++ b/frontend/src/views/website/website/config/php/function/index.vue @@ -1,7 +1,7 @@ diff --git a/frontend/src/views/website/website/config/php/upload/index.vue b/frontend/src/views/website/website/config/php/upload/index.vue index 69ebcee3b..d2264e6f9 100644 --- a/frontend/src/views/website/website/config/php/upload/index.vue +++ b/frontend/src/views/website/website/config/php/upload/index.vue @@ -1,7 +1,7 @@