mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-03 01:42:50 +08:00
Add Verbindungen menu, TS3-style Connect dialog, and layout restructure
- Replace inline toolbar connect fields with a modal Connect dialog matching the real TS3 client's layout, including a functional Standard Channel field wired through a new connector --default-channel flag - Add a Verbindungen dropdown menu (Verbinden/Aktuelle Verbindung trennen/ Alle Verbindungen trennen) with click-outside/Escape close and Ctrl+S/Ctrl+D shortcuts - Restructure layout: chat area (messages/tabs/input) now spans the full width at the bottom; right side shows a separate, non-scrollable server banner (object-fit scaled, shown only when set) above the client/server info panel; tree width and upper-area height are now drag-resizable - Surface server version, license, and banner URL from tsclientlib through the connector and gateway
This commit is contained in:
1 parent
95a3761235
commit
53e2887e14
5 files changed
+675
-117
No files matched your search
@@ -33,7 +33,15 @@ export interface ClientInfo {
|
||||
}
|
||||
|
||||
export type Ts3ConnectionEvent =
|
||||
| { type: "connected"; welcomeMessage: string; serverName: string; serverMaxClients: number }
|
||||
| {
|
||||
type: "connected";
|
||||
welcomeMessage: string;
|
||||
serverName: string;
|
||||
serverMaxClients: number;
|
||||
serverVersion: string;
|
||||
serverLicense: string;
|
||||
serverBannerUrl: string;
|
||||
}
|
||||
| { type: "channels"; channels: ChannelInfo[]; clients: ClientInfo[] }
|
||||
| { type: "chatMessage"; from: string; message: string }
|
||||
| { type: "serverMessage"; from: string; message: string }
|
||||
@@ -49,6 +57,7 @@ export interface Ts3ConnectOptions {
|
||||
nickname: string;
|
||||
serverPassword?: string;
|
||||
channelPassword?: string;
|
||||
defaultChannel?: string;
|
||||
}
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
@@ -76,6 +85,7 @@ export class Ts3Connection {
|
||||
const args = ["--address", this.options.host, "--nickname", this.options.nickname];
|
||||
if (this.options.serverPassword) args.push("--server-password", this.options.serverPassword);
|
||||
if (this.options.channelPassword) args.push("--channel-password", this.options.channelPassword);
|
||||
if (this.options.defaultChannel) args.push("--default-channel", this.options.defaultChannel);
|
||||
this.child = spawn(CONNECTOR_BIN, args);
|
||||
|
||||
createInterface({ input: this.child.stdout }).on("line", (line) => {
|
||||
@@ -103,7 +113,15 @@ export class Ts3Connection {
|
||||
}
|
||||
|
||||
const event = JSON.parse(line) as
|
||||
| { type: "connected"; welcome_message: string; server_name: string; server_max_clients: number }
|
||||
| {
|
||||
type: "connected";
|
||||
welcome_message: string;
|
||||
server_name: string;
|
||||
server_max_clients: number;
|
||||
server_version: string;
|
||||
server_license: string;
|
||||
server_banner_url: string;
|
||||
}
|
||||
| { type: "channels"; channels: RawChannelInfo[]; clients: RawClientInfo[] }
|
||||
| { type: "chatMessage"; from: string; message: string }
|
||||
| { type: "serverMessage"; from: string; message: string }
|
||||
@@ -120,6 +138,9 @@ export class Ts3Connection {
|
||||
welcomeMessage: event.welcome_message,
|
||||
serverName: event.server_name,
|
||||
serverMaxClients: event.server_max_clients,
|
||||
serverVersion: event.server_version,
|
||||
serverLicense: event.server_license,
|
||||
serverBannerUrl: event.server_banner_url,
|
||||
});
|
||||
} else if (event.type === "channels") {
|
||||
this.emit({
|
||||
|
||||
Reference in new issue
Block a user