mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
web: friendlier first screen for people without a server
- Connect dialog no longer prefills "localhost" (always rejected on the public gateway); empty field with an example placeholder instead. - Empty channel tree on desktop gets a Connect button and, outside the demo, a "No server? Try the demo" link. - While a connection is being set up the tree shows a spinner, "Connecting to <host>…" and a Cancel button instead of "Not connected". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
4afab66d6b
commit
e96eb62d90
8 files changed
+75
-2
No files matched your search
@@ -2042,6 +2042,38 @@
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.ts-tree-empty > button,
|
||||
.ts-tree-empty > a {
|
||||
display: block;
|
||||
margin-top: 0.75rem;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.ts-tree-empty > .ts-mobile-connect-btn {
|
||||
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 {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
@@ -5426,6 +5458,7 @@ input.ts-identities-uid {
|
||||
.ts-app.ts-mobile .ts-tree-panel > .ts-tree-empty:only-child {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-style: normal;
|
||||
|
||||
+24
-2
@@ -2332,6 +2332,7 @@ function ConnectDialog({
|
||||
<input
|
||||
autoFocus
|
||||
value={host}
|
||||
placeholder={t("connect.hostPlaceholder")}
|
||||
disabled={SERVER_CHOICES.length === 1}
|
||||
onChange={(e) => onHostChange(e.target.value)}
|
||||
/>
|
||||
@@ -8952,7 +8953,7 @@ function AppInner() {
|
||||
const [host, setHost] = useState(
|
||||
() =>
|
||||
localStorage.getItem(LAST_HOST_KEY) ??
|
||||
(DEMO_MODE ? DEMO_HOST : loadDesignTheme() === "nova" ? "" : "localhost")
|
||||
(DEMO_MODE ? DEMO_HOST : "")
|
||||
);
|
||||
const [nickname, setNickname] = useState(
|
||||
() => localStorage.getItem(LAST_NICKNAME_KEY) ?? (DEMO_MODE ? "Guest" : "")
|
||||
@@ -14726,7 +14727,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>
|
||||
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
"connect.title": "Připojit",
|
||||
"connect.novaSubtitle": "WebSpeak3 běží celý v prohlížeči — není potřeba nic stahovat",
|
||||
"connect.serverAddress": "Přezdívka nebo adresa serveru:",
|
||||
"connect.hostPlaceholder": "např. ts.example.com:9987",
|
||||
"connect.serverPassword": "Heslo serveru:",
|
||||
"connect.nickname": "Přezdívka:",
|
||||
"connect.phoneticNickname": "Fonetická přezdívka:",
|
||||
@@ -476,6 +477,8 @@
|
||||
"tree.search": "Hledat kanály a uživatele",
|
||||
"tree.label": "Kanály",
|
||||
"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.clickToJoin": "Dvojklikem se připojíte",
|
||||
"tree.joinNotConnected": "Nepřipojeno — nelze přepnout kanál",
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
"connect.title": "Verbinden",
|
||||
"connect.novaSubtitle": "WebSpeak3 läuft komplett im Browser — kein Download nötig",
|
||||
"connect.serverAddress": "Server Nickname oder Adresse:",
|
||||
"connect.hostPlaceholder": "z. B. ts.beispiel.de:9987",
|
||||
"connect.serverPassword": "Server Passwort:",
|
||||
"connect.nickname": "Nickname:",
|
||||
"connect.phoneticNickname": "Phonetischer Nickname:",
|
||||
@@ -476,6 +477,8 @@
|
||||
"tree.search": "Kanäle und Nutzer suchen",
|
||||
"tree.label": "Kanäle",
|
||||
"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.clickToJoin": "Doppelklick zum Beitreten",
|
||||
"tree.joinNotConnected": "Nicht verbunden — Channel-Wechsel nicht möglich",
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
"connect.title": "Connect",
|
||||
"connect.novaSubtitle": "WebSpeak3 runs entirely in the browser — no download needed",
|
||||
"connect.serverAddress": "Server nickname or address:",
|
||||
"connect.hostPlaceholder": "e.g. ts.example.com:9987",
|
||||
"connect.serverPassword": "Server password:",
|
||||
"connect.nickname": "Nickname:",
|
||||
"connect.phoneticNickname": "Phonetic nickname:",
|
||||
@@ -476,6 +477,8 @@
|
||||
"tree.search": "Search channels and users",
|
||||
"tree.label": "Channels",
|
||||
"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.clickToJoin": "Double-click to join",
|
||||
"tree.joinNotConnected": "Not connected — cannot switch channel",
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
"connect.title": "اتصال",
|
||||
"connect.novaSubtitle": "WebSpeak3 بهطور کامل در مرورگر اجرا میشود — بدون نیاز به دانلود",
|
||||
"connect.serverAddress": "نام مستعار یا آدرس سرور:",
|
||||
"connect.hostPlaceholder": "مثلاً ts.example.com:9987",
|
||||
"connect.serverPassword": "رمز عبور سرور:",
|
||||
"connect.nickname": "نام مستعار:",
|
||||
"connect.phoneticNickname": "تلفظ نام مستعار:",
|
||||
@@ -475,6 +476,8 @@
|
||||
"tree.search": "جستجوی کانالها و کاربران",
|
||||
"tree.label": "کانالها",
|
||||
"tree.notConnected": "متصل نیست",
|
||||
"tree.connectingTo": "در حال اتصال به {host}…",
|
||||
"tree.tryDemo": "سروری ندارید؟ دمو را امتحان کنید",
|
||||
"tree.clickToSelect": "برای انتخاب کلیک کن، برای ورود دوبار کلیک کن",
|
||||
"tree.clickToJoin": "برای ورود دوبار کلیک کن",
|
||||
"tree.joinNotConnected": "متصل نیست — نمیتوان کانال را تغییر داد",
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
"connect.title": "Подключение",
|
||||
"connect.novaSubtitle": "WebSpeak3 работает полностью в браузере — ничего скачивать не нужно",
|
||||
"connect.serverAddress": "Имя или адрес сервера:",
|
||||
"connect.hostPlaceholder": "например, ts.example.com:9987",
|
||||
"connect.serverPassword": "Пароль сервера:",
|
||||
"connect.nickname": "Никнейм:",
|
||||
"connect.phoneticNickname": "Фонетический никнейм:",
|
||||
@@ -476,6 +477,8 @@
|
||||
"tree.search": "Поиск каналов и пользователей",
|
||||
"tree.label": "Каналы",
|
||||
"tree.notConnected": "Нет подключения",
|
||||
"tree.connectingTo": "Подключение к {host}…",
|
||||
"tree.tryDemo": "Нет сервера? Попробуйте демо",
|
||||
"tree.clickToSelect": "Щелчок – выбрать, двойной щелчок – войти",
|
||||
"tree.clickToJoin": "Двойной щелчок – войти",
|
||||
"tree.joinNotConnected": "Нет подключения — нельзя сменить канал",
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
"away.setGlobalStatus": "设置全局离开状态",
|
||||
"connect.title": "连接",
|
||||
"connect.serverAddress": "服务器昵称或地址:",
|
||||
"connect.hostPlaceholder": "例如 ts.example.com:9987",
|
||||
"connect.serverPassword": "服务器密码:",
|
||||
"connect.nickname": "昵称:",
|
||||
"connect.phoneticNickname": "昵称读音:",
|
||||
@@ -368,6 +369,8 @@
|
||||
"tree.search": "搜索频道和用户",
|
||||
"tree.label": "频道",
|
||||
"tree.notConnected": "未连接",
|
||||
"tree.connectingTo": "正在连接到 {host}…",
|
||||
"tree.tryDemo": "没有服务器?试试演示版",
|
||||
"tree.clickToSelect": "单击选择,双击加入",
|
||||
"tree.clickToJoin": "双击加入",
|
||||
"tree.joinNotConnected": "未连接 — 无法切换频道",
|
||||
|
||||
Reference in new issue
Block a user