Mercurial > code > home > repos > light9
diff web/panels.ts @ 2408:7e7874fed2e3
buttons to add panels to the layout
author | drewp@bigasterisk.com |
---|---|
date | Sat, 18 May 2024 21:02:32 -0700 |
parents | |
children | ae4b90efb55a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/panels.ts Sat May 18 21:02:32 2024 -0700 @@ -0,0 +1,29 @@ +export { Light9AscoltamiUi } from "./ascoltami/Light9AscoltamiUi"; +export { Light9CollectorUi } from "./collector/Light9CollectorUi"; +export { Light9EffectListing } from "./effects/Light9EffectListing"; +export { Light9FadeUi } from "./fade/Light9FadeUi"; +export { Light9DeviceSettings } from "./live/Light9DeviceSettings"; + +const panels: Map<string, Array<string>> = new Map([ + ["light9-ascoltami-ui", ["ascoltami", "ascoltami"]], + ["light9-collector-ui", ["collector", "collector"]], + ["light9-device-settings", ["device-settings", "live"]], + ["light9-effect-listing", ["effect-listing" , "effectListing"]], + ["light9-fade-ui", ["fade", "fade"]], +]); + +export function panelElementNames(): string[] { + return Array.from(panels.keys()); +} + +export function panelUrl(elem: string): string { + const row = panels.get(elem); + if (!row) throw new Error("No panel: " + elem); + return "/" + row[1] + "/"; + } + +export function panelDisplayName(elem: string): string { + const row = panels.get(elem); + if (!row) throw new Error("No panel: " + elem); + return row[0]; +} \ No newline at end of file