Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b16d09330 | ||
|
|
027d81a8cd | ||
|
|
d833158784 | ||
|
|
75024c9364 | ||
|
|
1dd5db3c42 | ||
|
|
faba80e315 |
@@ -1,9 +1,9 @@
|
||||
package teaconst
|
||||
|
||||
const (
|
||||
Version = "1.3.0"
|
||||
Version = "1.3.1"
|
||||
|
||||
APINodeVersion = "1.3.0"
|
||||
APINodeVersion = "1.3.1"
|
||||
|
||||
ProductName = "Edge Admin"
|
||||
ProcessName = "edge-admin"
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"google.golang.org/grpc/credentials"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/encoding/gzip"
|
||||
"google.golang.org/grpc/keepalive"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"net"
|
||||
"net/url"
|
||||
@@ -514,12 +515,15 @@ func (this *RPCClient) init() error {
|
||||
grpc.MaxCallSendMsgSize(128<<20),
|
||||
grpc.UseCompressor(gzip.Name),
|
||||
)
|
||||
var keepaliveParams = grpc.WithKeepaliveParams(keepalive.ClientParameters{
|
||||
Time: 30 * time.Second,
|
||||
})
|
||||
if u.Scheme == "http" {
|
||||
conn, err = grpc.Dial(apiHost, grpc.WithTransportCredentials(insecure.NewCredentials()), callOptions)
|
||||
conn, err = grpc.Dial(apiHost, grpc.WithTransportCredentials(insecure.NewCredentials()), callOptions, keepaliveParams)
|
||||
} else if u.Scheme == "https" {
|
||||
conn, err = grpc.Dial(apiHost, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
})), callOptions)
|
||||
})), callOptions, keepaliveParams)
|
||||
} else {
|
||||
return errors.New("parse endpoint failed: invalid scheme '" + u.Scheme + "'")
|
||||
}
|
||||
|
||||
@@ -52,9 +52,13 @@ func (this *CreatePopupAction) RunPost(params struct {
|
||||
Type string
|
||||
|
||||
// DNSPod
|
||||
ParamId string
|
||||
ParamToken string
|
||||
ParamRegion string
|
||||
ParamDNSPodId string
|
||||
ParamDNSPodToken string
|
||||
ParamDNSPodRegion string
|
||||
|
||||
ParamDNSPodAPIType string
|
||||
ParamDNSPodAccessKeyId string
|
||||
ParamDNSPodAccessKeySecret string
|
||||
|
||||
// AliDNS
|
||||
ParamAliDNSAccessKeyId string
|
||||
@@ -89,18 +93,31 @@ func (this *CreatePopupAction) RunPost(params struct {
|
||||
Field("type", params.Type).
|
||||
Require("请选择服务商厂家")
|
||||
|
||||
apiParams := maps.Map{}
|
||||
var apiParams = maps.Map{}
|
||||
switch params.Type {
|
||||
case "dnspod":
|
||||
params.Must.
|
||||
Field("paramId", params.ParamId).
|
||||
Require("请输入密钥ID").
|
||||
Field("paramToken", params.ParamToken).
|
||||
Require("请输入密钥Token")
|
||||
apiParams["apiType"] = params.ParamDNSPodAPIType
|
||||
switch params.ParamDNSPodAPIType {
|
||||
case "tencentDNS":
|
||||
params.Must.
|
||||
Field("paramDNSPodAccessKeyId", params.ParamDNSPodAccessKeyId).
|
||||
Require("请输入SecretId").
|
||||
Field("paramDNSPodAccessKeySecret", params.ParamDNSPodAccessKeySecret).
|
||||
Require("请输入SecretKey")
|
||||
apiParams["accessKeyId"] = params.ParamDNSPodAccessKeyId
|
||||
apiParams["accessKeySecret"] = params.ParamDNSPodAccessKeySecret
|
||||
apiParams["region"] = params.ParamDNSPodRegion
|
||||
default:
|
||||
params.Must.
|
||||
Field("paramId", params.ParamDNSPodId).
|
||||
Require("请输入密钥ID").
|
||||
Field("paramToken", params.ParamDNSPodToken).
|
||||
Require("请输入密钥Token")
|
||||
|
||||
apiParams["id"] = params.ParamId
|
||||
apiParams["token"] = params.ParamToken
|
||||
apiParams["region"] = params.ParamRegion
|
||||
apiParams["id"] = params.ParamDNSPodId
|
||||
apiParams["token"] = params.ParamDNSPodToken
|
||||
apiParams["region"] = params.ParamDNSPodRegion
|
||||
}
|
||||
case "alidns":
|
||||
params.Must.
|
||||
Field("paramAliDNSAccessKeyId", params.ParamAliDNSAccessKeyId).
|
||||
|
||||
@@ -79,9 +79,13 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
||||
Type string
|
||||
|
||||
// DNSPod
|
||||
ParamId string
|
||||
ParamToken string
|
||||
ParamRegion string
|
||||
ParamDNSPodId string
|
||||
ParamDNSPodToken string
|
||||
ParamDNSPodRegion string
|
||||
|
||||
ParamDNSPodAPIType string
|
||||
ParamDNSPodAccessKeyId string
|
||||
ParamDNSPodAccessKeySecret string
|
||||
|
||||
// AliDNS
|
||||
ParamAliDNSAccessKeyId string
|
||||
@@ -118,18 +122,31 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
||||
Field("type", params.Type).
|
||||
Require("请选择服务商厂家")
|
||||
|
||||
apiParams := maps.Map{}
|
||||
var apiParams = maps.Map{}
|
||||
switch params.Type {
|
||||
case "dnspod":
|
||||
params.Must.
|
||||
Field("paramId", params.ParamId).
|
||||
Require("请输入密钥ID").
|
||||
Field("paramToken", params.ParamToken).
|
||||
Require("请输入密钥Token")
|
||||
apiParams["apiType"] = params.ParamDNSPodAPIType
|
||||
switch params.ParamDNSPodAPIType {
|
||||
case "tencentDNS":
|
||||
params.Must.
|
||||
Field("paramDNSPodAccessKeyId", params.ParamDNSPodAccessKeyId).
|
||||
Require("请输入SecretId").
|
||||
Field("paramDNSPodAccessKeySecret", params.ParamDNSPodAccessKeySecret).
|
||||
Require("请输入SecretKey")
|
||||
apiParams["accessKeyId"] = params.ParamDNSPodAccessKeyId
|
||||
apiParams["accessKeySecret"] = params.ParamDNSPodAccessKeySecret
|
||||
apiParams["region"] = params.ParamDNSPodRegion
|
||||
default:
|
||||
params.Must.
|
||||
Field("paramId", params.ParamDNSPodId).
|
||||
Require("请输入密钥ID").
|
||||
Field("paramToken", params.ParamDNSPodToken).
|
||||
Require("请输入密钥Token")
|
||||
|
||||
apiParams["id"] = params.ParamId
|
||||
apiParams["token"] = params.ParamToken
|
||||
apiParams["region"] = params.ParamRegion
|
||||
apiParams["id"] = params.ParamDNSPodId
|
||||
apiParams["token"] = params.ParamDNSPodToken
|
||||
apiParams["region"] = params.ParamDNSPodRegion
|
||||
}
|
||||
case "alidns":
|
||||
params.Must.
|
||||
Field("paramAliDNSAccessKeyId", params.ParamAliDNSAccessKeyId).
|
||||
|
||||
@@ -2218,10 +2218,10 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>添加X-Cache Header</td>
|
||||
<td>添加X-Cache报头</td>
|
||||
<td>
|
||||
<checkbox v-model="cacheConfig.addStatusHeader"></checkbox>
|
||||
<p class="comment">选中后自动在响应Header中增加<code-label>X-Cache: BYPASS|MISS|HIT|PURGE</code-label>。</p>
|
||||
<p class="comment">选中后自动在响应Header中增加<code-label>X-Cache: BYPASS|MISS|HIT|PURGE</code-label>;在浏览器端查看X-Cache值时请先禁用浏览器缓存,避免影响观察。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -6293,10 +6293,10 @@ Vue.component("http-cache-config-box", {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>添加X-Cache Header</td>
|
||||
<td>添加X-Cache报头</td>
|
||||
<td>
|
||||
<checkbox v-model="cacheConfig.addStatusHeader"></checkbox>
|
||||
<p class="comment">选中后自动在响应Header中增加<code-label>X-Cache: BYPASS|MISS|HIT|PURGE</code-label>。</p>
|
||||
<p class="comment">选中后自动在响应Header中增加<code-label>X-Cache: BYPASS|MISS|HIT|PURGE</code-label>;在浏览器端查看X-Cache值时请先禁用浏览器缓存,避免影响观察。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -122,10 +122,10 @@ Vue.component("http-cache-config-box", {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>添加X-Cache Header</td>
|
||||
<td>添加X-Cache报头</td>
|
||||
<td>
|
||||
<checkbox v-model="cacheConfig.addStatusHeader"></checkbox>
|
||||
<p class="comment">选中后自动在响应Header中增加<code-label>X-Cache: BYPASS|MISS|HIT|PURGE</code-label>。</p>
|
||||
<p class="comment">选中后自动在响应Header中增加<code-label>X-Cache: BYPASS|MISS|HIT|PURGE</code-label>;在浏览器端查看X-Cache值时请先禁用浏览器缓存,避免影响观察。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<td>名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus"/>
|
||||
<p class="comment">起一个容易识别的名称。</p>
|
||||
<p class="comment">为当前认证信息起一个容易识别的名称。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100" value="root"/>
|
||||
<input type="text" name="username" maxlength="100" value="root" v-model="username"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -42,7 +42,7 @@
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100" value="root"/>
|
||||
<input type="text" name="username" maxlength="100" value="root" v-model="username"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -62,17 +62,18 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr v-if="username != 'root'">
|
||||
<td>执行sudo</td>
|
||||
<td>
|
||||
<checkbox name="su" checked="checked"></checkbox>
|
||||
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令,请确保当前用户已经加入到sudo分组中。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>执行sudo</td>
|
||||
<td>
|
||||
<checkbox name="su"></checkbox>
|
||||
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Tea.context(function () {
|
||||
this.method = "user";
|
||||
this.username = "root"
|
||||
|
||||
this.success = NotifySuccess("保存成功", "/clusters/grants");
|
||||
});
|
||||
@@ -7,6 +7,7 @@
|
||||
<td>名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus" value=""/>
|
||||
<p class="comment">为当前认证信息起一个容易识别的名称。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -24,7 +25,7 @@
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100" value="root"/>
|
||||
<input type="text" name="username" maxlength="100" value="root" v-model="username"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -40,7 +41,7 @@
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100" value="root"/>
|
||||
<input type="text" name="username" maxlength="100" value="root" v-model="username"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -60,18 +61,19 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr v-if="username != 'root'">
|
||||
<td>执行sudo</td>
|
||||
<td>
|
||||
<checkbox name="su" checked="checked"></checkbox>
|
||||
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令,请确保当前用户已经加入到sudo分组中。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>执行sudo</td>
|
||||
<td>
|
||||
<checkbox name="su"></checkbox>
|
||||
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Tea.context(function () {
|
||||
this.method = "user";
|
||||
this.username = "root"
|
||||
|
||||
this.success = NotifyPopup;
|
||||
});
|
||||
@@ -9,7 +9,7 @@
|
||||
<td>名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus" v-model="grant.name"/>
|
||||
<p class="comment">起一个容易识别的名称。</p>
|
||||
<p class="comment">为当前认证信息起一个容易识别的名称。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -62,11 +62,11 @@
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tr>
|
||||
<tr v-if="grant.username != 'root'">
|
||||
<td>执行sudo</td>
|
||||
<td>
|
||||
<checkbox name="su" v-model="grant.su"></checkbox>
|
||||
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令。</p>
|
||||
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令,请确保当前用户已经加入到sudo分组中。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<td>名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus" value="" v-model="grant.name"/>
|
||||
<p class="comment">为当前认证信息起一个容易识别的名称。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -61,19 +62,19 @@
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tr v-if="grant.username != 'root'">
|
||||
<td>执行sudo</td>
|
||||
<td>
|
||||
<checkbox name="su" v-model="grant.su"></checkbox>
|
||||
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令,请确保当前用户已经加入到sudo分组中。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>执行sudo</td>
|
||||
<td>
|
||||
<checkbox name="su" v-model="grant.su"></checkbox>
|
||||
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td>
|
||||
|
||||
@@ -27,24 +27,47 @@
|
||||
|
||||
<!-- DNSPod -->
|
||||
<tbody v-if="type == 'dnspod'">
|
||||
<tr>
|
||||
<tr>
|
||||
<td>密钥类型 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="paramDNSPodAPIType" v-model="paramDNSPodAPIType">
|
||||
<option value="tencentDNS">腾讯云API密钥</option>
|
||||
<option value="dnsPodToken">DNSPod Token</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="paramDNSPodAPIType == 'tencentDNS'">
|
||||
<td>SecretId *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSPodAccessKeyId" maxlength="100"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥”中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="paramDNSPodAPIType == 'tencentDNS'">
|
||||
<td>SecretKey *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSPodAccessKeySecret" maxlength="100"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥”中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="paramDNSPodAPIType == 'dnsPodToken'">
|
||||
<td>密钥ID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramId" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">获取方法参考:<a href="https://docs.dnspod.cn/account/5f2d466de8320f1a740d9ff3/" target="_blank">文档</a> </p>
|
||||
<input type="text" name="paramDNSPodId" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥--DNSPod Token”中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr v-show="paramDNSPodAPIType == 'dnsPodToken'">
|
||||
<td>密钥Token *</td>
|
||||
<td>
|
||||
<input type="text" name="paramToken" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">获取方法参考:<a href="https://docs.dnspod.cn/account/5f2d466de8320f1a740d9ff3/" target="_blank">文档</a> </p>
|
||||
<input type="text" name="paramDNSPodToken" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥--DNSPod Token”中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr v-if="paramDNSPodAPIType == 'dnsPodToken'">
|
||||
<td>区域</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="paramRegion">
|
||||
<select class="ui dropdown auto-width" name="paramDNSPodRegion">
|
||||
<option value="">中国站</option>
|
||||
<option value="international">国际站</option>
|
||||
</select>
|
||||
@@ -241,28 +264,37 @@
|
||||
<!-- Microsoft Azure DNS -->
|
||||
<tbody v-if="type == 'azureDNS'">
|
||||
<tr>
|
||||
<td>Subscription ID *</td>
|
||||
<td>订阅ID <br/><em>(Subscription ID)</em> *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAzureDNSSubscriptionId" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">可以在订阅(Subscriptions)服务中查看。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tenant ID *</td>
|
||||
<td>目录(租户) ID <br/><em>(Directory Tenant ID)</em> *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAzureDNSTenantId" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">可以在应用注册(App registrations)中对应应用概述(Overview)中查看。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Client ID *</td>
|
||||
<td><input type="text" name="paramAzureDNSClientId" maxlength="100" spellcheck="false"/></td>
|
||||
<td>应用程序(客户端) ID <br/><em>(Client ID)</em> *</td>
|
||||
<td><input type="text" name="paramAzureDNSClientId" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">需要在应用注册(App registrations)中新注册应用程序获得。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Client Secret Value *</td>
|
||||
<td><input type="text" name="paramAzureDNSClientSecret" maxlength="100" spellcheck="false"/></td>
|
||||
<td>客户端密码值 <br/><em>(Client Secret Value)</em> *</td>
|
||||
<td><input type="text" name="paramAzureDNSClientSecret" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">可以在应用注册(App registrations)中对应应用的“证书和密码(Certificates & secrets)”--“客户端密码(Client secrets)”中创建和查看。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Resource Group Name *</td>
|
||||
<td><input type="text" name="paramAzureDNSResourceGroupName" maxlength="100" spellcheck="false"/></td>
|
||||
<td>资源组 <br/><em>(Resource Group Name)</em> *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAzureDNSResourceGroupName" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">权限设置帮助:你需要在对应资源组(Resource group)-- 访问控制(Access control (IAM))-- 角色分配(Role assignments)中添加一个角色分配(Role assignment),其中作业职能角色(Job function roles)为"DNS 区域参与者(DNS Zone Contributor)",成员(Members)为应用注册(App registrations)中的应用程序(application)(有时需要在选择成员(select members)界面搜索应用程序(application)名称才能看到)。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
|
||||
@@ -14,4 +14,7 @@ Tea.context(function () {
|
||||
this.typeDescription = ""
|
||||
}
|
||||
}
|
||||
|
||||
// DNSPod
|
||||
this.paramDNSPodAPIType = "tencentDNS"
|
||||
})
|
||||
@@ -21,15 +21,30 @@
|
||||
|
||||
<!-- DNSPod -->
|
||||
<tbody v-if="provider.type == 'dnspod'">
|
||||
<tr>
|
||||
<tr>
|
||||
<td class="color-border">密钥类型</td>
|
||||
<td>
|
||||
<span v-if="provider.apiParams.apiType == 'tencentDNS'">腾讯云API密钥</span>
|
||||
<span v-else>DNSPod Token</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="provider.apiParams.apiType == 'tencentDNS'">
|
||||
<td class="color-border">SecretId</td>
|
||||
<td>{{provider.apiParams.accessKeyId}}</td>
|
||||
</tr>
|
||||
<tr v-if="provider.apiParams.apiType == 'tencentDNS'">
|
||||
<td class="color-border">SecretKey</td>
|
||||
<td>{{provider.apiParams.accessKeySecret}}</td>
|
||||
</tr>
|
||||
<tr v-if="provider.apiParams.apiType != 'tencentDNS'">
|
||||
<td class="color-border">密钥ID</td>
|
||||
<td>{{provider.apiParams.id}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr v-if="provider.apiParams.apiType != 'tencentDNS'">
|
||||
<td class="color-border">密钥Token</td>
|
||||
<td>{{provider.apiParams.token}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr v-if="provider.apiParams.apiType != 'tencentDNS'">
|
||||
<td class="color-border">区域</td>
|
||||
<td>
|
||||
<span v-if="provider.apiParams.region == 'international'">国际站</span>
|
||||
@@ -178,31 +193,31 @@
|
||||
|
||||
<tbody v-if="provider.type == 'azureDNS'">
|
||||
<tr>
|
||||
<td class="color-border">Subscription ID</td>
|
||||
<td class="color-border">订阅ID <br/><em>(Subscription ID)</em></td>
|
||||
<td>
|
||||
{{provider.apiParams.subscriptionId}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">Tenant ID</td>
|
||||
<td class="color-border">目录(租户) ID <br/><em>(Directory Tenant ID)</em></td>
|
||||
<td>
|
||||
{{provider.apiParams.tenantId}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">Client ID</td>
|
||||
<td class="color-border">应用程序(客户端) ID <br/><em>(Client ID)</em></td>
|
||||
<td>
|
||||
{{provider.apiParams.clientId}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">Client Secret Value</td>
|
||||
<td class="color-border">客户端密码值 <br/><em>(Client Secret Value)</em></td>
|
||||
<td>
|
||||
{{provider.apiParams.clientSecret}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">Resource Group Name</td>
|
||||
<td class="color-border">资源组 <br/><em>(Resource Group Name)</em></td>
|
||||
<td>
|
||||
{{provider.apiParams.resourceGroupName}}
|
||||
</td>
|
||||
|
||||
@@ -26,24 +26,47 @@
|
||||
|
||||
<!-- DNSPod -->
|
||||
<tbody v-if="provider.type == 'dnspod'">
|
||||
<tr>
|
||||
<tr>
|
||||
<td>密钥类型 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="paramDNSPodAPIType" v-model="provider.params.apiType">
|
||||
<option value="tencentDNS">腾讯云API密钥</option>
|
||||
<option value="dnsPodToken">DNSPod Token</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="provider.params.apiType == 'tencentDNS'">
|
||||
<td>SecretId *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSPodAccessKeyId" maxlength="100" v-model="provider.params.accessKeyId"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥”中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="provider.params.apiType == 'tencentDNS'">
|
||||
<td>SecretKey *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSPodAccessKeySecret" maxlength="100" v-model="provider.params.accessKeySecret"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥”中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="provider.params.apiType == null || provider.params.apiType.length == 0 || provider.params.apiType == 'dnsPodToken'">
|
||||
<td>密钥ID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramId" maxlength="100" v-model="provider.params.id"/>
|
||||
<p class="comment">获取方法参考:<a href="https://docs.dnspod.cn/account/5f2d466de8320f1a740d9ff3/" target="_blank">文档</a> </p>
|
||||
<input type="text" name="paramDNSPodId" maxlength="100" v-model="provider.params.id"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥--DNSPod Token”中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr v-show="provider.params.apiType == null || provider.params.apiType.length == 0 || provider.params.apiType == 'dnsPodToken'">
|
||||
<td>密钥Token *</td>
|
||||
<td>
|
||||
<input type="text" name="paramToken" maxlength="100" v-model="provider.params.token" spellcheck="false"/>
|
||||
<p class="comment">获取方法参考:<a href="https://docs.dnspod.cn/account/5f2d466de8320f1a740d9ff3/" target="_blank">文档</a> </p>
|
||||
<input type="text" name="paramDNSPodToken" maxlength="100" v-model="provider.params.token" spellcheck="false"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥--DNSPod Token”中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr v-if="provider.params.apiType == null || provider.params.apiType.length == 0 || provider.params.apiType == 'dnsPodToken'">
|
||||
<td>区域</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="paramRegion" v-model="provider.params.region">
|
||||
<select class="ui dropdown auto-width" name="paramDNSPodRegion" v-model="provider.params.region">
|
||||
<option value="">中国站</option>
|
||||
<option value="international">国际站</option>
|
||||
</select>
|
||||
@@ -241,28 +264,38 @@
|
||||
<!-- Microsoft Azure DNS -->
|
||||
<tbody v-if="provider.type == 'azureDNS'">
|
||||
<tr>
|
||||
<td>Subscription ID *</td>
|
||||
<td>订阅ID <br/><em>(Subscription ID)</em> *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAzureDNSSubscriptionId" maxlength="100" v-model="provider.params.subscriptionId" spellcheck="false"/>
|
||||
<p class="comment">可以在订阅(Subscriptions)服务中查看。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tenant ID *</td>
|
||||
<td>目录(租户) ID <br/><em>(Directory Tenant ID)</em> *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAzureDNSTenantId" maxlength="100" v-model="provider.params.tenantId" spellcheck="false"/>
|
||||
<p class="comment">可以在应用注册(App registrations)中对应应用概述(Overview)中查看。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Client ID *</td>
|
||||
<td><input type="text" name="paramAzureDNSClientId" maxlength="100" v-model="provider.params.clientId" spellcheck="false"/></td>
|
||||
<td>应用程序(客户端) ID <br/><em>(Client ID)</em> *</td>
|
||||
<td><input type="text" name="paramAzureDNSClientId" maxlength="100" v-model="provider.params.clientId" spellcheck="false"/>
|
||||
<p class="comment">需要在应用注册(App registrations)中新注册应用程序获得。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Client Secret Value *</td>
|
||||
<td><input type="text" name="paramAzureDNSClientSecret" maxlength="100" v-model="provider.params.clientSecret" spellcheck="false"/></td>
|
||||
<td>客户端密码值 <br/><em>(Client Secret Value)</em> *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAzureDNSClientSecret" maxlength="100" v-model="provider.params.clientSecret" spellcheck="false"/>
|
||||
<p class="comment">可以在应用注册(App registrations)中对应应用的“证书和密码(Certificates & secrets)”--“客户端密码(Client secrets)”中创建和查看。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Resource Group Name *</td>
|
||||
<td><input type="text" name="paramAzureDNSResourceGroupName" maxlength="100" v-model="provider.params.resourceGroupName" spellcheck="false"/></td>
|
||||
<td>资源组 <br/><em>(Resource Group Name)</em> *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAzureDNSResourceGroupName" maxlength="100" v-model="provider.params.resourceGroupName" spellcheck="false"/>
|
||||
<p class="comment">权限设置帮助:你需要在对应资源组(Resource group)-- 访问控制(Access control (IAM))-- 角色分配(Role assignments)中添加一个角色分配(Role assignment),其中作业职能角色(Job function roles)为"DNS 区域参与者(DNS Zone Contributor)",成员(Members)为应用注册(App registrations)中的应用程序(application)(有时需要在选择成员(select members)界面搜索应用程序(application)名称才能看到)。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
|
||||
@@ -7,4 +7,9 @@ Tea.context(function () {
|
||||
that.typeDescription = v.description
|
||||
}
|
||||
})
|
||||
|
||||
// DNSPod
|
||||
if (this.provider.type == "dnspod" && this.provider.params != null && (this.provider.params.apiType == null || this.provider.params.apiType.length == 0)) {
|
||||
this.provider.params.apiType = "dnsPodToken"
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user