mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-03 01:42:50 +08:00
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b856094b48 | ||
|
|
f67d171001 | ||
|
|
762554b39d | ||
|
|
e96eb62d90 | ||
|
|
4afab66d6b | ||
|
|
e19ced1bd1 | ||
|
|
4e04ddb526 | ||
|
|
169d32a292 | ||
|
|
de94859a16 | ||
|
|
810d922b09 | ||
|
|
5e76bd3bdf |
No files matched your search
@@ -243,6 +243,7 @@ All optional; add them under `environment:` in your compose override next to `PO
|
|||||||
| `TURN_URLS` | unset | Comma-separated TURN URLs (e.g. `turn:turn.example.com:3478`) offered to browsers for screen streams, for viewers or publishers behind NATs where direct P2P fails. Pair with `TURN_SECRET` (coturn's `use-auth-secret`; each browser gets its own credential valid for 24 h) or with static `TURN_USERNAME` / `TURN_CREDENTIAL`, which every visitor can read. |
|
| `TURN_URLS` | unset | Comma-separated TURN URLs (e.g. `turn:turn.example.com:3478`) offered to browsers for screen streams, for viewers or publishers behind NATs where direct P2P fails. Pair with `TURN_SECRET` (coturn's `use-auth-secret`; each browser gets its own credential valid for 24 h) or with static `TURN_USERNAME` / `TURN_CREDENTIAL`, which every visitor can read. |
|
||||||
| `ALLOWED_ORIGINS` | unset (any origin) | Comma-separated list of web origins allowed to open `/ws` (e.g. `https://client.example.com`). Stops other websites from silently using your gateway as their relay. |
|
| `ALLOWED_ORIGINS` | unset (any origin) | Comma-separated list of web origins allowed to open `/ws` (e.g. `https://client.example.com`). Stops other websites from silently using your gateway as their relay. |
|
||||||
| `MAX_CONNECTIONS_PER_IP` / `MAX_CONNECTIONS` | `10` / `60` | Concurrent `/ws` connections per client IP and in total (each can hold a live TeamSpeak session). `0` disables a limit. |
|
| `MAX_CONNECTIONS_PER_IP` / `MAX_CONNECTIONS` | `10` / `60` | Concurrent `/ws` connections per client IP and in total (each can hold a live TeamSpeak session). `0` disables a limit. |
|
||||||
|
| `TURNSTILE_SITE_KEY` / `TURNSTILE_SECRET` | *(unset)* | Optional [Cloudflare Turnstile](https://developers.cloudflare.com/turnstile/) bot check before connecting. With both set, a browser solves the (usually invisible) check once and gets a pass bound to its IP for 12 h. Keeps scripts from opening TeamSpeak connections through your gateway. |
|
||||||
| `CONNECT_RATE_LIMIT` | `30` | Server connects per client IP per minute. Each one starts a new TeamSpeak session, so this stops anyone from flooding a server through your gateway. `0` disables it. |
|
| `CONNECT_RATE_LIMIT` | `30` | Server connects per client IP per minute. Each one starts a new TeamSpeak session, so this stops anyone from flooding a server through your gateway. `0` disables it. |
|
||||||
| `TRUST_PROXY` | off | Only when the gateway is reachable **solely** through a proxy/tunnel, so per-IP limits see the real client instead of the proxy: `cloudflare` (Cloudflare Tunnel or proxy) uses `CF-Connecting-IP`; `1` (your own nginx/Caddy/Traefik) uses the last `X-Forwarded-For` entry, the one your proxy appended. Don't set it on a directly exposed gateway - clients could then fake their IP. |
|
| `TRUST_PROXY` | off | Only when the gateway is reachable **solely** through a proxy/tunnel, so per-IP limits see the real client instead of the proxy: `cloudflare` (Cloudflare Tunnel or proxy) uses `CF-Connecting-IP`; `1` (your own nginx/Caddy/Traefik) uses the last `X-Forwarded-For` entry, the one your proxy appended. Don't set it on a directly exposed gateway - clients could then fake their IP. |
|
||||||
| `TELEMETRY` | on | Set to `0` to turn off the anonymous usage ping (see below). |
|
| `TELEMETRY` | on | Set to `0` to turn off the anonymous usage ping (see below). |
|
||||||
@@ -397,6 +398,8 @@ The UI texts live in flat JSON files in [`web/src/locales/`](web/src/locales/),
|
|||||||
|
|
||||||
The vast majority of this project's code was written by [Claude Code](https://claude.com/claude-code) (Anthropic's Claude), working iteratively with the repo owner one feature at a time.
|
The vast majority of this project's code was written by [Claude Code](https://claude.com/claude-code) (Anthropic's Claude), working iteratively with the repo owner one feature at a time.
|
||||||
|
|
||||||
|
Country flags use the [Twemoji Country Flags](https://github.com/talkjs/country-flag-emoji-polyfill) font, artwork from [Twemoji](https://github.com/twitter/twemoji) under [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/).
|
||||||
|
|
||||||
## 🌈 In Memory of Akimo
|
## 🌈 In Memory of Akimo
|
||||||
|
|
||||||
<!-- Permanent: never remove this section. -->
|
<!-- Permanent: never remove this section. -->
|
||||||
|
|||||||
+47
-1
@@ -902,6 +902,29 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Stable per-identity HWID in the TeamSpeak shape (`<32 hex>,<32 hex>`),
|
||||||
|
/// derived from the identity's UID hash so it survives reconnects.
|
||||||
|
fn hardware_id_for(uid: &[u8]) -> String {
|
||||||
|
let hex = |bytes: &[u8]| bytes.iter().map(|b| format!("{b:02x}")).collect::<String>();
|
||||||
|
let mut padded = uid.to_vec();
|
||||||
|
padded.resize(20, 0);
|
||||||
|
format!("{},{}", hex(&padded[..16]), hex(&padded[4..20]))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Text for a `banclient` the server refused. Permission ids differ between
|
||||||
|
/// TeamSpeak and TeaSpeak, so the usual causes are named instead of the id.
|
||||||
|
fn ban_failure_message(e: &tsclientlib::CommandError) -> String {
|
||||||
|
match e.missing_permission {
|
||||||
|
Some(perm) => format!(
|
||||||
|
"Ban failed: missing permission (id {}). Usual causes: a permanent ban (duration 0) \
|
||||||
|
without unlimited i_client_ban_max_bantime, a duration above it, too little \
|
||||||
|
i_client_ban_power, or the target has b_client_ignore_bans.",
|
||||||
|
perm.0
|
||||||
|
),
|
||||||
|
None => format!("Ban failed: {e}"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// VoySpeak (formerly GreenTeaSpeak) servers report versions like `2.5.1 [Build: …]`.
|
/// VoySpeak (formerly GreenTeaSpeak) servers report versions like `2.5.1 [Build: …]`.
|
||||||
/// Classic TeaSpeak reports `TeaSpeak 1.4.21-beta [Build: …]` — not a GTS host.
|
/// Classic TeaSpeak reports `TeaSpeak 1.4.21-beta [Build: …]` — not a GTS host.
|
||||||
/// Classic TeamSpeak 3 reports `3.13.8 [Build: …]` — must not use GTS labels.
|
/// Classic TeamSpeak 3 reports `3.13.8 [Build: …]` — must not use GTS labels.
|
||||||
@@ -1015,7 +1038,13 @@ async fn run(args: Args) -> Result<()> {
|
|||||||
.and_then(|s| serde_json::from_str::<Identity>(s).ok().or_else(|| Identity::new_from_str(s).ok()))
|
.and_then(|s| serde_json::from_str::<Identity>(s).ok().or_else(|| Identity::new_from_str(s).ok()))
|
||||||
.unwrap_or_else(Identity::create);
|
.unwrap_or_else(Identity::create);
|
||||||
let identity_str = serde_json::to_string(&identity).unwrap();
|
let identity_str = serde_json::to_string(&identity).unwrap();
|
||||||
let mut con_config = Connection::build(args.address).name(args.nickname).identity(identity);
|
// Without this every web user sends tsclientlib's built-in HWID, so a
|
||||||
|
// hardware-id ban on one web user would lock out all of them.
|
||||||
|
let hardware_id = hardware_id_for(&identity.key().to_pub().get_uid_no_base64());
|
||||||
|
let mut con_config = Connection::build(args.address)
|
||||||
|
.name(args.nickname)
|
||||||
|
.hardware_id(hardware_id)
|
||||||
|
.identity(identity);
|
||||||
let server_type = match args.server_type.as_str() {
|
let server_type = match args.server_type.as_str() {
|
||||||
"teaspeak" => ServerType::Teaspeak,
|
"teaspeak" => ServerType::Teaspeak,
|
||||||
"teamspeak" => ServerType::Teamspeak,
|
"teamspeak" => ServerType::Teamspeak,
|
||||||
@@ -2777,6 +2806,14 @@ async fn run(args: Args) -> Result<()> {
|
|||||||
} else {
|
} else {
|
||||||
emit(&Event::Error { message: format!("{label} failed: {e}") });
|
emit(&Event::Error { message: format!("{label} failed: {e}") });
|
||||||
}
|
}
|
||||||
|
} else if label == "Ban client" {
|
||||||
|
// A rejected ban must be visible: the UI only knows it sent one.
|
||||||
|
emit(&Event::Error { message: ban_failure_message(&e) });
|
||||||
|
if e.missing_permission.is_some() {
|
||||||
|
emit(&Event::ServerLog {
|
||||||
|
entry: ServerLogEntry::PermissionError { action: label },
|
||||||
|
});
|
||||||
|
}
|
||||||
} else if e.missing_permission.is_some() {
|
} else if e.missing_permission.is_some() {
|
||||||
emit(&Event::ServerLog {
|
emit(&Event::ServerLog {
|
||||||
entry: ServerLogEntry::PermissionError { action: label },
|
entry: ServerLogEntry::PermissionError { action: label },
|
||||||
@@ -3311,6 +3348,15 @@ mod tests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn hardware_id_is_stable_and_per_identity() {
|
||||||
|
let a = hardware_id_for(&[1u8; 20]);
|
||||||
|
assert_eq!(a, hardware_id_for(&[1u8; 20]));
|
||||||
|
assert_ne!(a, hardware_id_for(&[2u8; 20]));
|
||||||
|
let (left, right) = a.split_once(',').unwrap();
|
||||||
|
assert_eq!((left.len(), right.len()), (32, 32));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn upload_chunks_assemble_in_order_and_reject_gaps() {
|
fn upload_chunks_assemble_in_order_and_reject_gaps() {
|
||||||
let mut partials = HashMap::new();
|
let mut partials = HashMap::new();
|
||||||
|
|||||||
+18
-1
@@ -11,6 +11,7 @@ import { handleStore } from "./store.js";
|
|||||||
import { handleNewsConfig } from "./news.js";
|
import { handleNewsConfig } from "./news.js";
|
||||||
import { logFeedback, logConnectionEvent } from "./activity-log.js";
|
import { logFeedback, logConnectionEvent } from "./activity-log.js";
|
||||||
import { clientIp, createRateLimiter } from "./net.js";
|
import { clientIp, createRateLimiter } from "./net.js";
|
||||||
|
import { TURNSTILE_ENABLED, TURNSTILE_SITE_KEY, isValidPass, issuePass, verifyToken } from "./turnstile.js";
|
||||||
import "./telemetry.js";
|
import "./telemetry.js";
|
||||||
|
|
||||||
// TeamSpeak 2 support is experimental and opt-in (ENABLE_TS2=1).
|
// TeamSpeak 2 support is experimental and opt-in (ENABLE_TS2=1).
|
||||||
@@ -490,7 +491,7 @@ const requestHandler = (req: IncomingMessage, res: ServerResponse) => {
|
|||||||
// Same list as the "hello" message, readable before any connect
|
// Same list as the "hello" message, readable before any connect
|
||||||
// (the connect dialog offers TeamSpeak 2 only when it is enabled).
|
// (the connect dialog offers TeamSpeak 2 only when it is enabled).
|
||||||
res.writeHead(200, { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*", "Cache-Control": "public, max-age=300" });
|
res.writeHead(200, { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*", "Cache-Control": "public, max-age=300" });
|
||||||
res.end(JSON.stringify({ features: GATEWAY_FEATURES }));
|
res.end(JSON.stringify({ features: GATEWAY_FEATURES, ...(TURNSTILE_ENABLED ? { turnstileSiteKey: TURNSTILE_SITE_KEY } : {}) }));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (requestUrl.pathname === "/api/news") {
|
if (requestUrl.pathname === "/api/news") {
|
||||||
@@ -583,6 +584,7 @@ const wss = new WebSocketServer({
|
|||||||
}
|
}
|
||||||
const ip = clientIp(req);
|
const ip = clientIp(req);
|
||||||
if (MAX_CONNECTIONS_PER_IP > 0 && (connectionsPerIp.get(ip) ?? 0) >= MAX_CONNECTIONS_PER_IP) {
|
if (MAX_CONNECTIONS_PER_IP > 0 && (connectionsPerIp.get(ip) ?? 0) >= MAX_CONNECTIONS_PER_IP) {
|
||||||
|
console.warn(`[ratelimit] too many open connections from one IP (limit ${MAX_CONNECTIONS_PER_IP})`);
|
||||||
return done(false, 429, "Too many connections");
|
return done(false, 429, "Too many connections");
|
||||||
}
|
}
|
||||||
done(true);
|
done(true);
|
||||||
@@ -754,6 +756,21 @@ wss.on("connection", (socket: WebSocket, req: IncomingMessage) => {
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (TURNSTILE_ENABLED && !isValidPass(msg.turnstilePass, ip)) {
|
||||||
|
// No (valid) pass yet: ask the browser to solve the check, it
|
||||||
|
// resends this connect with the token.
|
||||||
|
if (msg.turnstileToken === undefined) {
|
||||||
|
socket.send(JSON.stringify({ type: "turnstileRequired" }));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!(await verifyToken(msg.turnstileToken, ip))) {
|
||||||
|
socket.send(
|
||||||
|
JSON.stringify({ type: "error", code: "turnstile_failed", message: "Bot check failed. Please try again." }),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
socket.send(JSON.stringify({ type: "turnstilePass", pass: issuePass(ip) }));
|
||||||
|
}
|
||||||
// Replacing a connection on the same socket: tear down the previous
|
// Replacing a connection on the same socket: tear down the previous
|
||||||
// connector so we don't leak processes.
|
// connector so we don't leak processes.
|
||||||
if (connection) {
|
if (connection) {
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
// Optional Cloudflare Turnstile bot check before a "connect". Off unless both
|
||||||
|
// TURNSTILE_SITE_KEY and TURNSTILE_SECRET are set. A solved check earns a
|
||||||
|
// signed pass (bound to the client IP, valid PASS_TTL_MS) that later connects
|
||||||
|
// and silent reconnects present instead, so a real user sees the check at
|
||||||
|
// most once in that window.
|
||||||
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
||||||
|
|
||||||
|
export const TURNSTILE_SITE_KEY = process.env.TURNSTILE_SITE_KEY ?? "";
|
||||||
|
const SECRET = process.env.TURNSTILE_SECRET ?? "";
|
||||||
|
export const TURNSTILE_ENABLED = TURNSTILE_SITE_KEY !== "" && SECRET !== "";
|
||||||
|
|
||||||
|
const PASS_TTL_MS = 12 * 60 * 60 * 1000;
|
||||||
|
// Derived from the secret, so passes survive a gateway restart.
|
||||||
|
const PASS_KEY = createHmac("sha256", SECRET).update("webspeak3-turnstile-pass").digest();
|
||||||
|
|
||||||
|
const sign = (ip: string, expires: number) =>
|
||||||
|
createHmac("sha256", PASS_KEY).update(`${ip}|${expires}`).digest("base64url");
|
||||||
|
|
||||||
|
export function issuePass(ip: string): string {
|
||||||
|
const expires = Date.now() + PASS_TTL_MS;
|
||||||
|
return `${expires}.${sign(ip, expires)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isValidPass(pass: unknown, ip: string): boolean {
|
||||||
|
if (typeof pass !== "string") return false;
|
||||||
|
const [exp, mac] = pass.split(".");
|
||||||
|
const expires = Number(exp);
|
||||||
|
if (!Number.isFinite(expires) || expires < Date.now() || !mac) return false;
|
||||||
|
const expected = Buffer.from(sign(ip, expires));
|
||||||
|
const given = Buffer.from(mac);
|
||||||
|
return given.length === expected.length && timingSafeEqual(given, expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function verifyToken(token: unknown, ip: string): Promise<boolean> {
|
||||||
|
if (typeof token !== "string" || token.length === 0 || token.length > 2048) return false;
|
||||||
|
try {
|
||||||
|
const res = await fetch("https://challenges.cloudflare.com/turnstile/v0/siteverify", {
|
||||||
|
method: "POST",
|
||||||
|
body: new URLSearchParams({ secret: SECRET, response: token, remoteip: ip }),
|
||||||
|
signal: AbortSignal.timeout(10_000),
|
||||||
|
});
|
||||||
|
const data = (await res.json()) as { success?: boolean; "error-codes"?: string[] };
|
||||||
|
if (!data.success) console.warn(`[turnstile] rejected: ${(data["error-codes"] ?? []).join(",")}`);
|
||||||
|
return data.success === true;
|
||||||
|
} catch (err) {
|
||||||
|
console.warn(`[turnstile] siteverify failed: ${err}`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
Submodule tsclientlib updated: 2e7794928f...cf074c091c.
+75
-14
@@ -2042,6 +2042,50 @@
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Disconnected/connecting: centered in the otherwise empty tree panel. */
|
||||||
|
.ts-tree-panel > .ts-tree-empty:only-child {
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-tree-empty > button,
|
||||||
|
.ts-tree-empty > a {
|
||||||
|
display: block;
|
||||||
|
margin-top: 0.75rem;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-tree-empty > .ts-mobile-connect-btn {
|
||||||
|
flex: none;
|
||||||
|
min-height: 40px;
|
||||||
|
padding: 0 1.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-tree-empty-demo {
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-spinner {
|
||||||
|
display: inline-block;
|
||||||
|
width: 0.9em;
|
||||||
|
height: 0.9em;
|
||||||
|
vertical-align: -0.1em;
|
||||||
|
border: 2px solid var(--text-muted);
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: ts-spin 0.8s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes ts-spin {
|
||||||
|
to { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
|
||||||
.ts-tree-list {
|
.ts-tree-list {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -2322,6 +2366,25 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Flags from the Twemoji Country Flags font (CC-BY 4.0), because Chromium on
|
||||||
|
Windows has no flag emoji and shows the two letters instead. unicode-range
|
||||||
|
keeps the font to flag characters and loads it only when one is shown. */
|
||||||
|
@font-face {
|
||||||
|
font-family: "Twemoji Country Flags";
|
||||||
|
src: url("./assets/fonts/TwemojiCountryFlags.woff2") format("woff2");
|
||||||
|
unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
|
||||||
|
font-display: swap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-flag {
|
||||||
|
font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-talk-lamp-away {
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.ts-client-icons {
|
.ts-client-icons {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -2345,17 +2408,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ts-group-badge {
|
.ts-group-badge {
|
||||||
display: inline-flex;
|
display: block;
|
||||||
align-items: center;
|
width: 15px;
|
||||||
justify-content: center;
|
height: 15px;
|
||||||
width: 14px;
|
|
||||||
height: 14px;
|
|
||||||
border-radius: 50%;
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
font-size: 9px;
|
|
||||||
font-weight: 700;
|
|
||||||
line-height: 1;
|
|
||||||
color: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ts-poke-button {
|
.ts-poke-button {
|
||||||
@@ -5412,10 +5468,6 @@ input.ts-identities-uid {
|
|||||||
|
|
||||||
/* Disconnected: the header already says so, keep the panel calm and centered. */
|
/* Disconnected: the header already says so, keep the panel calm and centered. */
|
||||||
.ts-app.ts-mobile .ts-tree-panel > .ts-tree-empty:only-child {
|
.ts-app.ts-mobile .ts-tree-panel > .ts-tree-empty:only-child {
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
@@ -5903,3 +5955,12 @@ input.ts-identities-uid {
|
|||||||
.ts-app.ts-mobile.ts-design-ide .ts-tree-panel {
|
.ts-app.ts-mobile.ts-design-ide .ts-tree-panel {
|
||||||
max-height: none;
|
max-height: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Cloudflare Turnstile: empty unless Cloudflare wants an interaction. */
|
||||||
|
.ts-turnstile {
|
||||||
|
position: fixed;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
z-index: 10000;
|
||||||
|
}
|
||||||
+233
-62
@@ -236,6 +236,7 @@ import {
|
|||||||
} from "./ConnectionTabs";
|
} from "./ConnectionTabs";
|
||||||
import { BARE_URL_REGEX, renderBbcode, wrapUrls } from "./lib/bbcode";
|
import { BARE_URL_REGEX, renderBbcode, wrapUrls } from "./lib/bbcode";
|
||||||
import { parseChannelName, spacerDisplayName } from "./lib/spacer";
|
import { parseChannelName, spacerDisplayName } from "./lib/spacer";
|
||||||
|
import { channelsInTreeOrder } from "./lib/channelOrder";
|
||||||
import akimoPhoto from "./assets/akimo.jpg";
|
import akimoPhoto from "./assets/akimo.jpg";
|
||||||
import {
|
import {
|
||||||
applyParkedGatewayEvent,
|
applyParkedGatewayEvent,
|
||||||
@@ -401,14 +402,73 @@ function loadServerType(): ServerType {
|
|||||||
// The gateway's feature list, readable before connecting. TeamSpeak 2 is
|
// The gateway's feature list, readable before connecting. TeamSpeak 2 is
|
||||||
// opt-in per gateway (ENABLE_TS2), so the connect dialog only offers it then.
|
// opt-in per gateway (ENABLE_TS2), so the connect dialog only offers it then.
|
||||||
const FEATURES_URL = DEMO_MODE ? null : FEEDBACK_URL.replace(/\/api\/feedback$/, "/api/features");
|
const FEATURES_URL = DEMO_MODE ? null : FEEDBACK_URL.replace(/\/api\/feedback$/, "/api/features");
|
||||||
let gatewayFeaturesPromise: Promise<string[]> | null = null;
|
type GatewayInfo = { features?: unknown; turnstileSiteKey?: unknown };
|
||||||
|
let gatewayInfoPromise: Promise<GatewayInfo> | null = null;
|
||||||
|
function fetchGatewayInfo(): Promise<GatewayInfo> {
|
||||||
|
if (!FEATURES_URL) return Promise.resolve({});
|
||||||
|
gatewayInfoPromise ??= fetch(FEATURES_URL)
|
||||||
|
.then((r) => (r.ok ? r.json() : {}))
|
||||||
|
.catch(() => ({}));
|
||||||
|
return gatewayInfoPromise;
|
||||||
|
}
|
||||||
function fetchGatewayFeatures(): Promise<string[]> {
|
function fetchGatewayFeatures(): Promise<string[]> {
|
||||||
if (!FEATURES_URL) return Promise.resolve([]);
|
return fetchGatewayInfo().then((d) => (Array.isArray(d.features) ? d.features : []));
|
||||||
gatewayFeaturesPromise ??= fetch(FEATURES_URL)
|
}
|
||||||
.then((r) => (r.ok ? r.json() : { features: [] }))
|
|
||||||
.then((d) => (Array.isArray(d.features) ? d.features : []))
|
// Cloudflare Turnstile bot check, only when the gateway asks for it
|
||||||
.catch(() => []);
|
// ("turnstileRequired"). Invisible for most visitors; the widget only shows
|
||||||
return gatewayFeaturesPromise;
|
// up when Cloudflare wants an interaction. The gateway then hands out a pass
|
||||||
|
// (kept here) so later connects and reconnects skip the check.
|
||||||
|
const TURNSTILE_PASS_KEY = "ws3.turnstilePass";
|
||||||
|
type TurnstileApi = {
|
||||||
|
render: (el: HTMLElement, opts: Record<string, unknown>) => string;
|
||||||
|
remove: (id: string) => void;
|
||||||
|
};
|
||||||
|
let turnstileScript: Promise<TurnstileApi> | null = null;
|
||||||
|
function loadTurnstile(): Promise<TurnstileApi> {
|
||||||
|
turnstileScript ??= new Promise((resolve, reject) => {
|
||||||
|
const s = document.createElement("script");
|
||||||
|
s.src = "https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit";
|
||||||
|
s.async = true;
|
||||||
|
s.onload = () => {
|
||||||
|
const api = (window as unknown as { turnstile?: TurnstileApi }).turnstile;
|
||||||
|
if (api) resolve(api);
|
||||||
|
else reject(new Error("turnstile missing"));
|
||||||
|
};
|
||||||
|
s.onerror = () => {
|
||||||
|
turnstileScript = null;
|
||||||
|
reject(new Error("turnstile blocked"));
|
||||||
|
};
|
||||||
|
document.head.appendChild(s);
|
||||||
|
});
|
||||||
|
return turnstileScript;
|
||||||
|
}
|
||||||
|
async function getTurnstileToken(): Promise<string> {
|
||||||
|
const { turnstileSiteKey } = await fetchGatewayInfo();
|
||||||
|
if (typeof turnstileSiteKey !== "string") return "";
|
||||||
|
try {
|
||||||
|
const api = await loadTurnstile();
|
||||||
|
const box = document.createElement("div");
|
||||||
|
box.className = "ts-turnstile";
|
||||||
|
document.body.appendChild(box);
|
||||||
|
return await new Promise<string>((resolve) => {
|
||||||
|
let id = "";
|
||||||
|
const done = (token: string) => {
|
||||||
|
if (id) api.remove(id);
|
||||||
|
box.remove();
|
||||||
|
resolve(token);
|
||||||
|
};
|
||||||
|
id = api.render(box, {
|
||||||
|
sitekey: turnstileSiteKey,
|
||||||
|
appearance: "interaction-only",
|
||||||
|
callback: done,
|
||||||
|
"error-callback": () => done(""),
|
||||||
|
"timeout-callback": () => done(""),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Everything needed to (re)open a gateway connection for one session, kept
|
/** Everything needed to (re)open a gateway connection for one session, kept
|
||||||
@@ -1309,15 +1369,30 @@ function ChannelIcon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** GTS2-style talk lamp: blue idle / green talking / muted mic. */
|
/** GTS2-style talk lamp: blue idle / green talking / muted mic. */
|
||||||
|
/** Red "off" badge in the lamp's bottom-right corner, shared by the mute icons. */
|
||||||
|
const OFF_BADGE = (
|
||||||
|
<>
|
||||||
|
<circle cx="10.35" cy="10.35" r="2.55" fill="#e53935" stroke="#1a1a1a" strokeWidth="0.55" />
|
||||||
|
<path d="M9.35 9.35l2 2M11.35 9.35l-2 2" stroke="#fff" strokeWidth="1.1" strokeLinecap="round" />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
|
/** The status slot in front of a client's name. Like the native client, away
|
||||||
|
* and mute replace the talk dot instead of being listed after the name.
|
||||||
|
* Order as in TeamSpeak: away, sound muted, mic muted, talking/idle. */
|
||||||
function TalkLamp({
|
function TalkLamp({
|
||||||
talking,
|
talking,
|
||||||
inputMuted,
|
inputMuted,
|
||||||
inputHardwareEnabled,
|
inputHardwareEnabled,
|
||||||
|
outputMuted = false,
|
||||||
|
away = false,
|
||||||
commander = false,
|
commander = false,
|
||||||
}: {
|
}: {
|
||||||
talking: boolean;
|
talking: boolean;
|
||||||
inputMuted: boolean;
|
inputMuted: boolean;
|
||||||
inputHardwareEnabled: boolean;
|
inputHardwareEnabled: boolean;
|
||||||
|
outputMuted?: boolean;
|
||||||
|
away?: boolean;
|
||||||
/** Channel commander: drawn as its own lamp when the design option asks for it. */
|
/** Channel commander: drawn as its own lamp when the design option asks for it. */
|
||||||
commander?: boolean;
|
commander?: boolean;
|
||||||
}) {
|
}) {
|
||||||
@@ -1326,40 +1401,57 @@ function TalkLamp({
|
|||||||
const muted = inputMuted || !inputHardwareEnabled;
|
const muted = inputMuted || !inputHardwareEnabled;
|
||||||
const asCommander = commander && tree.commanderLamp;
|
const asCommander = commander && tree.commanderLamp;
|
||||||
|
|
||||||
if (muted) {
|
const icon = (title: string, packIcon: string, paths: React.ReactNode) => (
|
||||||
|
<span className="ts-talk-lamp ts-talk-lamp-muted" title={title} aria-hidden="true" data-pack-icon={packIcon}>
|
||||||
|
<svg width="14" height="14" viewBox="0 0 14 14" focusable="false">
|
||||||
|
{paths}
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
|
||||||
|
if (away) {
|
||||||
return (
|
return (
|
||||||
<span
|
<span className="ts-talk-lamp ts-talk-lamp-muted ts-talk-lamp-away" title={t("tree.away")} aria-hidden="true" data-pack-icon="away">
|
||||||
className="ts-talk-lamp ts-talk-lamp-muted"
|
💤
|
||||||
title={t("tree.micMuted")}
|
|
||||||
aria-hidden="true"
|
|
||||||
data-pack-icon={inputMuted ? "micMuted" : "hardwareMicMuted"}
|
|
||||||
>
|
|
||||||
<svg width="14" height="14" viewBox="0 0 14 14" focusable="false">
|
|
||||||
<path
|
|
||||||
d="M7 1.4c-1.15 0-2.05.9-2.05 2.05v3.1c0 1.15.9 2.05 2.05 2.05s2.05-.9 2.05-2.05v-3.1C9.05 2.3 8.15 1.4 7 1.4Z"
|
|
||||||
fill="#9aa3ad"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M3.2 6.4v.4c0 2 1.7 3.55 3.8 3.55s3.8-1.55 3.8-3.55v-.4"
|
|
||||||
fill="none"
|
|
||||||
stroke="#8a939c"
|
|
||||||
strokeWidth="1.15"
|
|
||||||
strokeLinecap="round"
|
|
||||||
/>
|
|
||||||
<path d="M7 10.35v2" stroke="#8a939c" strokeWidth="1.15" strokeLinecap="round" />
|
|
||||||
<path d="M5.2 12.35h3.6" stroke="#8a939c" strokeWidth="1.15" strokeLinecap="round" />
|
|
||||||
<circle cx="10.35" cy="10.35" r="2.55" fill="#e53935" stroke="#1a1a1a" strokeWidth="0.55" />
|
|
||||||
<path
|
|
||||||
d="M9.35 9.35l2 2M11.35 9.35l-2 2"
|
|
||||||
stroke="#fff"
|
|
||||||
strokeWidth="1.1"
|
|
||||||
strokeLinecap="round"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (outputMuted) {
|
||||||
|
return icon(
|
||||||
|
t("tree.soundMuted"),
|
||||||
|
"soundMuted",
|
||||||
|
<>
|
||||||
|
<path d="M1.6 5h2.3l3.2-2.7v8.6L3.9 8.2H1.6Z" fill="#9aa3ad" stroke="#8a939c" strokeWidth="0.5" strokeLinejoin="round" />
|
||||||
|
<path d="M8.6 4.6c.7.6 1 1.3 1 2s-.3 1.4-1 2" fill="none" stroke="#8a939c" strokeWidth="1.1" strokeLinecap="round" />
|
||||||
|
{OFF_BADGE}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (muted) {
|
||||||
|
return icon(
|
||||||
|
t("tree.micMuted"),
|
||||||
|
inputMuted ? "micMuted" : "hardwareMicMuted",
|
||||||
|
<>
|
||||||
|
<path
|
||||||
|
d="M7 1.4c-1.15 0-2.05.9-2.05 2.05v3.1c0 1.15.9 2.05 2.05 2.05s2.05-.9 2.05-2.05v-3.1C9.05 2.3 8.15 1.4 7 1.4Z"
|
||||||
|
fill="#9aa3ad"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M3.2 6.4v.4c0 2 1.7 3.55 3.8 3.55s3.8-1.55 3.8-3.55v-.4"
|
||||||
|
fill="none"
|
||||||
|
stroke="#8a939c"
|
||||||
|
strokeWidth="1.15"
|
||||||
|
strokeLinecap="round"
|
||||||
|
/>
|
||||||
|
<path d="M7 10.35v2" stroke="#8a939c" strokeWidth="1.15" strokeLinecap="round" />
|
||||||
|
<path d="M5.2 12.35h3.6" stroke="#8a939c" strokeWidth="1.15" strokeLinecap="round" />
|
||||||
|
{OFF_BADGE}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (talking) {
|
if (talking) {
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
@@ -1383,15 +1475,13 @@ function TalkLamp({
|
|||||||
function ClientStatusIcons({ client }: { client: ClientInfo }) {
|
function ClientStatusIcons({ client }: { client: ClientInfo }) {
|
||||||
const t = useT();
|
const t = useT();
|
||||||
const { tree } = useContext(DisplayPrefsContext);
|
const { tree } = useContext(DisplayPrefsContext);
|
||||||
// Mute is shown on the TalkLamp; keep secondary flags here.
|
// Away and mute are shown on the TalkLamp; keep secondary flags here.
|
||||||
return (
|
return (
|
||||||
<span className="ts-status-icons">
|
<span className="ts-status-icons">
|
||||||
{client.isChannelCommander && !tree.commanderLamp && <span title={t("tree.channelCommander")}>⭐</span>}
|
{client.isChannelCommander && !tree.commanderLamp && <span title={t("tree.channelCommander")}>⭐</span>}
|
||||||
{client.away && <span title={t("tree.away")} data-pack-icon="away">💤</span>}
|
|
||||||
{!client.inputMuted && client.inputHardwareEnabled && !client.hasTalkPower && (
|
{!client.inputMuted && client.inputHardwareEnabled && !client.hasTalkPower && (
|
||||||
<span title={t("tree.noTalkPower")}>🔒</span>
|
<span title={t("tree.noTalkPower")}>🔒</span>
|
||||||
)}
|
)}
|
||||||
{client.outputMuted && <span title={t("tree.soundMuted")} data-pack-icon="soundMuted">🔕</span>}
|
|
||||||
{client.isStreaming && <span title={t("tree.streaming")}>📺</span>}
|
{client.isStreaming && <span title={t("tree.streaming")}>📺</span>}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
@@ -1413,9 +1503,15 @@ function GroupIcon({ group, images }: { group: GroupEntry; images: Record<string
|
|||||||
const base64 = group.iconId >= CUSTOM_ICON_ID_THRESHOLD ? images[`/icon_${group.iconId}`] : undefined;
|
const base64 = group.iconId >= CUSTOM_ICON_ID_THRESHOLD ? images[`/icon_${group.iconId}`] : undefined;
|
||||||
if (base64) return <img className="ts-group-icon" src={iconDataUrl(base64)} alt="" title={group.name} />;
|
if (base64) return <img className="ts-group-icon" src={iconDataUrl(base64)} alt="" title={group.name} />;
|
||||||
return (
|
return (
|
||||||
<span className="ts-group-badge" style={{ background: groupBadgeColor(group.iconId) }} title={group.name}>
|
<svg className="ts-group-badge" width="16" height="16" viewBox="0 0 16 16" role="img" aria-label={group.name}>
|
||||||
{group.name.trim().charAt(0).toUpperCase() || "?"}
|
<title>{group.name}</title>
|
||||||
</span>
|
<circle cx="6.5" cy="4.6" r="2.9" fill="#8b95a1" />
|
||||||
|
<path d="M1 14.6c0-3.3 2.4-5.6 5.5-5.6s5.5 2.3 5.5 5.6Z" fill="#8b95a1" />
|
||||||
|
<circle cx="11.6" cy="11.4" r="4.1" fill={groupBadgeColor(group.iconId)} stroke="var(--bg, #fff)" strokeWidth="0.9" />
|
||||||
|
<text x="11.6" y="13.95" textAnchor="middle" fontSize="7" fontWeight="700" fill="#fff" fontFamily="system-ui, sans-serif">
|
||||||
|
{group.name.trim().charAt(0).toUpperCase() || "?"}
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1453,6 +1549,7 @@ function ChannelTree({
|
|||||||
ownClientId,
|
ownClientId,
|
||||||
talkers,
|
talkers,
|
||||||
serverGroups,
|
serverGroups,
|
||||||
|
channelGroups = null,
|
||||||
groupIconImages,
|
groupIconImages,
|
||||||
selected,
|
selected,
|
||||||
sessionKey,
|
sessionKey,
|
||||||
@@ -1471,6 +1568,8 @@ function ChannelTree({
|
|||||||
ownClientId: number | null;
|
ownClientId: number | null;
|
||||||
talkers: Set<number>;
|
talkers: Set<number>;
|
||||||
serverGroups: GroupEntry[] | null;
|
serverGroups: GroupEntry[] | null;
|
||||||
|
/** For the channel group icon, shown after the server group icons like in the native client. */
|
||||||
|
channelGroups?: GroupEntry[] | null;
|
||||||
groupIconImages: Record<string, string>;
|
groupIconImages: Record<string, string>;
|
||||||
selected: SelectedItem | null;
|
selected: SelectedItem | null;
|
||||||
/** Identifies which multi-join tab this tree belongs to, so the manual
|
/** Identifies which multi-join tab this tree belongs to, so the manual
|
||||||
@@ -1497,12 +1596,12 @@ function ChannelTree({
|
|||||||
const children = channels.filter((c) => c.parent === parent).sort((a, b) => a.order - b.order);
|
const children = channels.filter((c) => c.parent === parent).sort((a, b) => a.order - b.order);
|
||||||
if (children.length === 0) return null;
|
if (children.length === 0) return null;
|
||||||
|
|
||||||
|
// Server group icons, then the channel group icon (the flag follows last).
|
||||||
const clientGroupBadges = (client: ClientInfo): GroupEntry[] =>
|
const clientGroupBadges = (client: ClientInfo): GroupEntry[] =>
|
||||||
serverGroups
|
[
|
||||||
? client.serverGroups
|
...(serverGroups ? client.serverGroups.map((gid) => serverGroups.find((g) => g.id === gid)) : []),
|
||||||
.map((gid) => serverGroups.find((g) => g.id === gid))
|
channelGroups?.find((g) => g.id === client.channelGroup),
|
||||||
.filter((g): g is GroupEntry => !!g && g.iconId !== 0)
|
].filter((g): g is GroupEntry => !!g && g.iconId !== 0);
|
||||||
: [];
|
|
||||||
|
|
||||||
// "Own channel" mode keeps the own channel and the channels above it open.
|
// "Own channel" mode keeps the own channel and the channels above it open.
|
||||||
const ownPath = new Set<number>();
|
const ownPath = new Set<number>();
|
||||||
@@ -1575,6 +1674,7 @@ function ChannelTree({
|
|||||||
ownClientId={ownClientId}
|
ownClientId={ownClientId}
|
||||||
talkers={talkers}
|
talkers={talkers}
|
||||||
serverGroups={serverGroups}
|
serverGroups={serverGroups}
|
||||||
|
channelGroups={channelGroups}
|
||||||
groupIconImages={groupIconImages}
|
groupIconImages={groupIconImages}
|
||||||
selected={selected}
|
selected={selected}
|
||||||
sessionKey={sessionKey}
|
sessionKey={sessionKey}
|
||||||
@@ -1754,6 +1854,8 @@ function ChannelTree({
|
|||||||
}
|
}
|
||||||
inputMuted={c.inputMuted}
|
inputMuted={c.inputMuted}
|
||||||
inputHardwareEnabled={c.inputHardwareEnabled}
|
inputHardwareEnabled={c.inputHardwareEnabled}
|
||||||
|
outputMuted={c.outputMuted}
|
||||||
|
away={c.away}
|
||||||
commander={c.isChannelCommander}
|
commander={c.isChannelCommander}
|
||||||
/>
|
/>
|
||||||
<span className="ts-client-status-leading">
|
<span className="ts-client-status-leading">
|
||||||
@@ -1765,7 +1867,6 @@ function ChannelTree({
|
|||||||
className="ts-client-avatar"
|
className="ts-client-avatar"
|
||||||
isSelf={c.id === ownClientId}
|
isSelf={c.id === ownClientId}
|
||||||
/>
|
/>
|
||||||
{tree.flags && countryFlag(c.country) && <span title={c.country}>{countryFlag(c.country)}</span>}
|
|
||||||
<span className="ts-tree-label">{c.name}</span>
|
<span className="ts-tree-label">{c.name}</span>
|
||||||
{tree.awayMessage && c.away && c.awayMessage && (
|
{tree.awayMessage && c.away && c.awayMessage && (
|
||||||
<span className="ts-client-away-message">({c.awayMessage})</span>
|
<span className="ts-client-away-message">({c.awayMessage})</span>
|
||||||
@@ -1774,6 +1875,9 @@ function ChannelTree({
|
|||||||
{clientGroupBadges(c).map((g) => (
|
{clientGroupBadges(c).map((g) => (
|
||||||
<GroupIcon key={g.id} group={g} images={groupIconImages} />
|
<GroupIcon key={g.id} group={g} images={groupIconImages} />
|
||||||
))}
|
))}
|
||||||
|
{tree.flags && countryFlag(c.country) && (
|
||||||
|
<span className="ts-flag" title={c.country}>{countryFlag(c.country)}</span>
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@@ -1970,6 +2074,8 @@ function InfoPanel({
|
|||||||
talking={false}
|
talking={false}
|
||||||
inputMuted={client.inputMuted}
|
inputMuted={client.inputMuted}
|
||||||
inputHardwareEnabled={client.inputHardwareEnabled}
|
inputHardwareEnabled={client.inputHardwareEnabled}
|
||||||
|
outputMuted={client.outputMuted}
|
||||||
|
away={client.away}
|
||||||
/>
|
/>
|
||||||
<span>{client.name}</span>
|
<span>{client.name}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -1980,7 +2086,7 @@ function InfoPanel({
|
|||||||
<div className="ts-info-row">
|
<div className="ts-info-row">
|
||||||
<span>{t("info.country")}</span>{" "}
|
<span>{t("info.country")}</span>{" "}
|
||||||
<span>
|
<span>
|
||||||
{countryFlag(client.country) ? `${countryFlag(client.country)} ` : ""}
|
{countryFlag(client.country) && <span className="ts-flag">{countryFlag(client.country)} </span>}
|
||||||
{client.country}
|
{client.country}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -2227,6 +2333,7 @@ function ConnectDialog({
|
|||||||
<input
|
<input
|
||||||
autoFocus
|
autoFocus
|
||||||
value={host}
|
value={host}
|
||||||
|
placeholder={t("connect.hostPlaceholder")}
|
||||||
disabled={SERVER_CHOICES.length === 1}
|
disabled={SERVER_CHOICES.length === 1}
|
||||||
onChange={(e) => onHostChange(e.target.value)}
|
onChange={(e) => onHostChange(e.target.value)}
|
||||||
/>
|
/>
|
||||||
@@ -4346,7 +4453,7 @@ function MoveClientDialog({
|
|||||||
}) {
|
}) {
|
||||||
const t = useT();
|
const t = useT();
|
||||||
const backdrop = useBackdropDismiss(onClose);
|
const backdrop = useBackdropDismiss(onClose);
|
||||||
const movable = [...channels].sort((a, b) => a.order - b.order);
|
const movable = channelsInTreeOrder(channels);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="ts-dialog-backdrop" {...backdrop}>
|
<div className="ts-dialog-backdrop" {...backdrop}>
|
||||||
@@ -4364,7 +4471,7 @@ function MoveClientDialog({
|
|||||||
<div className="ts-connection-info-loading">{t("moveClient.empty")}</div>
|
<div className="ts-connection-info-loading">{t("moveClient.empty")}</div>
|
||||||
) : (
|
) : (
|
||||||
<ul className="ts-group-assign-list">
|
<ul className="ts-group-assign-list">
|
||||||
{movable.map((ch) => {
|
{movable.map(({ channel: ch, depth }) => {
|
||||||
const current = ch.id === currentChannelId;
|
const current = ch.id === currentChannelId;
|
||||||
const spacer = spacerDisplayName(ch.name, ch.parent === 0);
|
const spacer = spacerDisplayName(ch.name, ch.parent === 0);
|
||||||
const label = spacer.isSpacer
|
const label = spacer.isSpacer
|
||||||
@@ -4376,6 +4483,7 @@ function MoveClientDialog({
|
|||||||
className={`ts-menu-item${current ? " ts-group-assign-current" : ""}`}
|
className={`ts-menu-item${current ? " ts-group-assign-current" : ""}`}
|
||||||
disabled={current || spacer.isSpacer}
|
disabled={current || spacer.isSpacer}
|
||||||
onClick={() => onSelect(ch.id)}
|
onClick={() => onSelect(ch.id)}
|
||||||
|
style={depth > 0 ? { paddingLeft: `${depth * 1.25}em` } : undefined}
|
||||||
>
|
>
|
||||||
<span className="ts-menu-item-icon">
|
<span className="ts-menu-item-icon">
|
||||||
{current ? "✔️" : spacer.isSpacer ? "➖" : "📁"}
|
{current ? "✔️" : spacer.isSpacer ? "➖" : "📁"}
|
||||||
@@ -5019,8 +5127,8 @@ function PermissionsEditorDialog({
|
|||||||
))}
|
))}
|
||||||
{(scope === "channel" || scope === "channelclient") && (
|
{(scope === "channel" || scope === "channelclient") && (
|
||||||
<ul className="ts-perms-editor-list">
|
<ul className="ts-perms-editor-list">
|
||||||
{channels.map((c) => (
|
{channelsInTreeOrder(channels).map(({ channel: c, depth }) => (
|
||||||
<li key={c.id}>
|
<li key={c.id} style={depth > 0 ? { paddingLeft: `${depth * 1.25}em` } : undefined}>
|
||||||
<button
|
<button
|
||||||
className={`ts-link-button${channelId === c.id ? " ts-perms-editor-selected" : ""}`}
|
className={`ts-link-button${channelId === c.id ? " ts-perms-editor-selected" : ""}`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -8847,7 +8955,7 @@ function AppInner() {
|
|||||||
const [host, setHost] = useState(
|
const [host, setHost] = useState(
|
||||||
() =>
|
() =>
|
||||||
localStorage.getItem(LAST_HOST_KEY) ??
|
localStorage.getItem(LAST_HOST_KEY) ??
|
||||||
(DEMO_MODE ? DEMO_HOST : loadDesignTheme() === "nova" ? "" : "localhost")
|
(DEMO_MODE ? DEMO_HOST : "")
|
||||||
);
|
);
|
||||||
const [nickname, setNickname] = useState(
|
const [nickname, setNickname] = useState(
|
||||||
() => localStorage.getItem(LAST_NICKNAME_KEY) ?? (DEMO_MODE ? "Guest" : "")
|
() => localStorage.getItem(LAST_NICKNAME_KEY) ?? (DEMO_MODE ? "Guest" : "")
|
||||||
@@ -9941,10 +10049,17 @@ function AppInner() {
|
|||||||
const connectFavoriteId = params.favoriteId;
|
const connectFavoriteId = params.favoriteId;
|
||||||
const connectIdentityBlob = identities.find((i) => i.id === connectIdentityId)?.blob ?? undefined;
|
const connectIdentityBlob = identities.find((i) => i.id === connectIdentityId)?.blob ?? undefined;
|
||||||
|
|
||||||
const onopen = () => {
|
const sendConnect = (extra: Record<string, unknown> = {}) => {
|
||||||
logClient("info", "Connection", `Connecting to ${connectHost}…`);
|
let turnstilePass: string | undefined;
|
||||||
|
try {
|
||||||
|
turnstilePass = localStorage.getItem(TURNSTILE_PASS_KEY) ?? undefined;
|
||||||
|
} catch {
|
||||||
|
/* storage blocked */
|
||||||
|
}
|
||||||
socket.send(
|
socket.send(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
|
...extra,
|
||||||
|
turnstilePass,
|
||||||
type: "connect",
|
type: "connect",
|
||||||
host: connectHost,
|
host: connectHost,
|
||||||
nickname: connectNickname,
|
nickname: connectNickname,
|
||||||
@@ -9959,6 +10074,10 @@ function AppInner() {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
const onopen = () => {
|
||||||
|
logClient("info", "Connection", `Connecting to ${connectHost}…`);
|
||||||
|
sendConnect();
|
||||||
|
};
|
||||||
|
|
||||||
// Downloads arrive in pieces (see the connector's TRANSFER_CHUNK_BYTES),
|
// Downloads arrive in pieces (see the connector's TRANSFER_CHUNK_BYTES),
|
||||||
// keyed by channel + path; every piece but the last is a whole number of
|
// keyed by channel + path; every piece but the last is a whole number of
|
||||||
@@ -9998,6 +10117,20 @@ function AppInner() {
|
|||||||
setTurnServers(Array.isArray(data.iceServers) ? data.iceServers : []);
|
setTurnServers(Array.isArray(data.iceServers) ? data.iceServers : []);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (data.type === "turnstileRequired") {
|
||||||
|
void getTurnstileToken().then((turnstileToken) => {
|
||||||
|
if (socket.readyState === WebSocket.OPEN) sendConnect({ turnstileToken });
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.type === "turnstilePass") {
|
||||||
|
try {
|
||||||
|
localStorage.setItem(TURNSTILE_PASS_KEY, String(data.pass));
|
||||||
|
} catch {
|
||||||
|
/* storage blocked: the check just runs again next time */
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Inactive tab: update parked snapshot only (no audio playback).
|
// Inactive tab: update parked snapshot only (no audio playback).
|
||||||
if (sessionId !== activeSessionIdRef.current) {
|
if (sessionId !== activeSessionIdRef.current) {
|
||||||
@@ -10378,7 +10511,13 @@ function AppInner() {
|
|||||||
appendLog({ text: data.message, kind: "error" });
|
appendLog({ text: data.message, kind: "error" });
|
||||||
} else {
|
} else {
|
||||||
setConnecting(false);
|
setConnecting(false);
|
||||||
setConnectError(data.code === "gateway_full" ? t("connectError.gatewayFull") : data.message);
|
setConnectError(
|
||||||
|
data.code === "gateway_full"
|
||||||
|
? t("connectError.gatewayFull")
|
||||||
|
: data.code === "turnstile_failed"
|
||||||
|
? t("connectError.botCheck")
|
||||||
|
: data.message
|
||||||
|
);
|
||||||
updateTabMeta(sessionId, { connecting: false, connected: false });
|
updateTabMeta(sessionId, { connecting: false, connected: false });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -11106,6 +11245,10 @@ function AppInner() {
|
|||||||
if (!connected || serverGroups) return;
|
if (!connected || serverGroups) return;
|
||||||
socketRef.current?.send(JSON.stringify({ type: "getServerGroupList" }));
|
socketRef.current?.send(JSON.stringify({ type: "getServerGroupList" }));
|
||||||
}, [connected, serverGroups]);
|
}, [connected, serverGroups]);
|
||||||
|
useEffect(() => {
|
||||||
|
if (!connected || channelGroups) return;
|
||||||
|
socketRef.current?.send(JSON.stringify({ type: "getChannelGroupList" }));
|
||||||
|
}, [connected, channelGroups]);
|
||||||
|
|
||||||
// Same icon-file cache as the server icons dialog (fileDownloadData for
|
// Same icon-file cache as the server icons dialog (fileDownloadData for
|
||||||
// cid 0 always lands in serverIconImages, regardless of who asked) - fetch
|
// cid 0 always lands in serverIconImages, regardless of who asked) - fetch
|
||||||
@@ -11119,13 +11262,14 @@ function AppInner() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!serverGroups) return;
|
if (!serverGroups) return;
|
||||||
const iconById = new Map(serverGroups.map((g) => [g.id, g.iconId]));
|
const iconById = new Map(serverGroups.map((g) => [g.id, g.iconId]));
|
||||||
|
const channelIconById = new Map((channelGroups ?? []).map((g) => [g.id, g.iconId]));
|
||||||
// Plus every group listed in an open group menu, so unassigned ones show their icon too.
|
// Plus every group listed in an open group menu, so unassigned ones show their icon too.
|
||||||
const menuGroups = !groupAssignTarget
|
const menuGroups = !groupAssignTarget
|
||||||
? []
|
? []
|
||||||
: ((groupAssignTarget.kind === "channel" ? channelGroups : serverGroups) ?? []);
|
: ((groupAssignTarget.kind === "channel" ? channelGroups : serverGroups) ?? []);
|
||||||
const wantedIconIds = new Set(
|
const wantedIconIds = new Set(
|
||||||
clients
|
clients
|
||||||
.flatMap((c) => c.serverGroups.map((gid) => iconById.get(gid) ?? 0))
|
.flatMap((c) => [...c.serverGroups.map((gid) => iconById.get(gid) ?? 0), channelIconById.get(c.channelGroup) ?? 0])
|
||||||
.concat(menuGroups.map((g) => g.iconId))
|
.concat(menuGroups.map((g) => g.iconId))
|
||||||
.filter((id) => id >= CUSTOM_ICON_ID_THRESHOLD)
|
.filter((id) => id >= CUSTOM_ICON_ID_THRESHOLD)
|
||||||
);
|
);
|
||||||
@@ -12585,7 +12729,8 @@ function AppInner() {
|
|||||||
reason: banReason,
|
reason: banReason,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
logClient("info", "Moderation", `Banned ${banTarget.name}`);
|
// Only a request: the server may still refuse it (an error event follows then).
|
||||||
|
logClient("info", "Moderation", `Ban requested for ${banTarget.name}`);
|
||||||
setBanTarget(null);
|
setBanTarget(null);
|
||||||
setBanReason("");
|
setBanReason("");
|
||||||
setBanSeconds("0");
|
setBanSeconds("0");
|
||||||
@@ -13361,8 +13506,12 @@ function AppInner() {
|
|||||||
{whisperMenuOpen && (
|
{whisperMenuOpen && (
|
||||||
<div className="ts-menu ts-menu-away" ref={focusFirstItem} onKeyDown={handleMenuKeyDown}>
|
<div className="ts-menu ts-menu-away" ref={focusFirstItem} onKeyDown={handleMenuKeyDown}>
|
||||||
<div className="ts-context-menu-title">{t("whisper.channels")}</div>
|
<div className="ts-context-menu-title">{t("whisper.channels")}</div>
|
||||||
{channels.map((ch) => (
|
{channelsInTreeOrder(channels).map(({ channel: ch, depth }) => (
|
||||||
<label key={ch.id} className="ts-menu-item">
|
<label
|
||||||
|
key={ch.id}
|
||||||
|
className="ts-menu-item"
|
||||||
|
style={depth > 0 ? { paddingLeft: `${depth * 1.25}em` } : undefined}
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={whisperChannelIds.has(ch.id)}
|
checked={whisperChannelIds.has(ch.id)}
|
||||||
@@ -14572,6 +14721,7 @@ function AppInner() {
|
|||||||
ownClientId={ownClientId ?? ownClient?.id ?? null}
|
ownClientId={ownClientId ?? ownClient?.id ?? null}
|
||||||
talkers={displayTalkers}
|
talkers={displayTalkers}
|
||||||
serverGroups={serverGroups}
|
serverGroups={serverGroups}
|
||||||
|
channelGroups={channelGroups}
|
||||||
groupIconImages={serverIconImages}
|
groupIconImages={serverIconImages}
|
||||||
selected={selected}
|
selected={selected}
|
||||||
sessionKey={activeSessionId ?? ""}
|
sessionKey={activeSessionId ?? ""}
|
||||||
@@ -14584,7 +14734,28 @@ function AppInner() {
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div className="ts-tree-empty">{t("tree.notConnected")}</div>
|
<div className="ts-tree-empty">
|
||||||
|
{connecting ? (
|
||||||
|
<>
|
||||||
|
<span className="ts-spinner" aria-hidden="true" /> {t("tree.connectingTo", { host })}
|
||||||
|
<button onClick={handleDisconnect}>{t("connect.cancel")}</button>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{t("tree.notConnected")}
|
||||||
|
{!mobile && (
|
||||||
|
<button className="ts-mobile-connect-btn" onClick={() => setConnectDialogOpen(true)}>
|
||||||
|
{t("menu.connections.connect")}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{!DEMO_MODE && (
|
||||||
|
<a className="ts-tree-empty-demo" href="https://demo.webspeak3.de" target="_blank" rel="noreferrer">
|
||||||
|
{t("tree.tryDemo")}
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1,49 @@
|
|||||||
|
/** Minimal shape needed to lay channels out like the channel tree. */
|
||||||
|
export interface OrderedChannelLike {
|
||||||
|
id: number;
|
||||||
|
parent: number;
|
||||||
|
/** Position among the siblings of the same parent (not a global index). */
|
||||||
|
order: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flattens channels in channel-tree order: each parent is followed by its
|
||||||
|
* subchannels (recursively), siblings sorted by `order`. `order` is only
|
||||||
|
* meaningful between siblings, so a flat sort by it interleaves the levels.
|
||||||
|
* Channels whose parent is missing are appended at the end as roots.
|
||||||
|
*/
|
||||||
|
export function channelsInTreeOrder<T extends OrderedChannelLike>(
|
||||||
|
channels: readonly T[],
|
||||||
|
): { channel: T; depth: number }[] {
|
||||||
|
const byParent = new Map<number, T[]>();
|
||||||
|
for (const ch of channels) {
|
||||||
|
const list = byParent.get(ch.parent);
|
||||||
|
if (list) list.push(ch);
|
||||||
|
else byParent.set(ch.parent, [ch]);
|
||||||
|
}
|
||||||
|
for (const list of byParent.values()) list.sort((a, b) => a.order - b.order || a.id - b.id);
|
||||||
|
|
||||||
|
const out: { channel: T; depth: number }[] = [];
|
||||||
|
const seen = new Set<number>();
|
||||||
|
const walk = (parent: number, depth: number) => {
|
||||||
|
for (const ch of byParent.get(parent) ?? []) {
|
||||||
|
if (seen.has(ch.id)) continue;
|
||||||
|
seen.add(ch.id);
|
||||||
|
out.push({ channel: ch, depth });
|
||||||
|
walk(ch.id, depth + 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
walk(0, 0);
|
||||||
|
// Orphans (parent not in the list) and anything in a parent cycle.
|
||||||
|
for (const ch of channels) {
|
||||||
|
if (seen.has(ch.id)) continue;
|
||||||
|
const orphanParent = ch.parent;
|
||||||
|
for (const sibling of byParent.get(orphanParent) ?? []) {
|
||||||
|
if (seen.has(sibling.id)) continue;
|
||||||
|
seen.add(sibling.id);
|
||||||
|
out.push({ channel: sibling, depth: 0 });
|
||||||
|
walk(sibling.id, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
@@ -112,6 +112,7 @@
|
|||||||
"connect.title": "Připojit",
|
"connect.title": "Připojit",
|
||||||
"connect.novaSubtitle": "WebSpeak3 běží celý v prohlížeči — není potřeba nic stahovat",
|
"connect.novaSubtitle": "WebSpeak3 běží celý v prohlížeči — není potřeba nic stahovat",
|
||||||
"connect.serverAddress": "Přezdívka nebo adresa serveru:",
|
"connect.serverAddress": "Přezdívka nebo adresa serveru:",
|
||||||
|
"connect.hostPlaceholder": "např. ts.example.com:9987",
|
||||||
"connect.serverPassword": "Heslo serveru:",
|
"connect.serverPassword": "Heslo serveru:",
|
||||||
"connect.nickname": "Přezdívka:",
|
"connect.nickname": "Přezdívka:",
|
||||||
"connect.phoneticNickname": "Fonetická přezdívka:",
|
"connect.phoneticNickname": "Fonetická přezdívka:",
|
||||||
@@ -476,6 +477,8 @@
|
|||||||
"tree.search": "Hledat kanály a uživatele",
|
"tree.search": "Hledat kanály a uživatele",
|
||||||
"tree.label": "Kanály",
|
"tree.label": "Kanály",
|
||||||
"tree.notConnected": "Nepřipojeno",
|
"tree.notConnected": "Nepřipojeno",
|
||||||
|
"tree.connectingTo": "Připojování k {host}…",
|
||||||
|
"tree.tryDemo": "Nemáte server? Vyzkoušejte demo",
|
||||||
"tree.clickToSelect": "Kliknutím vyberete, dvojklikem se připojíte",
|
"tree.clickToSelect": "Kliknutím vyberete, dvojklikem se připojíte",
|
||||||
"tree.clickToJoin": "Dvojklikem se připojíte",
|
"tree.clickToJoin": "Dvojklikem se připojíte",
|
||||||
"tree.joinNotConnected": "Nepřipojeno — nelze přepnout kanál",
|
"tree.joinNotConnected": "Nepřipojeno — nelze přepnout kanál",
|
||||||
@@ -718,6 +721,7 @@
|
|||||||
"serverContext.disconnect": "Odpojit",
|
"serverContext.disconnect": "Odpojit",
|
||||||
"connectError.dismiss": "Zavřít",
|
"connectError.dismiss": "Zavřít",
|
||||||
"connectError.gatewayFull": "Brána je právě plná. Zkus to za pár minut znovu – nebo si WebSpeak3 hostuj sám: github.com/WebSpeak3/webspeak3",
|
"connectError.gatewayFull": "Brána je právě plná. Zkus to za pár minut znovu – nebo si WebSpeak3 hostuj sám: github.com/WebSpeak3/webspeak3",
|
||||||
|
"connectError.botCheck": "Kontrola proti botům selhala. Obnov stránku a zkus to znovu. Blokátory reklam nebo skriptů mohou kontrole bránit.",
|
||||||
"dialog.close": "Zavřít",
|
"dialog.close": "Zavřít",
|
||||||
"sounds.title": "Zvuky",
|
"sounds.title": "Zvuky",
|
||||||
"sounds.subtitle": "Nastavit zvuková upozornění na události",
|
"sounds.subtitle": "Nastavit zvuková upozornění na události",
|
||||||
|
|||||||
@@ -112,6 +112,7 @@
|
|||||||
"connect.title": "Verbinden",
|
"connect.title": "Verbinden",
|
||||||
"connect.novaSubtitle": "WebSpeak3 läuft komplett im Browser — kein Download nötig",
|
"connect.novaSubtitle": "WebSpeak3 läuft komplett im Browser — kein Download nötig",
|
||||||
"connect.serverAddress": "Server Nickname oder Adresse:",
|
"connect.serverAddress": "Server Nickname oder Adresse:",
|
||||||
|
"connect.hostPlaceholder": "z. B. ts.beispiel.de:9987",
|
||||||
"connect.serverPassword": "Server Passwort:",
|
"connect.serverPassword": "Server Passwort:",
|
||||||
"connect.nickname": "Nickname:",
|
"connect.nickname": "Nickname:",
|
||||||
"connect.phoneticNickname": "Phonetischer Nickname:",
|
"connect.phoneticNickname": "Phonetischer Nickname:",
|
||||||
@@ -476,6 +477,8 @@
|
|||||||
"tree.search": "Kanäle und Nutzer suchen",
|
"tree.search": "Kanäle und Nutzer suchen",
|
||||||
"tree.label": "Kanäle",
|
"tree.label": "Kanäle",
|
||||||
"tree.notConnected": "Nicht verbunden",
|
"tree.notConnected": "Nicht verbunden",
|
||||||
|
"tree.connectingTo": "Verbinde mit {host}…",
|
||||||
|
"tree.tryDemo": "Kein Server? Probier die Demo",
|
||||||
"tree.clickToSelect": "Klicken zum Auswählen, Doppelklick zum Beitreten",
|
"tree.clickToSelect": "Klicken zum Auswählen, Doppelklick zum Beitreten",
|
||||||
"tree.clickToJoin": "Doppelklick zum Beitreten",
|
"tree.clickToJoin": "Doppelklick zum Beitreten",
|
||||||
"tree.joinNotConnected": "Nicht verbunden — Channel-Wechsel nicht möglich",
|
"tree.joinNotConnected": "Nicht verbunden — Channel-Wechsel nicht möglich",
|
||||||
@@ -718,6 +721,7 @@
|
|||||||
"serverContext.disconnect": "Verbindung trennen",
|
"serverContext.disconnect": "Verbindung trennen",
|
||||||
"connectError.dismiss": "Schließen",
|
"connectError.dismiss": "Schließen",
|
||||||
"connectError.gatewayFull": "Das Gateway ist gerade voll. Versuch es in ein paar Minuten nochmal – oder hoste WebSpeak3 selbst: github.com/WebSpeak3/webspeak3",
|
"connectError.gatewayFull": "Das Gateway ist gerade voll. Versuch es in ein paar Minuten nochmal – oder hoste WebSpeak3 selbst: github.com/WebSpeak3/webspeak3",
|
||||||
|
"connectError.botCheck": "Bot-Prüfung fehlgeschlagen. Bitte lade die Seite neu und versuch es noch mal. Werbe- oder Skriptblocker können die Prüfung stören.",
|
||||||
"dialog.close": "Schließen",
|
"dialog.close": "Schließen",
|
||||||
"sounds.title": "Sounds",
|
"sounds.title": "Sounds",
|
||||||
"sounds.subtitle": "Sound-Benachrichtigungen für Ereignisse festlegen",
|
"sounds.subtitle": "Sound-Benachrichtigungen für Ereignisse festlegen",
|
||||||
|
|||||||
@@ -112,6 +112,7 @@
|
|||||||
"connect.title": "Connect",
|
"connect.title": "Connect",
|
||||||
"connect.novaSubtitle": "WebSpeak3 runs entirely in the browser — no download needed",
|
"connect.novaSubtitle": "WebSpeak3 runs entirely in the browser — no download needed",
|
||||||
"connect.serverAddress": "Server nickname or address:",
|
"connect.serverAddress": "Server nickname or address:",
|
||||||
|
"connect.hostPlaceholder": "e.g. ts.example.com:9987",
|
||||||
"connect.serverPassword": "Server password:",
|
"connect.serverPassword": "Server password:",
|
||||||
"connect.nickname": "Nickname:",
|
"connect.nickname": "Nickname:",
|
||||||
"connect.phoneticNickname": "Phonetic nickname:",
|
"connect.phoneticNickname": "Phonetic nickname:",
|
||||||
@@ -476,6 +477,8 @@
|
|||||||
"tree.search": "Search channels and users",
|
"tree.search": "Search channels and users",
|
||||||
"tree.label": "Channels",
|
"tree.label": "Channels",
|
||||||
"tree.notConnected": "Not connected",
|
"tree.notConnected": "Not connected",
|
||||||
|
"tree.connectingTo": "Connecting to {host}…",
|
||||||
|
"tree.tryDemo": "No server? Try the demo",
|
||||||
"tree.clickToSelect": "Click to select, double-click to join",
|
"tree.clickToSelect": "Click to select, double-click to join",
|
||||||
"tree.clickToJoin": "Double-click to join",
|
"tree.clickToJoin": "Double-click to join",
|
||||||
"tree.joinNotConnected": "Not connected — cannot switch channel",
|
"tree.joinNotConnected": "Not connected — cannot switch channel",
|
||||||
@@ -718,6 +721,7 @@
|
|||||||
"serverContext.disconnect": "Disconnect",
|
"serverContext.disconnect": "Disconnect",
|
||||||
"connectError.dismiss": "Dismiss",
|
"connectError.dismiss": "Dismiss",
|
||||||
"connectError.gatewayFull": "The gateway is full right now. Try again in a few minutes – or host WebSpeak3 yourself: github.com/WebSpeak3/webspeak3",
|
"connectError.gatewayFull": "The gateway is full right now. Try again in a few minutes – or host WebSpeak3 yourself: github.com/WebSpeak3/webspeak3",
|
||||||
|
"connectError.botCheck": "Bot check failed. Please reload the page and try again. Ad or script blockers can get in the way of the check.",
|
||||||
"dialog.close": "Close",
|
"dialog.close": "Close",
|
||||||
"sounds.title": "Sounds",
|
"sounds.title": "Sounds",
|
||||||
"sounds.subtitle": "Configure sound notifications for events",
|
"sounds.subtitle": "Configure sound notifications for events",
|
||||||
|
|||||||
@@ -112,6 +112,7 @@
|
|||||||
"connect.title": "اتصال",
|
"connect.title": "اتصال",
|
||||||
"connect.novaSubtitle": "WebSpeak3 بهطور کامل در مرورگر اجرا میشود — بدون نیاز به دانلود",
|
"connect.novaSubtitle": "WebSpeak3 بهطور کامل در مرورگر اجرا میشود — بدون نیاز به دانلود",
|
||||||
"connect.serverAddress": "نام مستعار یا آدرس سرور:",
|
"connect.serverAddress": "نام مستعار یا آدرس سرور:",
|
||||||
|
"connect.hostPlaceholder": "مثلاً ts.example.com:9987",
|
||||||
"connect.serverPassword": "رمز عبور سرور:",
|
"connect.serverPassword": "رمز عبور سرور:",
|
||||||
"connect.nickname": "نام مستعار:",
|
"connect.nickname": "نام مستعار:",
|
||||||
"connect.phoneticNickname": "تلفظ نام مستعار:",
|
"connect.phoneticNickname": "تلفظ نام مستعار:",
|
||||||
@@ -475,6 +476,8 @@
|
|||||||
"tree.search": "جستجوی کانالها و کاربران",
|
"tree.search": "جستجوی کانالها و کاربران",
|
||||||
"tree.label": "کانالها",
|
"tree.label": "کانالها",
|
||||||
"tree.notConnected": "متصل نیست",
|
"tree.notConnected": "متصل نیست",
|
||||||
|
"tree.connectingTo": "در حال اتصال به {host}…",
|
||||||
|
"tree.tryDemo": "سروری ندارید؟ دمو را امتحان کنید",
|
||||||
"tree.clickToSelect": "برای انتخاب کلیک کن، برای ورود دوبار کلیک کن",
|
"tree.clickToSelect": "برای انتخاب کلیک کن، برای ورود دوبار کلیک کن",
|
||||||
"tree.clickToJoin": "برای ورود دوبار کلیک کن",
|
"tree.clickToJoin": "برای ورود دوبار کلیک کن",
|
||||||
"tree.joinNotConnected": "متصل نیست — نمیتوان کانال را تغییر داد",
|
"tree.joinNotConnected": "متصل نیست — نمیتوان کانال را تغییر داد",
|
||||||
@@ -717,6 +720,7 @@
|
|||||||
"serverContext.disconnect": "قطع اتصال",
|
"serverContext.disconnect": "قطع اتصال",
|
||||||
"connectError.dismiss": "رد کردن",
|
"connectError.dismiss": "رد کردن",
|
||||||
"connectError.gatewayFull": "گیتوی در حال حاضر پر است. چند دقیقه دیگر دوباره امتحان کنید – یا WebSpeak3 را خودتان میزبانی کنید: github.com/WebSpeak3/webspeak3",
|
"connectError.gatewayFull": "گیتوی در حال حاضر پر است. چند دقیقه دیگر دوباره امتحان کنید – یا WebSpeak3 را خودتان میزبانی کنید: github.com/WebSpeak3/webspeak3",
|
||||||
|
"connectError.botCheck": "بررسی ضد ربات ناموفق بود. لطفاً صفحه را دوباره بارگذاری کنید و دوباره امتحان کنید. مسدودکنندههای تبلیغات یا اسکریپت ممکن است مانع بررسی شوند.",
|
||||||
"dialog.close": "بستن",
|
"dialog.close": "بستن",
|
||||||
"sounds.title": "صداها",
|
"sounds.title": "صداها",
|
||||||
"sounds.subtitle": "پیکربندی اعلانهای صوتی برای رویدادها",
|
"sounds.subtitle": "پیکربندی اعلانهای صوتی برای رویدادها",
|
||||||
|
|||||||
@@ -112,6 +112,7 @@
|
|||||||
"connect.title": "Подключение",
|
"connect.title": "Подключение",
|
||||||
"connect.novaSubtitle": "WebSpeak3 работает полностью в браузере — ничего скачивать не нужно",
|
"connect.novaSubtitle": "WebSpeak3 работает полностью в браузере — ничего скачивать не нужно",
|
||||||
"connect.serverAddress": "Имя или адрес сервера:",
|
"connect.serverAddress": "Имя или адрес сервера:",
|
||||||
|
"connect.hostPlaceholder": "например, ts.example.com:9987",
|
||||||
"connect.serverPassword": "Пароль сервера:",
|
"connect.serverPassword": "Пароль сервера:",
|
||||||
"connect.nickname": "Никнейм:",
|
"connect.nickname": "Никнейм:",
|
||||||
"connect.phoneticNickname": "Фонетический никнейм:",
|
"connect.phoneticNickname": "Фонетический никнейм:",
|
||||||
@@ -476,6 +477,8 @@
|
|||||||
"tree.search": "Поиск каналов и пользователей",
|
"tree.search": "Поиск каналов и пользователей",
|
||||||
"tree.label": "Каналы",
|
"tree.label": "Каналы",
|
||||||
"tree.notConnected": "Нет подключения",
|
"tree.notConnected": "Нет подключения",
|
||||||
|
"tree.connectingTo": "Подключение к {host}…",
|
||||||
|
"tree.tryDemo": "Нет сервера? Попробуйте демо",
|
||||||
"tree.clickToSelect": "Щелчок – выбрать, двойной щелчок – войти",
|
"tree.clickToSelect": "Щелчок – выбрать, двойной щелчок – войти",
|
||||||
"tree.clickToJoin": "Двойной щелчок – войти",
|
"tree.clickToJoin": "Двойной щелчок – войти",
|
||||||
"tree.joinNotConnected": "Нет подключения — нельзя сменить канал",
|
"tree.joinNotConnected": "Нет подключения — нельзя сменить канал",
|
||||||
@@ -718,6 +721,7 @@
|
|||||||
"serverContext.disconnect": "Отключиться",
|
"serverContext.disconnect": "Отключиться",
|
||||||
"connectError.dismiss": "Закрыть",
|
"connectError.dismiss": "Закрыть",
|
||||||
"connectError.gatewayFull": "Шлюз сейчас переполнен. Попробуйте через несколько минут – или разверните WebSpeak3 у себя: github.com/WebSpeak3/webspeak3",
|
"connectError.gatewayFull": "Шлюз сейчас переполнен. Попробуйте через несколько минут – или разверните WebSpeak3 у себя: github.com/WebSpeak3/webspeak3",
|
||||||
|
"connectError.botCheck": "Проверка на бота не пройдена. Обновите страницу и попробуйте снова. Блокировщики рекламы или скриптов могут мешать проверке.",
|
||||||
"dialog.close": "Закрыть",
|
"dialog.close": "Закрыть",
|
||||||
"sounds.title": "Звуки",
|
"sounds.title": "Звуки",
|
||||||
"sounds.subtitle": "Настройка звуковых уведомлений о событиях",
|
"sounds.subtitle": "Настройка звуковых уведомлений о событиях",
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
"away.setGlobalStatus": "设置全局离开状态",
|
"away.setGlobalStatus": "设置全局离开状态",
|
||||||
"connect.title": "连接",
|
"connect.title": "连接",
|
||||||
"connect.serverAddress": "服务器昵称或地址:",
|
"connect.serverAddress": "服务器昵称或地址:",
|
||||||
|
"connect.hostPlaceholder": "例如 ts.example.com:9987",
|
||||||
"connect.serverPassword": "服务器密码:",
|
"connect.serverPassword": "服务器密码:",
|
||||||
"connect.nickname": "昵称:",
|
"connect.nickname": "昵称:",
|
||||||
"connect.phoneticNickname": "昵称读音:",
|
"connect.phoneticNickname": "昵称读音:",
|
||||||
@@ -368,6 +369,8 @@
|
|||||||
"tree.search": "搜索频道和用户",
|
"tree.search": "搜索频道和用户",
|
||||||
"tree.label": "频道",
|
"tree.label": "频道",
|
||||||
"tree.notConnected": "未连接",
|
"tree.notConnected": "未连接",
|
||||||
|
"tree.connectingTo": "正在连接到 {host}…",
|
||||||
|
"tree.tryDemo": "没有服务器?试试演示版",
|
||||||
"tree.clickToSelect": "单击选择,双击加入",
|
"tree.clickToSelect": "单击选择,双击加入",
|
||||||
"tree.clickToJoin": "双击加入",
|
"tree.clickToJoin": "双击加入",
|
||||||
"tree.joinNotConnected": "未连接 — 无法切换频道",
|
"tree.joinNotConnected": "未连接 — 无法切换频道",
|
||||||
@@ -559,6 +562,7 @@
|
|||||||
"serverContext.disconnect": "断开连接",
|
"serverContext.disconnect": "断开连接",
|
||||||
"connectError.dismiss": "关闭",
|
"connectError.dismiss": "关闭",
|
||||||
"connectError.gatewayFull": "网关当前已满。请几分钟后再试,或自行部署 WebSpeak3:github.com/WebSpeak3/webspeak3",
|
"connectError.gatewayFull": "网关当前已满。请几分钟后再试,或自行部署 WebSpeak3:github.com/WebSpeak3/webspeak3",
|
||||||
|
"connectError.botCheck": "人机验证失败。请刷新页面后重试。广告或脚本拦截器可能会干扰验证。",
|
||||||
"dialog.close": "关闭",
|
"dialog.close": "关闭",
|
||||||
"sounds.title": "声音",
|
"sounds.title": "声音",
|
||||||
"sounds.subtitle": "配置事件提示音",
|
"sounds.subtitle": "配置事件提示音",
|
||||||
|
|||||||
Reference in new issue
Block a user