add api function cancel. fix local device port when overridden

This commit is contained in:
Stewart Allen 2020-07-03 14:46:09 -04:00
commit cd2f431da0

View file

@ -206,6 +206,7 @@
slice: prepareSlices, slice: prepareSlices,
print: preparePrint, print: preparePrint,
export: function() { KIRI.export() }, export: function() { KIRI.export() },
cancel: cancelWorker,
clear: clearWidgetCache clear: clearWidgetCache
}, },
hide: { hide: {
@ -733,6 +734,10 @@
}); });
} }
function cancelWorker() {
if (KIRI.work.isSlicing()) KIRI.work.restart();
}
function clearWidgetCache() { function clearWidgetCache() {
hideSlices(); hideSlices();
clearSlices(); clearSlices();
@ -1885,7 +1890,7 @@
html.push(`<tbody>`); html.push(`<tbody>`);
for (let k in j) { for (let k in j) {
let r = j[k].stat; let r = j[k].stat;
bind.push({uuid: r.device.uuid, host: r.device.addr[0], post: r.device.port}); bind.push({uuid: r.device.uuid, host: r.device.addr[0], port: r.device.port});
html.push(`<tr>`); html.push(`<tr>`);
html.push(`<td>${r.device.name}</td>`); html.push(`<td>${r.device.name}</td>`);
html.push(`<td>${r.device.mode}</td>`); html.push(`<td>${r.device.mode}</td>`);