feat: add devices page with goal input and step log
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
17
web/src/lib/api/devices.remote.ts
Normal file
17
web/src/lib/api/devices.remote.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { query, getRequestEvent } from '$app/server';
|
||||
import { env } from '$env/dynamic/private';
|
||||
|
||||
const SERVER_URL = env.SERVER_URL || 'http://localhost:8080';
|
||||
|
||||
export const listDevices = query(async () => {
|
||||
const { request } = getRequestEvent();
|
||||
|
||||
const res = await fetch(`${SERVER_URL}/devices`, {
|
||||
headers: {
|
||||
cookie: request.headers.get('cookie') ?? ''
|
||||
}
|
||||
});
|
||||
|
||||
if (!res.ok) return [];
|
||||
return res.json();
|
||||
});
|
||||
Reference in New Issue
Block a user