diff options
Diffstat (limited to 'client-web/source/resource')
-rw-r--r-- | client-web/source/resource/mod.ts | 2 | ||||
-rw-r--r-- | client-web/source/resource/track.ts | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/client-web/source/resource/mod.ts b/client-web/source/resource/mod.ts index 9583604..50bc91c 100644 --- a/client-web/source/resource/mod.ts +++ b/client-web/source/resource/mod.ts @@ -1,3 +1,5 @@ +/// <reference lib="dom" /> + import { ProvideInfo } from "../../../common/packets.d.ts" import { ediv } from "../helper.ts" import { log } from "../logger.ts" diff --git a/client-web/source/resource/track.ts b/client-web/source/resource/track.ts index bc26acc..b2f73ab 100644 --- a/client-web/source/resource/track.ts +++ b/client-web/source/resource/track.ts @@ -1,3 +1,5 @@ +/// <reference lib="dom" /> + import { ProvideInfo } from "../../../common/packets.d.ts"; import { ebutton } from "../helper.ts"; import { TrackHandle } from "../track_handle.ts"; @@ -29,8 +31,10 @@ export class TrackResource extends Resource { super.destroy() } + // TODO --- all the following code could be more generic and prettier in the UI --- + create_preview(): HTMLElement { - return ebutton("Enable", { + return ebutton(`Enable ${this.info.kind}`, { onclick: (e) => { (e as HTMLButtonElement).disabled = true; this.request() @@ -40,7 +44,7 @@ export class TrackResource extends Resource { create_element() { if (!this.track) { return this.create_preview() } const el = document.createElement("div") - el.append(ebutton("Disable", { + el.append(ebutton(`Enable ${this.info.kind}`, { onclick: (e) => { (e as HTMLButtonElement).disabled = true; this.request_stop() |