1.4.5.2
This commit is contained in:
209
EdgeAdmin/web/views/@default/dns/clusters/cluster.html
Normal file
209
EdgeAdmin/web/views/@default/dns/clusters/cluster.html
Normal file
@@ -0,0 +1,209 @@
|
||||
{$layout}
|
||||
|
||||
<first-menu>
|
||||
<menu-item :href="'/dns'">所有集群</menu-item>
|
||||
<span class="item">|</span>
|
||||
<menu-item :href="'/dns/clusters/cluster?clusterId=' + cluster.id" active="true">{{cluster.name}}</menu-item>
|
||||
</first-menu>
|
||||
|
||||
<!-- 基本信息 -->
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">集群</td>
|
||||
<td><link-icon :href="'/clusters/cluster?clusterId=' + cluster.id">{{cluster.name}}</link-icon></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DNS子域名</td>
|
||||
<td>
|
||||
<span v-if="dnsInfo.domainName.length > 0"><var>{{dnsInfo.dnsName}}</var>.{{dnsInfo.domainName}}</span>
|
||||
<span v-else class="disabled">没有设置</span>
|
||||
|
||||
<a href="" @click.prevent="updateCluster(cluster.id)">[修改]</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DNS服务商</td>
|
||||
<td>
|
||||
<div v-if="dnsInfo.providerName.length > 0">
|
||||
<link-icon :href="'/dns/providers/provider?providerId=' + dnsInfo.providerId">{{dnsInfo.providerTypeName}} - {{dnsInfo.providerName}}</link-icon>
|
||||
</div>
|
||||
<span v-else-if="dnsInfo.domainName.length == 0" class="disabled">请先设置域名</span>
|
||||
<span v-else class="disabled">没有设置</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>自动设置CNAME记录</td>
|
||||
<td>
|
||||
<span v-if="dnsInfo.cnameRecords.length == 0" class="disabled">暂时还没有设置。</span>
|
||||
<div v-else>
|
||||
<span v-for="record in dnsInfo.cnameRecords" class="ui label basic small">{{record}}</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="dnsInfo.domainName.length > 0">
|
||||
<td>操作</td>
|
||||
<td>
|
||||
<div v-if="!isSyncing">
|
||||
<link-red v-if="dnsHasChanges" @click.prevent="syncCluster(cluster.id)">检测到解析记录有变化,需要同步</link-red>
|
||||
<a href="" @click.prevent="syncCluster(cluster.id)" v-else>DNS服务商同步</a>
|
||||
</div>
|
||||
<span v-else>DNS服务商同步中...</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- 当前任务 -->
|
||||
<div v-if="tasks.length > 0">
|
||||
<h3>正在执行的任务</h3>
|
||||
<table class="ui table selectable celled">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>对象</th>
|
||||
<th>任务</th>
|
||||
<th>状态</th>
|
||||
<th>触发时间</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="task in tasks">
|
||||
<td>
|
||||
<span v-if="(task.type == 'clusterChange' || task.type == 'clusterNodesChange') && task.cluster != null">{{task.cluster.name}}
|
||||
<link-icon :href="'/dns/clusters/cluster?clusterId=' + task.cluster.id" target="_top"></link-icon>
|
||||
</span>
|
||||
<span v-if="task.type == 'nodeChange'">{{task.node.name}}</span>
|
||||
<span v-if="task.type == 'serverChange'">{{task.server.name}}</span>
|
||||
<span v-if="task.type == 'domainChange'">{{task.domain.name}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="task.type == 'clusterChange' || task.type == 'clusterNodesChange'">集群</span>
|
||||
<span v-if="task.type == 'nodeChange'">节点</span>
|
||||
<span v-if="task.type == 'serverChange'">网站</span>
|
||||
<span v-if="task.type == 'domainChange'">域名</span>
|
||||
</td>
|
||||
<td style="word-break: break-word; width: 26em">
|
||||
<span v-if="task.isDone" class="red">{{task.error}}</span>
|
||||
<span v-else>正在同步...</span>
|
||||
</td>
|
||||
<td>{{task.updatedTime}}</td>
|
||||
<td>
|
||||
<a href="" title="删除" class="remove-btn" @click.prevent="deleteTask(task.id)"><i class="icon remove small grey"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 问题合集 -->
|
||||
<div v-if="issues.length > 0">
|
||||
<h3>需要修复的问题</h3>
|
||||
<table class="ui table selectable celled" v-if="issues.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 50%">问题对象</th>
|
||||
<th>问题描述</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="issue in issues">
|
||||
<td>
|
||||
<div v-if="issue.type == 'cluster'">
|
||||
集群 "{{issue.target}}" <link-icon :href="'/clusters/cluster?clusterId=' + issue.targetId"></link-icon>
|
||||
</div>
|
||||
<div v-if="issue.type == 'node'">
|
||||
集群 "{{issue.params.clusterName}}" 节点 "{{issue.target}}" <link-icon :href="'/clusters/cluster/node?clusterId=' + issue.params.clusterId + '&nodeId=' + issue.targetId"></link-icon>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span>{{issue.description}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<div v-if="issue.type == 'cluster'">
|
||||
<link-red @click.prevent="updateCluster(issue.targetId)">修复</link-red>
|
||||
</div>
|
||||
<div v-if="issue.type == 'node'">
|
||||
<link-red @click.prevent="updateNode(issue.params.clusterId, issue.targetId)">修复</link-red>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="margin"></div>
|
||||
</div>
|
||||
|
||||
<p class="comment">下面的DNS解析记录也可以手工在DNS服务商提供的管理平台添加。</p>
|
||||
|
||||
<!-- 节点DNS解析记录 -->
|
||||
<h3>节点DNS解析记录 <span> ({{nodes.length}}个)</span></h3>
|
||||
<p class="comment" v-if="nodes.length == 0">暂时没有需要设置的DNS记录。</p>
|
||||
<table class="ui table selectable celled" v-if="nodes.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>节点</th>
|
||||
<th>子域名</th>
|
||||
<th>记录类型</th>
|
||||
<th>记录值</th>
|
||||
<th>线路</th>
|
||||
<th>状态</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="node in nodes">
|
||||
<td><link-icon :href="'/clusters/cluster/node?clusterId=' + node.clusterId + '&nodeId=' + node.id">{{node.name}}</link-icon></td>
|
||||
<td>
|
||||
<span v-if="dnsInfo.dnsName.length > 0">{{dnsInfo.dnsName}}</span>
|
||||
<link-red v-else @click.prevent="updateCluster(cluster.id)">没有设置</link-red>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="node.ipAddr.indexOf(':') > -1">AAAA</span>
|
||||
<span v-else>A</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="node.ipAddr.length > 0">{{node.ipAddr}}</span>
|
||||
<link-red title="点击设置" v-else @click.prevent="updateNode(node.clusterId, node.id, node.ipAddrId)">没有设置</link-red>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="node.route.code.length > 0">{{node.route.name}}</span>
|
||||
<link-red v-else title="点击设置" @click.prevent="updateNode(node.clusterId, node.id, node.ipAddrId)">没有设置</link-red>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="node.isBackup" class="red">备用节点</span>
|
||||
<span v-else-if="node.isOffline" class="red">已下线</span>
|
||||
<div v-else="">
|
||||
<span v-if="node.isInstalled">
|
||||
<span class="green" v-if="node.isResolved">已解析</span>
|
||||
<span v-else class="red">未解析</span>
|
||||
</span>
|
||||
<link-red :href="'/clusters/cluster/node/install?clusterId=' + cluster.id + '&nodeId=' + node.id" v-if="!node.isInstalled" title="节点未安装"><span class="red">未安装</span></link-red>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<link-popup @click.prevent="updateNode(node.clusterId, node.id, node.ipAddrId)">修改</link-popup>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- 网站解析记录 -->
|
||||
<h3>网站解析记录 <span> ({{servers.length}}个)</span></h3>
|
||||
<p class="comment" v-if="servers.length == 0">暂时没有需要设置的DNS记录。</p>
|
||||
<table class="ui table selectable celled" v-if="servers.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>网站</th>
|
||||
<th>子域名</th>
|
||||
<th>记录类型</th>
|
||||
<th>记录值</th>
|
||||
<th>状态</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="server in servers">
|
||||
<td><link-icon :href="'/servers/server?serverId=' + server.id">{{server.name}}</link-icon> </td>
|
||||
<td>{{server.dnsName}}</td>
|
||||
<td>CNAME</td>
|
||||
<td>
|
||||
<span v-if="dnsInfo.domainName.length > 0"><var>{{dnsInfo.dnsName}}</var>.{{dnsInfo.domainName}}.</span>
|
||||
<link-red title="点击设置" v-else @click.prevent="updateCluster(cluster.id)">没有设置</link-red>
|
||||
</td>
|
||||
<td>
|
||||
<span class="green" v-if="server.isResolved">已解析</span>
|
||||
<span v-else class="red">未解析</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
56
EdgeAdmin/web/views/@default/dns/clusters/cluster.js
Normal file
56
EdgeAdmin/web/views/@default/dns/clusters/cluster.js
Normal file
@@ -0,0 +1,56 @@
|
||||
Tea.context(function () {
|
||||
this.updateCluster = function (clusterId) {
|
||||
teaweb.popup("/dns/updateClusterPopup?clusterId=" + clusterId, {
|
||||
height: "25em",
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.updateNode = function (clusterId, nodeId, ipAddrId) {
|
||||
teaweb.popup("/dns/issues/updateNodePopup?clusterId=" + clusterId + "&nodeId=" + nodeId + "&ipAddrId=" + (ipAddrId ? ipAddrId : 0), {
|
||||
width: "46em",
|
||||
height: "26em",
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.isSyncing = false
|
||||
this.syncCluster = function (clusterId) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要执行数据同步吗?", function () {
|
||||
that.isSyncing = true
|
||||
that.$post(".sync")
|
||||
.params({clusterId: clusterId})
|
||||
.done(function () {
|
||||
that.isSyncing = false
|
||||
that.dnsHasChanges = false
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.success("同步成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
this.deleteTask = function (taskId) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要删除这个任务吗?", function () {
|
||||
that.$post("/dns/tasks/delete")
|
||||
.params({
|
||||
taskId: taskId
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
20
EdgeAdmin/web/views/@default/dns/domains/clustersPopup.html
Normal file
20
EdgeAdmin/web/views/@default/dns/domains/clustersPopup.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>使用域名"{{domain}}"的集群</h3>
|
||||
<table class="ui table selectable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>集群</th>
|
||||
<th>域名</th>
|
||||
<th class="width10">解析状态</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="cluster in clusters">
|
||||
<td>{{cluster.name}}<a :href="'/clusters/cluster?clusterId=' + cluster.id" target="_blank"><link-icon></link-icon></a> </td>
|
||||
<td>{{cluster.dnsName}}.{{domain}}</td>
|
||||
<td>
|
||||
<span class="green" v-if="cluster.isOk">已解析</span>
|
||||
<span class="red" v-else>未解析</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
19
EdgeAdmin/web/views/@default/dns/domains/createPopup.html
Normal file
19
EdgeAdmin/web/views/@default/dns/domains/createPopup.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>添加管理域名</h3>
|
||||
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="providerId" :value="providerId"/>
|
||||
<csrf-token></csrf-token>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">域名 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="64" ref="focus"/>
|
||||
<p class="comment">在DNS服务商中可以管理的域名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
42
EdgeAdmin/web/views/@default/dns/domains/nodesPopup.html
Normal file
42
EdgeAdmin/web/views/@default/dns/domains/nodesPopup.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>使用域名"{{domain}}"的节点</h3>
|
||||
<form class="ui form" action="/dns/domains/nodesPopup" method="get">
|
||||
<input type="hidden" name="domainId" :value="domainId"/>
|
||||
<div class="ui fields inline">
|
||||
<div class="ui field">
|
||||
<input type="text" placeholder="关键词" v-model="keyword"/>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<select class="ui dropdown auto-width" v-model="status">
|
||||
<option value="">[全部状态]</option>
|
||||
<option value="ok">已解析</option>
|
||||
<option value="notOk">未解析</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="ui divider"></div>
|
||||
<table class="ui table selectable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>集群</th>
|
||||
<th>节点</th>
|
||||
<th>子域名</th>
|
||||
<th>线路</th>
|
||||
<th>IP</th>
|
||||
<th class="width10">解析状态</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="node in nodes">
|
||||
<td>{{node.cluster.name}}<a :href="'/clusters/cluster?clusterId=' + node.cluster.id" target="_blank"><link-icon></link-icon></a> </td>
|
||||
<td>{{node.name}}<a :href="'/clusters/cluster/node?clusterId=' + node.cluster.id + '&nodeId=' + node.id" target="_blank"><link-icon></link-icon></a></td>
|
||||
<td>{{node.cluster.dnsName}}</td>
|
||||
<td>{{node.route.name}}</td>
|
||||
<td>{{node.ipAddr}}</td>
|
||||
<td>
|
||||
<span class="green" v-if="node.isOk">已解析</span>
|
||||
<span class="red" v-else>未解析</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
45
EdgeAdmin/web/views/@default/dns/domains/nodesPopup.js
Normal file
45
EdgeAdmin/web/views/@default/dns/domains/nodesPopup.js
Normal file
@@ -0,0 +1,45 @@
|
||||
Tea.context(function () {
|
||||
this.keyword = ""
|
||||
this.status = ""
|
||||
|
||||
let allNodes = []
|
||||
this.clusters.forEach(function (cluster) {
|
||||
let nodes = cluster.nodes
|
||||
nodes.forEach(function (node) {
|
||||
node.cluster = cluster
|
||||
allNodes.push(node)
|
||||
})
|
||||
})
|
||||
|
||||
this.nodes = allNodes
|
||||
|
||||
this.$delay(function () {
|
||||
this.$watch("keyword", function () {
|
||||
this.reloadNodes()
|
||||
})
|
||||
this.$watch("status", function () {
|
||||
this.reloadNodes()
|
||||
})
|
||||
})
|
||||
|
||||
this.reloadNodes = function () {
|
||||
let that = this
|
||||
this.nodes = allNodes.$copy().$findAll(function (k, v) {
|
||||
if (that.keyword.length > 0
|
||||
&& !teaweb.match(v.cluster.name, that.keyword)
|
||||
&& !teaweb.match(v.cluster.dnsName, that.keyword)
|
||||
&& !teaweb.match(v.name, that.keyword)
|
||||
&& !teaweb.match(v.ipAddr, that.keyword)
|
||||
&& !teaweb.match(v.route.name, that.keyword)) {
|
||||
return false
|
||||
}
|
||||
if (that.status == "ok" && !v.isOk) {
|
||||
return false
|
||||
}
|
||||
if (that.status == "notOk" && v.isOk) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
})
|
||||
18
EdgeAdmin/web/views/@default/dns/domains/routesPopup.html
Normal file
18
EdgeAdmin/web/views/@default/dns/domains/routesPopup.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>域名支持的线路</h3>
|
||||
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">线路</td>
|
||||
<td>
|
||||
<p class="comment" v-if="routes.length == 0">暂时还没有支持的线路。</p>
|
||||
<div v-if="routes.length > 0">
|
||||
<div class="ui label tiny basic" 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>
|
||||
|
||||
<button class="ui button primary" @click.prevent="close" type="button">确定</button>
|
||||
3
EdgeAdmin/web/views/@default/dns/domains/routesPopup.js
Normal file
3
EdgeAdmin/web/views/@default/dns/domains/routesPopup.js
Normal file
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.close = NotifyPopup
|
||||
})
|
||||
39
EdgeAdmin/web/views/@default/dns/domains/selectPopup.html
Normal file
39
EdgeAdmin/web/views/@default/dns/domains/selectPopup.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>选择集群DNS设置</h3>
|
||||
|
||||
<form method="post" class="ui form" data-tea-success="success" data-tea-action="$">
|
||||
<csrf-token></csrf-token>
|
||||
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">DNS服务商</td>
|
||||
<td>
|
||||
<select name="providerType" class="ui dropdown auto-width" v-model="providerType" @change="changeProviderType">
|
||||
<option v-for="providerType in providerTypes" :value="providerType.code">{{providerType.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>账号</td>
|
||||
<td>
|
||||
<p class="comment" v-if="providers.length == 0">没有账号可选</p>
|
||||
<select name="providerId" class="ui dropdown auto-width" v-model="providerId" v-show="providers.length > 0">
|
||||
<option v-for="provider in providers" :value="provider.id">{{provider.name}}</option>
|
||||
</select>
|
||||
<p class="comment"><a href="/dns/providers" target="_blank">去管理DNS服务商账号»</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="providerId > 0">
|
||||
<td>域名</td>
|
||||
<td>
|
||||
<p class="comment" v-if="domains.length == 0">没有域名可选</p>
|
||||
<select name="domainId" class="ui dropdown auto-width" v-model="domainId" v-show="domains.length > 0">
|
||||
<option v-for="domain in domains" :value="domain.id">{{domain.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
80
EdgeAdmin/web/views/@default/dns/domains/selectPopup.js
Normal file
80
EdgeAdmin/web/views/@default/dns/domains/selectPopup.js
Normal file
@@ -0,0 +1,80 @@
|
||||
Tea.context(function () {
|
||||
this.$delay(function () {
|
||||
this.changeProviderType()
|
||||
this.changeProvider()
|
||||
|
||||
this.$watch("providerId", function () {
|
||||
this.changeProvider()
|
||||
})
|
||||
this.$watch("domainId", function () {
|
||||
this.changeDomain()
|
||||
})
|
||||
})
|
||||
|
||||
this.success = NotifyPopup
|
||||
|
||||
// 初始化的内容
|
||||
// this.domainId = 0
|
||||
// this.domain = ""
|
||||
// this.providerId = 0
|
||||
|
||||
if (this.providerType == "") {
|
||||
this.providerType = this.providerTypes[0].code
|
||||
}
|
||||
this.providers = []
|
||||
this.domains = []
|
||||
|
||||
this.changeProviderType = function () {
|
||||
this.$post("/dns/providerOptions")
|
||||
.params({
|
||||
type: this.providerType
|
||||
})
|
||||
.success(function (resp) {
|
||||
this.providers = resp.data.providers
|
||||
|
||||
// 检查providerId
|
||||
if (this.providers.length == 0) {
|
||||
this.providerId = 0
|
||||
return
|
||||
}
|
||||
let that = this
|
||||
if (this.providers.$find(function (k, v) {
|
||||
return v.id == that.providerId
|
||||
}) == null) {
|
||||
this.providerId = this.providers[0].id
|
||||
}
|
||||
this.changeProvider()
|
||||
})
|
||||
}
|
||||
|
||||
this.changeProvider = function () {
|
||||
this.$post("/dns/domainOptions")
|
||||
.params({
|
||||
providerId: this.providerId
|
||||
})
|
||||
.success(function (resp) {
|
||||
this.domains = resp.data.domains
|
||||
this.changeDomain()
|
||||
})
|
||||
}
|
||||
|
||||
this.changeDomain = function () {
|
||||
if (this.domains.length == 0) {
|
||||
this.domainId = 0
|
||||
this.domain = ""
|
||||
return
|
||||
}
|
||||
|
||||
let domainId = this.domainId
|
||||
let domainInfo = this.domains.$find(function (k, v) {
|
||||
return v.id == domainId
|
||||
})
|
||||
if (domainInfo == null) {
|
||||
// 默认选取第一个
|
||||
this.domainId = this.domains[0].id
|
||||
this.domain = this.domains[0].name
|
||||
} else {
|
||||
this.domain = domainInfo.name
|
||||
}
|
||||
}
|
||||
})
|
||||
40
EdgeAdmin/web/views/@default/dns/domains/serversPopup.html
Normal file
40
EdgeAdmin/web/views/@default/dns/domains/serversPopup.html
Normal file
@@ -0,0 +1,40 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>使用域名"{{domain}}"的网站</h3>
|
||||
<form class="ui form" action="/dns/domains/serversPopup" method="get">
|
||||
<input type="hidden" name="domainId" :value="domainId"/>
|
||||
<div class="ui fields inline">
|
||||
<div class="ui field">
|
||||
<input type="text" placeholder="关键词" v-model="keyword"/>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<select class="ui dropdown auto-width" v-model="status">
|
||||
<option value="">[全部状态]</option>
|
||||
<option value="ok">已解析</option>
|
||||
<option value="notOk">未解析</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="ui divider"></div>
|
||||
<table class="ui table selectable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>集群</th>
|
||||
<th>网站</th>
|
||||
<th>子域名</th>
|
||||
<th>CNAME</th>
|
||||
<th class="width10">解析状态</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="server in servers">
|
||||
<td>{{server.cluster.name}}<a :href="'/clusters/cluster?clusterId=' + server.cluster.id" target="_blank"><link-icon></link-icon></a> </td>
|
||||
<td>{{server.name}}<a :href="'/servers/server?clusterId=' + server.cluster.id + '&serverId=' + server.id" target="_blank"><link-icon></link-icon></a></td>
|
||||
<td>{{server.cluster.dnsName}}</td>
|
||||
<td>{{server.dnsName}}</td>
|
||||
<td>
|
||||
<span class="green" v-if="server.isOk">已解析</span>
|
||||
<span class="red" v-else>未解析</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
44
EdgeAdmin/web/views/@default/dns/domains/serversPopup.js
Normal file
44
EdgeAdmin/web/views/@default/dns/domains/serversPopup.js
Normal file
@@ -0,0 +1,44 @@
|
||||
Tea.context(function () {
|
||||
this.keyword = ""
|
||||
this.status = ""
|
||||
|
||||
let allServers = []
|
||||
this.clusters.forEach(function (cluster) {
|
||||
let servers = cluster.servers
|
||||
servers.forEach(function (server) {
|
||||
server.cluster = cluster
|
||||
allServers.push(server)
|
||||
})
|
||||
})
|
||||
|
||||
this.servers = allServers
|
||||
|
||||
this.$delay(function () {
|
||||
this.$watch("keyword", function () {
|
||||
this.reloadServers()
|
||||
})
|
||||
this.$watch("status", function () {
|
||||
this.reloadServers()
|
||||
})
|
||||
})
|
||||
|
||||
this.reloadServers = function () {
|
||||
let that = this
|
||||
this.servers = allServers.$copy().$findAll(function (k, v) {
|
||||
if (that.keyword.length > 0
|
||||
&& !teaweb.match(v.cluster.name, that.keyword)
|
||||
&& !teaweb.match(v.cluster.dnsName, that.keyword)
|
||||
&& !teaweb.match(v.name, that.keyword)
|
||||
&& !teaweb.match(v.dnsName, that.keyword)) {
|
||||
return false
|
||||
}
|
||||
if (that.status == "ok" && !v.isOk) {
|
||||
return false
|
||||
}
|
||||
if (that.status == "notOk" && v.isOk) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
})
|
||||
33
EdgeAdmin/web/views/@default/dns/domains/updatePopup.html
Normal file
33
EdgeAdmin/web/views/@default/dns/domains/updatePopup.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改管理域名</h3>
|
||||
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="domainId" :value="domain.id"/>
|
||||
<csrf-token></csrf-token>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">域名 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="64" ref="focus" v-model="domain.name"/>
|
||||
<p class="comment">在DNS服务商中可以管理的域名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>启用当前域名</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isOn" value="1" v-model="domain.isOn"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
4
EdgeAdmin/web/views/@default/dns/index.css
Normal file
4
EdgeAdmin/web/views/@default/dns/index.css
Normal file
@@ -0,0 +1,4 @@
|
||||
.italic {
|
||||
font-style: italic !important;
|
||||
}
|
||||
/*# sourceMappingURL=index.css.map */
|
||||
1
EdgeAdmin/web/views/@default/dns/index.css.map
Normal file
1
EdgeAdmin/web/views/@default/dns/index.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EACC,6BAAA","file":"index.css"}
|
||||
52
EdgeAdmin/web/views/@default/dns/index.html
Normal file
52
EdgeAdmin/web/views/@default/dns/index.html
Normal file
@@ -0,0 +1,52 @@
|
||||
{$layout}
|
||||
|
||||
<div class="margin"></div>
|
||||
|
||||
<form class="ui form" method="get" action="/dns">
|
||||
<div class="ui fields inline">
|
||||
<div class="ui field">
|
||||
<input type="text" name="keyword" placeholder="集群、域名..." v-model="keyword"/>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<button class="ui button" type="submit">搜索</button>
|
||||
|
||||
<a href="/dns" v-if="keyword.length > 0">[清除条件]</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<p class="comment" v-if="clusters.length == 0" style="margin-top: 1em">暂时还没有集群。</p>
|
||||
<table class="ui table selectable celled" v-if="clusters.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>集群</th>
|
||||
<th>子域名</th>
|
||||
<th>DNS服务商</th>
|
||||
<th>DNS服务商账号</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="cluster in clusters">
|
||||
<td>
|
||||
<a :href="'/dns/clusters/cluster?clusterId=' + cluster.id"><keyword :v-word="keyword">{{cluster.name}}</keyword></a><link-icon :href="'/clusters/cluster?clusterId=' + cluster.id"></link-icon>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="cluster.dnsName.length > 0 && cluster.domainName.length > 0"><em class="italic"><keyword :v-word="keyword">{{cluster.dnsName}}</keyword></em>.<keyword :v-word="keyword">{{cluster.domainName}}</keyword></span>
|
||||
<span v-else="" class="disabled">-</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="cluster.providerTypeName.length > 0">{{cluster.providerTypeName}}</span>
|
||||
<span v-else class="disabled">-</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="cluster.providerName.length > 0">{{cluster.providerName}}<link-icon :href="'/dns/providers/provider?providerId=' + cluster.providerId"></link-icon></span>
|
||||
<span v-else="" class="disabled">-</span>
|
||||
</td>
|
||||
<td>
|
||||
<a :href="'/dns/clusters/cluster?clusterId=' + cluster.id">详情</a> <a href="" @click.prevent="updateCluster(cluster.id)">修改</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="comment" v-if="clusters.length > 0">这里列出了所有集群对应的域名设置。</p>
|
||||
|
||||
<div class="page" v-html="page"></div>
|
||||
12
EdgeAdmin/web/views/@default/dns/index.js
Normal file
12
EdgeAdmin/web/views/@default/dns/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
Tea.context(function () {
|
||||
this.updateCluster = function (clusterId) {
|
||||
teaweb.popup("/dns/updateClusterPopup?clusterId=" + clusterId, {
|
||||
height: "25em",
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
3
EdgeAdmin/web/views/@default/dns/index.less
Normal file
3
EdgeAdmin/web/views/@default/dns/index.less
Normal file
@@ -0,0 +1,3 @@
|
||||
.italic {
|
||||
font-style: italic !important;
|
||||
}
|
||||
50
EdgeAdmin/web/views/@default/dns/issues/index.html
Normal file
50
EdgeAdmin/web/views/@default/dns/issues/index.html
Normal file
@@ -0,0 +1,50 @@
|
||||
{$layout}
|
||||
|
||||
<first-menu>
|
||||
<span class="item" v-if="issues.length > 0">共<span class="red">{{issues.length}}</span>个问题</span>
|
||||
<span class="item" v-if="issues.length > 0">|</span>
|
||||
<a href="/dns/issues" title="刷新" class="item" @click.prevent="reload">刷新</a>
|
||||
<span class="item">|</span>
|
||||
<span class="item"><tip-icon content="这里是一个全局的DNS解析问题发现页,方便我们诊断并修复问题。"></tip-icon></span>
|
||||
</first-menu>
|
||||
|
||||
<div v-if="isRequesting">
|
||||
<div class="margin"></div>
|
||||
正在检查系统问题,请耐心等待...
|
||||
</div>
|
||||
|
||||
<div v-if="issues.length == 0 && !isRequesting">
|
||||
<div class="margin"></div>
|
||||
<p class="comment">暂时没有发现问题。</p>
|
||||
</div>
|
||||
|
||||
<table class="ui table selectable celled" v-if="issues.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 50%">问题对象</th>
|
||||
<th>问题描述</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="issue in issues">
|
||||
<td>
|
||||
<div v-if="issue.type == 'cluster'">
|
||||
集群 "{{issue.target}}" <link-icon :href="'/clusters/cluster?clusterId=' + issue.targetId"></link-icon>
|
||||
</div>
|
||||
<div v-if="issue.type == 'node'">
|
||||
集群 "{{issue.params.clusterName}}" 节点 "{{issue.target}}" <link-icon :href="'/clusters/cluster/node?clusterId=' + issue.params.clusterId + '&nodeId=' + issue.targetId"></link-icon>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span>{{issue.description}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<div v-if="issue.type == 'cluster'">
|
||||
<link-red @click.prevent="updateCluster(issue.targetId)">修复</link-red>
|
||||
</div>
|
||||
<div v-if="issue.type == 'node'">
|
||||
<link-red @click.prevent="updateNode(issue.params.clusterId, issue.targetId)">修复</link-red>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
43
EdgeAdmin/web/views/@default/dns/issues/index.js
Normal file
43
EdgeAdmin/web/views/@default/dns/issues/index.js
Normal file
@@ -0,0 +1,43 @@
|
||||
Tea.context(function () {
|
||||
this.isRequesting = true
|
||||
|
||||
this.$delay(function () {
|
||||
this.reload()
|
||||
})
|
||||
|
||||
this.updateCluster = function (clusterId) {
|
||||
let that = this
|
||||
teaweb.popup("/dns/updateClusterPopup?clusterId=" + clusterId, {
|
||||
height: "25em",
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
that.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.updateNode = function (clusterId, nodeId) {
|
||||
let that = this
|
||||
teaweb.popup("/dns/issues/updateNodePopup?clusterId=" + clusterId + "&nodeId=" + nodeId, {
|
||||
width: "46em",
|
||||
height: "26em",
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
that.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.reload = function () {
|
||||
this.isRequesting = true
|
||||
this.$post("$")
|
||||
.success(function (resp) {
|
||||
this.issues = resp.data.issues;
|
||||
})
|
||||
.done(function () {
|
||||
this.isRequesting = false
|
||||
})
|
||||
}
|
||||
})
|
||||
42
EdgeAdmin/web/views/@default/dns/issues/updateNodePopup.html
Normal file
42
EdgeAdmin/web/views/@default/dns/issues/updateNodePopup.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改节点DNS设置</h3>
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="nodeId" :value="nodeId"/>
|
||||
<input type="hidden" name="domainId" :value="domainId"/>
|
||||
<input type="hidden" name="ipAddrId" :value="ipAddrId"/>
|
||||
<csrf-token></csrf-token>
|
||||
|
||||
<table class="ui table definition selectable">
|
||||
<tr v-if="domainName.length > 0">
|
||||
<td>主域名</td>
|
||||
<td>{{domainName}}
|
||||
<p class="comment">由当前节点所属集群设置。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">IP地址 *</td>
|
||||
<td>
|
||||
<input type="text" name="ipAddr" maxlength="64" ref="focus" v-model="ipAddr"/>
|
||||
<p class="comment">用于域名解析的节点IP地址。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="domainId > 0">
|
||||
<td>线路</td>
|
||||
<td>
|
||||
<p class="comment" v-if="allRoutes.length == 0">没有可选的线路。<a href="" @click.prevent="syncDomain(domainId)">[获取线路]</a></p>
|
||||
<div v-if="allRoutes.length > 0">
|
||||
<dns-route-selector :v-all-routes="allRoutes" :v-routes="routes"></dns-route-selector>
|
||||
<p class="comment">当前节点IP对应的线路。<a href="" @click.prevent="syncDomain(domainId)">[重新获取线路]</a></p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="domainId == 0">
|
||||
<td>线路</td>
|
||||
<td><span class="disabled">当前集群没有选择域名。</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
13
EdgeAdmin/web/views/@default/dns/issues/updateNodePopup.js
Normal file
13
EdgeAdmin/web/views/@default/dns/issues/updateNodePopup.js
Normal file
@@ -0,0 +1,13 @@
|
||||
Tea.context(function () {
|
||||
this.syncDomain = function (domainId) {
|
||||
this.$post(".syncDomain")
|
||||
.params({
|
||||
domainId: domainId
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.success("从服务商获取线路成功", function () {
|
||||
window.location.reload()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
416
EdgeAdmin/web/views/@default/dns/providers/createPopup.html
Normal file
416
EdgeAdmin/web/views/@default/dns/providers/createPopup.html
Normal file
@@ -0,0 +1,416 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>添加DNS服务商账号</h3>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">账号说明 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="50" ref="focus"/>
|
||||
<p class="comment">用来方便区分不同的账号。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>服务商厂家 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="type" v-model="type" @change="changeType">
|
||||
<option value="">[请选择]</option>
|
||||
<option v-for="type in types" :value="type.code">{{type.name}}</option>
|
||||
</select>
|
||||
<p class="comment" v-if="typeDescription.length > 0">{{typeDescription}} 系统会保留原有域名下的域名解析,请放心使用。<span v-if="!teaIsPlus">购买商业版可获得更多厂商支持。</span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="type.length > 0">
|
||||
<td colspan="2">API参数</td>
|
||||
</tr>
|
||||
|
||||
<!-- DNSPod -->
|
||||
<tbody v-if="type == 'dnspod'">
|
||||
<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密钥”中获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="paramDNSPodAPIType == 'dnsPodToken'">
|
||||
<td>密钥ID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSPodId" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥--DNSPod Token”中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="paramDNSPodAPIType == 'dnsPodToken'">
|
||||
<td>密钥Token *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSPodToken" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥--DNSPod Token”中获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="paramDNSPodAPIType == 'dnsPodToken'">
|
||||
<td>区域</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="paramDNSPodRegion">
|
||||
<option value="">中国站</option>
|
||||
<option value="international">国际站</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- AliDNS -->
|
||||
<tbody v-if="type == 'alidns'">
|
||||
<tr>
|
||||
<td>AccessKeyId *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAliDNSAccessKeyId" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">登录阿里云控制台 -- 在"访问控制"中创建和获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AccessKeySecret *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAliDNSAccessKeySecret" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">登录阿里云控制台 -- 在"访问控制"中创建和获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>区域ID<optional-label></optional-label></td>
|
||||
<td>
|
||||
<input type="text" name="paramAliDNSRegionId" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">阿里云产品所在区域代号,通常不需要填写。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 华为云 -->
|
||||
<tbody v-if="type == 'huaweiDNS'">
|
||||
<tr>
|
||||
<td>AccessKeyId *</td>
|
||||
<td>
|
||||
<input type="text" name="paramHuaweiAccessKeyId" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">登录华为云控制台 -- 在"我的凭证 -- 访问密钥"中创建和获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AccessKeySecret *</td>
|
||||
<td>
|
||||
<input type="text" name="paramHuaweiAccessKeySecret" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">登录华为云控制台 -- 在"我的凭证 -- 访问密钥"中创建和获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>终端节点</td>
|
||||
<td>
|
||||
<input type="text" name="paramHuaweiEndpoint" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">选填项。可以填写终端节点(Endpoint)区域代号或者域名,参考 <a href="https://developer.huaweicloud.com/endpoint?DNS" target="_blank">https://developer.huaweicloud.com/endpoint?DNS</a>(如果此链接失效,请到华为云开发者中心自行查找)。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- CloudFlare -->
|
||||
<tbody v-if="type == 'cloudFlare'">
|
||||
<tr>
|
||||
<td>API密钥 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramCloudFlareAPIKey" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在个人资料中的"API令牌"--"API密钥"--"Global API Key"中获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>账号邮箱 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramCloudFlareEmail" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">登录账号使用的邮箱。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- GoDaddy -->
|
||||
<tbody v-if="type == 'godaddy'">
|
||||
<tr>
|
||||
<td>Key *</td>
|
||||
<td>
|
||||
<input type="text" name="paramGoDaddyKey" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">可以在GoDaddy<a href="https://developer.godaddy.com/keys" target="_blank">开发者中心</a>创建,创建时Environment选择Production。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Secret *</td>
|
||||
<td>
|
||||
<input type="text" name="paramGoDaddySecret" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment"><mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- ClouDNS -->
|
||||
<tbody v-if="type == 'cloudns'">
|
||||
<tr>
|
||||
<td>用户认证ID<em>(auth-id)</em></td>
|
||||
<td>
|
||||
<input type="text" name="paramClouDNSAuthId" maxlength="20" spellcheck="false"/>
|
||||
<p class="comment">和子用户认证ID二选一。可以在ClouDNS<a href="https://www.cloudns.net/api-settings/" target="_blank">API设置页面</a>添加。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>子用户认证ID<em>(sub-auth-id)</em></td>
|
||||
<td>
|
||||
<input type="text" name="paramClouDNSSubAuthId" maxlength="20" spellcheck="false"/>
|
||||
<p class="comment">和用户认证ID二选一。可以在ClouDNS<a href="https://www.cloudns.net/api-settings/" target="_blank">API设置页面</a>添加。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>认证密码 *<em>(auth-password)</em></td>
|
||||
<td>
|
||||
<input type="password" name="paramClouDNSAuthPassword" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">用户或者子用户的认证密码。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- DNS.COM -->
|
||||
<tbody v-if="type == 'dnscom'">
|
||||
<tr>
|
||||
<td>API Key *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSComKey" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在51DNS.COM控制台账号中心--API设置中创建和查看。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>API Secret *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSComSecret" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在51DNS.COM控制台账号中心--API设置中创建和查看。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- DNS.LA -->
|
||||
<tbody v-if="type == 'dnsla'">
|
||||
<tr>
|
||||
<td>API ID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSLaAPIId" maxlength="100"/>
|
||||
<p class="comment">在DNS.LA控制台--账户信息中查看。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>API密钥 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSLaSecret" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在DNS.LA控制台--账户信息中查看。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- VolcEngine -->
|
||||
<tbody v-if="type == 'volcEngine'">
|
||||
<tr>
|
||||
<td>Access Key ID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramVolcEngineAccessKeyId" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在火山引擎“访问控制--API访问密钥”中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Secret Access Key *</td>
|
||||
<td>
|
||||
<input type="text" name="paramVolcEngineAccessKeySecret" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment"><mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- Amazon Route 53 -->
|
||||
<tbody v-if="type == 'amazonRoute53'">
|
||||
<tr>
|
||||
<td>Access Key ID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAmazonRoute53AccessKeyId" maxlength="100" spellcheck="false"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Secret Access Key *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAmazonRoute53AccessKeySecret" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment"><mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>API区域</td>
|
||||
<td>
|
||||
<input type="text" name="paramAmazonRoute53Region" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">通常不需要填写。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- Microsoft Azure DNS -->
|
||||
<tbody v-if="type == 'azureDNS'">
|
||||
<tr>
|
||||
<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>目录(租户) 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>应用程序(客户端) 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>客户端密码值 <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)”中创建和查看。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
|
||||
<!-- bunny.net -->
|
||||
<tbody v-if="type == 'bunnyNet'">
|
||||
<tr>
|
||||
<td>API密钥 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramBunnyNetAPIKey" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在"Edit account details" -- "API Key"中获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- Gname -->
|
||||
<tbody v-if="type == 'gname'">
|
||||
<tr>
|
||||
<td>APPID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramGnameAppid" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在Gname控制台API设置中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>API Secret *</td>
|
||||
<td>
|
||||
<input type="text" name="paramGnameSecret" maxlength="100" spellcheck="false"/>
|
||||
<p class="comment">在Gname控制台API设置中获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- EdgeDNS -->
|
||||
<tbody v-if="type == 'localEdgeDNS'">
|
||||
<tr>
|
||||
<td>选择域名服务集群 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="paramLocalEdgeDNSClusterId">
|
||||
<option value="0">[选择域名服务集群]</option>
|
||||
<option v-for="cluster in nsClusters" :value="cluster.id">{{cluster.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- EdgeDNS API -->
|
||||
<tbody v-if="type == 'edgeDNSAPI'">
|
||||
<tr>
|
||||
<td>API地址 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramEdgeDNSAPIHost" maxlength="100"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AccessKey类型 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="paramEdgeDNSAPIRole">
|
||||
<option value="user">平台用户</option>
|
||||
<option value="admin">管理员</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AccessKey ID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramEdgeDNSAPIAccessKeyId" maxlength="64"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AccessKey密钥 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramEdgeDNSAPIAccessKeySecret" maxlength="64"/>
|
||||
<p class="comment"><mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 自定义HTTP-->
|
||||
<tbody v-if="type == 'customHTTP'">
|
||||
<tr>
|
||||
<td>HTTP URL *</td>
|
||||
<td>
|
||||
<input type="text" name="paramCustomHTTPURL" maxlength="200"/>
|
||||
<p class="comment">HTTP URL完整地址,DNS所有操作都会以POST的方式转发到此地址。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>私钥 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramCustomHTTPSecret" maxlength="64" v-model="paramCustomHTTPSecret"/>
|
||||
<p class="comment">通讯用的私钥,转发请求时会在Header中加入相关信息,方便开发者校验请求是否合法。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 更多选项 -->
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>最小TTL</td>
|
||||
<td>
|
||||
<div class="ui right labeled input">
|
||||
<input type="text" name="minTTL" size="4" maxlength="6" style="width: 6em"/>
|
||||
<span class="ui label">秒</span>
|
||||
</div>
|
||||
<p class="comment">生成的DNS时可以使用的最小TTL,请根据你选择的服务商和你在服务商中的账号等级进行填写;不填写或者0表示默认。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
20
EdgeAdmin/web/views/@default/dns/providers/createPopup.js
Normal file
20
EdgeAdmin/web/views/@default/dns/providers/createPopup.js
Normal file
@@ -0,0 +1,20 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
this.type = ""
|
||||
this.typeDescription = ""
|
||||
|
||||
this.changeType = function () {
|
||||
let that = this
|
||||
let t = this.types.$find(function (k, v) {
|
||||
return v.code == that.type
|
||||
})
|
||||
if (t != null) {
|
||||
this.typeDescription = t.description
|
||||
} else {
|
||||
this.typeDescription = ""
|
||||
}
|
||||
}
|
||||
|
||||
// DNSPod
|
||||
this.paramDNSPodAPIType = "tencentDNS"
|
||||
})
|
||||
55
EdgeAdmin/web/views/@default/dns/providers/index.html
Normal file
55
EdgeAdmin/web/views/@default/dns/providers/index.html
Normal file
@@ -0,0 +1,55 @@
|
||||
{$layout}
|
||||
|
||||
<first-menu>
|
||||
<a href="" class="item" @click.prevent="createProvider()">[添加DNS账号信息]</a>
|
||||
</first-menu>
|
||||
|
||||
<div class="margin"></div>
|
||||
|
||||
<form class="ui form" method="get" action="/dns/providers">
|
||||
<div class="ui fields inline">
|
||||
<div class="ui field">
|
||||
<input type="text" name="keyword" placeholder="账号说明..." v-model="keyword"/>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<input type="text" name="domain" placeholder="域名..." v-model="domain"/>
|
||||
</div>
|
||||
<div class="ui field" v-if="providerTypes.length > 0">
|
||||
<select class="ui dropdown auto-width" name="providerType" v-model="providerType">
|
||||
<option value="">[服务商厂家]</option>
|
||||
<option v-for="p in providerTypes" :value="p.code">{{p.name}}({{p.count}})</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<button class="ui button" type="submit">搜索</button>
|
||||
|
||||
<a :href="Tea.url('.')" v-if="keyword.length > 0 || domain.length > 0 || providerType.length > 0">[清除条件]</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<p class="comment" v-if="providers.length == 0">暂时还没有第三方DNS服务商。</p>
|
||||
|
||||
<table class="ui table selectable celled" v-if="providers.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>账号说明</th>
|
||||
<th class="three wide">服务商</th>
|
||||
<th class="width5 center">域名</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(provider, index) in providers">
|
||||
<td><a :href="'/dns/providers/provider?providerId=' + provider.id"><keyword :v-word="keyword">{{provider.name}}</keyword></a></td>
|
||||
<td>{{provider.typeName}}</td>
|
||||
<td class="center">
|
||||
<span v-if="provider.countDomains == 0" class="disabled">0</span>
|
||||
<span v-else>{{provider.countDomains}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<a :href="'/dns/providers/provider?providerId=' + provider.id">详情</a> <a href="" @click.prevent="deleteProvider(provider.id)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="page" v-html="page"></div>
|
||||
23
EdgeAdmin/web/views/@default/dns/providers/index.js
Normal file
23
EdgeAdmin/web/views/@default/dns/providers/index.js
Normal file
@@ -0,0 +1,23 @@
|
||||
Tea.context(function () {
|
||||
this.createProvider = function () {
|
||||
teaweb.popup(Tea.url(".createPopup"), {
|
||||
height: "28em",
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.deleteProvider = function (providerId) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要删除这个DNS服务商账号吗?", function () {
|
||||
that.$post(".delete")
|
||||
.params({
|
||||
providerId: providerId
|
||||
})
|
||||
.refresh()
|
||||
})
|
||||
}
|
||||
})
|
||||
356
EdgeAdmin/web/views/@default/dns/providers/provider.html
Normal file
356
EdgeAdmin/web/views/@default/dns/providers/provider.html
Normal file
@@ -0,0 +1,356 @@
|
||||
{$layout}
|
||||
|
||||
<first-menu>
|
||||
<a href="/dns/providers" class="item">DNS账号列表</a>
|
||||
<span class="item">|</span>
|
||||
<a :href="'/dns/providers/provider?providerId=' + provider.id" class="item active">{{provider.name}}</a>
|
||||
</first-menu>
|
||||
|
||||
|
||||
<h3>账号信息 <a href="" @click.prevent="updateProvider(provider.id)">[修改]</a> </h3>
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">账号说明</td>
|
||||
<td>{{provider.name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>服务商</td>
|
||||
<td>{{provider.typeName}}</td>
|
||||
</tr>
|
||||
|
||||
<!-- DNSPod -->
|
||||
<tbody v-if="provider.type == 'dnspod'">
|
||||
<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 v-if="provider.apiParams.apiType != 'tencentDNS'">
|
||||
<td class="color-border">密钥Token</td>
|
||||
<td>{{provider.apiParams.token}}</td>
|
||||
</tr>
|
||||
<tr v-if="provider.apiParams.apiType != 'tencentDNS'">
|
||||
<td class="color-border">区域</td>
|
||||
<td>
|
||||
<span v-if="provider.apiParams.region == 'international'">国际站</span>
|
||||
<span v-else>中国站</span>
|
||||
</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>
|
||||
<tr>
|
||||
<td>区域ID</td>
|
||||
<td>
|
||||
<span v-if="provider.apiParams.regionId != null && provider.apiParams.regionId.length > 0">{{provider.apiParams.regionId}}</span>
|
||||
<span v-else class="disabled">没有设置。</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- HuaweiDNS -->
|
||||
<tbody v-if="provider.type == 'huaweiDNS'">
|
||||
<tr>
|
||||
<td>AccessKeyId</td>
|
||||
<td>{{provider.apiParams.accessKeyId}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AccessKeySecret</td>
|
||||
<td>{{provider.apiParams.accessKeySecret}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>终端节点</td>
|
||||
<td>
|
||||
<span v-if="provider.apiParams.endpoint != null && provider.apiParams.endpoint.length > 0">{{provider.apiParams.endpoint}}</span>
|
||||
<span v-else class="disabled">默认</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- CloudFlare -->
|
||||
<tbody v-if="provider.type == 'cloudFlare'">
|
||||
<tr>
|
||||
<td class="color-border">API密钥</td>
|
||||
<td>
|
||||
{{provider.apiParams.apiKey}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">账号邮箱</td>
|
||||
<td>{{provider.apiParams.email}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- GoDaddy -->
|
||||
<tbody v-if="provider.type == 'godaddy'">
|
||||
<tr>
|
||||
<td class="color-border">Key</td>
|
||||
<td>
|
||||
{{provider.apiParams.key}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">Secret</td>
|
||||
<td>{{provider.apiParams.secret}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- ClouDNS -->
|
||||
<tbody v-if="provider.type == 'cloudns'">
|
||||
<tr v-if="provider.apiParams.authId > 0">
|
||||
<td class="color-border">用户认证ID<em>(auth-id)</em></td>
|
||||
<td>{{provider.apiParams.authId}}</td>
|
||||
</tr>
|
||||
<tr v-if="provider.apiParams.subAuthId > 0">
|
||||
<td class="color-border">子用户认证ID<em>(sub-auth-id)</em></td>
|
||||
<td>{{provider.apiParams.subAuthId}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">认证密码<em>(auth-password)</em></td>
|
||||
<td>{{provider.apiParams.authPassword}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- DNS.COM -->
|
||||
<tbody v-if="provider.type == 'dnscom'">
|
||||
<tr>
|
||||
<td class="color-border">API Key</td>
|
||||
<td>{{provider.apiParams.key}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">API Secret</td>
|
||||
<td>{{provider.apiParams.secret}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
|
||||
<!-- DNS.LA -->
|
||||
<tbody v-if="provider.type == 'dnsla'">
|
||||
<tr>
|
||||
<td class="color-border">API ID</td>
|
||||
<td>{{provider.apiParams.apiId}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">API密钥</td>
|
||||
<td>{{provider.apiParams.secret}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- VolcEngine -->
|
||||
<tbody v-if="provider.type == 'volcEngine'">
|
||||
<tr>
|
||||
<td class="color-border">Access Key ID</td>
|
||||
<td>{{provider.apiParams.accessKeyId}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">Secret Access Key</td>
|
||||
<td>{{provider.apiParams.accessKeySecret}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- Amazon Route 53 -->
|
||||
<tbody v-if="provider.type == 'amazonRoute53'">
|
||||
<tr>
|
||||
<td class="color-border">Access Key ID</td>
|
||||
<td>{{provider.apiParams.accessKeyId}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">Secret Access Key</td>
|
||||
<td>{{provider.apiParams.accessKeySecret}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">API区域</td>
|
||||
<td>
|
||||
<span v-if="provider.apiParams.region != null && provider.apiParams.region.length > 0">{{provider.apiParams.region}}</span>
|
||||
<span v-else class="disabled">暂未设置</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody v-if="provider.type == 'azureDNS'">
|
||||
<tr>
|
||||
<td class="color-border">订阅ID <br/><em>(Subscription ID)</em></td>
|
||||
<td>
|
||||
{{provider.apiParams.subscriptionId}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">目录(租户) ID <br/><em>(Directory Tenant ID)</em></td>
|
||||
<td>
|
||||
{{provider.apiParams.tenantId}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">应用程序(客户端) ID <br/><em>(Client ID)</em></td>
|
||||
<td>
|
||||
{{provider.apiParams.clientId}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">客户端密码值 <br/><em>(Client Secret Value)</em></td>
|
||||
<td>
|
||||
{{provider.apiParams.clientSecret}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">资源组 <br/><em>(Resource Group Name)</em></td>
|
||||
<td>
|
||||
{{provider.apiParams.resourceGroupName}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- bunny.net -->
|
||||
<tbody v-if="provider.type == 'bunnyNet'">
|
||||
<tr>
|
||||
<td class="color-border">API密钥</td>
|
||||
<td>
|
||||
{{provider.apiParams.apiKey}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- Local EdgeDNS -->
|
||||
<tbody v-if="provider.type == 'localEdgeDNS'">
|
||||
<tr>
|
||||
<td class="color-border">域名服务集群</td>
|
||||
<td>
|
||||
{{provider.localEdgeDNS.name}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- EdgeDNS API -->
|
||||
<tbody v-if="provider.type == 'edgeDNSAPI'">
|
||||
<tr>
|
||||
<td class="color-border">API地址</td>
|
||||
<td>{{provider.apiParams.host}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">AccessKey类型</td>
|
||||
<td>
|
||||
<span v-if="provider.apiParams.role == 'user'">平台用户</span>
|
||||
<span v-if="provider.apiParams.role == 'admin'">管理员</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">AccessKey ID</td>
|
||||
<td>{{provider.apiParams.accessKeyId}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">AccessKey密钥</td>
|
||||
<td>{{provider.apiParams.accessKeySecret}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- CustomHTTP -->
|
||||
<tbody v-if="provider.type == 'customHTTP'">
|
||||
<tr>
|
||||
<td class="color-border">HTTP URL</td>
|
||||
<td>{{provider.apiParams.url}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">私钥</td>
|
||||
<td>{{provider.apiParams.secret}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr v-if="provider.minTTL > 0">
|
||||
<td>最小TTL</td>
|
||||
<td>{{provider.minTTL}}秒</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<h4>管理的域名 <a href="" @click.prevent="syncDomains()" style="font-size: 0.8em">[刷新域名]</a> <a href="" @click.prevent="createDomain()" style="font-size: 0.8em">[添加域名]</a></h4>
|
||||
|
||||
<p class="ui message blue" v-if="isUpdatingDomains">正在检查域名状态...</p>
|
||||
|
||||
<second-menu>
|
||||
<menu-item :href="'/dns/providers/provider?providerId=' + provider.id + '&filter='" :active="filter == ''">正常状态</menu-item>
|
||||
<menu-item :href="'/dns/providers/provider?providerId=' + provider.id + '&filter=down'" :active="filter == 'down'">已下线</menu-item>
|
||||
<menu-item :href="'/dns/providers/provider?providerId=' + provider.id + '&filter=deleted'" :active="filter == 'deleted'">已删除</menu-item>
|
||||
</second-menu>
|
||||
|
||||
<p class="comment" v-if="domains.length == 0">暂时还没有<span v-if="filter == 'deleted'">已删除</span><span v-if="filter == 'down'">已下线</span><span v-if="filter == ''">可以管理</span>的域名。</p>
|
||||
|
||||
<table class="ui table selectable celled" v-if="domains.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>域名</th>
|
||||
<th class="center" style="width: 7em">线路</th>
|
||||
<th class="center" style="width: 6em">集群</th>
|
||||
<th class="center" style="width: 7em">节点域名</th>
|
||||
<th class="center" style="width: 7em">网站域名</th>
|
||||
<th>数据更新时间</th>
|
||||
<th class="center width10">状态</th>
|
||||
<th class="three op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(domain, index) in domains">
|
||||
<td>{{domain.name}}</td>
|
||||
<td class="center">
|
||||
<a href="" v-if="domain.countRoutes > 0" @click.prevent="showRoutes(domain.id)">{{domain.countRoutes}}个<popup-icon></popup-icon></a>
|
||||
<span v-else class="disabled">0个</span>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="" v-if="domain.countClusters > 0" @click.prevent="viewClusters(domain.id)">{{domain.countClusters}}<popup-icon></popup-icon></a>
|
||||
<span v-else class="disabled">0个</span>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="" v-if="domain.countAllNodes > 0" @click.prevent="viewNodes(domain.id)">{{domain.countNodeRecords}}/{{domain.countAllNodes}}个<popup-icon></popup-icon></a>
|
||||
<span v-else class="disabled">0个</span>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="" v-if="domain.countAllServers > 0" @click.prevent="viewServers(domain.id)">{{domain.countServerRecords}}/{{domain.countAllServers}}个<popup-icon></popup-icon></a>
|
||||
<span v-else class="disabled">0个</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="domain.dataUpdatedTime.length > 0">{{domain.dataUpdatedTime}}</span>
|
||||
<span v-else class="disabled">尚未更新</span>
|
||||
</td>
|
||||
<td class="center">
|
||||
<span v-if="!domain.isOn"><label-on :v-is-on="domain.isOn"></label-on></span>
|
||||
<div v-else-if="domain.countRoutes == 0 || domain.nodesChanged || domain.serversChanged">
|
||||
<a href="" style="border-bottom: 1px #db2828 dashed" title="点击和DNS服务商系统同步" @click.prevent="syncDomain(index,domain)" v-if="!domain.isSyncing"><span class="red">需要同步</span></a>
|
||||
<span v-else>正在同步...</span>
|
||||
</div>
|
||||
<div v-else-if="!domain.isUp">
|
||||
<a href="" style="border-bottom: 1px #db2828 dashed" @click.prevent="alertDown"><span class="red">已下线</span></a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="" @click.prevent="syncDomain(index, domain)" v-if="!domain.isSyncing">同步</a>
|
||||
<span v-else>正在同步...</span>
|
||||
<a href="" @click.prevent="updateDomain(domain.id)" v-if="!domain.isSyncing">修改</a>
|
||||
<a href="" @click.prevent="deleteDomain(domain)" v-if="!domain.isSyncing && !domain.isDeleted">删除</a>
|
||||
<a href="" @click.prevent="recoverDomain(domain)" v-if="!domain.isSyncing && domain.isDeleted">恢复</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<page-box></page-box>
|
||||
139
EdgeAdmin/web/views/@default/dns/providers/provider.js
Normal file
139
EdgeAdmin/web/views/@default/dns/providers/provider.js
Normal file
@@ -0,0 +1,139 @@
|
||||
Tea.context(function () {
|
||||
this.isUpdatingDomains = false
|
||||
this.hasDeletedDomains = this.domains.$find(function (k, v) {
|
||||
return v.isDeleted
|
||||
}) != null
|
||||
|
||||
this.$delay(function () {
|
||||
if (this.pageNo <= 1 && this.filter.length == 0) {
|
||||
this.syncDomains()
|
||||
}
|
||||
})
|
||||
|
||||
this.syncDomains = function () {
|
||||
this.isUpdatingDomains = true
|
||||
this.$post(".syncDomains")
|
||||
.params({
|
||||
providerId: this.provider.id
|
||||
})
|
||||
.success(function (resp) {
|
||||
if (resp.data.hasChanges) {
|
||||
teaweb.reload()
|
||||
}
|
||||
})
|
||||
.done(function () {
|
||||
this.$delay(function () {
|
||||
this.isUpdatingDomains = false
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
|
||||
this.updateProvider = function (providerId) {
|
||||
teaweb.popup(Tea.url(".updatePopup?providerId=" + providerId), {
|
||||
height: "28em",
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.createDomain = function () {
|
||||
teaweb.popup("/dns/domains/createPopup?providerId=" + this.provider.id, {
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.updateDomain = function (domainId) {
|
||||
teaweb.popup("/dns/domains/updatePopup?domainId=" + domainId, {
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.deleteDomain = function (domain) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要删除域名\"" + domain.name + "\"吗?", function () {
|
||||
that.$post("/dns/domains/delete")
|
||||
.params({
|
||||
domainId: domain.id
|
||||
})
|
||||
.post()
|
||||
.refresh()
|
||||
})
|
||||
}
|
||||
|
||||
this.recoverDomain = function (domain) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要恢复域名\"" + domain.name + "\"吗?", function () {
|
||||
that.$post("/dns/domains/recover")
|
||||
.params({
|
||||
domainId: domain.id
|
||||
})
|
||||
.post()
|
||||
.refresh()
|
||||
})
|
||||
}
|
||||
|
||||
this.syncDomain = function (index, domain) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要同步此域名下的所有解析记录吗?", function () {
|
||||
domain.isSyncing = true
|
||||
Vue.set(that.domains, index, domain)
|
||||
|
||||
this.$post("/dns/domains/sync")
|
||||
.params({
|
||||
domainId: domain.id
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.success("同步成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
})
|
||||
.fail(function (resp) {
|
||||
teaweb.warn(resp.message, function () {
|
||||
if (resp.data.shouldFix) {
|
||||
window.location = "/dns/issues"
|
||||
}
|
||||
})
|
||||
})
|
||||
.done(function () {
|
||||
Vue.set(that.domains, index, domain)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
this.showRoutes = function (domainId) {
|
||||
teaweb.popup("/dns/domains/routesPopup?domainId=" + domainId)
|
||||
}
|
||||
|
||||
this.viewClusters = function (domainId) {
|
||||
teaweb.popup("/dns/domains/clustersPopup?domainId=" + domainId)
|
||||
}
|
||||
|
||||
this.viewNodes = function (domainId) {
|
||||
teaweb.popup("/dns/domains/nodesPopup?domainId=" + domainId, {
|
||||
width: "50em",
|
||||
height: "30em"
|
||||
})
|
||||
}
|
||||
|
||||
this.viewServers = function (domainId) {
|
||||
teaweb.popup("/dns/domains/serversPopup?domainId=" + domainId, {
|
||||
width: "50em",
|
||||
height: "30em"
|
||||
})
|
||||
}
|
||||
|
||||
this.alertDown = function () {
|
||||
teaweb.popupTip("当前域名已从服务商下线")
|
||||
}
|
||||
})
|
||||
418
EdgeAdmin/web/views/@default/dns/providers/updatePopup.html
Normal file
418
EdgeAdmin/web/views/@default/dns/providers/updatePopup.html
Normal file
@@ -0,0 +1,418 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改DNS服务商账号</h3>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="providerId" :value="provider.id"/>
|
||||
<input type="hidden" name="type" :value="provider.type"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">账号说明 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="50" ref="focus" v-model="provider.name"/>
|
||||
<p class="comment">用来方便区分不同的账号。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>服务商厂家 *</td>
|
||||
<td>
|
||||
{{provider.typeName}}
|
||||
<p class="comment">{{typeDescription}}创建后无法修改此选项。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">API参数</td>
|
||||
</tr>
|
||||
|
||||
<!-- DNSPod -->
|
||||
<tbody v-if="provider.type == 'dnspod'">
|
||||
<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密钥”中获取。<mask-warning></mask-warning></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="paramDNSPodId" maxlength="100" v-model="provider.params.id"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥--DNSPod Token”中获取。</p>
|
||||
</td>
|
||||
</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="paramDNSPodToken" maxlength="100" v-model="provider.params.token" spellcheck="false"/>
|
||||
<p class="comment">在DNSPod控制台“账号中心--API密钥--DNSPod Token”中获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</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="paramDNSPodRegion" v-model="provider.params.region">
|
||||
<option value="">中国站</option>
|
||||
<option value="international">国际站</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- AliDNS -->
|
||||
<tbody v-if="provider.type == 'alidns'">
|
||||
<tr>
|
||||
<td>AccessKeyId *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAliDNSAccessKeyId" maxlength="100" v-model="provider.params.accessKeyId" spellcheck="false"/>
|
||||
<p class="comment">登录阿里云控制台 -- 在"访问控制"中创建和获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AccessKeySecret *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAliDNSAccessKeySecret" maxlength="100" v-model="provider.params.accessKeySecret" spellcheck="false"/>
|
||||
<p class="comment">登录阿里云控制台 -- 在"访问控制"中创建和获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>区域ID<optional-label></optional-label></td>
|
||||
<td>
|
||||
<input type="text" name="paramAliDNSRegionId" maxlength="100" v-model="provider.params.regionId"/>
|
||||
<p class="comment">阿里云产品所在区域代号,通常不需要填写。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 华为云 -->
|
||||
<tbody v-if="provider.type == 'huaweiDNS'">
|
||||
<tr>
|
||||
<td>AccessKeyId *</td>
|
||||
<td>
|
||||
<input type="text" name="paramHuaweiAccessKeyId" maxlength="100" v-model="provider.params.accessKeyId" spellcheck="false"/>
|
||||
<p class="comment">登录华为云控制台 -- 在"我的凭证 -- 访问密钥"中创建和获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AccessKeySecret *</td>
|
||||
<td>
|
||||
<input type="text" name="paramHuaweiAccessKeySecret" maxlength="100" v-model="provider.params.accessKeySecret" spellcheck="false"/>
|
||||
<p class="comment">登录华为云控制台 -- 在"我的凭证 -- 访问密钥"中创建和获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>终端节点</td>
|
||||
<td>
|
||||
<input type="text" name="paramHuaweiEndpoint" maxlength="100" v-model="provider.params.endpoint" spellcheck="false"/>
|
||||
<p class="comment">选填项。可以填写终端节点(Endpoint)区域代号或者域名,参考 <a href="https://developer.huaweicloud.com/endpoint?DNS" target="_blank">https://developer.huaweicloud.com/endpoint?DNS</a>(如果此链接失效,请到华为云开发者中心自行查找)。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
|
||||
<!-- CloudFlare -->
|
||||
<tbody v-if="provider.type == 'cloudFlare'">
|
||||
<tr>
|
||||
<td>API密钥 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramCloudFlareAPIKey" maxlength="100" v-model="provider.params.apiKey" spellcheck="false"/>
|
||||
<p class="comment">在个人资料中的"API令牌"--"API密钥"--"Global API Key"中获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>账号邮箱 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramCloudFlareEmail" maxlength="100" v-model="provider.params.email" spellcheck="false"/>
|
||||
<p class="comment">登录账号使用的邮箱。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- GoDaddy -->
|
||||
<tbody v-if="provider.type == 'godaddy'">
|
||||
<tr>
|
||||
<td>Key *</td>
|
||||
<td>
|
||||
<input type="text" name="paramGoDaddyKey" maxlength="100" v-model="provider.params.key" spellcheck="false"/>
|
||||
<p class="comment">可以在GoDaddy<a href="https://developer.godaddy.com/keys" target="_blank">开发者中心</a>创建,创建时Environment选择Production。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Secret *</td>
|
||||
<td>
|
||||
<input type="text" name="paramGoDaddySecret" maxlength="100" v-model="provider.params.secret" spellcheck="false"/>
|
||||
<p class="comment"><mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- ClouDNS -->
|
||||
<tbody v-if="provider.type == 'cloudns'">
|
||||
<tr>
|
||||
<td>用户认证ID<em>(auth-id)</em></td>
|
||||
<td>
|
||||
<input type="text" name="paramClouDNSAuthId" maxlength="20" v-model="provider.params.authId" spellcheck="false"/>
|
||||
<p class="comment">和子用户认证ID二选一。可以在ClouDNS<a href="https://www.cloudns.net/api-settings/" target="_blank">API设置页面</a>添加。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>子用户认证ID<em>(sub-auth-id)</em></td>
|
||||
<td>
|
||||
<input type="text" name="paramClouDNSSubAuthId" maxlength="20" v-model="provider.params.subAuthId"/>
|
||||
<p class="comment">和用户认证ID二选一。可以在ClouDNS<a href="https://www.cloudns.net/api-settings/" target="_blank">API设置页面</a>添加。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>认证密码 *<em>(auth-password)</em></td>
|
||||
<td>
|
||||
<input type="password" name="paramClouDNSAuthPassword" maxlength="100" v-model="provider.params.authPassword" spellcheck="false"/>
|
||||
<p class="comment">用户或者子用户的认证密码。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- DNS.COM -->
|
||||
<tbody v-if="provider.type == 'dnscom'">
|
||||
<tr>
|
||||
<td>API Key *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSComKey" maxlength="100" v-model="provider.params.key" spellcheck="false"/>
|
||||
<p class="comment">在51DNS.COM控制台账号中心--API设置中创建和查看。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>API Secret *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSComSecret" maxlength="100" v-model="provider.params.secret" spellcheck="false"/>
|
||||
<p class="comment">在51DNS.COM控制台账号中心--API设置中创建和查看。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- DNS.LA -->
|
||||
<tbody v-if="provider.type == 'dnsla'">
|
||||
<tr>
|
||||
<td>API ID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSLaAPIId" maxlength="100" v-model="provider.params.apiId" spellcheck="false"/>
|
||||
<p class="comment">在DNS.LA控制台--账户信息中查看。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>API密钥 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramDNSLaSecret" maxlength="100" v-model="provider.params.secret" spellcheck="false"/>
|
||||
<p class="comment">在DNS.LA控制台--账户信息中查看。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- VolcEngine -->
|
||||
<tbody v-if="provider.type == 'volcEngine'">
|
||||
<tr>
|
||||
<td>Access Key ID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramVolcEngineAccessKeyId" maxlength="100" v-model="provider.params.accessKeyId" spellcheck="false"/>
|
||||
<p class="comment">在火山引擎“访问控制--API访问密钥”中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Secret Access Key *</td>
|
||||
<td>
|
||||
<input type="text" name="paramVolcEngineAccessKeySecret" maxlength="100" v-model="provider.params.accessKeySecret" spellcheck="false"/>
|
||||
<p class="comment"><mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- Amazon Route 53 -->
|
||||
<tbody v-if="provider.type == 'amazonRoute53'">
|
||||
<tr>
|
||||
<td>Access Key ID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAmazonRoute53AccessKeyId" maxlength="100" v-model="provider.params.accessKeyId" spellcheck="false"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Secret Access Key *</td>
|
||||
<td>
|
||||
<input type="text" name="paramAmazonRoute53AccessKeySecret" maxlength="100" v-model="provider.params.accessKeySecret" spellcheck="false"/>
|
||||
<p class="comment"><mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>API区域</td>
|
||||
<td>
|
||||
<input type="text" name="paramAmazonRoute53Region" maxlength="100" v-model="provider.params.region" spellcheck="false"/>
|
||||
<p class="comment">通常不需要填写。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- Microsoft Azure DNS -->
|
||||
<tbody v-if="provider.type == 'azureDNS'">
|
||||
<tr>
|
||||
<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>目录(租户) 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>应用程序(客户端) 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>客户端密码值 <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)”中创建和查看。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
|
||||
<!-- bunny.net -->
|
||||
<tbody v-if="provider.type == 'bunnyNet'">
|
||||
<tr>
|
||||
<td>API密钥 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramBunnyNetAPIKey" maxlength="100" spellcheck="false" v-model="provider.params.apiKey"/>
|
||||
<p class="comment">在"Edit account details" -- "API Key"中获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- Gname -->
|
||||
<tbody v-if="provider.type == 'gname'">
|
||||
<tr>
|
||||
<td>APPID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramGnameAppid" maxlength="100" v-model="provider.params.appid" spellcheck="false"/>
|
||||
<p class="comment">在Gname控制台API设置中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>API Secret *</td>
|
||||
<td>
|
||||
<input type="text" name="paramGnameSecret" maxlength="100" v-model="provider.params.secret" spellcheck="false"/>
|
||||
<p class="comment">在Gname控制台API设置中获取。<mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- EdgeDNS -->
|
||||
<tbody v-if="provider.type == 'localEdgeDNS'">
|
||||
<tr>
|
||||
<td>选择域名服务集群 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="paramLocalEdgeDNSClusterId" v-model="provider.params.clusterId">
|
||||
<option value="0">[选择域名服务集群]</option>
|
||||
<option v-for="cluster in nsClusters" :value="cluster.id">{{cluster.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
|
||||
<!-- EdgeDNS API -->
|
||||
<tbody v-if="provider.type == 'edgeDNSAPI'">
|
||||
<tr>
|
||||
<td>API地址 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramEdgeDNSAPIHost" maxlength="100" v-model="provider.params.host"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AccessKey类型 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="paramEdgeDNSAPIRole" v-model="provider.params.role">
|
||||
<option value="user">平台用户</option>
|
||||
<option value="admin">管理员</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AccessKey ID *</td>
|
||||
<td>
|
||||
<input type="text" name="paramEdgeDNSAPIAccessKeyId" maxlength="64" v-model="provider.params.accessKeyId"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AccessKey密钥 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramEdgeDNSAPIAccessKeySecret" maxlength="64" v-model="provider.params.accessKeySecret"/>
|
||||
<p class="comment"><mask-warning></mask-warning></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 自定义HTTP-->
|
||||
<tbody v-if="provider.type == 'customHTTP'">
|
||||
<tr>
|
||||
<td>HTTP URL *</td>
|
||||
<td>
|
||||
<input type="text" name="paramCustomHTTPURL" maxlength="200" v-model="provider.params.url"/>
|
||||
<p class="comment">HTTP URL完整地址,DNS所有操作都会以POST的方式转发到此地址。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>私钥 *</td>
|
||||
<td>
|
||||
<input type="text" name="paramCustomHTTPSecret" maxlength="64" v-model="provider.params.secret"/>
|
||||
<p class="comment">通讯用的私钥,转发请求时会在Header中加入相关信息,方便开发者校验请求是否合法。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 更多选项 -->
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>最小TTL</td>
|
||||
<td>
|
||||
<div class="ui right labeled input">
|
||||
<input type="text" name="minTTL" size="4" maxlength="6" style="width: 6em" v-model="provider.minTTL"/>
|
||||
<span class="ui label">秒</span>
|
||||
</div>
|
||||
<p class="comment">生成的DNS时可以使用的最小TTL,请根据你选择的服务商和你在服务商中的账号等级进行填写;不填写或者0表示默认。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
15
EdgeAdmin/web/views/@default/dns/providers/updatePopup.js
Normal file
15
EdgeAdmin/web/views/@default/dns/providers/updatePopup.js
Normal file
@@ -0,0 +1,15 @@
|
||||
Tea.context(function () {
|
||||
this.typeDescription = ""
|
||||
|
||||
let that = this
|
||||
this.types.forEach(function (v) {
|
||||
if (v.code == that.provider.type) {
|
||||
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"
|
||||
}
|
||||
})
|
||||
6
EdgeAdmin/web/views/@default/dns/tasks/listPopup.css
Normal file
6
EdgeAdmin/web/views/@default/dns/tasks/listPopup.css
Normal file
@@ -0,0 +1,6 @@
|
||||
h3 span {
|
||||
margin-left: 0.5em;
|
||||
color: grey;
|
||||
font-size: 0.6em !important;
|
||||
}
|
||||
/*# sourceMappingURL=listPopup.css.map */
|
||||
1
EdgeAdmin/web/views/@default/dns/tasks/listPopup.css.map
Normal file
1
EdgeAdmin/web/views/@default/dns/tasks/listPopup.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["listPopup.less"],"names":[],"mappings":"AAAA,EAAG;EACF,kBAAA;EACA,WAAA;EACA,2BAAA","file":"listPopup.css"}
|
||||
43
EdgeAdmin/web/views/@default/dns/tasks/listPopup.html
Normal file
43
EdgeAdmin/web/views/@default/dns/tasks/listPopup.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>正在同步的DNS任务<span v-if="tasks.length > 0">(共{{tasks.length}}个)</span></h3>
|
||||
<p class="comment" v-if="tasks.length == 0">暂时没有同步的任务。</p>
|
||||
<div v-if="tasks.length > 0">
|
||||
<button class="ui button tiny basic" @click.prevent="deleteAllTasks">清空所有任务</button>
|
||||
|
||||
<table class="ui table selectable celled">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="three wide">对象</th>
|
||||
<th>任务</th>
|
||||
<th>状态</th>
|
||||
<th>触发时间</th>
|
||||
<th class="one op"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="task in tasks">
|
||||
<td nowrap="">
|
||||
<span v-if="(task.type == 'clusterChange' || task.type == 'clusterNodesChange' || task.type == 'clusterRemoveDomain') && task.cluster != null">{{task.cluster.name}}
|
||||
<link-icon :href="'/dns/clusters/cluster?clusterId=' + task.cluster.id" target="_top"></link-icon>
|
||||
</span>
|
||||
<span v-if="task.type == 'nodeChange'">{{task.node.name}}</span>
|
||||
<span v-if="task.type == 'serverChange'">{{task.server.name}}</span>
|
||||
<span v-if="task.type == 'domainChange'">{{task.domain.name}}</span>
|
||||
</td>
|
||||
<td nowrap="">
|
||||
<span v-if="task.type == 'clusterChange' || task.type == 'clusterNodesChange' || task.type == 'clusterRemoveDomain'">集群</span>
|
||||
<span v-if="task.type == 'nodeChange'">节点</span>
|
||||
<span v-if="task.type == 'serverChange'">网站</span>
|
||||
<span v-if="task.type == 'domainChange'">域名</span>
|
||||
</td>
|
||||
<td style="word-break: break-word; width: 26em">
|
||||
<span v-if="task.isDone" class="red">{{task.error}}</span>
|
||||
<span v-else>正在同步...</span>
|
||||
</td>
|
||||
<td nowrap="">{{task.updatedTime}}</td>
|
||||
<td>
|
||||
<a href="" title="删除" class="remove-btn" @click.prevent="deleteTask(task.id)"><i class="icon remove small grey"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
40
EdgeAdmin/web/views/@default/dns/tasks/listPopup.js
Normal file
40
EdgeAdmin/web/views/@default/dns/tasks/listPopup.js
Normal file
@@ -0,0 +1,40 @@
|
||||
Tea.context(function () {
|
||||
this.$delay(function () {
|
||||
this.reload()
|
||||
})
|
||||
|
||||
this.reload = function () {
|
||||
this.$post("$")
|
||||
.success(function (resp) {
|
||||
this.tasks = resp.data.tasks
|
||||
})
|
||||
.done(function () {
|
||||
this.$delay(function () {
|
||||
this.reload()
|
||||
}, 3000)
|
||||
})
|
||||
}
|
||||
|
||||
this.deleteTask = function (taskId) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要删除这个任务吗?", function () {
|
||||
that.$post(".delete")
|
||||
.params({
|
||||
taskId: taskId
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
this.deleteAllTasks = function () {
|
||||
let that = this
|
||||
teaweb.confirm("确定要清空所有的任务吗?", function () {
|
||||
that.$post(".deleteAll")
|
||||
.success(function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
5
EdgeAdmin/web/views/@default/dns/tasks/listPopup.less
Normal file
5
EdgeAdmin/web/views/@default/dns/tasks/listPopup.less
Normal file
@@ -0,0 +1,5 @@
|
||||
h3 span {
|
||||
margin-left: 0.5em;
|
||||
color: grey;
|
||||
font-size: 0.6em !important;
|
||||
}
|
||||
104
EdgeAdmin/web/views/@default/dns/updateClusterPopup.html
Normal file
104
EdgeAdmin/web/views/@default/dns/updateClusterPopup.html
Normal file
@@ -0,0 +1,104 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改集群DNS设置</h3>
|
||||
|
||||
<form method="post" class="ui form" data-tea-success="success" data-tea-action="$">
|
||||
<input type="hidden" name="clusterId" :value="clusterId"/>
|
||||
<csrf-token></csrf-token>
|
||||
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">DNS服务商</td>
|
||||
<td>
|
||||
<select name="providerType" class="ui dropdown auto-width" v-model="providerType" @change="changeProviderType">
|
||||
<option v-for="providerType in providerTypes" :value="providerType.code">{{providerType.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>账号</td>
|
||||
<td>
|
||||
<p class="comment" v-if="providers.length == 0">没有账号可选</p>
|
||||
<select name="providerId" class="ui dropdown auto-width" v-model="providerId" v-show="providers.length > 0">
|
||||
<option v-for="provider in providers" :value="provider.id">{{provider.name}}</option>
|
||||
</select>
|
||||
<p class="comment"><a href="/dns/providers" target="_blank">去管理DNS服务商账号»</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="providerId > 0">
|
||||
<td>域名</td>
|
||||
<td>
|
||||
<p class="comment" v-if="domains.length == 0">没有域名可选</p>
|
||||
<select name="domainId" class="ui dropdown auto-width" v-model="domainId" v-show="domains.length > 0">
|
||||
<option v-for="domain in domains" :value="domain.id">{{domain.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>子域名</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<input type="text" name="dnsName" v-model="dnsName" maxlength="64" size="20" style="width:10em"/>
|
||||
<span class="ui label">.<span v-if="domain.length == 0">主域名</span><span v-else>{{domain}}</span></span>
|
||||
</div>
|
||||
<p class="comment">子域名和主域名共同组成集群的域名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>自动设置CNAME记录</td>
|
||||
<td>
|
||||
<values-box :values="cnameRecords" name="cnameRecords" placeholder="记录名" ref="cnameRecords"></values-box>
|
||||
<p class="comment">除集群已创建的网站之外,自动解析到集群的CNAME记录,比如<code-label @click.prevent="addCnameRecord('www')">www</code-label>。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>允许通过CNAME访问网站</td>
|
||||
<td>
|
||||
<checkbox name="cnameAsDomain" v-model="cnameAsDomain"></checkbox>
|
||||
<p class="comment">选中后,表示允许使用CNAME直接访问网站;如果取消选中,则表示CNAME只作为DNS解析记录使用。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="teaIsPlus">
|
||||
<td>包含Ln节点</td>
|
||||
<td>
|
||||
<checkbox name="includingLnNodes" v-model="includingLnNodes"></checkbox>
|
||||
<p class="comment">选中后,表示域名解析中包含L2及以上级别节点,也就意味着用户请求可能会被分配到这些节点。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>记录TTL</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<input type="text" name="ttl" maxlength="6" style="width: 6em" v-model="ttl"/>
|
||||
<span class="ui label">秒</span>
|
||||
</div>
|
||||
<p class="comment">每个DNS服务商或者账号的TTL限制各有不同,请注意取值范围;修改后,只对新的解析记录生效。0表示使用默认。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>同步节点DNS状态</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="nodesAutoSync" value="1" v-model="nodesAutoSync"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>同步网站DNS状态</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="serversAutoSync" value="1" v-model="serversAutoSync"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
87
EdgeAdmin/web/views/@default/dns/updateClusterPopup.js
Normal file
87
EdgeAdmin/web/views/@default/dns/updateClusterPopup.js
Normal file
@@ -0,0 +1,87 @@
|
||||
Tea.context(function () {
|
||||
this.$delay(function () {
|
||||
this.changeProviderType()
|
||||
this.changeProvider()
|
||||
|
||||
this.$watch("providerId", function () {
|
||||
this.changeProvider()
|
||||
})
|
||||
this.$watch("domainId", function () {
|
||||
this.changeDomain()
|
||||
})
|
||||
})
|
||||
|
||||
this.success = NotifyPopup
|
||||
|
||||
// 初始化的内容
|
||||
// this.domainId = 0
|
||||
// this.domain = ""
|
||||
// this.providerId = 0
|
||||
|
||||
if (this.providerType == "") {
|
||||
this.providerType = this.providerTypes[0].code
|
||||
}
|
||||
this.providers = []
|
||||
this.domains = []
|
||||
|
||||
this.changeProviderType = function () {
|
||||
this.$post(".providerOptions")
|
||||
.params({
|
||||
type: this.providerType
|
||||
})
|
||||
.success(function (resp) {
|
||||
this.providers = resp.data.providers
|
||||
|
||||
// 检查providerId
|
||||
if (this.providers.length == 0) {
|
||||
this.providerId = 0
|
||||
return
|
||||
}
|
||||
let that = this
|
||||
if (this.providers.$find(function (k, v) {
|
||||
return v.id == that.providerId
|
||||
}) == null) {
|
||||
this.providerId = this.providers[0].id
|
||||
}
|
||||
this.changeProvider()
|
||||
})
|
||||
}
|
||||
|
||||
this.changeProvider = function () {
|
||||
this.$post(".domainOptions")
|
||||
.params({
|
||||
providerId: this.providerId
|
||||
})
|
||||
.success(function (resp) {
|
||||
this.domains = resp.data.domains
|
||||
this.changeDomain()
|
||||
})
|
||||
}
|
||||
|
||||
this.changeDomain = function () {
|
||||
if (this.domains.length == 0) {
|
||||
this.domainId = 0
|
||||
this.domain = ""
|
||||
return
|
||||
}
|
||||
|
||||
let domainId = this.domainId
|
||||
let domainInfo = this.domains.$find(function (k, v) {
|
||||
return v.id == domainId
|
||||
})
|
||||
if (domainInfo == null) {
|
||||
// 默认选取第一个
|
||||
this.domainId = this.domains[0].id
|
||||
this.domain = this.domains[0].name
|
||||
} else {
|
||||
this.domain = domainInfo.name
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动设置CNAME
|
||||
*/
|
||||
this.addCnameRecord = function (name) {
|
||||
this.$refs.cnameRecords.addValue(name)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user