mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-29 22:36:35 +08:00
自建DNS增加解析测试
This commit is contained in:
14
web/views/@default/ns/test/index.css
Normal file
14
web/views/@default/ns/test/index.css
Normal file
@@ -0,0 +1,14 @@
|
||||
pre.pre-box {
|
||||
background: #eee;
|
||||
padding: 1em;
|
||||
}
|
||||
.reasons {
|
||||
margin-top: 0.3em;
|
||||
}
|
||||
.reasons ul {
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
line-height: 1.8;
|
||||
}
|
||||
/*# sourceMappingURL=index.css.map */
|
||||
1
web/views/@default/ns/test/index.css.map
Normal file
1
web/views/@default/ns/test/index.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,GAAG;EACF,gBAAA;EACA,YAAA;;AAGD;EACC,iBAAA;;AADD,QAGC;EACC,SAAA;EACA,gBAAA;EACA,UAAA;EACA,gBAAA","file":"index.css"}
|
||||
76
web/views/@default/ns/test/index.html
Normal file
76
web/views/@default/ns/test/index.html
Normal file
@@ -0,0 +1,76 @@
|
||||
{$layout}
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-timeout="30" data-tea-before="before" data-tea-success="success" data-tea-done="done">
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td>集群 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="clusterId" v-model="clusterId" @change="changeCluster">
|
||||
<option v-for="cluster in clusters" :value="cluster.id">{{cluster.name}}</option>
|
||||
</select>
|
||||
<p class="comment">这里只列出有节点的集群。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="clusterId > 0">
|
||||
<td>节点 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="nodeId" v-model="nodeId" @change="changeNode">
|
||||
<option v-for="node in nodes" :value="node.id">{{node.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="selectedNode != null">
|
||||
<td>节点IP *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="ip">
|
||||
<option v-for="ip in selectedNode.addrs" :value="ip">{{ip}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">域名 *</td>
|
||||
<td>
|
||||
<input type="text" name="domain" maxlength="200" ref="focus" placeholder="xxx.com"/>
|
||||
<p class="comment">要解析的域名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>记录类型 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="type">
|
||||
<option v-for="type in recordTypes" :value="type.type">{{type.type}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>模拟客户端IP</td>
|
||||
<td>
|
||||
<input type="text" name="clientIP" style="width: 12em" maxlength="128" placeholder="x.x.x.x"/>
|
||||
<p class="comment">可选项,用来模拟客户端IP。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>解析结果</td>
|
||||
<td>
|
||||
<div v-if="result != null">
|
||||
<span class="red" v-if="!result.isOk">{{result.err}}</span>
|
||||
<div class="reasons" v-if="result.isNetErr">
|
||||
可能的原因有:
|
||||
<ul>
|
||||
<li>1. DNS节点没有启动;</li>
|
||||
<li>2. DNS节点53/udp端口没有加入到节点防火墙规则或者其他安全策略中:</li>
|
||||
<li>3. DNS节点IP地址填写错误;</li>
|
||||
<li>4. 其他原因。</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div v-if="result.isOk">
|
||||
<pre class="pre-box"><span class="green">{{result.result}}</span></pre>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn v-if="!isDoing">开始解析</submit-btn>
|
||||
<button class="ui button disabled" type="button" v-if="isDoing">解析中...</button>
|
||||
</form>
|
||||
51
web/views/@default/ns/test/index.js
Normal file
51
web/views/@default/ns/test/index.js
Normal file
@@ -0,0 +1,51 @@
|
||||
Tea.context(function () {
|
||||
this.clusterId = 0
|
||||
if (this.clusters.length > 0) {
|
||||
this.clusterId = this.clusters[0].id
|
||||
this.$delay(function () {
|
||||
this.changeCluster()
|
||||
})
|
||||
}
|
||||
|
||||
this.nodeId = 0
|
||||
this.nodes = []
|
||||
this.selectedNode = null
|
||||
|
||||
this.isDoing = false
|
||||
this.result = null
|
||||
|
||||
this.before = function () {
|
||||
this.isDoing = true
|
||||
this.result = null
|
||||
}
|
||||
|
||||
this.success = function (resp) {
|
||||
this.result = resp.data
|
||||
}
|
||||
|
||||
this.done = function () {
|
||||
this.isDoing = false
|
||||
}
|
||||
|
||||
this.changeCluster = function () {
|
||||
this.nodeId = 0
|
||||
this.$post(".nodeOptions")
|
||||
.params({
|
||||
clusterId: this.clusterId
|
||||
})
|
||||
.success(function (resp) {
|
||||
this.nodes = resp.data.nodes
|
||||
if (this.nodes.length > 0) {
|
||||
this.nodeId = this.nodes[0].id
|
||||
this.changeNode()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.changeNode = function () {
|
||||
let that = this
|
||||
this.selectedNode = this.nodes.$find(function (k, v) {
|
||||
return v.id == that.nodeId
|
||||
})
|
||||
}
|
||||
})
|
||||
15
web/views/@default/ns/test/index.less
Normal file
15
web/views/@default/ns/test/index.less
Normal file
@@ -0,0 +1,15 @@
|
||||
pre.pre-box {
|
||||
background: #eee;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.reasons {
|
||||
margin-top: 0.3em;
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
line-height: 1.8;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user