mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-01-03 17:46:37 +08:00
增加DNS域名管理
This commit is contained in:
19
web/views/@default/dns/domains/createPopup.html
Normal file
19
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>
|
||||
3
web/views/@default/dns/domains/createPopup.js
Normal file
3
web/views/@default/dns/domains/createPopup.js
Normal file
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
})
|
||||
@@ -11,21 +11,24 @@
|
||||
<tr>
|
||||
<th>账号说明</th>
|
||||
<th>服务商</th>
|
||||
<th>可用线路</th>
|
||||
<th>最近更新时间</th>
|
||||
<th>域名</th>
|
||||
<th>数据更新时间</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="provider in providers">
|
||||
<tr v-for="(provider, index) in providers">
|
||||
<td>{{provider.name}}</td>
|
||||
<td>{{provider.typeName}}</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<span v-if="provider.countDomains == 0" class="disabled">0个域名</span>
|
||||
<span v-else>{{provider.countDomains}}个域名</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="provider.dataUpdatedTime.length > 0">{{provider.dataUpdatedTime}}</span>
|
||||
<span v-else class="disabled">-</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="" @click.prevent="updateProvider(provider.id)">修改</a> <a href="" @click.prevent="deleteProvider(provider.id)">删除</a>
|
||||
<a :href="'/dns/providers/provider?providerId=' + provider.id">详情</a> <a href="" @click.prevent="deleteProvider(provider.id)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -10,17 +10,6 @@ Tea.context(function () {
|
||||
})
|
||||
}
|
||||
|
||||
this.updateProvider = function (providerId) {
|
||||
teaweb.popup(Tea.url(".updatePopup?providerId=" + providerId), {
|
||||
height: "26em",
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.deleteProvider = function (providerId) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要删除这个DNS服务商账号吗?", function () {
|
||||
|
||||
59
web/views/@default/dns/providers/provider.html
Normal file
59
web/views/@default/dns/providers/provider.html
Normal file
@@ -0,0 +1,59 @@
|
||||
{$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>密钥ID</td>
|
||||
<td>{{provider.apiParams.id}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>密钥Token</td>
|
||||
<td>{{provider.apiParams.token}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<h3>管理的域名 <a href="" @click.prevent="createDomain()">[添加域名]</a> </h3>
|
||||
<p class="comment" v-if="domains.length == 0">暂时还没有可以管理的域名。</p>
|
||||
|
||||
<table class="ui table selectable" v-if="domains.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>域名</th>
|
||||
<th>数据更新时间</th>
|
||||
<th>状态</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="domain in domains">
|
||||
<td>{{domain.name}}</td>
|
||||
<td>
|
||||
<span v-if="domain.dataUpdatedTime.length > 0">{{domain.dataUpdatedTime}}</span>
|
||||
<span v-else class="disabled">尚未更新</span>
|
||||
</td>
|
||||
<td><label-on :v-is-on="domain.isOn"></label-on></td>
|
||||
<td>
|
||||
<a href="">修改</a>
|
||||
<a href="" @click.prevent="deleteDomain(domain)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
34
web/views/@default/dns/providers/provider.js
Normal file
34
web/views/@default/dns/providers/provider.js
Normal file
@@ -0,0 +1,34 @@
|
||||
Tea.context(function () {
|
||||
this.updateProvider = function (providerId) {
|
||||
teaweb.popup(Tea.url(".updatePopup?providerId=" + providerId), {
|
||||
height: "26em",
|
||||
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.deleteDomain = function (domain) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要删除域名\"" + domain.name + "\"吗?", function () {
|
||||
that.$post("/dns/domains/delete")
|
||||
.params({
|
||||
domainId: domain.id
|
||||
})
|
||||
.post()
|
||||
.refresh()
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user