mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-02 17:32:50 +08:00
Add Server Log tab notifications for client/channel/permission events
Surfaces join/leave/channel-switch/group-assignment/channel- and server-edit events inline in the Server tab, matching the native TS3 client's behavior. Own missing-permission errors are shown; other clients' permission failures are not. Sourced from tsclientlib's book-event diffs rather than admin-only ServerQuery logs, so it works for any connected user regardless of log-view permissions. Also upgrades the channel-switch command to report permission errors instead of failing silently, and adds a scripted demo-mode preview of the feature for the GitHub Pages demo. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0d8e9336f8
commit
42f82d49aa
6 files changed
+272
-11
No files matched your search
@@ -33,6 +33,17 @@ export interface ClientInfo {
|
||||
isChannelCommander: boolean;
|
||||
}
|
||||
|
||||
export type ServerLogEntry =
|
||||
| { kind: "clientJoin"; client: string; channel: string }
|
||||
| { kind: "clientLeave"; client: string }
|
||||
| { kind: "clientChannelSwitch"; client: string; fromChannel: string; toChannel: string }
|
||||
| { kind: "clientChannelGroupAssigned"; client: string; group: string }
|
||||
| { kind: "channelCreated"; channel: string }
|
||||
| { kind: "channelDeleted"; channel: string }
|
||||
| { kind: "channelEdited"; channel: string }
|
||||
| { kind: "serverEdited" }
|
||||
| { kind: "permissionError"; action: string };
|
||||
|
||||
export type Ts3ConnectionEvent =
|
||||
| {
|
||||
type: "connected";
|
||||
@@ -51,7 +62,8 @@ export type Ts3ConnectionEvent =
|
||||
| { type: "audioOut"; pcm: string }
|
||||
| { type: "talkers"; clients: number[] }
|
||||
| { type: "disconnected"; reason: string }
|
||||
| { type: "error"; message: string };
|
||||
| { type: "error"; message: string }
|
||||
| ({ type: "serverLog" } & ServerLogEntry);
|
||||
|
||||
export interface Ts3ConnectOptions {
|
||||
host: string;
|
||||
@@ -134,7 +146,8 @@ export class Ts3Connection {
|
||||
| { type: "audioOut"; pcm: string }
|
||||
| { type: "talkers"; clients: number[] }
|
||||
| { type: "disconnected"; reason: string }
|
||||
| { type: "error"; message: string };
|
||||
| { type: "error"; message: string }
|
||||
| ({ type: "serverLog" } & ServerLogEntry);
|
||||
|
||||
if (event.type === "connected") {
|
||||
this.emit({
|
||||
|
||||
Reference in new issue
Block a user