chore: merge feat/simple-entry-diagnostics into feat/clarity-quality-controls
# Conflicts: # src/client/pages/HostPage.tsx # src/client/styles.css
This commit is contained in:
commit
fb19e59c27
12 files changed
+311
-109
No files matched your search
@@ -10,7 +10,7 @@ export function AppHeader({ status }: { status: ReactNode }) {
|
||||
</span>
|
||||
<span>Screener</span>
|
||||
</a>
|
||||
<div className="header-status">{status}</div>
|
||||
{status && <div className="header-status">{status}</div>}
|
||||
</header>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import type { ChangeEvent } from "react";
|
||||
|
||||
interface ConnectionDetailsToggleProps {
|
||||
checked: boolean;
|
||||
onChange: (checked: boolean) => void;
|
||||
}
|
||||
|
||||
export function ConnectionDetailsToggle({
|
||||
checked,
|
||||
onChange,
|
||||
}: ConnectionDetailsToggleProps) {
|
||||
return (
|
||||
<label
|
||||
className="connection-details-toggle"
|
||||
title="展开或隐藏连接的技术指标"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={checked}
|
||||
onChange={(event: ChangeEvent<HTMLInputElement>) =>
|
||||
onChange(event.currentTarget.checked)
|
||||
}
|
||||
/>
|
||||
<span>显示连接详情</span>
|
||||
</label>
|
||||
);
|
||||
}
|
||||
@@ -39,7 +39,7 @@ export function PeerStatusBadge({
|
||||
state: RTCPeerConnectionState | "waiting";
|
||||
}) {
|
||||
const labels: Record<RTCPeerConnectionState | "waiting", BadgeProps> = {
|
||||
waiting: { tone: "neutral", label: "等待画面" },
|
||||
waiting: { tone: "neutral", label: "等待开始分享" },
|
||||
new: { tone: "neutral", label: "准备中" },
|
||||
connecting: { tone: "neutral", label: "正在连接" },
|
||||
connected: { tone: "good", label: "已连接" },
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { PeerSnapshot } from "../types";
|
||||
|
||||
export function qualityLimitationSummary(
|
||||
snapshots: readonly PeerSnapshot[],
|
||||
): string | null {
|
||||
for (const snapshot of snapshots) {
|
||||
if (snapshot.qualityWarning) {
|
||||
return snapshot.qualityWarning;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Reference in new issue
Block a user