mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-08 07:50:28 +08:00
23 lines
405 B
JavaScript
23 lines
405 B
JavaScript
|
|
Tea.context(function () {
|
||
|
|
this.addItem = function (item) {
|
||
|
|
this.$post("$")
|
||
|
|
.params({
|
||
|
|
clusterId: this.clusterId,
|
||
|
|
itemId: item.id
|
||
|
|
})
|
||
|
|
.success(function () {
|
||
|
|
item.isChecked = true
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
this.removeItem = function (item) {
|
||
|
|
this.$post(".delete")
|
||
|
|
.params({
|
||
|
|
clusterId: this.clusterId,
|
||
|
|
itemId: item.id
|
||
|
|
})
|
||
|
|
.success(function () {
|
||
|
|
item.isChecked = false
|
||
|
|
})
|
||
|
|
}
|
||
|
|
})
|