From 76b3cf4d2ba989ff9996358a979801669a3d9851 Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Mon, 17 Apr 2023 14:04:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=89=8B=E5=8A=A8=E8=BE=93=E5=85=A5=20PHP=20?= =?UTF-8?q?=E6=89=A9=E5=B1=95=20(#668)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/runtime_utils.go | 13 ++++++++++++- frontend/src/lang/modules/en.ts | 2 +- frontend/src/lang/modules/zh.ts | 3 ++- frontend/src/views/website/runtime/edit/index.vue | 2 ++ frontend/src/views/website/runtime/param/index.vue | 3 +++ 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/backend/app/service/runtime_utils.go b/backend/app/service/runtime_utils.go index 8979adcfd..2b5bfca7a 100644 --- a/backend/app/service/runtime_utils.go +++ b/backend/app/service/runtime_utils.go @@ -8,7 +8,9 @@ import ( "github.com/1Panel-dev/1Panel/backend/global" "github.com/1Panel-dev/1Panel/backend/utils/docker" "github.com/1Panel-dev/1Panel/backend/utils/files" + "github.com/docker/cli/cli/command" "github.com/subosito/gotenv" + "os" "path" "strings" ) @@ -87,7 +89,16 @@ func getComposeService(name, runtimeDir string, composeFile, env []byte, skipNor if err != nil { return nil, err } - composeService, err := docker.NewComposeService() + logPath := path.Join(runtimeDir, "build.log") + fileOp := files.NewFileOp() + if fileOp.Stat(logPath) { + _ = fileOp.DeleteFile(logPath) + } + file, err := os.Create(logPath) + if err != nil { + return nil, err + } + composeService, err := docker.NewComposeService(command.WithOutputStream(file)) if err != nil { return nil, err } diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 47d1646e9..ab87c69d2 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1308,7 +1308,7 @@ const message = { status: 'Status', versionHelper: 'PHP version, e.g. v8.0', buildHelper: - 'The more extensions you select, the more CPU will be occupied during the image making process, so avoid selecting all extensions', + 'The more extensions you select, the more CPU will be occupied during the image making process, so avoid selecting all extensions,If there is no extension you want, you can manually enter it and select it', openrestryWarn: 'PHP needs to be upgraded to OpenResty to version 1.21.4.1 or later to use', toupgrade: 'To Upgrade', }, diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 766f303cb..0ff150d8f 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1288,7 +1288,8 @@ const message = { version: '版本', status: '状态', versionHelper: 'PHP的版本,例如 v8.0', - buildHelper: '选择的扩展越多,制作镜像过程中占用 CPU 越多,请尽量避免选择全部扩展', + buildHelper: + '选择的扩展越多,制作镜像过程中占用 CPU 越多,请尽量避免选择全部扩展,如果没有想要的扩展,可以手动输入之后选择', openrestryWarn: 'PHP 需要升级 OpenResty 至 1.21.4.1 版本以上才能使用', toupgrade: '去升级', }, diff --git a/frontend/src/views/website/runtime/edit/index.vue b/frontend/src/views/website/runtime/edit/index.vue index 1daf4b420..82a8a7e76 100644 --- a/frontend/src/views/website/runtime/edit/index.vue +++ b/frontend/src/views/website/runtime/edit/index.vue @@ -6,6 +6,8 @@ v-if="p.type == 'select'" :multiple="p.multiple" filterable + allow-create + default-first-option @change="updateParam" >