mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 14:50:25 +08:00
创建集群的时候可以填写DNS信息/集群设置页增加DNS设置功能
This commit is contained in:
54
web/public/js/components/dns/dns-domain-selector.js
Normal file
54
web/public/js/components/dns/dns-domain-selector.js
Normal file
@@ -0,0 +1,54 @@
|
||||
Vue.component("dns-domain-selector", {
|
||||
props: ["v-domain-id", "v-domain-name"],
|
||||
data: function () {
|
||||
let domainId = this.vDomainId
|
||||
if (domainId == null) {
|
||||
domainId = 0
|
||||
}
|
||||
let domainName = this.vDomainName
|
||||
if (domainName == null) {
|
||||
domainName = ""
|
||||
}
|
||||
return {
|
||||
domainId: domainId,
|
||||
domainName: domainName
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
select: function () {
|
||||
let that = this
|
||||
teaweb.popup("/dns/domains/selectPopup", {
|
||||
callback: function (resp) {
|
||||
that.domainId = resp.data.domainId
|
||||
that.domainName = resp.data.domainName
|
||||
}
|
||||
})
|
||||
},
|
||||
remove: function() {
|
||||
this.domainId = 0
|
||||
this.domainName = ""
|
||||
},
|
||||
update: function () {
|
||||
let that = this
|
||||
teaweb.popup("/dns/domains/selectPopup?domainId=" + this.domainId, {
|
||||
callback: function (resp) {
|
||||
that.domainId = resp.data.domainId
|
||||
that.domainName = resp.data.domainName
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<input type="hidden" name="dnsDomainId" :value="domainId"/>
|
||||
<div v-if="domainName.length > 0">
|
||||
<span class="ui label small">
|
||||
{{domainName}}
|
||||
<a href="" @click.prevent="update"><i class="icon pencil small"></i></a>
|
||||
<a href="" @click.prevent="remove()"><i class="icon remove"></i></a>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="domainName.length == 0">
|
||||
<a href="" @click.prevent="select()">[选择域名]</a>
|
||||
</div>
|
||||
</div>`
|
||||
})
|
||||
Reference in New Issue
Block a user