OneLauncher-Cracked/apps/oneclient/frontend/src/components/overlay/DebugInfo.tsx
Jacob fb5da05ad9
feat: better debug (#486)
* fix: tauri os plugin not being fully loaded

* feat: debug keybind

Bound to `CTRL+SHIFT+D` (and `ALT+F12`) and copies the debug info to the
clipboard

* refactor: __root.tx

Clean up a lot of code and move them into there own files

* feat: os distro in debug

* refactor: get_full_debug_info_parsed

* feat: made by info in settings

Also made it so that you can click on it to copy debug info

* fix: warning in oneclient/desktop/lib.rs

* refactor: copyDebugInfo

Moved it to the backend to later be used

* feat: log out debug info when oneclient launches

* `inDev` -> `In Dev`

* feat: toggle debug logging

* fix rust compiler
2026-03-03 20:46:11 -05:00

32 lines
910 B
TypeScript

import type { DebugInfoArray } from '@/utils/debugInfo';
import { Overlay } from '@/components';
import { copyDebugInfo, useDebugInfo } from '@/utils/debugInfo';
import { Button } from '@onelauncher/common/components';
export function DebugInfo() {
const debugInfo = useDebugInfo();
return (
<Overlay.Dialog>
<Overlay.Title>Debug Info</Overlay.Title>
<RawDebugInfo debugInfo={debugInfo} />
</Overlay.Dialog>
);
}
export function RawDebugInfo({ debugInfo }: { debugInfo: DebugInfoArray }) {
return (
<>
<div>
{debugInfo.map((lineData) => {
let line = '';
if (lineData.title === 'Build Timestamp')
line = `${lineData.title}: ${new Date(Number(lineData.value) * 1000).toString()}`;
else line = `${lineData.title}: ${lineData.value}`;
return <p key={lineData.title}>{line}</p>;
})}
</div>
<Button onPress={copyDebugInfo}>Copy Data</Button>
</>
);
}