mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-16 18:54:43 +08:00
feat: 网站反向代理增加协议选择 (#1832)
This commit is contained in:
parent
80e845f320
commit
aa1e548ddf
@ -107,8 +107,10 @@ func (f *FileInfo) search(search string, count int) (files []FileSearchInfo, tot
|
|||||||
if err = cmd.Start(); err != nil {
|
if err = cmd.Start(); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer cmd.Wait()
|
defer func() {
|
||||||
defer cmd.Process.Kill()
|
_ = cmd.Wait()
|
||||||
|
_ = cmd.Process.Kill()
|
||||||
|
}()
|
||||||
|
|
||||||
scanner := bufio.NewScanner(output)
|
scanner := bufio.NewScanner(output)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
|
@ -1314,7 +1314,7 @@ const message = {
|
|||||||
value: 'value',
|
value: 'value',
|
||||||
enable: 'Enable',
|
enable: 'Enable',
|
||||||
proxyAddress: 'Proxy Address',
|
proxyAddress: 'Proxy Address',
|
||||||
proxyHelper: 'Example: http://127.0.0.1:8080',
|
proxyHelper: 'Example: 127.0.0.1:8080',
|
||||||
forceDelete: 'Force Delete',
|
forceDelete: 'Force Delete',
|
||||||
forceDeleteHelper:
|
forceDeleteHelper:
|
||||||
'Forced deletion will ignore errors generated during the deletion process and eventually delete metadata',
|
'Forced deletion will ignore errors generated during the deletion process and eventually delete metadata',
|
||||||
@ -1471,6 +1471,7 @@ const message = {
|
|||||||
'Switching the PHP version will delete the original PHP container (the website code that has been mounted will not be lost), continue? ',
|
'Switching the PHP version will delete the original PHP container (the website code that has been mounted will not be lost), continue? ',
|
||||||
changeVersion: 'Switch version',
|
changeVersion: 'Switch version',
|
||||||
retainConfig: 'Whether to keep php-fpm.conf and php.ini files',
|
retainConfig: 'Whether to keep php-fpm.conf and php.ini files',
|
||||||
|
runDirHelper2: 'Please ensure that the secondary running directory is under the index directory',
|
||||||
},
|
},
|
||||||
php: {
|
php: {
|
||||||
short_open_tag: 'Short tag support',
|
short_open_tag: 'Short tag support',
|
||||||
@ -1489,6 +1490,8 @@ const message = {
|
|||||||
disableFunction: 'Disable function',
|
disableFunction: 'Disable function',
|
||||||
disableFunctionHelper: 'Enter the function to be disabled, such as exec, please use multiple, split',
|
disableFunctionHelper: 'Enter the function to be disabled, such as exec, please use multiple, split',
|
||||||
uploadMaxSize: 'Upload limit',
|
uploadMaxSize: 'Upload limit',
|
||||||
|
indexHelper:
|
||||||
|
'In order to ensure the normal operation of the PHP website, please place the code in the index directory and avoid renaming',
|
||||||
},
|
},
|
||||||
nginx: {
|
nginx: {
|
||||||
serverNamesHashBucketSizeHelper: 'The hash table size of the server name',
|
serverNamesHashBucketSizeHelper: 'The hash table size of the server name',
|
||||||
|
@ -1257,7 +1257,7 @@ const message = {
|
|||||||
value: '值',
|
value: '值',
|
||||||
enable: '開啟',
|
enable: '開啟',
|
||||||
proxyAddress: '代理地址',
|
proxyAddress: '代理地址',
|
||||||
proxyHelper: '例: http://127.0.0.1:8080',
|
proxyHelper: '例: 127.0.0.1:8080',
|
||||||
forceDelete: '強製刪除',
|
forceDelete: '強製刪除',
|
||||||
forceDeleteHelper: '強製刪除,會忽略刪除過程中產生的錯誤並最終刪除元數據',
|
forceDeleteHelper: '強製刪除,會忽略刪除過程中產生的錯誤並最終刪除元數據',
|
||||||
deleteAppHelper: '同時刪除關聯應用、數據庫以及應用備份',
|
deleteAppHelper: '同時刪除關聯應用、數據庫以及應用備份',
|
||||||
@ -1404,6 +1404,7 @@ const message = {
|
|||||||
changePHPVersionWarn: '切換 PHP 版本會刪除原有的 PHP 容器(不會丟失已經掛載的網站代碼),是否繼續? ',
|
changePHPVersionWarn: '切換 PHP 版本會刪除原有的 PHP 容器(不會丟失已經掛載的網站代碼),是否繼續? ',
|
||||||
changeVersion: '切換版本',
|
changeVersion: '切換版本',
|
||||||
retainConfig: '是否保留 php-fpm.conf 和 php.ini 文件',
|
retainConfig: '是否保留 php-fpm.conf 和 php.ini 文件',
|
||||||
|
runDirHelper2: '請確保二級運行目錄位於 index 目錄下',
|
||||||
},
|
},
|
||||||
php: {
|
php: {
|
||||||
short_open_tag: '短標簽支持',
|
short_open_tag: '短標簽支持',
|
||||||
@ -1422,6 +1423,7 @@ const message = {
|
|||||||
disableFunction: '禁用函數',
|
disableFunction: '禁用函數',
|
||||||
disableFunctionHelper: '輸入要禁用的函數,例如exec,多個請用,分割',
|
disableFunctionHelper: '輸入要禁用的函數,例如exec,多個請用,分割',
|
||||||
uploadMaxSize: '上傳限製',
|
uploadMaxSize: '上傳限製',
|
||||||
|
indexHelper: '為保障PHP網站正常運行,請將代碼放置於 index 目錄,並避免重命名',
|
||||||
},
|
},
|
||||||
nginx: {
|
nginx: {
|
||||||
serverNamesHashBucketSizeHelper: '服務器名字的hash表大小',
|
serverNamesHashBucketSizeHelper: '服務器名字的hash表大小',
|
||||||
|
@ -1257,7 +1257,7 @@ const message = {
|
|||||||
value: '值',
|
value: '值',
|
||||||
enable: '开启',
|
enable: '开启',
|
||||||
proxyAddress: '代理地址',
|
proxyAddress: '代理地址',
|
||||||
proxyHelper: '例: http://127.0.0.1:8080',
|
proxyHelper: '例: 127.0.0.1:8080',
|
||||||
forceDelete: '强制删除',
|
forceDelete: '强制删除',
|
||||||
forceDeleteHelper: '强制删除,会忽略删除过程中产生的错误并最终删除元数据',
|
forceDeleteHelper: '强制删除,会忽略删除过程中产生的错误并最终删除元数据',
|
||||||
deleteAppHelper: '同时删除关联应用、数据库以及应用备份',
|
deleteAppHelper: '同时删除关联应用、数据库以及应用备份',
|
||||||
@ -1281,7 +1281,7 @@ const message = {
|
|||||||
primaryPath: '主目录',
|
primaryPath: '主目录',
|
||||||
folderTitle: '网站主目录主要包含四个文件夹',
|
folderTitle: '网站主目录主要包含四个文件夹',
|
||||||
wafFolder: '防火墙规则',
|
wafFolder: '防火墙规则',
|
||||||
indexFolder: '网站root目录',
|
indexFolder: '网站 root 目录(PHP 运行环境 静态网站代码存放目录)',
|
||||||
logFolder: '网站日志',
|
logFolder: '网站日志',
|
||||||
sslFolder: '网站证书',
|
sslFolder: '网站证书',
|
||||||
enableOrNot: '是否启用',
|
enableOrNot: '是否启用',
|
||||||
@ -1404,6 +1404,7 @@ const message = {
|
|||||||
changePHPVersionWarn: '切换 PHP 版本会删除原有的 PHP 容器(不会丢失已经挂载的网站代码),是否继续?',
|
changePHPVersionWarn: '切换 PHP 版本会删除原有的 PHP 容器(不会丢失已经挂载的网站代码),是否继续?',
|
||||||
changeVersion: '切换版本',
|
changeVersion: '切换版本',
|
||||||
retainConfig: '是否保留 php-fpm.conf 和 php.ini 文件',
|
retainConfig: '是否保留 php-fpm.conf 和 php.ini 文件',
|
||||||
|
runDirHelper2: '请确保二级运行目录位于 index 目录下',
|
||||||
},
|
},
|
||||||
php: {
|
php: {
|
||||||
short_open_tag: '短标签支持',
|
short_open_tag: '短标签支持',
|
||||||
@ -1422,6 +1423,7 @@ const message = {
|
|||||||
disableFunction: '禁用函数',
|
disableFunction: '禁用函数',
|
||||||
disableFunctionHelper: '输入要禁用的函数,例如exec,多个请用,分割',
|
disableFunctionHelper: '输入要禁用的函数,例如exec,多个请用,分割',
|
||||||
uploadMaxSize: '上传限制',
|
uploadMaxSize: '上传限制',
|
||||||
|
indexHelper: '为保障 PHP 网站正常运行,请将代码放置于 index 目录,并避免重命名',
|
||||||
},
|
},
|
||||||
nginx: {
|
nginx: {
|
||||||
serverNamesHashBucketSizeHelper: '服务器名字的hash表大小',
|
serverNamesHashBucketSizeHelper: '服务器名字的hash表大小',
|
||||||
|
@ -347,3 +347,7 @@ html {
|
|||||||
.left-button {
|
.left-button {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pre-select {
|
||||||
|
width: 85px !important;
|
||||||
|
}
|
||||||
|
@ -30,6 +30,9 @@
|
|||||||
{{ $t('nginx.saveAndReload') }}
|
{{ $t('nginx.saveAndReload') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-space>
|
</el-space>
|
||||||
|
<span class="input-help">
|
||||||
|
{{ $t('website.runDirHelper2') }}
|
||||||
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="configDir" :label="$t('website.userGroup')">
|
<el-form-item v-if="configDir" :label="$t('website.userGroup')">
|
||||||
<el-space wrap>
|
<el-space wrap>
|
||||||
@ -49,6 +52,7 @@
|
|||||||
<template #default>
|
<template #default>
|
||||||
<span class="warnHelper">{{ $t('website.runDirHelper') }}</span>
|
<span class="warnHelper">{{ $t('website.runDirHelper') }}</span>
|
||||||
<span class="warnHelper">{{ $t('website.runUserHelper') }}</span>
|
<span class="warnHelper">{{ $t('website.runUserHelper') }}</span>
|
||||||
|
<span class="warnHelper">{{ $t('php.indexHelper') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-alert>
|
</el-alert>
|
||||||
<br />
|
<br />
|
||||||
|
@ -223,7 +223,7 @@
|
|||||||
<el-select
|
<el-select
|
||||||
v-model="website.appinstall.memoryUnit"
|
v-model="website.appinstall.memoryUnit"
|
||||||
placeholder="Select"
|
placeholder="Select"
|
||||||
style="width: 85px"
|
class="pre-select"
|
||||||
>
|
>
|
||||||
<el-option label="KB" value="K" />
|
<el-option label="KB" value="K" />
|
||||||
<el-option label="MB" value="M" />
|
<el-option label="MB" value="M" />
|
||||||
@ -268,8 +268,20 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="website.type === 'proxy'" :label="$t('website.proxyAddress')" prop="proxy">
|
<el-form-item
|
||||||
<el-input v-model="website.proxy" :placeholder="$t('website.proxyHelper')"></el-input>
|
v-if="website.type === 'proxy'"
|
||||||
|
:label="$t('website.proxyAddress')"
|
||||||
|
prop="proxyAddress"
|
||||||
|
>
|
||||||
|
<el-input v-model="website.proxyAddress" :placeholder="$t('website.proxyHelper')">
|
||||||
|
<template #prepend>
|
||||||
|
<el-select v-model="website.proxyProtocol" class="pre-select">
|
||||||
|
<el-option label="http" value="http://" />
|
||||||
|
<el-option label="https" value="https://" />
|
||||||
|
<el-option :label="$t('website.other')" value="" />
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('website.remark')" prop="remark">
|
<el-form-item :label="$t('website.remark')" prop="remark">
|
||||||
<el-input v-model="website.remark"></el-input>
|
<el-input v-model="website.remark"></el-input>
|
||||||
@ -348,6 +360,8 @@ const website = ref({
|
|||||||
IPV6: false,
|
IPV6: false,
|
||||||
proxyType: 'tcp',
|
proxyType: 'tcp',
|
||||||
port: 9000,
|
port: 9000,
|
||||||
|
proxyProtocol: 'http://',
|
||||||
|
proxyAddress: '',
|
||||||
});
|
});
|
||||||
const rules = ref<any>({
|
const rules = ref<any>({
|
||||||
primaryDomain: [Rules.domain],
|
primaryDomain: [Rules.domain],
|
||||||
@ -356,7 +370,7 @@ const rules = ref<any>({
|
|||||||
webSiteGroupId: [Rules.requiredSelectBusiness],
|
webSiteGroupId: [Rules.requiredSelectBusiness],
|
||||||
appInstallId: [Rules.requiredSelectBusiness],
|
appInstallId: [Rules.requiredSelectBusiness],
|
||||||
appType: [Rules.requiredInput],
|
appType: [Rules.requiredInput],
|
||||||
proxy: [Rules.requiredInput],
|
proxyAddress: [Rules.requiredInput],
|
||||||
runtimeID: [Rules.requiredSelectBusiness],
|
runtimeID: [Rules.requiredSelectBusiness],
|
||||||
appinstall: {
|
appinstall: {
|
||||||
name: [Rules.appName],
|
name: [Rules.appName],
|
||||||
@ -549,6 +563,10 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
preCheckRef.value.acceptParams({ items: res.data });
|
preCheckRef.value.acceptParams({ items: res.data });
|
||||||
} else {
|
} else {
|
||||||
|
if (website.value.type === 'proxy') {
|
||||||
|
website.value.proxy = website.value.proxyProtocol + website.value.proxyAddress;
|
||||||
|
console.log(website.value.proxy);
|
||||||
|
}
|
||||||
CreateWebsite(website.value)
|
CreateWebsite(website.value)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user