mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-04-19 20:59:00 +00:00
feat: goto terminal
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
import { showConnectionFailedDialog } from "$lib/dialogs/connection-failed-dialog";
|
import { showConnectionFailedDialog } from "$lib/dialogs/connection-failed-dialog";
|
||||||
import { persistentWritable } from "$lib/storage";
|
import { persistentWritable } from "$lib/storage";
|
||||||
import { browser } from "$app/environment";
|
import { browser } from "$app/environment";
|
||||||
|
import { goto } from "$app/navigation";
|
||||||
|
|
||||||
let ports = $state<SerialPort[]>([]);
|
let ports = $state<SerialPort[]>([]);
|
||||||
let element: HTMLDivElement | undefined = $state();
|
let element: HTMLDivElement | undefined = $state();
|
||||||
@@ -53,6 +54,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function connectDevice(event: MouseEvent, serial: Serial) {
|
async function connectDevice(event: MouseEvent, serial: Serial) {
|
||||||
|
if (event.altKey) {
|
||||||
|
goto("/terminal/");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const port = await serial.requestPort({
|
const port = await serial.requestPort({
|
||||||
filters: event.shiftKey ? [] : [...PORT_FILTERS.values()],
|
filters: event.shiftKey ? [] : [...PORT_FILTERS.values()],
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user