fix: button state in during closing
This commit is contained in:
+5
-5
@@ -241,7 +241,7 @@ async function handlePrimaryButtonClick() {
|
|||||||
break;
|
break;
|
||||||
case 'READY':
|
case 'READY':
|
||||||
let locale = $('#locale').value;
|
let locale = $('#locale').value;
|
||||||
let options = { locale, mapping: new Object(), writable: new Boolean(writable) };
|
let options = { locale, subcategories, mapping: new Object(), writable: new Boolean(writable), start: 2, limit: null };
|
||||||
|
|
||||||
for (let element of $.all("input[type='number'].params")) {
|
for (let element of $.all("input[type='number'].params")) {
|
||||||
parameters[element.id] = element.disabled ? null : element.valueAsNumber;
|
parameters[element.id] = element.disabled ? null : element.valueAsNumber;
|
||||||
@@ -264,9 +264,8 @@ async function handlePrimaryButtonClick() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (options.slice) {
|
if (options.slice) {
|
||||||
options.start = $('#offset').valueAsNumber * $('#chunksize').valueAsNumber + 2;
|
|
||||||
options.limit = Math.min(minor || major, $('#chunksize').valueAsNumber);
|
options.limit = Math.min(minor || major, $('#chunksize').valueAsNumber);
|
||||||
options.subcategories = subcategories.length > 0 ? subcategories: null;
|
options.start += $('#offset').valueAsNumber * $('#chunksize').valueAsNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
await Rpc2.invoke('begin', options, parameters);
|
await Rpc2.invoke('begin', options, parameters);
|
||||||
@@ -432,8 +431,8 @@ while (await new Promise(o => setTimeout(o, 1000, true))) {
|
|||||||
$('#remainingLabel').innerText = '';
|
$('#remainingLabel').innerText = '';
|
||||||
break;
|
break;
|
||||||
case 'CLOSING':
|
case 'CLOSING':
|
||||||
try {
|
if (writable) try {
|
||||||
if (writable === null) break;
|
$.all('#actions > button').forEach(e => e.disabled = true);
|
||||||
let data = await filereader().then(([_, b]) => Rpc2.invoke('merge', new Uint8Array(b).toBase64()));
|
let data = await filereader().then(([_, b]) => Rpc2.invoke('merge', new Uint8Array(b).toBase64()));
|
||||||
await writable.write(Uint8Array.fromBase64(data));
|
await writable.write(Uint8Array.fromBase64(data));
|
||||||
await writable.close();
|
await writable.close();
|
||||||
@@ -443,6 +442,7 @@ while (await new Promise(o => setTimeout(o, 1000, true))) {
|
|||||||
await writable.abort().catch(() => void 0);
|
await writable.abort().catch(() => void 0);
|
||||||
}
|
}
|
||||||
writable = null;
|
writable = null;
|
||||||
|
continue;
|
||||||
case 'RUNNING':
|
case 'RUNNING':
|
||||||
$('#send > span.text').innerText = 'Pause';
|
$('#send > span.text').innerText = 'Pause';
|
||||||
$('#send').classList.add('pulse');
|
$('#send').classList.add('pulse');
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ def main(driver: Chrome, logger = logging.getLogger('main')):
|
|||||||
result = dict()
|
result = dict()
|
||||||
col = headers.index(header) + 1
|
col = headers.index(header) + 1
|
||||||
|
|
||||||
for row in range(options.get('start', 2), limit + 1):
|
for row in range(options.get('start'), limit + 1):
|
||||||
key = str(wb.active.cell(row, col).value)
|
key = str(wb.active.cell(row, col).value)
|
||||||
result[key] = result.get(key, 0) + 1
|
result[key] = result.get(key, 0) + 1
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ def main(driver: Chrome, logger = logging.getLogger('main')):
|
|||||||
buffer = BytesIO(data)
|
buffer = BytesIO(data)
|
||||||
target = load_workbook(buffer)
|
target = load_workbook(buffer)
|
||||||
|
|
||||||
for row in range(options.get('start', 2), limit + 1):
|
for row in range(options.get('start'), limit + 1):
|
||||||
c1 = wb.active.cell(row, index + 1)
|
c1 = wb.active.cell(row, index + 1)
|
||||||
c2 = target.active.cell(row, index + 1)
|
c2 = target.active.cell(row, index + 1)
|
||||||
if not (c1.value and str(c1.value).strip()):
|
if not (c1.value and str(c1.value).strip()):
|
||||||
|
|||||||
Reference in New Issue
Block a user