mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-08 21:04:19 +00:00
update
This commit is contained in:
parent
ca3a01ef2e
commit
fc8eacd2be
1 changed files with 11 additions and 8 deletions
|
@ -204,16 +204,19 @@
|
||||||
const selectFile = () => {
|
const selectFile = () => {
|
||||||
const input = document.createElement('input');
|
const input = document.createElement('input');
|
||||||
input.type = 'file';
|
input.type = 'file';
|
||||||
|
input.multiple = true;
|
||||||
input.onchange = async () => {
|
input.onchange = async () => {
|
||||||
if(input.files){
|
if(input.files){
|
||||||
const blob = new Blob([input.files[0]], { type: 'application/octet-stream' });
|
for(let i = 0; i < input.files.length; i++){
|
||||||
const rawEEPROM = new Uint8Array(await blob.arrayBuffer());
|
const blob = new Blob([input.files[i]], { type: 'application/octet-stream' });
|
||||||
const firmware = {
|
const rawEEPROM = new Uint8Array(await blob.arrayBuffer());
|
||||||
binaryFile: unpack(rawEEPROM),
|
const firmware = {
|
||||||
binaryName: input.files[0].name,
|
binaryFile: unpack(rawEEPROM),
|
||||||
color: getColor()
|
binaryName: input.files[i].name,
|
||||||
|
color: getColor()
|
||||||
|
}
|
||||||
|
state.rom.push(firmware)
|
||||||
}
|
}
|
||||||
state.rom.push(firmware)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
input.click();
|
input.click();
|
||||||
|
@ -293,7 +296,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const changeName = (val: any) => {
|
const changeName = (val: any) => {
|
||||||
state.rom[val].binaryName = state.rom[val].binaryName.replace(/[^\a-\z\A-\Z0-9.]/g, '')
|
state.rom[val].binaryName = state.rom[val].binaryName.replace(/[^\x00-\xff]/g, '')
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue