fix: 解决关闭高级设置之后没有提示端口放开的问题 (#1887)

This commit is contained in:
zhengkunwang 2023-08-09 14:08:12 +08:00 committed by GitHub
parent fe705a25ea
commit 87e9662af4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 11 deletions

View file

@ -1,13 +1,8 @@
import router from '@/routers';
export function canEditPort(app: any): boolean {
if (app.key == 'openresty') {
return false;
}
if (app.type == 'php') {
return false;
}
return true;
export function canEditPort(appKey: string): boolean {
const apps = ['openresty', 'php', 'frpc', 'frps', 'ddns-go', 'home-assistant'];
return !apps.includes(appKey);
}
export function toFolder(folder: string) {

View file

@ -75,7 +75,7 @@
{{ $t('container.limitHelper', [limits.memory]) }}{{ req.memoryUnit }}B
</span>
</el-form-item>
<el-form-item prop="allowPort" v-if="canEditPort(installData.app)">
<el-form-item prop="allowPort" v-if="canEditPort(installData.app.key)">
<el-checkbox v-model="req.allowPort" :label="$t('app.allowPort')" size="large" />
<span class="input-help">{{ $t('app.allowPortHelper') }}</span>
</el-form-item>
@ -224,7 +224,7 @@ const submit = async (formEl: FormInstance | undefined) => {
if (req.memoryLimit < 0) {
req.memoryLimit = 0;
}
if (installData.value.app.key != 'openresty' && req.advanced && !req.allowPort) {
if (canEditPort(installData.value.app.key) && !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'),

View file

@ -75,7 +75,7 @@
</el-input>
<span class="input-help">{{ $t('container.limitHelper') }}</span>
</el-form-item>
<el-form-item prop="allowPort" v-if="canEditPort(paramData.app)">
<el-form-item prop="allowPort" v-if="canEditPort(paramData.app.key)">
<el-checkbox v-model="paramModel.allowPort" :label="$t('app.allowPort')" size="large" />
<span class="input-help">{{ $t('app.allowPortHelper') }}</span>
</el-form-item>