fix: switched to node-7z
fix: switched to bun spawn but with windowsVerbatimArguments feat: Added ppsspp integration feat: Added focusing controls for windows feat: Added shortcut to kill emulators
This commit is contained in:
parent
a7eb655a48
commit
90d6711935
31 changed files with 1382 additions and 88 deletions
|
|
@ -62,33 +62,46 @@ export const system = new Elysia({ prefix: '/api/system' })
|
|||
return new Response(buildNotificationsStream());
|
||||
})
|
||||
.ws('/info/system', {
|
||||
response: SystemInfoSchema,
|
||||
response: z.discriminatedUnion('type', [
|
||||
z.object({ type: z.literal('info'), data: SystemInfoSchema }),
|
||||
z.object({ type: z.literal('focus') })
|
||||
]),
|
||||
async open (ws)
|
||||
{
|
||||
const battery = await si.battery();
|
||||
const wifi = await si.wifiConnections();
|
||||
const bluetooth = await si.bluetoothDevices();
|
||||
ws.send({
|
||||
battery: battery,
|
||||
wifiConnections: wifi,
|
||||
bluetoothDevices: bluetooth
|
||||
type: 'info',
|
||||
data: {
|
||||
battery: battery,
|
||||
wifiConnections: wifi,
|
||||
bluetoothDevices: bluetooth
|
||||
}
|
||||
}, true);
|
||||
|
||||
const handleFocus = () => ws.send({ type: 'focus' });
|
||||
events.on('focus', handleFocus);
|
||||
(ws.data as any).dispose = [() => events.removeListener('focus', handleFocus)];
|
||||
(ws.data as any).observer = setInterval(async () =>
|
||||
{
|
||||
const battery = await si.battery();
|
||||
const wifi = await si.wifiConnections();
|
||||
const bluetooth = await si.bluetoothDevices();
|
||||
ws.send({
|
||||
battery: battery,
|
||||
wifiConnections: wifi,
|
||||
bluetoothDevices: bluetooth
|
||||
type: 'info',
|
||||
data: {
|
||||
battery: battery,
|
||||
wifiConnections: wifi,
|
||||
bluetoothDevices: bluetooth
|
||||
}
|
||||
}, true);
|
||||
}, 1000 * 30);
|
||||
},
|
||||
close (ws)
|
||||
{
|
||||
clearInterval((ws.data as any).observer);
|
||||
(ws.data as any).dispose.forEach((dispose: any) => dispose());
|
||||
}
|
||||
})
|
||||
.get('/drives', async () =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue