Files
EdgeAdmin/web/public/js/components/cluster/node-clusters-labels.js

31 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-07-31 22:23:07 +08:00
// 显示节点的多个集群
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"
}
return {
cluster: cluster,
secondaryClusters: secondaryClusters,
labelSize: labelSize
}
},
template: `<div>
2021-09-15 19:22:54 +08:00
<a v-if="cluster != null" :href="'/clusters/cluster?clusterId=' + cluster.id" title="主集群" style="margin-bottom: 0.3em;">
<span class="ui label basic grey" :class="labelSize" v-if="labelSize != 'tiny'">{{cluster.name}}</span>
<grey-label v-if="labelSize == 'tiny'">{{cluster.name}}</grey-label>
</a>
<a v-for="c in secondaryClusters" :href="'/clusters/cluster?clusterId=' + c.id" :class="labelSize" title="从集群">
<span class="ui label basic grey" :class="labelSize" v-if="labelSize != 'tiny'">{{c.name}}</span>
<grey-label v-if="labelSize == 'tiny'">{{c.name}}</grey-label>
</a>
2021-07-31 22:23:07 +08:00
</div>`
})