annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2408
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
1 export { Light9AscoltamiUi } from "./ascoltami/Light9AscoltamiUi";
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
2 export { Light9CollectorUi } from "./collector/Light9CollectorUi";
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
3 export { Light9EffectListing } from "./effects/Light9EffectListing";
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
4 export { Light9FadeUi } from "./fade/Light9FadeUi";
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
5 export { Light9DeviceSettings } from "./live/Light9DeviceSettings";
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
6
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
7 const panels: Map<string, Array<string>> = new Map([
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
8 ["light9-ascoltami-ui", ["ascoltami", "ascoltami"]],
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
9 ["light9-collector-ui", ["collector", "collector"]],
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
10 ["light9-device-settings", ["device-settings", "live"]],
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
11 ["light9-effect-listing", ["effect-listing" , "effectListing"]],
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
12 ["light9-fade-ui", ["fade", "fade"]],
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
13 ]);
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
14
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
15 export function panelElementNames(): string[] {
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
16 return Array.from(panels.keys());
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
17 }
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
18
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
19 export function panelUrl(elem: string): string {
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
20 const row = panels.get(elem);
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
21 if (!row) throw new Error("No panel: " + elem);
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
22 return "/" + row[1] + "/";
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
23 }
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
24
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
25 export function panelDisplayName(elem: string): string {
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
26 const row = panels.get(elem);
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
27 if (!row) throw new Error("No panel: " + elem);
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
28 return row[0];
7e7874fed2e3 buttons to add panels to the layout
drewp@bigasterisk.com
parents:
diff changeset
29 }