支持阿里云DNS

This commit is contained in:
刘祥超
2020-11-15 11:57:43 +08:00
parent 9ce8c83798
commit 5d652c2f77
14 changed files with 178 additions and 27 deletions

View File

@@ -69,7 +69,7 @@
<link-red title="点击设置" v-else @click.prevent="updateNode(node.id)">没有设置</link-red>
</td>
<td>
<span v-if="node.route.length > 0">{{node.route}}</span>
<span v-if="node.route.code.length > 0">{{node.route.name}}</span>
<link-red v-else title="点击设置" @click.prevent="updateNode(node.id)">没有设置</link-red>
</td>
<td>

View File

@@ -8,8 +8,9 @@
<td>
<p class="comment" v-if="routes.length == 0">暂时还没有支持的线路。</p>
<div v-if="routes.length > 0">
<div class="ui label tiny" v-for="route in routes" style="margin-bottom: 0.5em">{{route}}</div>
<div class="ui label tiny" v-for="route in routes" style="margin-bottom: 0.5em">{{route.name}}<span v-if="route.code.length > 0 && route.code != route.name"> ({{route.code}})</span></div>
</div>
<p class="comment">注意有些DNS服务商会根据账号的会员级别等限制线路的使用。</p>
</td>
</tr>
</table>

View File

@@ -26,7 +26,7 @@
<td>
<p class="comment" v-if="routes.length == 0">没有可选的线路。</p>
<select class="ui dropdown auto-width" name="route" v-if="routes.length > 0" v-model="route">
<option v-for="route in routes" :value="route">{{route}}</option>
<option v-for="route in routes" :value="route.code">{{route.name}}</option>
</select>
<p class="comment" v-if="routes.length > 0">当前节点IP对应的线路。</p>
</td>

View File

@@ -31,12 +31,50 @@
<td>密钥ID *</td>
<td>
<input type="text" name="paramId" maxlength="100"/>
<p class="comment">获取方法参考:<a href="https://docs.dnspod.cn/account/5f2d466de8320f1a740d9ff3/" target="_blank">文档</a> </p>
</td>
</tr>
<tr>
<td>密钥Token *</td>
<td>
<input type="text" name="paramToken" maxlength="100"/>
<p class="comment">获取方法参考:<a href="https://docs.dnspod.cn/account/5f2d466de8320f1a740d9ff3/" target="_blank">文档</a> </p>
</td>
</tr>
</tbody>
<!-- AliDNS -->
<tbody v-if="type == 'alidns'">
<tr>
<td>AccessKeyId *</td>
<td>
<input type="text" name="paramAccessKeyId" maxlength="100"/>
<p class="comment">登录阿里云控制台 -- 在"访问控制"中创建和获取。</p>
</td>
</tr>
<tr>
<td>AccessKeySecret *</td>
<td>
<input type="text" name="paramAccessKeySecret" maxlength="100"/>
<p class="comment">登录阿里云控制台 -- 在"访问控制"中创建和获取。</p>
</td>
</tr>
</tbody>
<!-- DNS.COM -->
<tbody v-if="type == 'dnscom'">
<tr>
<td>AccessKeyId *</td>
<td>
<input type="text" name="paramApiKey" maxlength="100"/>
<p class="comment">登录DNS.COM控制台 -- 在"账户中心" -- "API设置"中创建和获取。</p>
</td>
</tr>
<tr>
<td>AccessKeySecret *</td>
<td>
<input type="text" name="paramApiSecret" maxlength="100"/>
<p class="comment">登录DNS.COM控制台 -- 在"账户中心" -- "API设置"中创建和获取。</p>
</td>
</tr>
</tbody>

View File

@@ -1,7 +1,7 @@
Tea.context(function () {
this.createProvider = function () {
teaweb.popup(Tea.url(".createPopup"), {
height: "26em",
height: "28em",
callback: function () {
teaweb.success("保存成功", function () {
teaweb.reload()

View File

@@ -18,6 +18,7 @@
<td>服务商</td>
<td>{{provider.typeName}}</td>
</tr>
<!-- DNSPod -->
<tbody v-if="provider.type == 'dnspod'">
<tr>
@@ -29,6 +30,18 @@
<td>{{provider.apiParams.token}}</td>
</tr>
</tbody>
<!-- AliDNS -->
<tbody v-if="provider.type == 'alidns'">
<tr>
<td>AccessKeyId</td>
<td>{{provider.apiParams.accessKeyId}}</td>
</tr>
<tr>
<td>AccessKeySecret</td>
<td>{{provider.apiParams.accessKeySecret}}</td>
</tr>
</tbody>
</table>

View File

@@ -1,7 +1,7 @@
Tea.context(function () {
this.updateProvider = function (providerId) {
teaweb.popup(Tea.url(".updatePopup?providerId=" + providerId), {
height: "26em",
height: "28em",
callback: function () {
teaweb.success("保存成功", function () {
teaweb.reload()
@@ -65,7 +65,6 @@ Tea.context(function () {
})
})
.done(function () {
domain.isSyncing = false
Vue.set(that.domains, index, domain)
})
})

View File

@@ -29,13 +29,33 @@
<tr>
<td>密钥ID *</td>
<td>
<input type="text" name="paramId" maxlength="100" :value="provider.params.id"/>
<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>
</td>
</tr>
<tr>
<td>密钥Token *</td>
<td>
<input type="text" name="paramToken" maxlength="100" :value="provider.params.token"/>
<input type="text" name="paramToken" maxlength="100" v-model="provider.params.token"/>
<p class="comment">获取方法参考:<a href="https://docs.dnspod.cn/account/5f2d466de8320f1a740d9ff3/" target="_blank">文档</a> </p>
</td>
</tr>
</tbody>
<!-- AliDNS -->
<tbody v-if="provider.type == 'alidns'">
<tr>
<td>AccessKeyId *</td>
<td>
<input type="text" name="paramAccessKeyId" maxlength="100" v-model="provider.params.accessKeyId"/>
<p class="comment">登录阿里云控制台 -- 在"访问控制"中创建和获取。</p>
</td>
</tr>
<tr>
<td>AccessKeySecret *</td>
<td>
<input type="text" name="paramAccessKeySecret" maxlength="100" v-model="provider.params.accessKeySecret"/>
<p class="comment">登录阿里云控制台 -- 在"访问控制"中创建和获取。</p>
</td>
</tr>
</tbody>