mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-03 01:42:50 +08:00
Add Options dialog with the real client's settings sidebar
Opens via Extras -> Optionen. Sidebar navigation matches the real TS3 client (Anwendung/myTeamSpeak/Wiedergabe/.../Meldungen) and switches the content panel, but the settings themselves are still placeholders - none of the actual options are wired up yet. Local-only for now, not deployed.
This commit is contained in:
1 parent
a2863520a5
commit
e5c5cc3f80
2 files changed
+145
-1
No files matched your search
@@ -783,6 +783,70 @@
|
|||||||
gap: 0.6rem;
|
gap: 0.6rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ts-options-dialog {
|
||||||
|
width: 640px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-options-body {
|
||||||
|
display: flex;
|
||||||
|
height: 420px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-options-sidebar {
|
||||||
|
width: 200px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
border-right: 1px solid var(--border-soft);
|
||||||
|
padding: 0.5rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.15rem;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-options-sidebar-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
padding: 0.4rem 0.5rem;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: left;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
color: var(--text);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-options-sidebar-item:hover {
|
||||||
|
background: var(--row-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-options-sidebar-item-active {
|
||||||
|
background: var(--row-hover);
|
||||||
|
outline: 1px solid var(--border);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-options-sidebar-icon {
|
||||||
|
width: 1.2em;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-options-content {
|
||||||
|
flex: 1;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-options-content h3 {
|
||||||
|
margin: 0 0 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ts-options-placeholder {
|
||||||
|
font-size: 12px;
|
||||||
|
font-style: italic;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
.ts-dialog-titlebar {
|
.ts-dialog-titlebar {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
+81
-1
@@ -735,6 +735,70 @@ function AwayDialog({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const OPTIONS_SECTIONS = [
|
||||||
|
{ id: "anwendung", icon: "🎧", label: "Anwendung" },
|
||||||
|
{ id: "myteamspeak", icon: "👤", label: "myTeamSpeak" },
|
||||||
|
{ id: "wiedergabe", icon: "🔊", label: "Wiedergabe" },
|
||||||
|
{ id: "aufnahme", icon: "🎙️", label: "Aufnahme" },
|
||||||
|
{ id: "design", icon: "🖌️", label: "Design" },
|
||||||
|
{ id: "erweiterungen", icon: "🧩", label: "Erweiterungen" },
|
||||||
|
{ id: "hotkeys", icon: "⌨️", label: "Hotkeys" },
|
||||||
|
{ id: "whispern", icon: "🤫", label: "Whispern" },
|
||||||
|
{ id: "downloads", icon: "⬇️", label: "Downloads" },
|
||||||
|
{ id: "chat", icon: "💬", label: "Chat" },
|
||||||
|
{ id: "sicherheit", icon: "🛡️", label: "Sicherheit" },
|
||||||
|
{ id: "nachrichten", icon: "🔤", label: "Nachrichten" },
|
||||||
|
{ id: "meldungen", icon: "ℹ️", label: "Meldungen" },
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
function OptionsDialog({
|
||||||
|
section,
|
||||||
|
onSectionChange,
|
||||||
|
onClose,
|
||||||
|
}: {
|
||||||
|
section: string;
|
||||||
|
onSectionChange: (id: string) => void;
|
||||||
|
onClose: () => void;
|
||||||
|
}) {
|
||||||
|
const active = OPTIONS_SECTIONS.find((s) => s.id === section) ?? OPTIONS_SECTIONS[0];
|
||||||
|
return (
|
||||||
|
<div className="ts-dialog-backdrop" onClick={onClose}>
|
||||||
|
<div className="ts-dialog ts-options-dialog" onClick={(e) => e.stopPropagation()}>
|
||||||
|
<div className="ts-dialog-titlebar">
|
||||||
|
<span>Optionen</span>
|
||||||
|
<button onClick={onClose} title="Close">
|
||||||
|
✕
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="ts-options-body">
|
||||||
|
<div className="ts-options-sidebar">
|
||||||
|
{OPTIONS_SECTIONS.map((s) => (
|
||||||
|
<button
|
||||||
|
key={s.id}
|
||||||
|
className={`ts-options-sidebar-item${s.id === active.id ? " ts-options-sidebar-item-active" : ""}`}
|
||||||
|
onClick={() => onSectionChange(s.id)}
|
||||||
|
>
|
||||||
|
<span className="ts-options-sidebar-icon">{s.icon}</span>
|
||||||
|
<span>{s.label}</span>
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<div className="ts-options-content">
|
||||||
|
<h3>{active.label}</h3>
|
||||||
|
<p className="ts-options-placeholder">Diese Einstellungen sind noch nicht implementiert.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="ts-dialog-buttons">
|
||||||
|
<div className="ts-dialog-buttons-right">
|
||||||
|
<button onClick={onClose}>OK</button>
|
||||||
|
<button onClick={onClose}>Abbrechen</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const [host, setHost] = useState(() => localStorage.getItem(LAST_HOST_KEY) ?? "localhost");
|
const [host, setHost] = useState(() => localStorage.getItem(LAST_HOST_KEY) ?? "localhost");
|
||||||
const [nickname, setNickname] = useState(() => localStorage.getItem(LAST_NICKNAME_KEY) ?? "Claude Code");
|
const [nickname, setNickname] = useState(() => localStorage.getItem(LAST_NICKNAME_KEY) ?? "Claude Code");
|
||||||
@@ -786,6 +850,8 @@ function App() {
|
|||||||
const [awayDialogMessage, setAwayDialogMessage] = useState("");
|
const [awayDialogMessage, setAwayDialogMessage] = useState("");
|
||||||
const [awayPresets, setAwayPresets] = useState<string[]>(() => loadAwayPresets());
|
const [awayPresets, setAwayPresets] = useState<string[]>(() => loadAwayPresets());
|
||||||
const [extrasMenuOpen, setExtrasMenuOpen] = useState(false);
|
const [extrasMenuOpen, setExtrasMenuOpen] = useState(false);
|
||||||
|
const [optionsDialogOpen, setOptionsDialogOpen] = useState(false);
|
||||||
|
const [optionsSection, setOptionsSection] = useState<string>(OPTIONS_SECTIONS[0].id);
|
||||||
const socketRef = useRef<WebSocket | null>(null);
|
const socketRef = useRef<WebSocket | null>(null);
|
||||||
const connectionsMenuRef = useRef<HTMLDivElement | null>(null);
|
const connectionsMenuRef = useRef<HTMLDivElement | null>(null);
|
||||||
const favoritesMenuRef = useRef<HTMLDivElement | null>(null);
|
const favoritesMenuRef = useRef<HTMLDivElement | null>(null);
|
||||||
@@ -1451,7 +1517,13 @@ function App() {
|
|||||||
<span className="ts-menu-item-label">Overwolf installieren</span>
|
<span className="ts-menu-item-label">Overwolf installieren</span>
|
||||||
</button>
|
</button>
|
||||||
<div className="ts-menu-separator" />
|
<div className="ts-menu-separator" />
|
||||||
<button className="ts-menu-item" disabled>
|
<button
|
||||||
|
className="ts-menu-item"
|
||||||
|
onClick={() => {
|
||||||
|
setOptionsDialogOpen(true);
|
||||||
|
setExtrasMenuOpen(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span className="ts-menu-item-icon">⚙️</span>
|
<span className="ts-menu-item-icon">⚙️</span>
|
||||||
<span className="ts-menu-item-label">Optionen</span>
|
<span className="ts-menu-item-label">Optionen</span>
|
||||||
<span className="ts-menu-item-shortcut">Alt+P</span>
|
<span className="ts-menu-item-shortcut">Alt+P</span>
|
||||||
@@ -1628,6 +1700,14 @@ function App() {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{optionsDialogOpen && (
|
||||||
|
<OptionsDialog
|
||||||
|
section={optionsSection}
|
||||||
|
onSectionChange={setOptionsSection}
|
||||||
|
onClose={() => setOptionsDialogOpen(false)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{connectError && (
|
{connectError && (
|
||||||
<div className="ts-connect-error">
|
<div className="ts-connect-error">
|
||||||
<span>⚠️ {connectError}</span>
|
<span>⚠️ {connectError}</span>
|
||||||
|
|||||||
Reference in new issue
Block a user