1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-02-08 01:20:07 +08:00

feat: 增加华为云申请证书 (#6687)

Refs https://github.com/1Panel-dev/1Panel/issues/6047
This commit is contained in:
zhengkunwang 2024-10-11 14:41:05 +08:00 committed by GitHub
parent 1a44f48fad
commit 5374afb226
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 28 additions and 5 deletions

View File

@ -164,6 +164,10 @@ export const DNSTypes = [
label: i18n.global.t('website.tencentCloud'), label: i18n.global.t('website.tencentCloud'),
value: 'TencentCloud', value: 'TencentCloud',
}, },
{
label: i18n.global.t('website.huaweicloud'),
value: 'HuaweiCloud',
},
{ {
label: 'DNSPod (' + i18n.global.t('ssl.deprecated') + ')', label: 'DNSPod (' + i18n.global.t('ssl.deprecated') + ')',
value: 'DnsPod', value: 'DnsPod',

View File

@ -2138,6 +2138,7 @@ const message = {
sni: 'Origin SNI', sni: 'Origin SNI',
sniHelper: sniHelper:
"When the reverse proxy backend is HTTPS, you might need to set the origin SNI. Please refer to the CDN service provider's documentation for details.", "When the reverse proxy backend is HTTPS, you might need to set the origin SNI. Please refer to the CDN service provider's documentation for details.",
huaweicloud: 'Huawei Cloud',
}, },
php: { php: {
short_open_tag: 'Short tag support', short_open_tag: 'Short tag support',

View File

@ -1987,6 +1987,7 @@ const message = {
website404Helper: '網站 404 錯誤頁僅支援 PHP 運行環境網站和靜態網站', website404Helper: '網站 404 錯誤頁僅支援 PHP 運行環境網站和靜態網站',
sni: '回源 SNI', sni: '回源 SNI',
sniHelper: '反代後端為 https 的時候可能需要設置回源 SNI具體需要看 CDN 服務商文檔', sniHelper: '反代後端為 https 的時候可能需要設置回源 SNI具體需要看 CDN 服務商文檔',
huaweicloud: '華為雲',
}, },
php: { php: {
short_open_tag: '短標簽支持', short_open_tag: '短標簽支持',

View File

@ -1989,6 +1989,7 @@ const message = {
website404Helper: '网站 404 错误页仅支持 PHP 运行环境网站和静态网站', website404Helper: '网站 404 错误页仅支持 PHP 运行环境网站和静态网站',
sni: '回源 SNI', sni: '回源 SNI',
sniHelper: '反代后端为 https 的时候可能需要设置回源 SNI具体需要看 CDN 服务商文档', sniHelper: '反代后端为 https 的时候可能需要设置回源 SNI具体需要看 CDN 服务商文档',
huaweicloud: '华为云',
}, },
php: { php: {
short_open_tag: '短标签支持', short_open_tag: '短标签支持',

View File

@ -14,7 +14,11 @@
<el-input v-model.trim="account.name"></el-input> <el-input v-model.trim="account.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('commons.table.type')" prop="type"> <el-form-item :label="$t('commons.table.type')" prop="type">
<el-select v-model="account.type" :disabled="accountData.mode === 'edit'"> <el-select
v-model="account.type"
:disabled="accountData.mode === 'edit'"
@change="changeType(account.type)"
>
<el-option <el-option
v-for="(type, index) in DNSTypes" v-for="(type, index) in DNSTypes"
:key="index" :key="index"
@ -25,8 +29,11 @@
<span class="input-help text-red-500" v-if="account.type === 'DnsPod'"> <span class="input-help text-red-500" v-if="account.type === 'DnsPod'">
{{ $t('ssl.deprecatedHelper') }} {{ $t('ssl.deprecatedHelper') }}
</span> </span>
<span class="input-help text-red-500" v-if="account.type === 'CloudFlare'">
{{ $t('ssl.cfHelper') }}
</span>
</el-form-item> </el-form-item>
<div v-if="account.type === 'AliYun'"> <div v-if="account.type === 'AliYun' || account.type === 'HuaweiCloud'">
<el-form-item label="Access Key" prop="authorization.accessKey"> <el-form-item label="Access Key" prop="authorization.accessKey">
<el-input v-model.trim="account.authorization['accessKey']"></el-input> <el-input v-model.trim="account.authorization['accessKey']"></el-input>
</el-form-item> </el-form-item>
@ -34,6 +41,9 @@
<el-input v-model.trim="account.authorization['secretKey']"></el-input> <el-input v-model.trim="account.authorization['secretKey']"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item label="Region" prop="authorization.region" v-if="account.type === 'HuaweiCloud'">
<el-input v-model.trim="account.authorization['region']" :placeholder="'cn-north-1'"></el-input>
</el-form-item>
<div v-if="account.type === 'TencentCloud'"> <div v-if="account.type === 'TencentCloud'">
<el-form-item label="Secret ID" prop="authorization.secretID"> <el-form-item label="Secret ID" prop="authorization.secretID">
<el-input v-model.trim="account.authorization['secretID']"></el-input> <el-input v-model.trim="account.authorization['secretID']"></el-input>
@ -57,9 +67,6 @@
</el-form-item> </el-form-item>
<el-form-item label="API Token" prop="authorization.apiKey"> <el-form-item label="API Token" prop="authorization.apiKey">
<el-input v-model.trim="account.authorization['apiKey']"></el-input> <el-input v-model.trim="account.authorization['apiKey']"></el-input>
<span class="input-help text-red-500">
{{ $t('ssl.cfHelper') }}
</span>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item <el-form-item
@ -130,6 +137,7 @@ const rules = ref<any>({
apiKey: [Rules.requiredInput], apiKey: [Rules.requiredInput],
apiUser: [Rules.requiredInput], apiUser: [Rules.requiredInput],
secretID: [Rules.requiredInput], secretID: [Rules.requiredInput],
region: [Rules.requiredInput],
}, },
}); });
const account = ref({ const account = ref({
@ -156,6 +164,14 @@ const resetForm = () => {
accountForm.value?.resetFields(); accountForm.value?.resetFields();
}; };
const changeType = (type: string) => {
account.value.type = type;
account.value.authorization = {};
if (account.value.type == 'HuaweiCloud') {
account.value.authorization['region'] = 'cn-north-1';
}
};
const acceptParams = async (props: AccountProps) => { const acceptParams = async (props: AccountProps) => {
accountData.value.mode = props.mode; accountData.value.mode = props.mode;
if (props.mode === 'edit') { if (props.mode === 'edit') {