Implement select in order to select devices

This commit is contained in:
Hydroxycarbamide 2022-09-11 23:44:38 +02:00
parent 085623e107
commit 04c9fc8412

View file

@ -7,7 +7,8 @@
let version: string = '';
let devices: string[];
let devices: string[] = [];
let selectedDevice;
let revancedCliReleases: Map<string, Release> | undefined;
let revancedVersions: Array<Array<string>> | undefined;
@ -31,7 +32,9 @@
const getDevices = () => {
invoke('get_devices')
.then((response: string[]) => {
devices = response;
devices = response
.filter((s) => s.length <= 0)
.map((s) => s.split('\t')[0]);
});
};
@ -133,6 +136,15 @@
options={integrationsVersions}
bind:selected={selectedIntegrationsVersion}
/>
{#if devices.length > 0}
<Select
id="devices"
defaultText={'Select the target device'}
options={devices.map((d) => [d, d])}
bind:selected={selectedDevice}
/>
{/if}
</div>
</main>