From 1f65d2243e8ec221a4e9046d354411e458fc99f2 Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 17 May 2023 21:48:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9B=E5=BB=BA=E4=B8=80=E9=94=AE?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E7=BD=91=E7=AB=99=E5=92=8C=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=A2=9E=E5=8A=A0=E9=AB=98=E7=BA=A7=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=20(#1064)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/dto/request/app.go | 24 ++++---- backend/app/dto/request/website.go | 2 + backend/app/service/website.go | 2 + .../app-store/installed/detail/index.vue | 2 +- .../views/website/website/create/index.vue | 59 +++++++++++++++++++ 5 files changed, 78 insertions(+), 11 deletions(-) diff --git a/backend/app/dto/request/app.go b/backend/app/dto/request/app.go index af7d26fd9..cf6eb951b 100644 --- a/backend/app/dto/request/app.go +++ b/backend/app/dto/request/app.go @@ -14,16 +14,20 @@ type AppSearch struct { } type AppInstallCreate struct { - AppDetailId uint `json:"appDetailId" validate:"required"` - Params map[string]interface{} `json:"params"` - Name string `json:"name" validate:"required"` - Services map[string]string `json:"services"` - Advanced bool `json:"advanced"` - CpuQuota float64 `json:"cpuQuota"` - MemoryLimit float64 `json:"memoryLimit"` - MemoryUnit string `json:"memoryUnit"` - ContainerName string `json:"containerName"` - AllowPort bool `json:"allowPort"` + AppDetailId uint `json:"appDetailId" validate:"required"` + Params map[string]interface{} `json:"params"` + Name string `json:"name" validate:"required"` + Services map[string]string `json:"services"` + AppContainerConfig +} + +type AppContainerConfig struct { + Advanced bool `json:"advanced"` + CpuQuota float64 `json:"cpuQuota"` + MemoryLimit float64 `json:"memoryLimit"` + MemoryUnit string `json:"memoryUnit"` + ContainerName string `json:"containerName"` + AllowPort bool `json:"allowPort"` } type AppInstalledSearch struct { diff --git a/backend/app/dto/request/website.go b/backend/app/dto/request/website.go index fb53d189f..d95a891ae 100644 --- a/backend/app/dto/request/website.go +++ b/backend/app/dto/request/website.go @@ -37,6 +37,8 @@ type NewAppInstall struct { Name string `json:"name"` AppDetailId uint `json:"appDetailID"` Params map[string]interface{} `json:"params"` + + AppContainerConfig } type WebsiteInstallCheckReq struct { diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 0ba7f1aac..a04d25ede 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -206,6 +206,7 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error) req.Name = create.AppInstall.Name req.AppDetailId = create.AppInstall.AppDetailId req.Params = create.AppInstall.Params + req.AppContainerConfig = create.AppInstall.AppContainerConfig tx, installCtx := getTxAndContext() install, err = NewIAppService().Install(installCtx, req) if err != nil { @@ -243,6 +244,7 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error) req.AppDetailId = create.AppInstall.AppDetailId req.Params = create.AppInstall.Params req.Params["IMAGE_NAME"] = runtime.Image + req.AppContainerConfig = create.AppInstall.AppContainerConfig nginxInstall, err = getAppInstallByKey(constant.AppOpenresty) if err != nil { return err diff --git a/frontend/src/views/app-store/installed/detail/index.vue b/frontend/src/views/app-store/installed/detail/index.vue index 088ba73b2..1833a47b1 100644 --- a/frontend/src/views/app-store/installed/detail/index.vue +++ b/frontend/src/views/app-store/installed/detail/index.vue @@ -126,7 +126,7 @@ const submitModel = ref({}); const canEdit = ref(false); const acceptParams = async (props: ParamProps) => { - canEdit.value = false; + canEdit.value = true; submitModel.value.installId = props.id; params.value = []; paramData.value.id = props.id; diff --git a/frontend/src/views/website/website/create/index.vue b/frontend/src/views/website/website/create/index.vue index 3c476b9dd..08cef9df6 100644 --- a/frontend/src/views/website/website/create/index.vue +++ b/frontend/src/views/website/website/create/index.vue @@ -186,6 +186,58 @@ + + + + +
+ + + + + + + + {{ $t('container.limitHelper') }} + + + + + + {{ $t('container.limitHelper') }} + + + + {{ $t('app.allowPortHelper') }} + +