0.4.4
This commit is contained in:
@@ -4,7 +4,7 @@ import * as bootstrap from "bootstrap";
|
||||
import "simplebar";
|
||||
import ResizeObserver from "resize-observer-polyfill";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { trace, takeoverConsole } from "@fltsci/tauri-plugin-tracing";
|
||||
import { debug, takeoverConsole } from "@fltsci/tauri-plugin-tracing";
|
||||
|
||||
(window as Window & typeof globalThis & { bootstrap?: typeof bootstrap }).bootstrap = bootstrap;
|
||||
(window as Window & typeof globalThis & { ResizeObserver?: typeof ResizeObserver }).ResizeObserver = ResizeObserver;
|
||||
@@ -16,6 +16,13 @@ async function openDemoWsWindow(): Promise<void> {
|
||||
console.error("open_demo_ws_window failed:", error);
|
||||
}
|
||||
}
|
||||
async function openDemoHttpWindow(): Promise<void> {
|
||||
try {
|
||||
await invoke("open_demo_http_window");
|
||||
} catch (error) {
|
||||
console.error("open_demo_http_window failed:", error);
|
||||
}
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", async () => {
|
||||
void takeoverConsole();
|
||||
const sidebarToggle = document.querySelector<HTMLButtonElement>('#sidebarToggle');
|
||||
@@ -54,6 +61,9 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
|
||||
const openDemoWsButton = document.querySelector<HTMLButtonElement>("#openDemoWsButton");
|
||||
const openDemoWsButtonSecondary = document.querySelector<HTMLButtonElement>("#openDemoWsButtonSecondary");
|
||||
|
||||
const openDemoHttpButton = document.querySelector<HTMLButtonElement>("#openDemoHttpButton");
|
||||
const openDemoHttpButtonSecondary = document.querySelector<HTMLButtonElement>("#openDemoHttpButtonSecondary");
|
||||
|
||||
if (openDemoWsButton) {
|
||||
openDemoWsButton.addEventListener("click", () => {
|
||||
@@ -67,6 +77,18 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
});
|
||||
}
|
||||
|
||||
trace("window loaded");
|
||||
if (openDemoHttpButton) {
|
||||
openDemoHttpButton.addEventListener("click", () => {
|
||||
void openDemoHttpWindow();
|
||||
});
|
||||
}
|
||||
|
||||
if (openDemoHttpButtonSecondary) {
|
||||
openDemoHttpButtonSecondary.addEventListener("click", () => {
|
||||
void openDemoHttpWindow();
|
||||
});
|
||||
}
|
||||
|
||||
debug("window loaded");
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user