mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-22 18:02:42 +00:00
update deployment
This commit is contained in:
16
src/routes/(app)/ota-update/[device]/+page.ts
Normal file
16
src/routes/(app)/ota-update/[device]/+page.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { PageLoad } from "./$types";
|
||||
import type { DirectoryListing } from "../listing";
|
||||
|
||||
export const load = (async ({ fetch, params }) => {
|
||||
const result = await fetch(
|
||||
`${import.meta.env.VITE_FIRMWARE_URL}/${params.device}/`,
|
||||
);
|
||||
const data = await result.json();
|
||||
|
||||
return {
|
||||
versions: (data as DirectoryListing[]).sort((a, b) =>
|
||||
b.name.localeCompare(a.name),
|
||||
),
|
||||
device: params.device,
|
||||
};
|
||||
}) satisfies PageLoad;
|
||||
Reference in New Issue
Block a user