diff --git a/backend/app/service/website_ssl.go b/backend/app/service/website_ssl.go index 189908add..f709d278c 100644 --- a/backend/app/service/website_ssl.go +++ b/backend/app/service/website_ssl.go @@ -66,10 +66,7 @@ func (w WebsiteSSLService) Search(search request.WebsiteSSLSearch) ([]response.W opts []repo.DBOption result []response.WebsiteSSLDTO ) - opts = append(opts, commonRepo.WithOrderBy("created_at desc")) - if search.AcmeAccountID >= 0 { - opts = append(opts, websiteSSLRepo.WithByAcmeAccountId(search.AcmeAccountID)) - } + opts = append(opts, commonRepo.WithOrderBy("created_at desc"), websiteSSLRepo.WithByAcmeAccountId(search.AcmeAccountID)) sslList, err := websiteSSLRepo.List(opts...) if err != nil { return nil, err diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 45545b157..9d1e8cf6d 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1177,8 +1177,7 @@ const message = { containerName: 'Container Name', containerNameHelper: 'can be empty, it will be automatically generated', allowPort: 'Port external access', - allowPortHelper: - 'Allowing external port access will release the firewall port, please do not release the php operating environment', + allowPortHelper: 'Allowing external port access will release the firewall port', appInstallWarn: 'The application does not release the external access port by default, you can choose to release it in the advanced settings', upgradeStart: 'Start upgrading! Please refresh the page later', @@ -1191,7 +1190,7 @@ const message = { installHelper: 'Configuring image acceleration can solve the problem of image pull failure', upgradeHelper: 'The abnormal application needs to be synchronized to the normal state first', installWarn: - ' Port external access is not enabled, and cannot be accessed through the external network IP:port. Do you want to continue?', + 'Currently, if the port external access is not checked, it will not be able to access through the external network IP: port. Do you want to continue?', restoreWarn: 'The restore operation will delete the current data of the application and restart it. This operation cannot be rolled back, continue?', }, diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index a4b1973de..ad5cd2fc2 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1121,7 +1121,7 @@ const message = { containerName: '容器名稱', containerNameHelper: '可以為空,為空自動生成', allowPort: '端口外部訪問', - allowPortHelper: '允許端口外部訪問會放開防火墻端口,php運行環境請勿放開', + allowPortHelper: '允許端口外部訪問會放開防火墻端口', appInstallWarn: '應用端口默認不允許外部訪問,可以在下方高級設置中選擇放開', upgradeStart: '開始升級!請稍後刷新頁面', toFolder: '進入安裝目錄', @@ -1132,7 +1132,7 @@ const message = { allReadyInstalled: '已安裝', installHelper: '配置鏡像加速可以解決鏡像拉取失敗的問題', upgradeHelper: '異常應用需要先同步到正常狀態', - installWarn: '未開啟端口外部訪問,無法通過外網IP:端口訪問,是否繼續? ', + installWarn: '當前未勾選端口外部訪問,將無法通過外網IP:端口訪問,是否繼續? ', restoreWarn: '恢復操作將刪除該應用當前數據並重啟。此操作不可回滾,是否繼續?', }, website: { diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 6b08826a9..58fbb2e49 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1127,7 +1127,7 @@ const message = { containerName: '容器名称', containerNameHelper: '可以为空,为空自动生成', allowPort: '端口外部访问', - allowPortHelper: '允许端口外部访问会放开防火墙端口,php运行环境请勿放开', + allowPortHelper: '允许端口外部访问会放开防火墙端口', appInstallWarn: '应用端口默认不允许外部访问,可以在下方高级设置中选择放开', upgradeStart: '开始升级!请稍后刷新页面', toFolder: '进入安装目录', @@ -1138,7 +1138,7 @@ const message = { allReadyInstalled: '已安装', installHelper: '配置镜像加速可以解决镜像拉取失败的问题', upgradeHelper: '异常应用需要先同步到正常状态', - installWarn: '未开启端口外部访问,无法通过外网IP:端口访问,是否继续?', + installWarn: '当前未勾选端口外部访问,将无法通过外网IP:端口访问,是否继续?', restoreWarn: '恢复操作将删除该应用当前数据并重启。此操作不可回滚,是否继续?', }, website: { diff --git a/frontend/src/views/app-store/detail/install/index.vue b/frontend/src/views/app-store/detail/install/index.vue index e45a5b034..72639bdf7 100644 --- a/frontend/src/views/app-store/detail/install/index.vue +++ b/frontend/src/views/app-store/detail/install/index.vue @@ -41,23 +41,39 @@ :placeholder="$t('app.containerNameHelper')" > - + - {{ $t('container.limitHelper') }} + + {{ $t('container.limitHelper', [limits.cpu]) }}{{ $t('commons.units.core') }} + - + - {{ $t('container.limitHelper') }} + + {{ $t('container.limitHelper', [limits.memory]) }}{{ req.memoryUnit }}B + @@ -104,7 +120,7 @@ import { InstallApp } from '@/api/modules/app'; import { Rules, checkNumberRange } from '@/global/form-rules'; import { canEditPort } from '@/global/business'; import { FormInstance, FormRules } from 'element-plus'; -import { reactive, ref } from 'vue'; +import { onMounted, reactive, ref } from 'vue'; import { useRouter } from 'vue-router'; import Params from '../params/index.vue'; import Header from '@/components/drawer-header/index.vue'; @@ -113,6 +129,8 @@ import { javascript } from '@codemirror/lang-javascript'; import { oneDark } from '@codemirror/theme-one-dark'; import i18n from '@/lang'; import { MsgError } from '@/utils/message'; +import { Container } from '@/api/interface/container'; +import { loadResourceLimit } from '@/api/modules/container'; const extensions = [javascript(), oneDark]; const router = useRouter(); @@ -154,12 +172,25 @@ const initData = () => ({ dockerCompose: '', }); const req = reactive(initData()); +const limits = ref({ + cpu: null as number, + memory: null as number, +}); +const oldMemory = ref(0); const handleClose = () => { open.value = false; resetForm(); }; +const changeUnit = () => { + if (req.memoryUnit == 'M') { + limits.value.memory = oldMemory.value; + } else { + limits.value.memory = oldMemory.value / 1024; + } +}; + const resetForm = () => { if (paramForm.value) { paramForm.value.clearValidate(); @@ -193,24 +224,43 @@ const submit = async (formEl: FormInstance | undefined) => { if (req.memoryLimit < 0) { req.memoryLimit = 0; } - ElMessageBox.confirm(i18n.global.t('app.installWarn'), i18n.global.t('app.checkTitle'), { - confirmButtonText: i18n.global.t('commons.button.confirm'), - cancelButtonText: i18n.global.t('commons.button.cancel'), - }).then(async () => { - loading.value = true; - InstallApp(req) - .then(() => { - handleClose(); - router.push({ path: '/apps/installed' }); - }) - .finally(() => { - loading.value = false; - }); - }); + if (req.advanced && !req.allowPort) { + ElMessageBox.confirm(i18n.global.t('app.installWarn'), i18n.global.t('app.checkTitle'), { + confirmButtonText: i18n.global.t('commons.button.confirm'), + cancelButtonText: i18n.global.t('commons.button.cancel'), + }).then(async () => { + install(); + }); + } else { + install(); + } }); }; +const install = () => { + loading.value = true; + InstallApp(req) + .then(() => { + handleClose(); + router.push({ path: '/apps/installed' }); + }) + .finally(() => { + loading.value = false; + }); +}; + +const loadLimit = async () => { + const res = await loadResourceLimit(); + limits.value = res.data; + limits.value.memory = Number((limits.value.memory / 1024 / 1024).toFixed(2)); + oldMemory.value = limits.value.memory; +}; + defineExpose({ acceptParams, }); + +onMounted(() => { + loadLimit(); +});