replace tabs with space
parent
2186fe2428
commit
1f8bc2906e
@ -1,14 +1,14 @@
|
||||
<!DOCTYPE>
|
||||
<html>
|
||||
<head>
|
||||
<title>Doodle3D Box</title>
|
||||
<title>Doodle3D Box</title>
|
||||
|
||||
<script type="text/javascript" src="../jspm_packages/system.js"></script>
|
||||
<script type="text/javascript" src="../config.js"></script>
|
||||
<script type="text/javascript" src="../jspm_packages/system.js"></script>
|
||||
<script type="text/javascript" src="../config.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
System.import('./app.js');
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
System.import('./app.js');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,16 +1,16 @@
|
||||
import * as rest from '../rest.js';
|
||||
|
||||
export default class Config {
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
get(...keys) {
|
||||
return rest.get(`${ this.api }config/?${ keys.join('=&') }=`);
|
||||
}
|
||||
getAll() {
|
||||
return rest.get(`${ this.api }config/all`);
|
||||
}
|
||||
set(data) {
|
||||
return rest.post(`${ this.api }config`, data);
|
||||
}
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
get(...keys) {
|
||||
return rest.get(`${ this.api }config/?${ keys.join('=&') }=`);
|
||||
}
|
||||
getAll() {
|
||||
return rest.get(`${ this.api }config/all`);
|
||||
}
|
||||
set(data) {
|
||||
return rest.post(`${ this.api }config`, data);
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +1,19 @@
|
||||
import * as rest from '../rest.js';
|
||||
|
||||
export default class Info {
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
get() {
|
||||
return rest.get(`${ this.api }info`);
|
||||
}
|
||||
status() {
|
||||
return rest.get(`${ this.api }info/status`);
|
||||
}
|
||||
downloadLogFiles() {
|
||||
window.location = `${ this.api }info/logfiles`;
|
||||
}
|
||||
acces() {
|
||||
return rest.get(`${ this.api }info/access`);
|
||||
}
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
get() {
|
||||
return rest.get(`${ this.api }info`);
|
||||
}
|
||||
status() {
|
||||
return rest.get(`${ this.api }info/status`);
|
||||
}
|
||||
downloadLogFiles() {
|
||||
window.location = `${ this.api }info/logfiles`;
|
||||
}
|
||||
acces() {
|
||||
return rest.get(`${ this.api }info/access`);
|
||||
}
|
||||
}
|
||||
|
@ -1,46 +1,46 @@
|
||||
import * as rest from '../rest.js';
|
||||
|
||||
export default class Network {
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
scan() {
|
||||
return rest.get(`${ this.api }network/scan`);
|
||||
}
|
||||
known() {
|
||||
return rest.get(`${ this.api }network/known`);
|
||||
}
|
||||
status() {
|
||||
return rest.get(`${ this.api }network/status`);
|
||||
}
|
||||
assosiate(ssid, phrase, recreate = false) {
|
||||
const data = { ssid, recreate, phrase };
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
scan() {
|
||||
return rest.get(`${ this.api }network/scan`);
|
||||
}
|
||||
known() {
|
||||
return rest.get(`${ this.api }network/known`);
|
||||
}
|
||||
status() {
|
||||
return rest.get(`${ this.api }network/status`);
|
||||
}
|
||||
assosiate(ssid, phrase, recreate = false) {
|
||||
const data = { ssid, recreate, phrase };
|
||||
|
||||
return rest.post(`${ this.api }network/associate`, data);
|
||||
}
|
||||
disassociate() {
|
||||
//not tested
|
||||
return rest.post(`${ this.api }network/disassociate`, {});
|
||||
}
|
||||
openAccesPoint() {
|
||||
//not tested
|
||||
return rest.post(`${ this.api }network/openap`, {});
|
||||
}
|
||||
remove(ssid) {
|
||||
return rest.post(`${ this.api }network/remove`, {
|
||||
'ssid': ssid
|
||||
});
|
||||
}
|
||||
signin() {
|
||||
return rest.get(`${ this.api }network/signin`);
|
||||
}
|
||||
async alive() {
|
||||
try {
|
||||
await rest.get(`${ this.api }network/alive`);
|
||||
return rest.post(`${ this.api }network/associate`, data);
|
||||
}
|
||||
disassociate() {
|
||||
//not tested
|
||||
return rest.post(`${ this.api }network/disassociate`, {});
|
||||
}
|
||||
openAccesPoint() {
|
||||
//not tested
|
||||
return rest.post(`${ this.api }network/openap`, {});
|
||||
}
|
||||
remove(ssid) {
|
||||
return rest.post(`${ this.api }network/remove`, {
|
||||
'ssid': ssid
|
||||
});
|
||||
}
|
||||
signin() {
|
||||
return rest.get(`${ this.api }network/signin`);
|
||||
}
|
||||
async alive() {
|
||||
try {
|
||||
await rest.get(`${ this.api }network/alive`);
|
||||
|
||||
return true;
|
||||
} catch(error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch(error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,32 +1,32 @@
|
||||
import * as rest from '../rest.js';
|
||||
|
||||
export default class Printer {
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
temperature() {
|
||||
return rest.get(`${ this.api }printer/temperature`);
|
||||
}
|
||||
progress() {
|
||||
return rest.get(`${ this.api }printer/progress`);
|
||||
}
|
||||
state() {
|
||||
return rest.get(`${ this.api }printer/state`);
|
||||
}
|
||||
listAll() {
|
||||
return rest.get(`${ this.api }printer/listall`);
|
||||
}
|
||||
heatup() {
|
||||
return rest.post(`${ this.api }printer/heatup`, {});
|
||||
}
|
||||
print(gcode = '', first = false, start = false, last) {
|
||||
const data = { gcode, first, start, last };
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
temperature() {
|
||||
return rest.get(`${ this.api }printer/temperature`);
|
||||
}
|
||||
progress() {
|
||||
return rest.get(`${ this.api }printer/progress`);
|
||||
}
|
||||
state() {
|
||||
return rest.get(`${ this.api }printer/state`);
|
||||
}
|
||||
listAll() {
|
||||
return rest.get(`${ this.api }printer/listall`);
|
||||
}
|
||||
heatup() {
|
||||
return rest.post(`${ this.api }printer/heatup`, {});
|
||||
}
|
||||
print(gcode = '', first = false, start = false, last) {
|
||||
const data = { gcode, first, start, last };
|
||||
|
||||
return rest.post(`${ this.api }printer/print`, data);
|
||||
}
|
||||
stop(gcode = '') {
|
||||
const data = { gcode };
|
||||
return rest.post(`${ this.api }printer/print`, data);
|
||||
}
|
||||
stop(gcode = '') {
|
||||
const data = { gcode };
|
||||
|
||||
return rest.post(`${ this.api }printer/stop`, data);
|
||||
}
|
||||
return rest.post(`${ this.api }printer/stop`, data);
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +1,19 @@
|
||||
import * as rest from '../rest.js';
|
||||
|
||||
export default class Sketch {
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
getSketch(id) {
|
||||
return rest.get(`${ this.api }sketch/?id=${ id }`);
|
||||
}
|
||||
set(data = '') {
|
||||
return rest.post(`${ this.api }sketch`, { data });
|
||||
}
|
||||
status() {
|
||||
return rest.get(`${ this.api }sketch/status`);
|
||||
}
|
||||
clear() {
|
||||
return rest.post(`${ this.api }sketch/clear`);
|
||||
}
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
getSketch(id) {
|
||||
return rest.get(`${ this.api }sketch/?id=${ id }`);
|
||||
}
|
||||
set(data = '') {
|
||||
return rest.post(`${ this.api }sketch`, { data });
|
||||
}
|
||||
status() {
|
||||
return rest.get(`${ this.api }sketch/status`);
|
||||
}
|
||||
clear() {
|
||||
return rest.post(`${ this.api }sketch/clear`);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
import * as rest from '../rest.js';
|
||||
|
||||
export default class System {
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
versions() {
|
||||
return rest.get(`${ this.api }system/fwversions`);
|
||||
}
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
versions() {
|
||||
return rest.get(`${ this.api }system/fwversions`);
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,22 @@
|
||||
import * as rest from '../rest.js';
|
||||
|
||||
export default class Update {
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
status() {
|
||||
return rest.get(`${ this.api }update/status`);
|
||||
}
|
||||
download() {
|
||||
//not tested
|
||||
return rest.post(`${ this.api }update/download`, {});
|
||||
}
|
||||
install() {
|
||||
//not tested
|
||||
return rest.post(`${ this.api }update/install`, {});
|
||||
}
|
||||
clear() {
|
||||
//not tested
|
||||
return rest.post(`${ this.api }update/clear`, {});
|
||||
}
|
||||
constructor(api) {
|
||||
this.api = api;
|
||||
}
|
||||
status() {
|
||||
return rest.get(`${ this.api }update/status`);
|
||||
}
|
||||
download() {
|
||||
//not tested
|
||||
return rest.post(`${ this.api }update/download`, {});
|
||||
}
|
||||
install() {
|
||||
//not tested
|
||||
return rest.post(`${ this.api }update/install`, {});
|
||||
}
|
||||
clear() {
|
||||
//not tested
|
||||
return rest.post(`${ this.api }update/clear`, {});
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
export function sleep(time) {
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(resolve, time);
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(resolve, time);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue