-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
179 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,22 @@ | ||
import rest from './restapi.js'; | ||
import * as rest from './restapi.js'; | ||
|
||
export default class { | ||
constructor (localIP) { | ||
this.localIP = localIP; | ||
this.api = 'http://' + localIP + '/d3dapi/'; | ||
} | ||
|
||
get (keys, callback) { | ||
rest.get(this.api + 'config/?' + keys.join('=&') + '=', callback); | ||
get (keys) { | ||
return rest.get(this.api + 'config/?' + keys.join('=&') + '='); | ||
} | ||
|
||
getAll (callback) { | ||
rest.get(this.api + 'config/all', callback); | ||
getAll () { | ||
return rest.get(this.api + 'config/all'); | ||
} | ||
|
||
set (data, callback) { | ||
set (data) { | ||
var scope = this; | ||
|
||
rest.post(this.api + 'config', data, function (response) { | ||
|
||
if (callback !== undefined) { | ||
callback(response); | ||
} | ||
}); | ||
return rest.post(this.api + 'config', data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import rest from './restapi.js'; | ||
import * as rest from './restapi.js'; | ||
|
||
export default class { | ||
constructor (localIP) { | ||
this.localIP = localIP; | ||
this.api = `http://${localIP}/d3dapi/`; | ||
} | ||
|
||
get (callback) { | ||
rest.get(this.api + 'info', callback); | ||
get () { | ||
return rest.get(this.api + 'info'); | ||
} | ||
|
||
status (callback) { | ||
rest.get(this.api + 'info/status', callback); | ||
status () { | ||
return rest.get(this.api + 'info/status'); | ||
} | ||
|
||
downloadLogFiles () { | ||
window.location = this.api + 'info/logfiles'; | ||
} | ||
|
||
acces (callback) { | ||
rest.get(this.api + 'info/access', callback); | ||
acces () { | ||
return rest.get(this.api + 'info/access'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,54 @@ | ||
import rest from './restapi.js'; | ||
import * as rest from './restapi.js'; | ||
|
||
export default class { | ||
constructor (localIP) { | ||
this.localIP = localIP; | ||
this.api = `http://${localIP}/d3dapi/`; | ||
} | ||
|
||
scan (callback) { | ||
rest.get(this.api + 'network/scan', callback); | ||
scan () { | ||
return rest.get(this.api + 'network/scan'); | ||
} | ||
|
||
known (callback) { | ||
rest.get(this.api + 'network/known', callback); | ||
known () { | ||
return rest.get(this.api + 'network/known'); | ||
} | ||
|
||
status (callback) { | ||
rest.get(this.api + 'network/status', callback); | ||
status () { | ||
return rest.get(this.api + 'network/status'); | ||
} | ||
|
||
assosiate (data, callback) { | ||
rest.post(this.api + 'network/associate', data, callback); | ||
assosiate (ssid, phrase = null, recreate = false) { | ||
|
||
var data = {ssid, recreate}; | ||
if (phrase) phrase = phrase; | ||
|
||
return rest.post(this.api + 'network/associate', data); | ||
} | ||
|
||
disassosiate (callback) { | ||
disassosiate () { | ||
//not tested | ||
|
||
rest.post(this.api + 'network/disassociate', {}, callback); | ||
return rest.post(this.api + 'network/disassociate', {}); | ||
} | ||
|
||
openAccesPoint (callback) { | ||
openAccesPoint () { | ||
//not tested | ||
|
||
rest.post(this.api + 'network/openap', {}, callback); | ||
return rest.post(this.api + 'network/openap', {}); | ||
} | ||
|
||
remove (ssid, callback) { | ||
rest.post(this.api + 'network/remove', { | ||
remove (ssid) { | ||
return rest.post(this.api + 'network/remove', { | ||
'ssid': ssid | ||
}, callback); | ||
}); | ||
} | ||
|
||
signin (callback) { | ||
rest.get(this.api + 'network/signin', callback); | ||
signin () { | ||
return rest.get(this.api + 'network/signin'); | ||
} | ||
|
||
alive (callback) { | ||
rest.get(this.api + 'network/alive', callback); | ||
alive () { | ||
return rest.get(this.api + 'network/alive'); | ||
} | ||
} |
Oops, something went wrong.