Skip to content

Commit

Permalink
fix terminal, add statechange type
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlauer-Hax committed Oct 22, 2023
1 parent aba8bf5 commit f7e5802
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
4 changes: 2 additions & 2 deletions pages/hosting/loading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const currentPath = asPointer("/");
export let messageQueueSidecar = <{ request: SidecarRequest, response: Deferred<SidecarResponse>; }[]>[];
let activeSideCar: Deferred<void> | undefined = undefined;
export const isSidecarConnect = asPointer(false);
export const sidecarDetailsSource = asPointer((_data: SidecarResponse | "connected") => { });
export const sidecarDetailsSource = asPointer((_data: SidecarResponse | "clear") => { });
export function stopSidecarConnection() {
activeSideCar?.resolve();
}
Expand Down Expand Up @@ -164,7 +164,7 @@ export async function startSidecarConnection(id: string) {
syncedResponses.add(msg);
ws.send(JSON.stringify(msg.request));
}, 100);
sidecarDetailsSource.getValue()?.("connected");
sidecarDetailsSource.getValue()?.("clear");
isSidecarConnect.setValue(true);
};

Expand Down
13 changes: 3 additions & 10 deletions spec/music.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,6 @@ export const sidecarResponse = zod.discriminatedUnion("type", [
chunk: zod.string().optional(),
finish: zod.boolean()
}),
zod.object({
type: zod.literal("auth"),
success: zod.boolean()
}),
zod.object({
type: zod.literal("log"),
chunk: zod.string(),
Expand All @@ -374,14 +370,11 @@ export const sidecarResponse = zod.discriminatedUnion("type", [
error: zod.string()
}),
zod.object({
type: zod.literal("resources"),
cpu: zod.number(),
memory: zod.number(),
used: zod.number(),
avail: zod.number(),
type: zod.literal("next-chunk")
}),
zod.object({
type: zod.literal("next-chunk")
type: zod.literal("state"),
state: serverPowerState
})
]);

Expand Down

0 comments on commit f7e5802

Please sign in to comment.