bz-toggler
This commit is contained in:
@@ -5,6 +5,15 @@ class AgentsModel extends WindozModel {
|
||||
this.ressource = '/agents'
|
||||
}
|
||||
|
||||
async getTypes(family) {
|
||||
let endpoint = app.config.api[this.ressource].getTypes
|
||||
endpoint.uri = endpoint.uri.replace('{family}', family)
|
||||
return (
|
||||
this.request(endpoint.uri, endpoint.method)
|
||||
.then( async serverData => serverData.payload.agentTypes)
|
||||
)
|
||||
}
|
||||
|
||||
async getSprites(group) {
|
||||
let endpoint = app.config.api[this.ressource].getSprites
|
||||
endpoint.uri = endpoint.uri.replace('{group}', group)
|
||||
@@ -13,6 +22,15 @@ class AgentsModel extends WindozModel {
|
||||
.then( async serverData => serverData.payload.agentSprites)
|
||||
)
|
||||
}
|
||||
|
||||
async getProperties(id) {
|
||||
let endpoint = app.config.api[this.ressource].getProperties
|
||||
endpoint.uri = endpoint.uri.replace('{id}', id)
|
||||
return (
|
||||
this.request(endpoint.uri, endpoint.method)
|
||||
.then( async serverData => serverData.payload.agentProperties)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
app.registerClass('AgentsModel', AgentsModel);
|
||||
Reference in New Issue
Block a user