Automatically configure default preload URL if the backend serves the frontend directly.

Fixes #207
This commit is contained in:
Yeicor
2024-11-15 22:56:34 +01:00
parent ea181dac0b
commit 4343c52466
7 changed files with 195 additions and 63 deletions

View File

@@ -43,7 +43,7 @@ export class NetworkManager extends EventTarget {
* Updates will be emitted as "update" events, including the download URL and the model name.
*/
async load(url: string) {
if (url.startsWith("dev+")) {
if (url.startsWith("dev+") || url.startsWith("dev ")) {
let baseUrl = new URL(url.slice(4));
baseUrl.searchParams.set("api_updates", "true");
await this.monitorDevServer(baseUrl);