mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 23:00:25 +08:00
初步实现多集群共享节点
This commit is contained in:
28
web/public/js/components/cluster/node-clusters-labels.js
Normal file
28
web/public/js/components/cluster/node-clusters-labels.js
Normal file
@@ -0,0 +1,28 @@
|
||||
// 显示节点的多个集群
|
||||
Vue.component("node-clusters-labels", {
|
||||
props: ["v-primary-cluster", "v-secondary-clusters", "size"],
|
||||
data: function () {
|
||||
let cluster = this.vPrimaryCluster
|
||||
let secondaryClusters = this.vSecondaryClusters
|
||||
if (secondaryClusters == null) {
|
||||
secondaryClusters = []
|
||||
}
|
||||
|
||||
let labelSize = this.size
|
||||
if (labelSize == null) {
|
||||
labelSize = "small"
|
||||
}
|
||||
if (labelSize == "tiny") {
|
||||
labelSize += " olive"
|
||||
}
|
||||
return {
|
||||
cluster: cluster,
|
||||
secondaryClusters: secondaryClusters,
|
||||
labelSize: labelSize
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<a v-if="cluster != null" :href="'/clusters/cluster?clusterId=' + cluster.id" class="ui label basic" :class="labelSize" title="主集群" style="margin-bottom: 0.3em;">{{cluster.name}}</a>
|
||||
<a v-for="c in secondaryClusters" :href="'/clusters/cluster?clusterId=' + c.id" class="ui label basic" :class="labelSize" title="从集群" style="margin-bottom: 0.3em;"><span class="grey" style="text-decoration: none">{{c.name}}</span></a>
|
||||
</div>`
|
||||
})
|
||||
Reference in New Issue
Block a user