2015-07-23 19:12:50 +02:00
|
|
|
import * as rest from './restapi.js';
|
2015-07-15 15:06:18 +02:00
|
|
|
|
|
|
|
export default class {
|
|
|
|
constructor (localIP) {
|
|
|
|
this.localIP = localIP;
|
|
|
|
this.api = 'http://' + localIP + '/d3dapi/';
|
|
|
|
}
|
|
|
|
|
2015-07-23 19:12:50 +02:00
|
|
|
get (keys) {
|
|
|
|
return rest.get(this.api + 'config/?' + keys.join('=&') + '=');
|
2015-07-15 15:06:18 +02:00
|
|
|
}
|
|
|
|
|
2015-07-23 19:12:50 +02:00
|
|
|
getAll () {
|
|
|
|
return rest.get(this.api + 'config/all');
|
2015-07-15 15:06:18 +02:00
|
|
|
}
|
|
|
|
|
2015-07-23 19:12:50 +02:00
|
|
|
set (data) {
|
2015-07-15 15:06:18 +02:00
|
|
|
var scope = this;
|
|
|
|
|
2015-07-23 19:12:50 +02:00
|
|
|
return rest.post(this.api + 'config', data);
|
2015-07-15 15:06:18 +02:00
|
|
|
}
|
|
|
|
}
|