feat: show channel id in channel info dialog

This commit is contained in:
2024-09-23 06:10:49 +02:00
parent 4ec5b1b9ce
commit f8d0aee84e
2 changed files with 13 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ import { RemoveDialog } from "./remove-dialog";
export class ChannelDialog extends Dialog<IChannel | null> {
private channel: IChannel;
private nameField: TextInput;
private idField: TextInput;
private makeDefault: Button;
private mergeButton: Button;
private deleteButton: Button;
@@ -19,6 +20,11 @@ export class ChannelDialog extends Dialog<IChannel | null> {
this.nameField = new TextInput("Channel name");
this.nameField.setPosition(25, 10, 50, 10);
this.nameField.setValue(channel.name);
this.idField = new TextInput("Channel ID (for use with API)");
this.idField.setPosition(45, 10, 50, 10);
this.idField.setReadonly(true);
this.idField.setValue(channel.id.toString());
this.makeDefault = new Button("Make default");
this.makeDefault.setPosition(20, 70, 10, 10);
this.makeDefault.onClick(() => {
@@ -39,6 +45,7 @@ export class ChannelDialog extends Dialog<IChannel | null> {
this.deleteChannel();
});
this.add(this.nameField);
this.add(this.idField);
this.add(this.makeDefault);
this.add(this.mergeButton);
this.add(this.deleteButton);

View File

@@ -45,4 +45,9 @@ export class TextInput extends UINode {
this.inputElement.value = value;
return this;
}
public setReadonly(readonly: boolean) {
this.inputElement.readOnly = readonly;
return this;
}
}