Add developer mode option to show RTC connection statistics (#2904)
* Add developer mode option to show RTC connection statistics * Add note about localization * Add titles to help explain what the numbers are * Workaround horizontal scrolling * Use modal to show detailed stats instead of alert * Changed styling and fixed fps = 0 (#2916) (React rendered 0 instead of <Text /> for fps && <Text>{fps}</text>) --------- Co-authored-by: Timo <16718859+toger5@users.noreply.github.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
duplicateTiles as duplicateTilesSetting,
|
||||
debugTileLayout as debugTileLayoutSetting,
|
||||
showNonMemberTiles as showNonMemberTilesSetting,
|
||||
showConnectionStats as showConnectionStatsSetting,
|
||||
} from "./settings";
|
||||
import type { MatrixClient } from "matrix-js-sdk/src/client";
|
||||
|
||||
@@ -31,6 +32,10 @@ export const DeveloperSettingsTab: FC<Props> = ({ client }) => {
|
||||
showNonMemberTilesSetting,
|
||||
);
|
||||
|
||||
const [showConnectionStats, setShowConnectionStats] = useSetting(
|
||||
showConnectionStatsSetting,
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<p>
|
||||
@@ -103,6 +108,20 @@ export const DeveloperSettingsTab: FC<Props> = ({ client }) => {
|
||||
)}
|
||||
/>
|
||||
</FieldRow>
|
||||
<FieldRow>
|
||||
<InputField
|
||||
id="showConnectionStats"
|
||||
type="checkbox"
|
||||
label={t("developer_mode.show_connection_stats")}
|
||||
checked={!!showConnectionStats}
|
||||
onChange={useCallback(
|
||||
(event: ChangeEvent<HTMLInputElement>): void => {
|
||||
setShowConnectionStats(event.target.checked);
|
||||
},
|
||||
[setShowConnectionStats],
|
||||
)}
|
||||
/>
|
||||
</FieldRow>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -78,6 +78,11 @@ export const showNonMemberTiles = new Setting<boolean>(
|
||||
);
|
||||
export const debugTileLayout = new Setting("debug-tile-layout", false);
|
||||
|
||||
export const showConnectionStats = new Setting<boolean>(
|
||||
"show-connection-stats",
|
||||
false,
|
||||
);
|
||||
|
||||
export const audioInput = new Setting<string | undefined>(
|
||||
"audio-input",
|
||||
undefined,
|
||||
|
||||
Reference in New Issue
Block a user