mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 14:50:25 +08:00
增加用户系统界面管理、用户可以设置关联集群
This commit is contained in:
28
web/public/js/components/cluster/cluster-selector.js
Normal file
28
web/public/js/components/cluster/cluster-selector.js
Normal file
@@ -0,0 +1,28 @@
|
||||
Vue.component("cluster-selector", {
|
||||
mounted: function () {
|
||||
let that = this
|
||||
|
||||
Tea.action("/clusters/options")
|
||||
.post()
|
||||
.success(function (resp) {
|
||||
that.clusters = resp.data.clusters
|
||||
})
|
||||
},
|
||||
props: ["v-cluster-id"],
|
||||
data: function () {
|
||||
let clusterId = this.vClusterId
|
||||
if (clusterId == null) {
|
||||
clusterId = 0
|
||||
}
|
||||
return {
|
||||
clusters: [],
|
||||
clusterId: clusterId
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<select class="ui dropdown auto-width" name="clusterId" v-model="clusterId">
|
||||
<option value="0">[选择集群]</option>
|
||||
<option v-for="cluster in clusters" :value="cluster.id">{{cluster.name}}</option>
|
||||
</select>
|
||||
</div>`
|
||||
})
|
||||
Reference in New Issue
Block a user