初步实现多集群共享节点

This commit is contained in:
刘祥超
2021-07-31 22:23:07 +08:00
parent 3614b9f3b7
commit 867215e2af
38 changed files with 610 additions and 201 deletions

View File

@@ -8,7 +8,7 @@ Vue.component("dns-route-selector", {
return {
routes: routes,
routeCodes: routes.$map(function (k, v) {
return v.code
return v.code + "@" + v.domainId
}),
isAdding: false,
routeCode: ""
@@ -31,7 +31,7 @@ Vue.component("dns-route-selector", {
}
let that = this
let route = this.vAllRoutes.$find(function (k, v) {
return v.code == that.routeCode
return v.code + "@" + v.domainId == that.routeCode
})
if (route == null) {
return
@@ -53,8 +53,8 @@ Vue.component("dns-route-selector", {
template: `<div>
<input type="hidden" name="dnsRoutesJSON" :value="JSON.stringify(routeCodes)"/>
<div v-if="routes.length > 0">
<tiny-basic-label v-for="route in routes" :key="route.code">
{{route.name}} <a href="" @click.prevent="remove(route)"><i class="icon remove"></i></a>
<tiny-basic-label v-for="route in routes" :key="route.code + '@' + route.domainId">
{{route.name}} <span class="grey small">{{route.domainName}}</span><a href="" @click.prevent="remove(route)"><i class="icon remove"></i></a>
</tiny-basic-label>
<div class="ui divider"></div>
</div>
@@ -64,7 +64,7 @@ Vue.component("dns-route-selector", {
<div class="ui field">
<select class="ui dropdown auto-width" v-model="routeCode">
<option value="">[请选择]</option>
<option v-for="route in vAllRoutes" :value="route.code">{{route.name}}</option>
<option v-for="route in vAllRoutes" :value="route.code + '@' + route.domainId">{{route.name}}{{route.domainName}}</option>
</select>
</div>
<div class="ui field">