mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-01 02:52:49 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9788e7fa1c | ||
|
|
66da7efe4a | ||
|
|
3fb7000d02 | ||
|
|
03c95abcf7 | ||
|
|
d2ffbee873 | ||
|
|
413dbaf3a8 | ||
|
|
9187d2faed | ||
|
|
af85a73c7d |
No files matched your search
@@ -2,6 +2,25 @@
|
||||
|
||||
All notable changes to WebSpeak are documented here. Versions follow SemVer.
|
||||
|
||||
## [0.1.2] — 2026-09-02
|
||||
|
||||
### Added
|
||||
|
||||
- Current-version badge and a direct changelog link on the welcome page, next to the prominent GitHub repository button.
|
||||
- Mobile member actions through a three-dot menu, while desktop member actions remain available through the context menu.
|
||||
|
||||
### Changed
|
||||
|
||||
- Mobile and narrow-screen header controls now collapse longer labels into icons to preserve usable spacing.
|
||||
- The welcome page and connected workspace now present the GitHub, version, changelog, admin, theme, language, exit, and microphone controls as a consistent responsive control group.
|
||||
- The version shown on the welcome page is read from the gateway's public configuration so it stays aligned with the running backend.
|
||||
- Consolidated the post-0.1.1 mobile voice controls, microphone mute replacement for focus-dependent PTT, automatic protocol detection, simplified Docker Compose startup, and live-demo documentation.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Replaced the visually off-center settings glyph and normalized icon alignment for settings-related controls across the client.
|
||||
- Fixed narrow-screen exit and microphone controls so their text-collapse rules apply correctly.
|
||||
|
||||
## [0.1.1] — 2026-09-02
|
||||
|
||||
### Added
|
||||
@@ -19,6 +38,8 @@ All notable changes to WebSpeak are documented here. Versions follow SemVer.
|
||||
- The README architecture section now uses GitHub-native Markdown instead of a Mermaid rich-display block.
|
||||
- The README badge set now uses stable static Shields badges without a repository-metadata 404 dependency.
|
||||
- Version tags publish Windows/Linux deployment packages to GitHub Releases and publish the matching Docker image.
|
||||
- Removed the focus-dependent normal browser Space-key PTT mode and replaced it with a one-click microphone mute/unmute control on desktop and mobile.
|
||||
- Persisted the microphone mute state in browser preferences and suppresses upstream audio before it is sent to TeamSpeak while muted.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ A self-hosted TeamSpeak 3 / TeamSpeak 6 web client and voice gateway. Join your
|
||||
[](https://nodejs.org/)
|
||||
[](https://www.teamspeak.com/)
|
||||
|
||||
**在线 Demo:** [https://webspeak.example.invalid](https://webspeak.example.invalid)
|
||||
|
||||
**[中文](#中文)**<br />
|
||||
[更新日志](#更新日志) · [为什么是 WebSpeak](#为什么是-webspeak) · [核心能力](#核心能力) · [架构](#架构) · [快速开始](#快速开始) · [首次登录与默认目标](#首次登录与默认目标) · [访问模式与邀请](#访问模式与邀请) · [音频与设备](#音频与设备) · [数据与安全边界](#数据与安全边界) · [旧版本升级](#旧版本升级) · [健康检查](#健康检查开发与验证) · [项目结构](#项目结构) · [已知边界](#已知边界) · [社区](#社区)
|
||||
|
||||
@@ -28,13 +30,23 @@ A self-hosted TeamSpeak 3 / TeamSpeak 6 web client and voice gateway. Join your
|
||||
|
||||
### 更新日志
|
||||
|
||||
#### 2026-09-02 · v0.1.2
|
||||
|
||||
- 优化移动端浏览器体验:频道、成员、聊天和语音操作适配窄屏;移动端成员操作提供三个点菜单,桌面端继续使用右键菜单。
|
||||
- 将首页 GitHub 入口改为显眼按钮,并增加当前版本标识和更新日志入口;窄屏时自动收敛为图标,避免按钮文字互相挤占。
|
||||
- 修复设置齿轮图标和相关操作按钮的对齐问题,统一设置、退出、麦克风等控制的触控尺寸与视觉反馈。
|
||||
- 将上一个版本之后的移动端语音控制、闭麦替代按键说话、目标协议自动探测、Docker Compose 简化启动和在线 Demo 文档整理为本次版本内容。
|
||||
|
||||
#### 2026-09-02 · v0.1.1
|
||||
|
||||
- 汇总并正式发布浏览器客户端、管理员控制台、受控邀请、Session 运维、审计记录、诊断报告和 SQLite 备份能力。
|
||||
- 修复晚进入 WebSpeak 的浏览器会话无法看到先进入成员的问题;连接建立后会完成目录同步,并合并分阶段成员事件。
|
||||
- 修复私聊消息到达后网页端断开连接的问题,完善成员右键菜单、悬停高亮和语音活动状态展示。
|
||||
- 完成中英文界面、默认 TeamSpeak 目标、旧版配置迁移和首次登录强制改密流程。
|
||||
- 移除依赖页面焦点的普通空格键按键说话模式;改为桌面端和移动端均可用的一键闭麦/开麦,静音状态会保存在当前浏览器中。
|
||||
- 闭麦会在上行音频发送前直接阻断声音,同时保留 VOX 语音激活、输入设备选择、音量与阈值调节能力。
|
||||
- 发布流程稳定生成 Windows/Linux 部署包并同步发布 Docker 镜像;Docker 构建会正确处理依赖安装脚本。
|
||||
- 简化 Docker Compose 部署:默认从当前代码构建,自动创建并持久化数据卷,支持通过 `WEBSPEAK_PORT` 修改宿主机端口。
|
||||
|
||||
#### 2026-08-31 · v0.1.0
|
||||
|
||||
@@ -54,13 +66,13 @@ A self-hosted TeamSpeak 3 / TeamSpeak 6 web client and voice gateway. Join your
|
||||
|
||||
| 领域 | 已提供 |
|
||||
| --- | --- |
|
||||
| 语音 | Opus / PCM 桥接、自由麦、按键说话、VOX、连接状态与重连提示 |
|
||||
| 语音 | Opus / PCM 桥接、VOX 语音激活、一键闭麦/开麦、连接状态与重连提示 |
|
||||
| 设备 | 浏览器麦克风与扬声器选择、音量调节、实时输入电平、本地麦克风测试 |
|
||||
| 频道 | 频道树、频道切换、成员移动、频道文字聊天、服务器事件与状态展示 |
|
||||
| 成员 | 在线成员、发言绿色头像边框、Away 状态、私聊、Poke、昵称复制、成员音量 |
|
||||
| 管理 | 默认账号首次登录强制改密、默认 TeamSpeak 目标、站点信息、真实连接测试 |
|
||||
| 运维 | 活动 Session、邀请创建与撤销、审计事件、结构化日志、诊断报告、SQLite 备份 |
|
||||
| 浏览器体验 | 响应式布局、移动端按住说话、紧凑滚动布局、浏览器本地收藏与最近连接 |
|
||||
| 浏览器体验 | 响应式布局、桌面与移动端语音控制、紧凑滚动布局、浏览器本地收藏与最近连接 |
|
||||
|
||||
### 架构
|
||||
|
||||
@@ -72,7 +84,35 @@ A self-hosted TeamSpeak 3 / TeamSpeak 6 web client and voice gateway. Join your
|
||||
|
||||
### 快速开始
|
||||
|
||||
#### 方式 A:从 Dockerfile 构建
|
||||
#### 方式 A:Docker Compose(推荐)
|
||||
|
||||
Docker Compose 会直接使用当前目录的 Dockerfile 构建 WebSpeak,自动创建数据卷并启动服务,不需要手动创建镜像或数据卷。
|
||||
|
||||
```bash
|
||||
git clone https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
|
||||
cd WebSpeak-client-for-TeamSpeak
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
查看状态和日志:
|
||||
|
||||
```bash
|
||||
docker compose ps
|
||||
docker compose logs -f webspeak
|
||||
curl http://127.0.0.1:3040/health
|
||||
```
|
||||
|
||||
启动完成后打开 [http://127.0.0.1:3040/](http://127.0.0.1:3040/)。首次进入管理后台 `/admin` 使用 `admin / admin`,并按提示修改密码。
|
||||
|
||||
默认数据保存在 Docker volume `webspeak-data` 中。升级代码后再次执行 `docker compose up -d --build` 即可;停止服务使用 `docker compose down`,不要添加 `-v`,否则会删除数据库、密钥和管理员配置。
|
||||
|
||||
WebSpeak 默认对外提供 `3040` 端口。如需修改宿主机端口,只需设置 `WEBSPEAK_PORT`,容器内部端口无需修改:
|
||||
|
||||
```bash
|
||||
WEBSPEAK_PORT=3041 docker compose up -d --build
|
||||
```
|
||||
|
||||
#### 方式 B:Dockerfile 手动运行(可选)
|
||||
|
||||
```bash
|
||||
docker build -t webspeak:local .
|
||||
@@ -85,9 +125,9 @@ docker run -d \
|
||||
webspeak:local
|
||||
```
|
||||
|
||||
容器固定监听 `3040`,SQLite 数据库、安装级主密钥和日志保存在 `/data`。公网部署时,请在前面配置 HTTPS 反向代理;麦克风和部分浏览器音频能力需要安全上下文。
|
||||
容器内部监听 `3040`,SQLite 数据库、安装级主密钥和日志保存在 `/data`。手动运行时也请保留 `webspeak-data:/data` 数据卷。
|
||||
|
||||
#### 方式 B:源码运行
|
||||
#### 方式 C:源码运行
|
||||
|
||||
环境要求:
|
||||
|
||||
@@ -137,7 +177,7 @@ WebSpeak 的 HTTP 端口固定为 `3040`,TeamSpeak 默认语音端口为 `9987
|
||||
进入语音空间后,在设置中可以:
|
||||
|
||||
- 选择浏览器检测到的麦克风与扬声器;
|
||||
- 切换自由麦和按键说话;
|
||||
- 一键闭麦或开麦;
|
||||
- 调整输入、输出、通知音量与 VOX 阈值;
|
||||
- 查看麦克风权限、实时输入电平和音频上下文状态;
|
||||
- 使用最多 5 秒的本地麦克风测试,录音只在浏览器本地播放,不发送到 TeamSpeak。
|
||||
@@ -243,15 +283,27 @@ QQ群:`869500475`
|
||||
|
||||
WebSpeak brings TeamSpeak voice spaces to the browser. It is a self-hosted gateway and web client for TeamSpeak 3 and TeamSpeak 6: open a link, choose a nickname, and join from a modern browser without installing a desktop client.
|
||||
|
||||
**Live demo:** [https://webspeak.example.invalid](https://webspeak.example.invalid)
|
||||
|
||||
### Changelog
|
||||
|
||||
#### 2026-09-02 · v0.1.2
|
||||
|
||||
- Improved the mobile browser experience across channel, member, chat, and voice surfaces; mobile member actions now use a three-dot menu while desktop keeps the context menu.
|
||||
- Promoted the GitHub entry on the welcome page and added a current-version badge plus a changelog link; narrow layouts collapse text controls into icons to prevent crowding.
|
||||
- Fixed alignment for the settings gear and related controls, with consistent touch sizing and visual treatment for settings, exit, and microphone actions.
|
||||
- Consolidated the post-0.1.1 mobile voice controls, microphone mute replacement for focus-dependent PTT, automatic protocol detection, simplified Docker Compose startup, and live-demo documentation into this release.
|
||||
|
||||
#### 2026-09-02 · v0.1.1
|
||||
|
||||
- Consolidated and officially released the browser client, administrator console, managed invites, session operations, audit records, diagnostics, and SQLite backup support.
|
||||
- Fixed late WebSpeak browser sessions missing members who joined earlier by reconciling the directory after connect and merging staged member events.
|
||||
- Fixed browser sessions disconnecting after receiving a private message, and improved member context menus, hover highlighting, and speaking-state presentation.
|
||||
- Added the bilingual interface, default TeamSpeak target, legacy configuration migration, and mandatory first-login password rotation.
|
||||
- Removed the focus-dependent normal Space-key PTT mode and replaced it with a one-click microphone mute/unmute control on desktop and mobile; the mute state is persisted in the current browser.
|
||||
- Mute now suppresses upstream microphone audio before it is sent, while VOX activation, input-device selection, volume controls, and threshold tuning remain available.
|
||||
- Stabilized release publishing for Windows/Linux packages and the matching Docker image; Docker builds now handle the dependency patch script correctly.
|
||||
- Simplified Docker Compose deployment: it builds from the current checkout, creates and persists the data volume automatically, and supports changing the host port with `WEBSPEAK_PORT`.
|
||||
|
||||
#### 2026-08-31 · v0.1.0
|
||||
|
||||
@@ -271,13 +323,13 @@ WebSpeak brings TeamSpeak voice spaces to the browser. It is a self-hosted gatew
|
||||
|
||||
| Area | Included |
|
||||
| --- | --- |
|
||||
| Voice | Opus / PCM bridging, free mic, push-to-talk, VOX, connection state, reconnect feedback, and speaking indicators |
|
||||
| Voice | Opus / PCM bridging, VOX activation, one-click microphone mute/unmute, connection state, reconnect feedback, and speaking indicators |
|
||||
| Devices | Browser microphone and speaker selection, volume controls, live input level, and a local microphone test |
|
||||
| Channels | Channel tree, channel switching, member movement, channel text chat, server events, and status display |
|
||||
| Members | Online members, green speaking borders, Away state, private messages, Poke, nickname copy, and per-member volume |
|
||||
| Administration | Mandatory first-login password rotation, default TeamSpeak target, site information, and real connection tests |
|
||||
| Operations | Active sessions, invite creation and revocation, audit events, structured logs, diagnostics, and SQLite backup |
|
||||
| Browser experience | Responsive layouts, press-and-hold mobile PTT, compact scrolling regions, local favorites, and recent connections |
|
||||
| Browser experience | Responsive layouts, desktop and mobile voice controls, compact scrolling regions, local favorites, and recent connections |
|
||||
|
||||
### Architecture
|
||||
|
||||
@@ -289,7 +341,35 @@ WebSpeak brings TeamSpeak voice spaces to the browser. It is a self-hosted gatew
|
||||
|
||||
### Quick Start
|
||||
|
||||
#### Option A: Build with Docker
|
||||
#### Option A: Docker Compose (recommended)
|
||||
|
||||
Docker Compose builds WebSpeak from the Dockerfile in the current checkout, creates the persistent data volume automatically, and starts the service without a separate image-pull or volume-creation step.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
|
||||
cd WebSpeak-client-for-TeamSpeak
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
Check the service and health endpoint:
|
||||
|
||||
```bash
|
||||
docker compose ps
|
||||
docker compose logs -f webspeak
|
||||
curl http://127.0.0.1:3040/health
|
||||
```
|
||||
|
||||
Then open [http://127.0.0.1:3040/](http://127.0.0.1:3040/). On the first admin login, use `admin / admin` and follow the prompt to change the password.
|
||||
|
||||
Runtime data is kept in the `webspeak-data` Docker volume. After updating the checkout, run `docker compose up -d --build` again. Stop the service with `docker compose down`; do not add `-v`, because that removes the database, master key, and administrator settings.
|
||||
|
||||
The default host port is `3040`. To use another host port, set `WEBSPEAK_PORT`; the container port stays unchanged:
|
||||
|
||||
```bash
|
||||
WEBSPEAK_PORT=3041 docker compose up -d --build
|
||||
```
|
||||
|
||||
#### Option B: Run the Dockerfile manually (optional)
|
||||
|
||||
```bash
|
||||
docker build -t webspeak:local .
|
||||
@@ -302,9 +382,9 @@ docker run -d \
|
||||
webspeak:local
|
||||
```
|
||||
|
||||
The container listens on `3040`. SQLite data, the installation master key, and logs are stored in `/data`. If `certs/cert.pem` and `certs/key.pem` are present, the service enables HTTPS directly; for public deployments, an HTTPS reverse proxy is recommended. Microphone access and some browser audio features require a secure context.
|
||||
The container listens on `3040` internally. SQLite data, the installation master key, and logs are stored in `/data`; keep the `webspeak-data:/data` volume when running the image manually.
|
||||
|
||||
#### Option B: Run from source
|
||||
#### Option C: Run from source
|
||||
|
||||
Requirements:
|
||||
|
||||
@@ -356,7 +436,7 @@ In open mode, DNS resolution is followed by blocking loopback, private, link-loc
|
||||
Inside a voice space, the settings panel lets users:
|
||||
|
||||
- Choose a microphone and speaker detected by the browser.
|
||||
- Switch between free mic and push-to-talk.
|
||||
- Mute or unmute the microphone with one click.
|
||||
- Adjust input, output, notification, and VOX-threshold volumes.
|
||||
- Inspect microphone permission, live input level, and audio-context state.
|
||||
- Run a local microphone test of up to five seconds; the recording is played in the browser and is not sent to TeamSpeak.
|
||||
|
||||
+5
-3
@@ -1,10 +1,12 @@
|
||||
services:
|
||||
webspeak:
|
||||
image: ghcr.io/EchoSixHIYA/webspeak:latest
|
||||
container_name: webspeak
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: webspeak:local
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3040:3040"
|
||||
- "${WEBSPEAK_PORT:-3040}:3040"
|
||||
volumes:
|
||||
- webspeak-data:/data
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "webspeak-webclient",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "webspeak-webclient",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"hasInstallScript": true,
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "webspeak-webclient",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"private": true,
|
||||
"license": "AGPL-3.0-only",
|
||||
"type": "module",
|
||||
|
||||
@@ -208,7 +208,6 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
|
||||
},
|
||||
teamSpeak: {
|
||||
status: overview.teamSpeak.status,
|
||||
protocol: overview.teamSpeak.protocol,
|
||||
lastTestAt: overview.teamSpeak.lastTestAt,
|
||||
latencyMs: overview.teamSpeak.latencyMs,
|
||||
lastError: overview.teamSpeak.lastError,
|
||||
@@ -402,7 +401,6 @@ interface AdminOverview {
|
||||
teamSpeak: {
|
||||
target: string;
|
||||
status: string;
|
||||
protocol: string | null;
|
||||
lastTestAt: string | null;
|
||||
latencyMs: number | null;
|
||||
lastError: string | null;
|
||||
|
||||
@@ -88,6 +88,7 @@ export class AdminService {
|
||||
getPublicConfig(): Record<string, unknown> {
|
||||
const settings = this.database.getSettings();
|
||||
return {
|
||||
version: this.version,
|
||||
initialized: this.isInitialized(),
|
||||
siteName: settings.siteName,
|
||||
welcomeText: settings.welcomeText,
|
||||
@@ -104,7 +105,6 @@ export class AdminService {
|
||||
accessMode: settings.accessMode,
|
||||
siteName: settings.siteName,
|
||||
welcomeText: settings.welcomeText,
|
||||
detectedProtocol: settings.detectedProtocol,
|
||||
lastTestAt: settings.lastTestAt,
|
||||
lastTestLatencyMs: settings.lastTestLatencyMs,
|
||||
lastTestError: settings.lastTestError,
|
||||
@@ -136,7 +136,7 @@ export class AdminService {
|
||||
};
|
||||
}
|
||||
|
||||
async testConnection(targetText: string, password: string, persistResult: boolean): Promise<TeamSpeakProbeResult> {
|
||||
async testConnection(targetText: string, password: string, persistResult: boolean): Promise<Omit<TeamSpeakProbeResult, "protocol">> {
|
||||
let target: TeamSpeakTarget;
|
||||
try {
|
||||
target = parseTeamSpeakTarget(targetText);
|
||||
@@ -149,7 +149,8 @@ export class AdminService {
|
||||
this.database.recordConnectionTest({ protocol: result.protocol, latencyMs: result.latencyMs, error: null });
|
||||
this.database.addAudit("CONNECTION_TEST_SUCCEEDED", { protocol: result.protocol, latencyMs: result.latencyMs });
|
||||
}
|
||||
return result;
|
||||
const { protocol: _protocol, ...publicResult } = result;
|
||||
return publicResult;
|
||||
} catch (error: unknown) {
|
||||
const probeError = error instanceof TeamSpeakProbeError
|
||||
? error
|
||||
@@ -173,7 +174,6 @@ export class AdminService {
|
||||
teamSpeak: {
|
||||
target: formatTeamSpeakTarget({ host: settings.tsHost, port: settings.tsPort }),
|
||||
status: settings.lastTestError ? "unreachable" : settings.lastTestAt ? "reachable" : "unknown",
|
||||
protocol: settings.detectedProtocol,
|
||||
lastTestAt: settings.lastTestAt,
|
||||
latencyMs: settings.lastTestLatencyMs,
|
||||
lastError: settings.lastTestError,
|
||||
|
||||
@@ -139,11 +139,13 @@ test("admin API requires the default password to be changed before administratio
|
||||
const diagnostics = await request(origin, "/api/admin/diagnostics", { cookie });
|
||||
assert.equal(diagnostics.body.database.schemaVersion, 2);
|
||||
assert.equal("target" in diagnostics.body.teamSpeak, true);
|
||||
assert.equal("protocol" in diagnostics.body.teamSpeak, false);
|
||||
|
||||
const report = await request(origin, "/api/admin/diagnostics/report", { cookie });
|
||||
assert.equal(report.response.status, 200);
|
||||
assert.match(report.response.headers.get("content-disposition") ?? "", /diagnostic-report\.json/);
|
||||
assert.equal("target" in report.body.teamSpeak, false);
|
||||
assert.equal("protocol" in report.body.teamSpeak, false);
|
||||
assert.equal("serverPassword" in report.body, false);
|
||||
|
||||
const revoked = await request(origin, `/api/admin/invites/${encodeURIComponent(invite.body.invite.id)}/revoke`, {
|
||||
@@ -168,9 +170,9 @@ test("admin API requires the default password to be changed before administratio
|
||||
csrf: login.body.csrfToken,
|
||||
body: { target: "voice.example.com:9988", passwordAction: "remove" },
|
||||
});
|
||||
assert.equal(probe.body.protocol, "ts6");
|
||||
assert.equal("protocol" in probe.body, false);
|
||||
const settings = await request(origin, "/api/admin/server", { cookie });
|
||||
assert.equal(settings.body.detectedProtocol, "ts6");
|
||||
assert.equal("detectedProtocol" in settings.body, false);
|
||||
assert.equal(settings.body.lastTestLatencyMs, 7);
|
||||
|
||||
const logout = await request(origin, "/api/admin/logout", { method: "POST", cookie, csrf: login.body.csrfToken, body: {} });
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
<path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19v2h16v-2" />
|
||||
</template>
|
||||
<template v-else-if="name === 'settings'">
|
||||
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0L6.2 6.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path d="M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-1.42 1.42-.06-.06a1.7 1.7 0 0 0-1.88-.34 1.7 1.7 0 0 0-1.03 1.56V20h-2v-.09a1.7 1.7 0 0 0-1.03-1.56 1.7 1.7 0 0 0-1.88.34l-.06.06-1.42-1.42.06-.06A1.7 1.7 0 0 0 9.4 15a1.7 1.7 0 0 0-1.56-1.03H7v-2h.84A1.7 1.7 0 0 0 9.4 11a1.7 1.7 0 0 0-.34-1.88L9 9.06l1.42-1.42.06.06a1.7 1.7 0 0 0 1.88.34A1.7 1.7 0 0 0 13.39 6.5V6h2v.5a1.7 1.7 0 0 0 1.03 1.54 1.7 1.7 0 0 0 1.88-.34l.06-.06 1.42 1.42-.06.06A1.7 1.7 0 0 0 19.4 11a1.7 1.7 0 0 0 1.56 1.03H21v2h-.04A1.7 1.7 0 0 0 19.4 15Z" />
|
||||
</template>
|
||||
<path v-else-if="name === 'mic'" d="M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3Zm-7-3a7 7 0 0 0 14 0m-7 7v3m-3 0h6" />
|
||||
<path v-else-if="name === 'mic-off'" d="m4 4 16 16M10 6v5a2 2 0 0 0 3.2 1.6M14 6V5a2 2 0 0 0-3.7-1M5 11a7 7 0 0 0 10.6 6m3.4-6a7 7 0 0 0-.5-2.5M12 18v3m-3 0h6" />
|
||||
@@ -69,6 +69,7 @@
|
||||
<path v-else-if="name === 'waveform'" d="M3 12h2l2-6 3 12 3-9 2 6h6" />
|
||||
<path v-else-if="name === 'shield'" d="M12 21s8-3.5 8-10V5l-8-3-8 3v6c0 6.5 8 10 8 10Z" />
|
||||
<path v-else-if="name === 'monitor'" d="M4 4h16v12H4zM8 20h8M12 16v4" />
|
||||
<path v-else-if="name === 'github'" fill="currentColor" stroke="none" d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56 0-.28-.01-1.02-.02-2-3.2.7-3.88-1.54-3.88-1.54-.53-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7 1.15.08 1.75 1.18 1.75 1.18 1.02 1.75 2.68 1.24 3.33.95.1-.74.4-1.24.73-1.52-2.55-.29-5.23-1.28-5.23-5.68 0-1.25.45-2.27 1.18-3.07-.12-.29-.51-1.45.11-3.03 0 0 .96-.31 3.15 1.17.91-.25 1.88-.38 2.85-.38.97 0 1.94.13 2.85.38 2.19-1.48 3.15-1.17 3.15-1.17.62 1.58.23 2.74.11 3.03.73.8 1.18 1.82 1.18 3.07 0 4.41-2.69 5.38-5.25 5.67.41.35.78 1.04.78 2.1 0 1.52-.01 2.75-.01 3.12 0 .3.21.67.8.56C20.71 21.39 24 17.08 24 12 24 5.65 18.35.5 12 .5Z" />
|
||||
<path v-else-if="name === 'check'" d="m5 12 4 4L19 6" />
|
||||
<circle v-else cx="12" cy="12" r="8" />
|
||||
</svg>
|
||||
|
||||
@@ -105,8 +105,7 @@ export function useVoiceWebSocket() {
|
||||
const testAudioUrl = ref("");
|
||||
let testRecorder: MediaRecorder | null = null;
|
||||
let testRecorderTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
let pttPressed = false;
|
||||
const micMode = ref<"vox" | "ptt">("vox");
|
||||
const microphoneMuted = ref(false);
|
||||
const inputVolume = ref(1);
|
||||
const outputVolume = ref(1);
|
||||
const notificationVolume = ref(0.5);
|
||||
@@ -139,7 +138,7 @@ export function useVoiceWebSocket() {
|
||||
schemaVersion: 1,
|
||||
preferredInputDeviceId: selectedInputDeviceId.value,
|
||||
inputDeviceId: selectedInputDeviceId.value,
|
||||
voiceMode: micMode.value,
|
||||
microphoneMuted: microphoneMuted.value,
|
||||
voxThreshold: voxThreshold.value,
|
||||
inputGain: inputVolume.value,
|
||||
outputVolume: outputVolume.value,
|
||||
@@ -159,7 +158,7 @@ export function useVoiceWebSocket() {
|
||||
|
||||
void loadLocalPreferences().then((preferences) => {
|
||||
if (!selectedInputDeviceId.value) selectedInputDeviceId.value = preferences.preferredInputDeviceId ?? preferences.inputDeviceId ?? "";
|
||||
if (preferences.voiceMode === "vox" || preferences.voiceMode === "ptt") micMode.value = preferences.voiceMode;
|
||||
if (typeof preferences.microphoneMuted === "boolean") microphoneMuted.value = preferences.microphoneMuted;
|
||||
if (typeof preferences.voxThreshold === "number") voxThreshold.value = clamp(preferences.voxThreshold, 0.001, 0.08);
|
||||
if (typeof preferences.inputGain === "number") inputVolume.value = Math.max(0, Math.min(1, preferences.inputGain));
|
||||
if (typeof preferences.outputVolume === "number") outputVolume.value = Math.max(0, Math.min(1, preferences.outputVolume));
|
||||
@@ -306,11 +305,16 @@ export function useVoiceWebSocket() {
|
||||
for (let i = 0; i < input.length; i++) sum += input[i] * input[i];
|
||||
micLevel.value = Math.min(1, Math.sqrt(sum / Math.max(1, input.length)) * 6);
|
||||
const socket = ws.value;
|
||||
const shouldSend = !microphoneTestActive.value
|
||||
const shouldSend = !microphoneMuted.value
|
||||
&& !microphoneTestActive.value
|
||||
&& socket?.readyState === WebSocket.OPEN
|
||||
&& (micMode.value === "ptt" ? pttPressed : voxGate(input));
|
||||
&& voxGate(input);
|
||||
if (!shouldSend) {
|
||||
accumLen = 0;
|
||||
if (microphoneMuted.value) {
|
||||
voxAttack = 0;
|
||||
voxRelease = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!socket) {
|
||||
@@ -881,16 +885,14 @@ export function useVoiceWebSocket() {
|
||||
connect(lastConnection.target, lastConnection.channel, lastConnection.nickname, lastConnection.serverPassword, lastConnection.rememberIdentity ? identityMaterial.value || lastConnection.identity : "", lastConnection.rememberIdentity);
|
||||
}
|
||||
|
||||
function setMicMode(mode: "vox" | "ptt"): void {
|
||||
micMode.value = mode;
|
||||
if (mode === "vox") pttPressed = false;
|
||||
function setMicrophoneMuted(muted: boolean): void {
|
||||
microphoneMuted.value = muted;
|
||||
voxAttack = 0;
|
||||
voxRelease = 0;
|
||||
accumLen = 0;
|
||||
void saveAudioPreferences();
|
||||
}
|
||||
|
||||
function setPTT(pressed: boolean): void {
|
||||
pttPressed = pressed;
|
||||
}
|
||||
|
||||
function clearError(): void {
|
||||
state.error = "";
|
||||
state.errorCode = "";
|
||||
@@ -966,7 +968,7 @@ export function useVoiceWebSocket() {
|
||||
chatMessages,
|
||||
serverEvents,
|
||||
pokeNotifications,
|
||||
micMode,
|
||||
microphoneMuted,
|
||||
inputVolume,
|
||||
outputVolume,
|
||||
notificationVolume,
|
||||
@@ -1009,8 +1011,7 @@ export function useVoiceWebSocket() {
|
||||
setAway,
|
||||
setWhisperTargets,
|
||||
setWhisperActive,
|
||||
setMicMode,
|
||||
setPTT,
|
||||
setMicrophoneMuted,
|
||||
checkSupport,
|
||||
clearError,
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface LocalPreferences {
|
||||
schemaVersion: 1;
|
||||
locale?: "auto" | "zh-CN" | "en";
|
||||
theme?: "system" | "light" | "dark";
|
||||
voiceMode?: "vox" | "ptt";
|
||||
microphoneMuted?: boolean;
|
||||
voxThreshold?: number;
|
||||
language?: "zh" | "en";
|
||||
preferredInputDeviceId?: string;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<article class="settings-card"><h3>{{ tr('teamSpeakTarget') }}</h3><div class="target-fields"><label><span>{{ tr('serverAddress') }}</span><input v-model.trim="serverForm.address" :placeholder="tr('serverPlaceholder')" /></label><label><span>{{ tr('serverPort') }}</span><input v-model.trim="serverForm.port" inputmode="numeric" type="text" maxlength="5" :placeholder="tr('serverPortPlaceholder')" /></label></div><div class="password-row"><label><span>{{ tr('serverPassword') }}</span><input v-model="serverForm.serverPassword" type="password" autocomplete="off" :disabled="serverForm.passwordAction !== 'replace'" :placeholder="serverForm.hasPassword ? tr('passwordConfigured') : tr('optionalPassword')" /></label><div class="password-actions"><button type="button" :class="{ active: serverForm.passwordAction === 'replace' }" @click="serverForm.passwordAction = 'replace'">{{ tr('change') }}</button><button v-if="serverForm.hasPassword" type="button" :class="{ danger: serverForm.passwordAction === 'remove' }" @click="serverForm.passwordAction = 'remove'">{{ tr('remove') }}</button></div></div><button class="secondary-button" type="button" :disabled="testing" @click="testServerConnection"><span v-if="testing" class="spinner small"></span><Icon v-else name="activity" :size="17" />{{ testing ? tr('testing') : tr('testConnection') }}</button><div v-if="testResult" :class="['test-result', testResult.ok ? 'success' : 'error']"><Icon :name="testResult.ok ? 'check' : 'close'" :size="18" /><div><strong>{{ testResult.ok ? tr('connectionReady') : tr('connectionFailed') }}</strong><small>{{ testResultText }}</small></div></div></article>
|
||||
<article class="settings-card"><h3>{{ tr('accessAndIdentity') }}</h3><fieldset><legend>{{ tr('accessMode') }}</legend><label class="choice"><input v-model="serverForm.accessMode" type="radio" value="fixed" /><span><strong>{{ tr('fixedMode') }}</strong><small>{{ tr('fixedModeLead') }}</small></span></label><label class="choice"><input v-model="serverForm.accessMode" type="radio" value="open" /><span><strong>{{ tr('openMode') }}</strong><small>{{ tr('openModeLead') }}</small></span></label></fieldset><label><span>{{ tr('siteName') }}</span><input v-model.trim="serverForm.siteName" maxlength="80" /></label><label><span>{{ tr('welcomeText') }}</span><textarea v-model="serverForm.welcomeText" maxlength="500" rows="4"></textarea></label></article>
|
||||
</div>
|
||||
<article class="readonly-card"><h3>{{ tr('runtimeFacts') }}</h3><dl><div><dt>{{ tr('detectedProtocol') }}</dt><dd>{{ serverForm.detectedProtocol?.toUpperCase() || tr('unknown') }}</dd></div><div><dt>{{ tr('lastTest') }}</dt><dd>{{ formatDate(serverForm.lastTestAt) }}</dd></div><div><dt>{{ tr('latency') }}</dt><dd>{{ serverForm.lastTestLatencyMs == null ? '—' : `${serverForm.lastTestLatencyMs} ms` }}</dd></div><div><dt>{{ tr('internalPort') }}</dt><dd>3040</dd></div></dl></article>
|
||||
<article class="readonly-card"><h3>{{ tr('runtimeFacts') }}</h3><dl><div><dt>{{ tr('lastTest') }}</dt><dd>{{ formatDate(serverForm.lastTestAt) }}</dd></div><div><dt>{{ tr('latency') }}</dt><dd>{{ serverForm.lastTestLatencyMs == null ? '—' : `${serverForm.lastTestLatencyMs} ms` }}</dd></div><div><dt>{{ tr('internalPort') }}</dt><dd>3040</dd></div></dl></article>
|
||||
</section>
|
||||
|
||||
<section v-else-if="route.path === '/admin/operations'" class="page-content operations-page">
|
||||
@@ -54,7 +54,7 @@
|
||||
<div v-if="overview.legacyConfigImported" class="alert info import-notice"><span>{{ tr('legacyImported') }}</span><button type="button" @click="dismissLegacyNotice">{{ tr('gotIt') }}</button></div>
|
||||
<div class="hero-status"><div><small>{{ tr('systemStatus') }}</small><h2>{{ tr('everythingRunning') }}</h2><p>{{ tr('overviewLead') }}</p></div><span class="status-badge"><i></i>{{ tr('running') }}</span></div>
|
||||
<div class="metric-grid"><article><span><Icon name="activity" :size="20" /></span><small>{{ tr('gateway') }}</small><strong>{{ overview.gateway.version || '—' }}</strong><em>{{ formatUptime(overview.gateway.uptimeSeconds) }}</em></article><article><span><Icon name="server" :size="20" /></span><small>{{ tr('teamSpeakTarget') }}</small><strong>{{ overview.teamSpeak.target || '—' }}</strong><em>{{ targetStatusText }}</em></article><article><span><Icon name="users" :size="20" /></span><small>{{ tr('activeSessions') }}</small><strong>{{ overview.sessions.active }} / {{ overview.sessions.limit }}</strong><em>{{ tr('peakSessions', { count: overview.sessions.peak }) }}</em></article></div>
|
||||
<div class="overview-columns"><article class="overview-card target-health-card"><header><div><h3>{{ tr('targetHealth') }}</h3><p>{{ tr('targetHealthLead') }}</p></div><RouterLink to="/admin/server">{{ tr('manage') }}</RouterLink></header><dl><div><dt>{{ tr('status') }}</dt><dd><i :class="overview.teamSpeak.status"></i>{{ targetStatusText }}</dd></div><div><dt>{{ tr('detectedProtocol') }}</dt><dd>{{ overview.teamSpeak.protocol?.toUpperCase() || tr('unknown') }}</dd></div><div><dt>{{ tr('lastTest') }}</dt><dd>{{ formatDate(overview.teamSpeak.lastTestAt) }}</dd></div><div><dt>{{ tr('latency') }}</dt><dd>{{ overview.teamSpeak.latencyMs == null ? '—' : `${overview.teamSpeak.latencyMs} ms` }}</dd></div></dl></article><article class="overview-card recent-events-card"><header><div><h3>{{ tr('recentEvents') }}</h3><p>{{ tr('recentEventsLead') }}</p></div></header><ul class="event-list"><li v-for="event in overview.recentEvents" :key="`${event.event}-${event.createdAt}`"><span><Icon name="check" :size="14" /></span><div><strong>{{ eventName(event.event) }}</strong><small>{{ formatDate(event.createdAt) }}</small></div></li><li v-if="!overview.recentEvents.length" class="empty-event">{{ tr('noRecentEvents') }}</li></ul></article></div>
|
||||
<div class="overview-columns"><article class="overview-card target-health-card"><header><div><h3>{{ tr('targetHealth') }}</h3><p>{{ tr('targetHealthLead') }}</p></div><RouterLink to="/admin/server">{{ tr('manage') }}</RouterLink></header><dl><div><dt>{{ tr('status') }}</dt><dd><i :class="overview.teamSpeak.status"></i>{{ targetStatusText }}</dd></div><div><dt>{{ tr('lastTest') }}</dt><dd>{{ formatDate(overview.teamSpeak.lastTestAt) }}</dd></div><div><dt>{{ tr('latency') }}</dt><dd>{{ overview.teamSpeak.latencyMs == null ? '—' : `${overview.teamSpeak.latencyMs} ms` }}</dd></div></dl></article><article class="overview-card recent-events-card"><header><div><h3>{{ tr('recentEvents') }}</h3><p>{{ tr('recentEventsLead') }}</p></div></header><ul class="event-list"><li v-for="event in overview.recentEvents" :key="`${event.event}-${event.createdAt}`"><span><Icon name="check" :size="14" /></span><div><strong>{{ eventName(event.event) }}</strong><small>{{ formatDate(event.createdAt) }}</small></div></li><li v-if="!overview.recentEvents.length" class="empty-event">{{ tr('noRecentEvents') }}</li></ul></article></div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
@@ -71,7 +71,7 @@ import { applyTheme, getStoredTheme, nextTheme, saveTheme, type ThemeMode } from
|
||||
type Language = "zh" | "en";
|
||||
type Screen = "login" | "change-password" | "admin";
|
||||
type AccessMode = "fixed" | "open";
|
||||
interface ProbeState { ok: boolean; protocol?: string | null; latencyMs?: number; serverName?: string | null; code?: string }
|
||||
interface ProbeState { ok: boolean; latencyMs?: number; serverName?: string | null; code?: string }
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@@ -91,8 +91,8 @@ const newPassword = ref("");
|
||||
const confirmNewPassword = ref("");
|
||||
const testResult = ref<ProbeState | null>(null);
|
||||
|
||||
const serverForm = reactive({ address: "", port: "9987", serverPassword: "", passwordAction: "keep" as "keep" | "replace" | "remove", hasPassword: false, accessMode: "fixed" as AccessMode, siteName: "WebSpeak", welcomeText: "", detectedProtocol: null as string | null, lastTestAt: null as string | null, lastTestLatencyMs: null as number | null });
|
||||
const overview = reactive({ gateway: { version: "", uptimeSeconds: 0 }, teamSpeak: { target: "", status: "unknown", protocol: null as string | null, lastTestAt: null as string | null, latencyMs: null as number | null }, sessions: { active: 0, peak: 0, limit: 100 }, recentEvents: [] as Array<{ event: string; createdAt: string }>, legacyConfigImported: false });
|
||||
const serverForm = reactive({ address: "", port: "9987", serverPassword: "", passwordAction: "keep" as "keep" | "replace" | "remove", hasPassword: false, accessMode: "fixed" as AccessMode, siteName: "WebSpeak", welcomeText: "", lastTestAt: null as string | null, lastTestLatencyMs: null as number | null });
|
||||
const overview = reactive({ gateway: { version: "", uptimeSeconds: 0 }, teamSpeak: { target: "", status: "unknown", lastTestAt: null as string | null, latencyMs: null as number | null }, sessions: { active: 0, peak: 0, limit: 100 }, recentEvents: [] as Array<{ event: string; createdAt: string }>, legacyConfigImported: false });
|
||||
interface AdminSession { id: string; nickname: string; target: string; state: string; createdAt: string; ageSeconds: number; tsClientId: number | null; channelId: string | null; memberCount: number }
|
||||
interface ManagedInvite { id: string; target: string; channel: string; expiresAt: string; maxUses: number; useCount: number; createdAt: string; revokedAt: string | null; status: "active" | "expired" | "exhausted" | "revoked" }
|
||||
interface AdminLog { timestamp: string | null; level: string; message: string; context: Record<string, string | number | boolean> }
|
||||
@@ -158,7 +158,6 @@ const copy = {
|
||||
siteName: "站点显示名称",
|
||||
welcomeText: "欢迎文本",
|
||||
runtimeFacts: "运行时信息",
|
||||
detectedProtocol: "检测到的协议",
|
||||
lastTest: "最近测试",
|
||||
latency: "延迟",
|
||||
internalPort: "内部端口",
|
||||
@@ -300,7 +299,6 @@ const copy = {
|
||||
siteName: "Site display name",
|
||||
welcomeText: "Welcome text",
|
||||
runtimeFacts: "Runtime facts",
|
||||
detectedProtocol: "Detected protocol",
|
||||
lastTest: "Last test",
|
||||
latency: "Latency",
|
||||
internalPort: "Internal port",
|
||||
@@ -392,7 +390,7 @@ const copy = {
|
||||
function tr(key: keyof typeof copy.zh, vars: Record<string, string | number> = {}): string { let value: string = language.value === "zh" ? copy.zh[key] : copy.en[key] ?? copy.zh[key]; for (const [name, replacement] of Object.entries(vars)) value = value.replaceAll(`{{${name}}}`, String(replacement)); return value; }
|
||||
const passwordStrength = computed(() => Math.min(100, Math.max(8, newPassword.value.length * 5 + (/[\s\W]/.test(newPassword.value) ? 15 : 0))));
|
||||
const currentPageTitle = computed(() => route.path === "/admin/server" ? tr('server') : route.path === "/admin/operations" ? tr('operations') : tr('overview'));
|
||||
const testResultText = computed(() => { if (!testResult.value) return ""; if (!testResult.value.ok) return errorText(testResult.value.code); return [testResult.value.protocol?.toUpperCase(), testResult.value.serverName, testResult.value.latencyMs == null ? null : `${testResult.value.latencyMs} ms`].filter(Boolean).join(" · "); });
|
||||
const testResultText = computed(() => { if (!testResult.value) return ""; if (!testResult.value.ok) return errorText(testResult.value.code); return [testResult.value.serverName, testResult.value.latencyMs == null ? null : `${testResult.value.latencyMs} ms`].filter(Boolean).join(" · "); });
|
||||
const targetStatusText = computed(() => overview.teamSpeak.status === "reachable" ? tr('reachable') : overview.teamSpeak.status === "unreachable" ? tr('unreachable') : tr('notTested'));
|
||||
|
||||
onMounted(loadAdminView);
|
||||
@@ -413,7 +411,7 @@ async function copyInviteLink() { if (!createdInvite.value) return; try { await
|
||||
function showOperationNotice(message: string) { errorMessage.value = message; window.setTimeout(() => { if (errorMessage.value === message) errorMessage.value = ""; }, 2200); }
|
||||
async function downloadBackup() { try { const response = await fetch("/api/admin/backup", { headers: { accept: "application/octet-stream" } }); if (!response.ok) throw new Error("BACKUP_FAILED"); const blob = await response.blob(); const url = URL.createObjectURL(blob); const anchor = document.createElement("a"); anchor.href = url; anchor.download = `webspeak-backup-${new Date().toISOString().slice(0, 10)}.db`; anchor.click(); URL.revokeObjectURL(url); await loadOperations(); } catch (error) { errorMessage.value = errorText((error as ApiError).code); } }
|
||||
async function saveServerSettings() { submitting.value = true; errorMessage.value = ""; try { const result = await sendJson("/api/admin/server", "PUT", serverPayload()); const target = splitTeamSpeakTarget(result.settings?.target); Object.assign(serverForm, result.settings, { address: target.address, port: target.port, serverPassword: "", passwordAction: "keep" }); await loadOverview(); } catch (error) { errorMessage.value = errorText((error as ApiError).code); } finally { submitting.value = false; } }
|
||||
async function testServerConnection() { await runTest("/api/admin/server/test", { target: combineTeamSpeakTarget(serverForm.address, serverForm.port), serverPassword: serverForm.passwordAction === "replace" ? serverForm.serverPassword : undefined, passwordAction: serverForm.passwordAction }); if (testResult.value?.ok) { await loadOverview(); serverForm.detectedProtocol = testResult.value.protocol ?? null; serverForm.lastTestAt = new Date().toISOString(); serverForm.lastTestLatencyMs = testResult.value.latencyMs ?? null; } }
|
||||
async function testServerConnection() { await runTest("/api/admin/server/test", { target: combineTeamSpeakTarget(serverForm.address, serverForm.port), serverPassword: serverForm.passwordAction === "replace" ? serverForm.serverPassword : undefined, passwordAction: serverForm.passwordAction }); if (testResult.value?.ok) { await loadOverview(); serverForm.lastTestAt = new Date().toISOString(); serverForm.lastTestLatencyMs = testResult.value.latencyMs ?? null; } }
|
||||
function serverPayload() { return { target: combineTeamSpeakTarget(serverForm.address, serverForm.port), serverPassword: serverForm.passwordAction === "replace" ? serverForm.serverPassword : undefined, passwordAction: serverForm.passwordAction, accessMode: serverForm.accessMode, siteName: serverForm.siteName, welcomeText: serverForm.welcomeText }; }
|
||||
async function runTest(url: string, body: Record<string, unknown>) { testing.value = true; errorMessage.value = ""; testResult.value = null; try { testResult.value = await sendJson(url, "POST", body, url.includes("/server/test")); } catch (error) { testResult.value = { ok: false, code: (error as ApiError).code }; } finally { testing.value = false; } }
|
||||
async function dismissLegacyNotice() { await sendJson("/api/admin/legacy-import/dismiss", "POST", {}); overview.legacyConfigImported = false; }
|
||||
|
||||
+221
-90
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="web-client" @keydown="onKeyDown" @keyup="onKeyUp" tabindex="0">
|
||||
<div class="web-client">
|
||||
<!-- Connection / welcome screen -->
|
||||
<section v-if="!voiceState.connected && !voiceState.reconnecting && !voiceState.reconnectFailed" class="join-page">
|
||||
<header class="join-header">
|
||||
@@ -10,7 +10,7 @@
|
||||
<small>{{ t('browserWorkspace') }}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-tools"><div class="header-note"><span class="tiny-dot"></span> {{ t('secureGateway') }}</div><a class="guide-button" href="/admin"><Icon name="settings" :size="15" /> {{ t('adminConsole') }}</a><button type="button" class="header-action theme-toggle" :title="themeLabel" :aria-label="themeLabel" @click="cycleTheme"><Icon name="monitor" :size="17" /></button><button class="language-switch" :aria-label="t('langSwitch')" @click="toggleLanguage">{{ t('langSwitch') }}</button></div>
|
||||
<div class="header-tools"><div class="header-note"><span class="tiny-dot"></span> {{ t('secureGateway') }}</div><a class="github-button" href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak" target="_blank" rel="noreferrer" :title="t('githubRepository')" :aria-label="t('githubRepository')"><Icon name="github" :size="18" /><span>{{ t('githubRepository') }}</span></a><span class="version-badge" :title="`${t('currentVersion')}: v${appVersion}`" :aria-label="`${t('currentVersion')}: v${appVersion}`">v{{ appVersion }}</span><a class="changelog-button" href="https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/blob/master/CHANGELOG.md" target="_blank" rel="noreferrer" :title="t('viewChangelog')" :aria-label="t('viewChangelog')"><Icon name="clock" :size="16" /><span>{{ t('viewChangelog') }}</span></a><a class="guide-button" href="/admin" :title="t('adminConsole')" :aria-label="t('adminConsole')"><Icon name="settings" :size="15" /><span>{{ t('adminConsole') }}</span></a><button type="button" class="header-action theme-toggle" :title="themeLabel" :aria-label="themeLabel" @click="cycleTheme"><Icon name="monitor" :size="17" /></button><button class="language-switch" :aria-label="t('langSwitch')" @click="toggleLanguage">{{ t('langSwitch') }}</button></div>
|
||||
</header>
|
||||
|
||||
<main class="join-content">
|
||||
@@ -78,7 +78,7 @@
|
||||
</main>
|
||||
|
||||
<footer class="join-footer">
|
||||
<span>WebSpeak</span><span class="footer-separator">·</span><span>{{ t('teamSpeakClient') }}</span><span class="footer-spacer"></span><button type="button" class="clear-local-button" @click="clearBrowserData">{{ t('clearLocalData') }}</button><span class="footer-separator">·</span><a href="https://github.com/EchoSixHIYA/web-gateway-for-TeamSpeak" target="_blank" rel="noreferrer">{{ t('sourceCode') }}</a><span class="footer-separator">·</span><span>{{ t('browserSupport') }}</span>
|
||||
<span>WebSpeak</span><span class="footer-separator">·</span><span>{{ t('teamSpeakClient') }}</span><span class="footer-spacer"></span><button type="button" class="clear-local-button" @click="clearBrowserData">{{ t('clearLocalData') }}</button><span class="footer-separator">·</span><span>{{ t('browserSupport') }}</span>
|
||||
</footer>
|
||||
</section>
|
||||
|
||||
@@ -95,10 +95,11 @@
|
||||
</select>
|
||||
</label>
|
||||
<button class="header-action" :title="t('copyInvite')" @click="doShare"><Icon name="share" :size="18" /></button>
|
||||
<button class="header-action microphone-header-toggle" :class="{ muted: microphoneMuted }" :title="microphoneMuted ? t('unmuteMic') : t('muteMic')" :aria-label="microphoneMuted ? t('microphoneMuted') : t('microphoneActive')" :aria-pressed="!microphoneMuted" @click="toggleMicrophone"><Icon :name="microphoneMuted ? 'mic-off' : 'mic'" :size="18" /></button>
|
||||
<button class="header-action" :title="t('audioSettings')" :aria-label="t('audioSettings')" @click="settingsOpen = true"><Icon name="settings" :size="18" /></button>
|
||||
<button type="button" class="header-action theme-toggle" :title="themeLabel" :aria-label="themeLabel" @click="cycleTheme"><Icon name="monitor" :size="17" /></button>
|
||||
<button class="language-switch workspace-language" :aria-label="t('langSwitch')" @click="toggleLanguage">{{ t('langSwitch') }}</button>
|
||||
<button class="disconnect-button" @click="doDisconnect"><Icon name="door" :size="17" /> {{ t('exit') }}</button>
|
||||
<button class="disconnect-button" @click="doDisconnect"><Icon name="door" :size="17" /><span>{{ t('exit') }}</span></button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -125,6 +126,7 @@
|
||||
<div class="section-heading"><div><span class="section-kicker">{{ t('voiceActivity') }}</span><h2>{{ t('speakingNow') }}</h2></div><span class="section-counter">{{ t('onlineShort', { count: currentMembers.length }) }}</span></div>
|
||||
<div v-if="currentMembers.length" class="voice-grid">
|
||||
<article v-for="member in roomMembers" :key="member.id" :class="['voice-card', { speaking: isSpeaking(member), self: member.isSelf }]">
|
||||
<button v-if="isMobileViewport && !member.isSelf" type="button" class="voice-member-action" :aria-label="t('moreMemberOptions')" @click.stop="openMemberActions(member)"><Icon name="more" :size="17" /></button>
|
||||
<div class="voice-avatar-wrap"><div :class="['voice-avatar', { speaking: isSpeaking(member) }]" :style="avatarStyle(member.nickname, member.isSelf)">{{ avatarInitial(member.nickname) }}</div></div>
|
||||
<strong>{{ member.isSelf ? t('you') : member.nickname }}</strong><span>{{ isSpeaking(member) ? t('speaking') : member.isSelf ? t('connectedYou') : t('connected') }}</span>
|
||||
</article>
|
||||
@@ -136,6 +138,10 @@
|
||||
<button type="button" class="text-button" @click="clearWhisperTargets">{{ t('clearWhisperTargets') }}</button>
|
||||
<button type="button" class="whisper-ptt-button" :class="{ active: whisperPttActive || whisperActive }" :aria-pressed="whisperPttActive || whisperActive" @pointerdown.prevent="onWhisperPttDown" @pointerup.prevent="onWhisperPttUp" @pointercancel.prevent="onWhisperPttUp" @lostpointercapture="onWhisperPttUp"><Icon name="mic" :size="18" /> {{ whisperPttActive || whisperActive ? t('releaseWhisper') : t('whisperHoldToTalk') }}</button>
|
||||
</div>
|
||||
<div class="mobile-voice-controls">
|
||||
<button type="button" class="mobile-voice-toggle" :class="{ muted: microphoneMuted }" :aria-pressed="!microphoneMuted" @click="toggleMicrophone"><Icon :name="microphoneMuted ? 'mic-off' : 'mic'" :size="18" /><span>{{ microphoneMuted ? t('unmuteMic') : t('muteMic') }}</span></button>
|
||||
<button type="button" class="mobile-voice-settings" @click="settingsOpen = true"><Icon name="settings" :size="17" /><span>{{ t('audioSettings') }}</span></button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section :class="['chat-panel', { 'mobile-section-hidden': mobileSection !== 'chat' }]">
|
||||
@@ -163,7 +169,6 @@
|
||||
<input v-model="messageDraft" maxlength="500" :placeholder="chatPlaceholder" :aria-label="t('send')" />
|
||||
<button class="send-button" type="submit" :disabled="!messageDraft.trim()" :title="t('send')"><Icon name="send" :size="18" /></button>
|
||||
</form>
|
||||
<button v-if="micMode === 'ptt'" type="button" class="mobile-ptt-button" :class="{ active: pttActive }" @pointerdown.prevent="onMobilePttDown" @pointerup.prevent="onMobilePttUp" @pointercancel.prevent="onMobilePttUp" @lostpointercapture="onMobilePttUp"><Icon name="mic" :size="20" /> {{ pttActive ? t('releaseToTalk') : t('holdToTalk') }}</button>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
@@ -186,6 +191,7 @@
|
||||
<div class="member-copy"><strong>{{ memberDisplayName(member) }}</strong><span>{{ member.away ? t('away') : isSpeaking(member) ? t('speaking') : member.isSelf ? t('yourDevice') : t('memberOnline') }}</span></div>
|
||||
<div class="member-flags" :aria-label="t('memberStates')"><span v-if="member.away" :title="t('away')" :aria-label="t('away')"><Icon name="clock" :size="13" /></span><span v-if="member.inputMuted" :title="t('inputMuted')" :aria-label="t('inputMuted')"><Icon name="mic-off" :size="13" /></span><span v-if="member.outputMuted" :title="t('outputMuted')" :aria-label="t('outputMuted')"><Icon name="volume-off" :size="13" /></span><span v-if="member.channelCommander" :title="t('channelCommander')" :aria-label="t('channelCommander')"><Icon name="shield" :size="13" /></span></div>
|
||||
<div class="member-volume"><Icon :name="(volumes[member.id] ?? 1) === 0 ? 'volume-off' : 'volume'" :size="14" /><input type="range" min="0" max="400" :value="(volumes[member.id] ?? 1) * 100" :style="rangeStyle((volumes[member.id] ?? 1) / 4, 1)" :aria-label="t('memberVolume')" @input="onVolInput(member.id, $event)" /></div>
|
||||
<button v-if="isMobileViewport && !member.isSelf" type="button" class="member-action-button" :aria-label="t('moreMemberOptions')" @click.stop="openMemberActions(member)"><Icon name="more" :size="18" /></button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="channel-no-members">{{ t('noMembersInChannel') }}</div>
|
||||
@@ -198,6 +204,7 @@
|
||||
<section v-if="mobileSection === 'more'" class="mobile-more-panel">
|
||||
<span class="section-kicker">{{ t('mobileMore') }}</span>
|
||||
<h2>{{ t('mobileMore') }}</h2>
|
||||
<button type="button" :class="{ muted: microphoneMuted }" @click="toggleMicrophone"><Icon :name="microphoneMuted ? 'mic-off' : 'mic'" :size="18" /> {{ microphoneMuted ? t('unmuteMic') : t('muteMic') }}</button>
|
||||
<button type="button" @click="settingsOpen = true"><Icon name="settings" :size="18" /> {{ t('audioSettings') }}</button>
|
||||
<button type="button" @click="cycleTheme"><Icon name="monitor" :size="18" /> {{ themeLabel }}</button>
|
||||
<button type="button" @click="toggleLanguage"><Icon name="globe" :size="18" /> {{ t('langSwitch') }}</button>
|
||||
@@ -212,8 +219,9 @@
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div v-if="memberMenu && isMobileViewport" class="member-menu-backdrop" @click="memberMenu = null"></div>
|
||||
<div v-if="memberMenu" class="member-context-menu" :style="memberMenuStyle" @click.stop>
|
||||
<strong>{{ memberMenu.member.nickname }}</strong>
|
||||
<div class="member-menu-header"><strong>{{ memberMenu.member.nickname }}</strong><button type="button" class="member-menu-close" :aria-label="t('close')" @click="memberMenu = null"><Icon name="close" :size="17" /></button></div>
|
||||
<label class="menu-volume"><span>{{ t('memberVolume') }}</span><input type="range" min="0" max="400" :value="(volumes[memberMenu.member.id] ?? 1) * 100" :style="rangeStyle((volumes[memberMenu.member.id] ?? 1) / 4, 1)" :aria-label="t('memberVolume')" @input="onVolInput(memberMenu.member.id, $event)" /></label>
|
||||
<button type="button" @click="openPrivateChat(memberMenu.member.id); memberMenu = null"><Icon name="message" :size="15" /> {{ t('privateMessage') }}</button>
|
||||
<button type="button" @click="pokeMember(memberMenu.member); memberMenu = null"><Icon name="bell" :size="15" /> {{ t('poke') }}</button>
|
||||
@@ -225,7 +233,7 @@
|
||||
<div v-if="settingsOpen" class="modal-backdrop" @click.self="settingsOpen = false">
|
||||
<section class="settings-modal" role="dialog" aria-modal="true" :aria-labelledby="'settings-title'">
|
||||
<div class="settings-main"><header class="settings-header"><h2 id="settings-title">{{ t('audioConfiguration') }}</h2><button class="round-icon" :title="t('close')" @click="settingsOpen = false"><Icon name="close" :size="19" /></button></header><div class="settings-content">
|
||||
<section class="settings-section"><h3><Icon name="mic" :size="20" /> {{ t('inputDevice') }}</h3><label class="settings-label" for="input-device">{{ t('microphone') }}</label><select id="input-device" class="settings-select" :value="selectedInputDeviceId" :disabled="!inputDevices.length" @change="onInputDeviceChange"><option value="">{{ t('defaultMicrophone') }}</option><option v-for="(device, index) in inputDevices" :key="device.deviceId || `microphone-${index}`" :value="device.deviceId">{{ device.label || t('microphoneNumber', { index: index + 1 }) }}</option></select><p v-if="audioSettingsError" class="settings-error">{{ localizedMessage(audioSettingsError) }}</p><p class="audio-diagnostic"><span>{{ t('permission') }}</span><strong :class="`permission-${audioPermission}`">{{ audioPermission === 'granted' ? t('permissionGranted') : audioPermission === 'denied' ? t('permissionDenied') : t('permissionUnknown') }}</strong></p><label class="settings-label">{{ t('microphoneMode') }}</label><div class="mic-mode-switch settings-mode-switch" role="group" :aria-label="t('microphoneMode')"><button type="button" :class="{ active: micMode === 'vox' }" @click="setMicMode('vox')"><Icon name="mic" :size="15" /> {{ t('freeMic') }}</button><button type="button" :class="{ active: micMode === 'ptt' }" @click="setMicMode('ptt')"><Icon name="lock" :size="14" /> {{ t('pushToTalk') }}</button></div><p class="settings-hint">{{ micMode === 'ptt' ? t('pushToTalkHint') : t('micReady') }}</p><div class="settings-range-row"><label class="settings-label">{{ t('inputVolume') }}</label><strong>{{ Math.round(inputVolume * 100) }}%</strong></div><input class="settings-range" type="range" min="0" max="100" :value="inputVolume * 100" :style="rangeStyle(inputVolume, 1)" :aria-label="t('inputVolume')" @input="onInputVolume" /><div v-if="micMode === 'vox'" class="settings-range-row"><label class="settings-label">{{ t('voxThreshold') }}</label><strong>{{ (voxThreshold * 100).toFixed(1) }}%</strong></div><input v-if="micMode === 'vox'" class="settings-range" type="range" min="1" max="80" :value="voxThreshold * 1000" :style="rangeStyle(voxThreshold, 0.08)" :aria-label="t('voxThreshold')" @input="onVoxThreshold" /><div class="audio-level-row"><span>{{ t('micLevel') }}</span><strong>{{ Math.round(micLevel * 100) }}%</strong></div><div class="audio-level-track"><i :style="{ width: `${Math.round(micLevel * 100)}%` }"></i></div><div class="mic-test"><div class="mic-test-header"><strong>{{ t('microphoneTest') }}</strong><button type="button" @click="toggleMicTest">{{ microphoneTestActive ? t('stopTest') : t('startTest') }}</button></div><div class="meter"><i v-for="index in 24" :key="index" :class="{ active: microphoneTestActive && index <= micMeterBars }" :style="{ height: `${meterBarHeight(index) }px` }"></i></div><div class="meter-labels"><span>{{ t('silence') }}</span><span>{{ t('optimal') }}</span><span>{{ t('loud') }}</span></div><p class="settings-hint">{{ t('localMicTestHint') }}</p><audio v-if="testAudioUrl" class="test-audio" :src="testAudioUrl" controls :aria-label="t('microphoneTest')"></audio></div></section>
|
||||
<section class="settings-section"><h3><Icon name="mic" :size="20" /> {{ t('inputDevice') }}</h3><label class="settings-label" for="input-device">{{ t('microphone') }}</label><select id="input-device" class="settings-select" :value="selectedInputDeviceId" :disabled="!inputDevices.length" @change="onInputDeviceChange"><option value="">{{ t('defaultMicrophone') }}</option><option v-for="(device, index) in inputDevices" :key="device.deviceId || `microphone-${index}`" :value="device.deviceId">{{ device.label || t('microphoneNumber', { index: index + 1 }) }}</option></select><p v-if="audioSettingsError" class="settings-error">{{ localizedMessage(audioSettingsError) }}</p><p class="audio-diagnostic"><span>{{ t('permission') }}</span><strong :class="`permission-${audioPermission}`">{{ audioPermission === 'granted' ? t('permissionGranted') : audioPermission === 'denied' ? t('permissionDenied') : t('permissionUnknown') }}</strong></p><div class="microphone-control"><div><label class="settings-label">{{ t('microphoneState') }}</label><p class="settings-hint">{{ microphoneMuted ? t('microphoneMutedHint') : t('microphoneActiveHint') }}</p></div><button type="button" class="microphone-toggle" :class="{ muted: microphoneMuted }" :aria-pressed="!microphoneMuted" @click="toggleMicrophone"><Icon :name="microphoneMuted ? 'mic-off' : 'mic'" :size="16" /> {{ microphoneMuted ? t('unmuteMic') : t('muteMic') }}</button></div><div class="settings-range-row"><label class="settings-label">{{ t('inputVolume') }}</label><strong>{{ Math.round(inputVolume * 100) }}%</strong></div><input class="settings-range" type="range" min="0" max="100" :value="inputVolume * 100" :style="rangeStyle(inputVolume, 1)" :aria-label="t('inputVolume')" @input="onInputVolume" /><div class="settings-range-row"><label class="settings-label">{{ t('voxThreshold') }}</label><strong>{{ (voxThreshold * 100).toFixed(1) }}%</strong></div><input class="settings-range" type="range" min="1" max="80" :value="voxThreshold * 1000" :style="rangeStyle(voxThreshold, 0.08)" :aria-label="t('voxThreshold')" @input="onVoxThreshold" /><div class="audio-level-row"><span>{{ t('micLevel') }}</span><strong>{{ Math.round(micLevel * 100) }}%</strong></div><div class="audio-level-track"><i :style="{ width: `${Math.round(micLevel * 100)}%` }"></i></div><div class="mic-test"><div class="mic-test-header"><strong>{{ t('microphoneTest') }}</strong><button type="button" @click="toggleMicTest">{{ microphoneTestActive ? t('stopTest') : t('startTest') }}</button></div><div class="meter"><i v-for="index in 24" :key="index" :class="{ active: microphoneTestActive && index <= micMeterBars }" :style="{ height: `${meterBarHeight(index) }px` }"></i></div><div class="meter-labels"><span>{{ t('silence') }}</span><span>{{ t('optimal') }}</span><span>{{ t('loud') }}</span></div><p class="settings-hint">{{ t('localMicTestHint') }}</p><audio v-if="testAudioUrl" class="test-audio" :src="testAudioUrl" controls :aria-label="t('microphoneTest')"></audio></div></section>
|
||||
<div class="settings-separator"></div><section class="settings-section"><h3><Icon name="volume" :size="20" /> {{ t('outputVolume') }}</h3><label v-if="outputDeviceSupported" class="settings-label" for="output-device">{{ t('outputDevice') }}</label><select v-if="outputDeviceSupported" id="output-device" class="settings-select" :value="selectedOutputDeviceId" :disabled="!outputDevices.length" @change="onOutputDeviceChange"><option value="">{{ t('defaultOutput') }}</option><option v-for="(device, index) in outputDevices" :key="device.deviceId || `speaker-${index}`" :value="device.deviceId">{{ device.label || t('speakerNumber', { index: index + 1 }) }}</option></select><p v-else class="mode-note"><Icon name="info" :size="16" /><span>{{ t('outputDeviceUnsupported') }}</span></p><div class="settings-range-row"><label class="settings-label">{{ t('speakers') }}</label><strong>{{ Math.round(outputVolume * 100) }}%</strong></div><input class="settings-range" type="range" min="0" max="100" :value="outputVolume * 100" :style="rangeStyle(outputVolume, 1)" :aria-label="t('outputVolume')" @input="onOutputVolume" /><div class="settings-range-row"><label class="settings-label">{{ t('notificationVolume') }}</label><strong>{{ Math.round(notificationVolume * 100) }}%</strong></div><input class="settings-range" type="range" min="0" max="100" :value="notificationVolume * 100" :style="rangeStyle(notificationVolume, 1)" :aria-label="t('notificationVolume')" @input="onNotificationVolume" /><div class="audio-diagnostic"><span>{{ t('audioStatus') }}</span><strong>{{ audioContextState === 'running' ? t('audioReady') : audioContextState === 'suspended' ? t('audioSuspended') : t('audioUnknown') }}</strong></div><div class="mode-note"><Icon name="shield" :size="16" /><span>{{ t('audioPrivacy') }}</span></div></section>
|
||||
</div><footer class="settings-footer"><button class="primary-button save-button" @click="settingsOpen = false">{{ t('done') }}</button></footer></div>
|
||||
</section>
|
||||
@@ -255,7 +263,7 @@ const {
|
||||
chatMessages,
|
||||
serverEvents,
|
||||
pokeNotifications,
|
||||
micMode,
|
||||
microphoneMuted,
|
||||
inputVolume,
|
||||
outputVolume,
|
||||
notificationVolume,
|
||||
@@ -298,8 +306,7 @@ const {
|
||||
setAway,
|
||||
setWhisperTargets,
|
||||
setWhisperActive,
|
||||
setMicMode,
|
||||
setPTT,
|
||||
setMicrophoneMuted,
|
||||
checkSupport,
|
||||
clearError,
|
||||
} = useVoiceWebSocket();
|
||||
@@ -320,6 +327,7 @@ const recentServers = ref<RecentServer[]>([]);
|
||||
const initialized = ref(false);
|
||||
const siteName = ref("WebSpeak");
|
||||
const welcomeText = ref("");
|
||||
const appVersion = ref("0.1.2");
|
||||
const browserError = ref("");
|
||||
const serverConfigLoading = ref(true);
|
||||
const memberQuery = ref("");
|
||||
@@ -327,7 +335,6 @@ const messageDraft = ref("");
|
||||
const selectedChannelId = ref("");
|
||||
const settingsOpen = ref(false);
|
||||
const audioSettingsError = ref("");
|
||||
const pttActive = ref(false);
|
||||
const toast = ref("");
|
||||
const chatListEl = ref<HTMLElement | null>(null);
|
||||
const localPersistenceAvailable = isLocalPersistenceAvailable();
|
||||
@@ -337,6 +344,7 @@ const away = ref(false);
|
||||
const awayMessage = ref("");
|
||||
const memberMenu = ref<{ member: ChannelMember; x: number; y: number } | null>(null);
|
||||
const mobileSection = ref<"channels" | "chat" | "voice" | "more">("channels");
|
||||
const isMobileViewport = ref(false);
|
||||
const whisperPttActive = ref(false);
|
||||
let toastTimer: ReturnType<typeof setTimeout> | undefined;
|
||||
|
||||
@@ -353,6 +361,8 @@ const translations: Record<Language, Record<string, string>> = {
|
||||
browserWorkspace: "浏览器语音工作台",
|
||||
secureGateway: "安全语音网关",
|
||||
adminConsole: "管理控制台",
|
||||
currentVersion: "当前版本",
|
||||
viewChangelog: "查看更新日志",
|
||||
notConfigured: "WebSpeak 尚未配置 TeamSpeak 目标。",
|
||||
configureNow: "打开管理控制台",
|
||||
privateAudio: "私密社区语音",
|
||||
@@ -397,7 +407,7 @@ const translations: Record<Language, Record<string, string>> = {
|
||||
connecting: "正在连接…",
|
||||
enterVoice: "进入语音空间",
|
||||
connectionAuthorized: "连接信息仅用于本次语音会话",
|
||||
sourceCode: "获取源代码",
|
||||
githubRepository: "GitHub 仓库",
|
||||
browserSupport: "Chrome / Edge 94+",
|
||||
teamSpeakClient: "TeamSpeak 浏览器客户端",
|
||||
home: "首页",
|
||||
@@ -474,13 +484,13 @@ const translations: Record<Language, Record<string, string>> = {
|
||||
emojiUnavailable: "表情暂不可用",
|
||||
sendMessagePlaceholder: "发送消息给频道成员…",
|
||||
send: "发送",
|
||||
freeMic: "自由麦",
|
||||
pushToTalk: "按键说话",
|
||||
pushToTalkHint: "按住空格说话",
|
||||
holdToTalk: "按住说话",
|
||||
releaseToTalk: "松开结束",
|
||||
muteMic: "闭麦",
|
||||
unmuteMic: "开麦",
|
||||
microphoneActive: "麦克风已开启",
|
||||
microphoneMuted: "麦克风已关闭",
|
||||
microphoneActiveHint: "关闭麦克风后不会向服务器发送声音",
|
||||
microphoneMutedHint: "麦克风已关闭,其他人听不到你的声音",
|
||||
sending: "正在发送",
|
||||
micReady: "麦克风已就绪",
|
||||
exitVoice: "退出语音",
|
||||
people: "成员",
|
||||
searchMembers: "搜索成员",
|
||||
@@ -514,7 +524,7 @@ const translations: Record<Language, Record<string, string>> = {
|
||||
audioConfiguration: "音频配置",
|
||||
inputDevice: "输入设备",
|
||||
microphone: "麦克风",
|
||||
microphoneMode: "麦克风模式",
|
||||
microphoneState: "麦克风状态",
|
||||
defaultMicrophone: "默认浏览器麦克风",
|
||||
microphoneNumber: "麦克风 {{index}}",
|
||||
speakerNumber: "扬声器 {{index}}",
|
||||
@@ -568,6 +578,8 @@ const translations: Record<Language, Record<string, string>> = {
|
||||
browserWorkspace: "Browser voice workspace",
|
||||
secureGateway: "Secure voice gateway",
|
||||
adminConsole: "Admin console",
|
||||
currentVersion: "Current version",
|
||||
viewChangelog: "View changelog",
|
||||
notConfigured: "The WebSpeak TeamSpeak target has not been configured.",
|
||||
configureNow: "Open admin console",
|
||||
privateAudio: "Private community audio",
|
||||
@@ -612,7 +624,7 @@ const translations: Record<Language, Record<string, string>> = {
|
||||
connecting: "Connecting…",
|
||||
enterVoice: "Enter voice space",
|
||||
connectionAuthorized: "Connection details are used only for this voice session",
|
||||
sourceCode: "Source code",
|
||||
githubRepository: "GitHub repository",
|
||||
browserSupport: "Chrome / Edge 94+",
|
||||
teamSpeakClient: "TeamSpeak browser client",
|
||||
home: "Home",
|
||||
@@ -689,13 +701,13 @@ const translations: Record<Language, Record<string, string>> = {
|
||||
emojiUnavailable: "Emoji unavailable",
|
||||
sendMessagePlaceholder: "Message the channel…",
|
||||
send: "Send",
|
||||
freeMic: "Open mic",
|
||||
pushToTalk: "Push to talk",
|
||||
pushToTalkHint: "Hold Space to talk",
|
||||
holdToTalk: "Hold to talk",
|
||||
releaseToTalk: "Release to stop",
|
||||
muteMic: "Mute mic",
|
||||
unmuteMic: "Unmute mic",
|
||||
microphoneActive: "Microphone on",
|
||||
microphoneMuted: "Microphone off",
|
||||
microphoneActiveHint: "When muted, no microphone audio is sent to the server",
|
||||
microphoneMutedHint: "Your microphone is muted and other members cannot hear you",
|
||||
sending: "Sending",
|
||||
micReady: "Microphone ready",
|
||||
exitVoice: "Leave voice",
|
||||
people: "People",
|
||||
searchMembers: "Search members",
|
||||
@@ -729,7 +741,7 @@ const translations: Record<Language, Record<string, string>> = {
|
||||
audioConfiguration: "Audio configuration",
|
||||
inputDevice: "Input device",
|
||||
microphone: "Microphone",
|
||||
microphoneMode: "Microphone mode",
|
||||
microphoneState: "Microphone state",
|
||||
defaultMicrophone: "Default browser microphone",
|
||||
microphoneNumber: "Microphone {{index}}",
|
||||
speakerNumber: "Speaker {{index}}",
|
||||
@@ -977,10 +989,7 @@ watch([rememberIdentity, identityMaterial], ([remember, material]) => {
|
||||
if (!remember && material) identityMaterial.value = "";
|
||||
});
|
||||
watch(() => voiceState.connected, (connected) => {
|
||||
if (!connected) {
|
||||
stopPointerTalk();
|
||||
return;
|
||||
}
|
||||
if (!connected) return;
|
||||
playNotification("connected");
|
||||
const address = currentServerTarget();
|
||||
if (!address) return;
|
||||
@@ -996,7 +1005,6 @@ watch(() => voiceState.connected, (connected) => {
|
||||
});
|
||||
watch(() => voiceState.reconnecting, (reconnecting, wasReconnecting) => {
|
||||
if (reconnecting && !wasReconnecting) {
|
||||
stopPointerTalk();
|
||||
playNotification("disconnected");
|
||||
}
|
||||
});
|
||||
@@ -1005,7 +1013,8 @@ watch(() => voiceState.reconnectFailed, (failed, wasFailed) => {
|
||||
});
|
||||
|
||||
let deviceChangeHandler: (() => void) | undefined;
|
||||
let releasePttHandler: (() => void) | undefined;
|
||||
let viewportMediaQuery: MediaQueryList | undefined;
|
||||
let viewportChangeHandler: (() => void) | undefined;
|
||||
|
||||
onMounted(() => {
|
||||
browserError.value = checkSupport() ?? "";
|
||||
@@ -1027,18 +1036,18 @@ onMounted(() => {
|
||||
void listRecentServers().then((items) => { recentServers.value = items; });
|
||||
deviceChangeHandler = () => { void refreshAudioDevices().catch(() => undefined); };
|
||||
navigator.mediaDevices?.addEventListener("devicechange", deviceChangeHandler);
|
||||
releasePttHandler = () => stopPointerTalk();
|
||||
window.addEventListener("blur", releasePttHandler);
|
||||
document.addEventListener("visibilitychange", releasePttHandler);
|
||||
viewportMediaQuery = window.matchMedia("(max-width: 740px)");
|
||||
viewportChangeHandler = () => {
|
||||
isMobileViewport.value = viewportMediaQuery?.matches ?? false;
|
||||
if (!isMobileViewport.value) memberMenu.value = null;
|
||||
};
|
||||
viewportChangeHandler();
|
||||
viewportMediaQuery.addEventListener?.("change", viewportChangeHandler);
|
||||
});
|
||||
onUnmounted(() => {
|
||||
stopPointerTalk();
|
||||
disconnect();
|
||||
if (deviceChangeHandler) navigator.mediaDevices?.removeEventListener("devicechange", deviceChangeHandler);
|
||||
if (releasePttHandler) {
|
||||
window.removeEventListener("blur", releasePttHandler);
|
||||
document.removeEventListener("visibilitychange", releasePttHandler);
|
||||
}
|
||||
if (viewportMediaQuery && viewportChangeHandler) viewportMediaQuery.removeEventListener?.("change", viewportChangeHandler);
|
||||
if (toastTimer) clearTimeout(toastTimer);
|
||||
});
|
||||
|
||||
@@ -1057,7 +1066,6 @@ function doConnect() {
|
||||
}
|
||||
|
||||
function doDisconnect() {
|
||||
stopPointerTalk();
|
||||
disconnect();
|
||||
selectedChannelId.value = "";
|
||||
showToast(t("leftToast"));
|
||||
@@ -1147,7 +1155,8 @@ async function loadPublicConfig() {
|
||||
try {
|
||||
const response = await fetch("/api/public-config", { headers: { accept: "application/json" } });
|
||||
if (!response.ok) return;
|
||||
const config = await response.json() as { initialized?: unknown; siteName?: unknown; welcomeText?: unknown; accessMode?: unknown; target?: unknown };
|
||||
const config = await response.json() as { version?: unknown; initialized?: unknown; siteName?: unknown; welcomeText?: unknown; accessMode?: unknown; target?: unknown };
|
||||
if (typeof config.version === "string" && config.version.trim()) appVersion.value = config.version.trim();
|
||||
initialized.value = config.initialized === true;
|
||||
if (typeof config.siteName === "string" && config.siteName.trim()) siteName.value = config.siteName.trim();
|
||||
if (typeof config.welcomeText === "string") welcomeText.value = config.welcomeText;
|
||||
@@ -1177,6 +1186,7 @@ function openPrivateChat(clientId: number): void {
|
||||
if (!clientId || clientId === voiceState.tsClientId) return;
|
||||
privateClientId.value = clientId;
|
||||
chatTab.value = "private";
|
||||
if (isMobileViewport.value) mobileSection.value = "chat";
|
||||
memberMenu.value = null;
|
||||
nextTick(scrollChatToEnd);
|
||||
}
|
||||
@@ -1187,6 +1197,11 @@ function openMemberMenu(member: ChannelMember, event: Event): void {
|
||||
memberMenu.value = { member, x: Math.min((point?.clientX ?? 20), Math.max(12, window.innerWidth - 210)), y: Math.min((point?.clientY ?? 20), Math.max(12, window.innerHeight - 170)) };
|
||||
}
|
||||
|
||||
function openMemberActions(member: ChannelMember): void {
|
||||
if (member.isSelf) return;
|
||||
memberMenu.value = { member, x: 0, y: 0 };
|
||||
}
|
||||
|
||||
function toggleWhisperTarget(member: ChannelMember): void {
|
||||
if (member.isSelf) return;
|
||||
const targets = new Set(whisperTargetIds);
|
||||
@@ -1245,7 +1260,7 @@ function avatarStyle(name: string, isSelf = false) {
|
||||
}
|
||||
|
||||
function isSpeaking(member: ChannelMember) {
|
||||
return speakingIds.has(member.id) || Boolean(member.isSelf && pttActive.value);
|
||||
return speakingIds.has(member.id);
|
||||
}
|
||||
|
||||
function memberDisplayName(member: ChannelMember): string {
|
||||
@@ -1328,47 +1343,9 @@ function meterBarHeight(index: number) {
|
||||
return 5 + Math.round(intensity * 34);
|
||||
}
|
||||
|
||||
function onKeyDown(event: KeyboardEvent) {
|
||||
const target = event.target as HTMLElement | null;
|
||||
if (target?.tagName === "INPUT" || target?.tagName === "TEXTAREA") return;
|
||||
if (event.code === "Space" && micMode.value === "ptt" && !pttActive.value) {
|
||||
event.preventDefault();
|
||||
startPointerTalk();
|
||||
}
|
||||
}
|
||||
|
||||
function onKeyUp(event: KeyboardEvent) {
|
||||
if (event.code === "Space" && micMode.value === "ptt") {
|
||||
event.preventDefault();
|
||||
stopPointerTalk();
|
||||
}
|
||||
}
|
||||
|
||||
function startPointerTalk() {
|
||||
if (micMode.value !== "ptt") return;
|
||||
pttActive.value = true;
|
||||
setPTT(true);
|
||||
}
|
||||
|
||||
function stopPointerTalk() {
|
||||
if (pttActive.value) {
|
||||
pttActive.value = false;
|
||||
setPTT(false);
|
||||
}
|
||||
stopWhisperTalk();
|
||||
}
|
||||
|
||||
function onMobilePttDown(event: PointerEvent) {
|
||||
if (micMode.value !== "ptt") return;
|
||||
const target = event.currentTarget as HTMLElement | null;
|
||||
if (target?.setPointerCapture && !target.hasPointerCapture(event.pointerId)) target.setPointerCapture(event.pointerId);
|
||||
startPointerTalk();
|
||||
}
|
||||
|
||||
function onMobilePttUp(event: PointerEvent) {
|
||||
const target = event.currentTarget as HTMLElement | null;
|
||||
if (target?.releasePointerCapture && target.hasPointerCapture(event.pointerId)) target.releasePointerCapture(event.pointerId);
|
||||
stopPointerTalk();
|
||||
function toggleMicrophone(): void {
|
||||
setMicrophoneMuted(!microphoneMuted.value);
|
||||
showToast(microphoneMuted.value ? t("microphoneMuted") : t("microphoneActive"));
|
||||
}
|
||||
|
||||
function onWhisperPttDown(event: PointerEvent): void {
|
||||
@@ -1409,6 +1386,12 @@ function stopWhisperTalk(): void {
|
||||
.brand-lockup strong span { color: #24312f; font-weight: 500; }
|
||||
.brand-lockup small { display: block; margin-top: 2px; color: #7b8885; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
|
||||
.header-tools { display: flex; align-items: center; gap: 17px; }
|
||||
.github-button { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 13px; color: #fff; background: #1f2d2b; border: 1px solid #1f2d2b; border-radius: 9px; box-shadow: 0 5px 12px rgba(31,45,43,.16); font-size: 12px; font-weight: 800; text-decoration: none; transition: .18s; }
|
||||
.github-button:hover { color: #fff; background: #006a64; border-color: #006a64; box-shadow: 0 7px 16px rgba(0,106,100,.2); transform: translateY(-1px); }
|
||||
.github-button .ui-icon { flex: 0 0 auto; }
|
||||
.version-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 0 9px; color: #006a64; background: #e7f4f1; border: 1px solid #cfe9e4; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
|
||||
.changelog-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 0 10px; color: #006a64; background: #f2f8f6; border: 1px solid #dcebe7; border-radius: 8px; font-size: 11px; font-weight: 700; text-decoration: none; transition: .18s; }
|
||||
.changelog-button:hover { color: #fff; background: #006a64; border-color: #006a64; }
|
||||
.header-note { display: flex; align-items: center; gap: 8px; color: #71807c; font-size: 12px; }
|
||||
.language-switch { min-width: 50px; min-height: 28px; padding: 0 9px; color: #006a64; background: #e2f2ef; border: 1px solid #c8e6e1; border-radius: 7px; font-size: 10px; font-weight: 700; cursor: pointer; transition: .18s; }
|
||||
.language-switch:hover { color: #fff; background: #006a64; border-color: #006a64; }
|
||||
@@ -1643,6 +1626,7 @@ function stopWhisperTalk(): void {
|
||||
/* Keep connected controls in the header; the old bottom dock consumed the
|
||||
chat viewport and made the settings action appear detached from its icon. */
|
||||
.header-tools { align-items: center; }
|
||||
.header-action, .round-icon { line-height: 0; }
|
||||
.guide-button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; color: #006a64; background: #edf7f4; border: 1px solid #d7ebe6; border-radius: 8px; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; }
|
||||
.guide-button:hover { color: #fff; background: #006a64; border-color: #006a64; }
|
||||
.workspace-actions { align-items: center; flex-wrap: nowrap; }
|
||||
@@ -1653,7 +1637,9 @@ function stopWhisperTalk(): void {
|
||||
|
||||
@media (max-width: 740px) {
|
||||
.header-tools { gap: 7px; }
|
||||
.header-note, .guide-button span { display: none; }
|
||||
.header-note, .github-button span, .changelog-button span, .guide-button span { display: none; }
|
||||
.github-button { width: 34px; justify-content: center; padding: 0; }
|
||||
.changelog-button { width: 32px; min-width: 32px; min-height: 32px; padding: 0; }
|
||||
.guide-button { width: 32px; justify-content: center; padding: 0; }
|
||||
}
|
||||
.chat-tabs { display: flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 18px; overflow-x: auto; padding-bottom: 3px; }
|
||||
@@ -1691,9 +1677,6 @@ function stopWhisperTalk(): void {
|
||||
.audio-level-track { height: 7px; margin: 7px 0 17px; overflow: hidden; background: #e8efec; border-radius: 999px; }
|
||||
.audio-level-track i { display: block; height: 100%; min-width: 0; background: linear-gradient(90deg, #69c8bb, #58d675); border-radius: inherit; transition: width .08s linear; }
|
||||
.test-audio { display: block; width: 100%; height: 34px; margin-top: 11px; }
|
||||
.mobile-ptt-button { display: none; align-items: center; justify-content: center; gap: 9px; min-height: 54px; margin-top: 12px; color: #fff; background: #006a64; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; touch-action: none; user-select: none; }
|
||||
.mobile-ptt-button.active { background: #2f9d5c; box-shadow: 0 0 0 4px rgba(47,157,92,.16); }
|
||||
@media (max-width: 740px) { .mobile-ptt-button { display: flex; } }
|
||||
|
||||
/* M008 semantic theme tokens and keyboard-safe surfaces. */
|
||||
:global(:root) { color-scheme: light; --surface-0: #f7f9f8; --surface-1: #fff; --surface-2: #f1f6f4; --text-primary: #192120; --text-muted: #71807c; --border: #e4ece9; --accent: #006a64; --success: #65d879; --warning: #c89143; --danger: #c95a54; }
|
||||
@@ -1722,7 +1705,7 @@ function stopWhisperTalk(): void {
|
||||
.member-row:hover, .member-row:focus-within { background: color-mix(in srgb, var(--accent) 10%, var(--surface-1)); box-shadow: 0 4px 12px color-mix(in srgb, var(--text-primary) 8%, transparent); }
|
||||
:global(button:focus-visible), :global(a:focus-visible), :global(input:focus-visible), :global(select:focus-visible), :global(textarea:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
|
||||
.message-composer { position: sticky; bottom: env(safe-area-inset-bottom, 0px); z-index: 3; }
|
||||
@media (max-width: 740px) { .workspace-scroll { overscroll-behavior: contain; }.workspace-content { width: min(100% - 24px, 650px); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }.message-composer { margin-bottom: 8px; }.mobile-ptt-button { position: sticky; bottom: env(safe-area-inset-bottom, 0px); z-index: 3; } }
|
||||
@media (max-width: 740px) { .workspace-scroll { overscroll-behavior: contain; }.workspace-content { width: min(100% - 24px, 650px); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }.message-composer { margin-bottom: 8px; } }
|
||||
@media (max-width: 740px) { .member-context-menu { left: 12px !important; right: 12px; top: auto !important; bottom: env(safe-area-inset-bottom, 0px); min-width: 0; border-radius: 16px 16px 0 0; padding: 14px; } .member-context-menu button { min-height: 42px; font-size: 13px; } .member-context-menu strong { padding: 4px 8px 11px; font-size: 14px; } .menu-volume { font-size: 12px; } }
|
||||
|
||||
/* M007 whisper target controls and M008 mobile navigation. */
|
||||
@@ -1800,4 +1783,152 @@ function stopWhisperTalk(): void {
|
||||
:global(:root[data-theme="dark"] *) { scrollbar-color: #438f88 transparent; }
|
||||
:global(:root[data-theme="dark"] *::-webkit-scrollbar-thumb) { background: #438f88; border-color: transparent; }
|
||||
:global(:root[data-theme="dark"] *::-webkit-scrollbar-thumb:hover) { background: #69c7bc; }
|
||||
|
||||
/* Mobile interaction pass: keep the browser viewport fixed and give each
|
||||
mobile surface its own touch-friendly scroll area. */
|
||||
.mobile-voice-controls, .voice-member-action, .member-action-button, .member-menu-backdrop { display: none; }
|
||||
.microphone-header-toggle.muted { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
|
||||
.microphone-control { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
|
||||
.microphone-control .settings-label { margin-bottom: 4px; }
|
||||
.microphone-control .settings-hint { max-width: 390px; margin: 0; }
|
||||
.microphone-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; flex: 0 0 auto; padding: 0 12px; color: #fff; background: var(--accent); border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
|
||||
.microphone-toggle.muted { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, var(--surface-1)); }
|
||||
.member-menu-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
|
||||
.member-menu-close { display: none; }
|
||||
|
||||
@media (max-width: 740px) {
|
||||
:global(html), :global(body), :global(#app) { height: 100%; min-height: 100%; max-height: none; }
|
||||
.web-client { height: 100dvh; height: 100svh; min-height: 100dvh; min-height: 100svh; max-height: 100dvh; max-height: 100svh; }
|
||||
.app-shell { height: 100dvh; height: 100svh; min-height: 100dvh; min-height: 100svh; max-height: 100dvh; max-height: 100svh; padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); overflow: hidden; }
|
||||
.app-shell .workspace { height: calc(100dvh - 74px - env(safe-area-inset-bottom, 0px)); height: calc(100svh - 74px - env(safe-area-inset-bottom, 0px)); min-height: 0; max-height: calc(100dvh - 74px - env(safe-area-inset-bottom, 0px)); max-height: calc(100svh - 74px - env(safe-area-inset-bottom, 0px)); overflow: hidden; }
|
||||
.app-shell .workspace-scroll { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
|
||||
.workspace-header { min-height: calc(60px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 14px 0; box-sizing: border-box; position: sticky; top: 0; z-index: 6; background: color-mix(in srgb, var(--surface-1) 94%, transparent); backdrop-filter: blur(14px); }
|
||||
.breadcrumbs { flex: 1 1 auto; min-width: 0; gap: 6px; font-size: 13px; }
|
||||
.breadcrumbs .crumb-muted, .breadcrumbs > .ui-icon { display: none; }
|
||||
.mobile-brand { display: inline; font-size: 18px; }
|
||||
.workspace-actions { flex: 0 0 auto; gap: 3px; }
|
||||
.workspace-actions .header-action { width: 36px; height: 36px; flex-basis: 36px; }
|
||||
.workspace-actions .theme-toggle, .workspace-actions .workspace-language { display: none; }
|
||||
.channel-switcher { max-width: 132px; min-height: 36px; padding-inline: 9px; }
|
||||
.channel-switcher select { max-width: 92px; font-size: 12px; }
|
||||
.disconnect-button { width: 36px; height: 36px; min-height: 36px; margin-left: 0; padding: 0; justify-content: center; }
|
||||
.disconnect-button .ui-icon { display: block; margin: 0; }
|
||||
.disconnect-button span { display: none; }
|
||||
.workspace-content { display: block; width: 100%; max-width: none; min-height: 100%; margin: 0; padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
|
||||
.room-hero { min-height: 152px; padding: 22px 20px; border-radius: 18px; }
|
||||
.room-hero h1 { margin-top: 14px; font-size: 25px; }
|
||||
.room-hero p { max-width: 72%; font-size: 12px; }
|
||||
.room-stats { margin-top: 15px; font-size: 11px; }
|
||||
.hero-visual { right: -28px; bottom: -2px; transform: scale(.72); transform-origin: right bottom; }
|
||||
.voice-section { margin-top: 21px; }
|
||||
.section-heading { gap: 10px; }
|
||||
.section-heading h2 { font-size: 22px; }
|
||||
.voice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
|
||||
.voice-card { position: relative; min-height: 136px; padding: 18px 8px 14px; border-radius: 16px; }
|
||||
.voice-avatar-wrap, .voice-avatar { width: 60px; height: 60px; }
|
||||
.voice-avatar-wrap { margin-bottom: 10px; }
|
||||
.voice-avatar { font-size: 18px; }
|
||||
.voice-status { width: 21px; height: 21px; }
|
||||
.app-shell .voice-card > strong { max-width: 100%; font-size: 14px; }
|
||||
.app-shell .voice-card > span { margin-top: 4px; font-size: 11px; }
|
||||
.voice-member-action { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 34px; height: 34px; color: var(--text-muted); background: color-mix(in srgb, var(--surface-2) 78%, transparent); border-radius: 10px; cursor: pointer; }
|
||||
.voice-member-action:hover, .voice-member-action:active { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface-1)); }
|
||||
.mobile-voice-controls { display: flex; align-items: stretch; gap: 8px; margin-top: 14px; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
|
||||
.mobile-voice-toggle, .mobile-voice-settings { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; min-width: 0; padding: 0 11px; color: var(--accent); background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
|
||||
.mobile-voice-toggle { flex: 1 1 auto; }
|
||||
.mobile-voice-toggle.muted, .mobile-more-panel button.muted { color: var(--danger); }
|
||||
.mobile-voice-settings { flex: 0 0 auto; width: 82px; }
|
||||
.mobile-voice-settings span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
|
||||
.app-shell .member-panel.mobile-section-visible { display: flex !important; flex: 1 1 auto; width: 100%; height: auto; min-height: 0; max-height: none; padding: 18px 14px 16px; border-top: 0; border-right: 0; overflow: hidden; }
|
||||
.member-panel-heading { flex: 0 0 auto; }
|
||||
.member-panel-heading h2 { font-size: 23px; }
|
||||
.status-button { min-height: 34px; padding-inline: 10px; font-size: 12px; }
|
||||
.member-search { flex: 0 0 auto; min-height: 44px; margin-top: 14px; padding: 0 12px; border-radius: 11px; }
|
||||
.member-search input { font-size: 15px; }
|
||||
.app-shell .member-panel .member-tree { flex: 1 1 auto; min-height: 0; max-height: none; margin-top: 12px; padding: 0 2px 4px 0; overflow-y: auto; scrollbar-gutter: stable; }
|
||||
.member-channel-group { padding: 7px 0 12px; }
|
||||
.member-channel-heading { min-height: 44px; padding: 0 9px; border-radius: 11px; font-size: 14px; }
|
||||
.member-channel-heading small { font-size: 12px; }
|
||||
.member-list { gap: 3px; margin-top: 5px; }
|
||||
.member-row { min-height: 58px; margin: 0; padding: 7px 7px; gap: 9px; border-radius: 12px; }
|
||||
.member-avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 12px; }
|
||||
.member-presence { width: 10px; height: 10px; }
|
||||
.member-copy strong { font-size: 14px; }
|
||||
.member-copy span { margin-top: 3px; font-size: 12px; }
|
||||
.member-flags, .member-volume, .member-panel-tip { display: none; }
|
||||
.member-action-button { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; color: var(--text-muted); background: transparent; border-radius: 10px; cursor: pointer; }
|
||||
.member-action-button:hover, .member-action-button:active { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface-1)); }
|
||||
|
||||
.app-shell.mobile-view-chat .workspace-scroll { overflow: hidden; }
|
||||
.app-shell.mobile-view-chat .workspace-content { display: flex; flex-direction: column; min-height: 100%; padding: 0 14px calc(8px + env(safe-area-inset-bottom, 0px)); }
|
||||
.app-shell.mobile-view-chat .chat-panel { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; margin-top: 0; padding: 0; border-top: 0; }
|
||||
.app-shell.mobile-view-chat .chat-tabs { flex: 0 0 auto; margin-top: 0; padding: 10px 0 9px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
|
||||
.app-shell.mobile-view-chat .chat-tabs::-webkit-scrollbar { display: none; }
|
||||
.app-shell.mobile-view-chat .chat-heading { flex: 0 0 auto; padding: 13px 0 9px; }
|
||||
.app-shell.mobile-view-chat .chat-heading h2 { font-size: 21px; }
|
||||
.app-shell.mobile-view-chat .message-list { flex: 1 1 auto; min-height: 0; max-height: none; padding: 10px 2px 16px; overflow-y: auto; overscroll-behavior: contain; }
|
||||
.app-shell.mobile-view-chat .message-row { max-width: 94%; gap: 9px; }
|
||||
.app-shell.mobile-view-chat .message-avatar { width: 36px; height: 36px; }
|
||||
.app-shell.mobile-view-chat .message-meta strong { font-size: 12px; }
|
||||
.app-shell.mobile-view-chat .message-bubble { padding: 10px 12px; font-size: 14px; }
|
||||
.app-shell.mobile-view-chat .message-composer { position: relative; flex: 0 0 auto; min-height: 54px; margin: 0 0 4px; padding: 7px 8px 7px 13px; border: 1px solid var(--border); }
|
||||
.app-shell.mobile-view-chat .message-composer input { font-size: 14px; }
|
||||
|
||||
.mobile-more-panel { width: calc(100% - 28px); max-height: none; margin: 16px auto 0; padding: 18px; border-radius: 18px; overflow-y: auto; }
|
||||
.mobile-more-panel h2 { font-size: 25px; }
|
||||
.mobile-more-panel button { min-height: 52px; font-size: 14px; }
|
||||
.mobile-nav { min-height: 74px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
|
||||
.mobile-nav button { min-height: 52px; font-size: 12px; }
|
||||
|
||||
.member-menu-backdrop { position: fixed; z-index: 39; inset: 0; display: block; background: rgba(13, 29, 26, .38); backdrop-filter: blur(2px); }
|
||||
.member-context-menu { z-index: 40; left: 10px !important; right: 10px; top: auto !important; bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important; min-width: 0; max-height: calc(100svh - 100px); padding: 12px; border-radius: 18px; box-shadow: 0 18px 42px rgba(13, 38, 33, .25); }
|
||||
.member-menu-header strong { padding: 4px 8px 11px; font-size: 16px; }
|
||||
.member-menu-close { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; padding: 0 !important; color: var(--text-muted); background: var(--surface-2); border-radius: 10px; }
|
||||
.member-context-menu button { min-height: 50px; padding: 8px 10px; border-radius: 10px; font-size: 14px; }
|
||||
.member-context-menu .member-menu-close { min-height: 36px; }
|
||||
.menu-volume { padding: 5px 8px 11px; font-size: 12px; }
|
||||
.menu-volume input { height: 7px; }
|
||||
|
||||
.modal-backdrop { align-items: flex-end; padding: 0; }
|
||||
.settings-modal { width: 100%; max-height: calc(100svh - env(safe-area-inset-top, 0px)); border-radius: 22px 22px 0 0; }
|
||||
.settings-main { min-height: 0; overflow: hidden; }
|
||||
.settings-header { min-height: 64px; padding-inline: 18px; }
|
||||
.settings-content { min-height: 0; padding: 20px 18px; overflow-y: auto; }
|
||||
.settings-footer { min-height: 68px; padding: 8px 18px calc(8px + env(safe-area-inset-bottom, 0px)); }
|
||||
.settings-footer .save-button { min-height: 48px; }
|
||||
.microphone-control { align-items: stretch; flex-direction: column; gap: 10px; }
|
||||
.microphone-control .settings-hint { max-width: none; }
|
||||
.microphone-toggle { width: 100%; min-height: 44px; }
|
||||
|
||||
.join-page { height: 100dvh; height: 100svh; min-height: 100dvh; min-height: 100svh; max-height: 100dvh; max-height: 100svh; }
|
||||
.join-header { min-height: calc(62px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); box-sizing: border-box; }
|
||||
.join-content { align-items: stretch; justify-content: flex-start; gap: 24px; width: min(100% - 28px, 560px); padding: 24px 0 28px; overflow-y: auto; }
|
||||
.join-copy h1 { margin: 14px 0 14px; font-size: clamp(40px, 12vw, 58px); }
|
||||
.join-description { font-size: 15px; line-height: 1.65; }
|
||||
.promise-list { margin-top: 23px; }
|
||||
.join-card { padding: 22px 18px; border-radius: 18px; }
|
||||
.join-card h2 { font-size: 25px; }
|
||||
.field-grid { grid-template-columns: minmax(0, 1fr) 112px; }
|
||||
.join-footer { width: min(100% - 28px, 560px); }
|
||||
}
|
||||
|
||||
@media (max-width: 390px) {
|
||||
.join-page .header-tools { gap: 4px; }
|
||||
.join-page .github-button, .join-page .changelog-button, .join-page .guide-button { width: 32px; min-width: 32px; min-height: 32px; height: 32px; }
|
||||
.join-page .version-badge { min-height: 32px; padding-inline: 6px; font-size: 10px; }
|
||||
.join-page .language-switch { min-width: 44px; padding-inline: 6px; font-size: 11px; }
|
||||
.workspace-header { padding-inline: 10px; }
|
||||
.channel-switcher { max-width: 112px; }
|
||||
.channel-switcher select { max-width: 72px; }
|
||||
.workspace-actions .header-action { width: 32px; height: 32px; flex-basis: 32px; }
|
||||
.disconnect-button { width: 32px; height: 32px; }
|
||||
.room-hero { padding-inline: 16px; }
|
||||
.mobile-voice-settings { width: 56px; padding-inline: 4px; }
|
||||
.mobile-voice-toggle { flex: 0 0 44px; padding-inline: 0; }
|
||||
.mobile-voice-toggle span { display: none; }
|
||||
.mobile-voice-settings span { display: none; }
|
||||
.join-content { gap: 18px; }
|
||||
.join-card { padding-inline: 15px; }
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user