Files
spacedrive/interface/app/$libraryId/debug.tsx
Brendan Allan c65d92ee4c [ENG-380] Interface code structure improvement (#581)
* beginnings of app directory

* settings mostly good

* colocate way more components

* flatten components folder

* reexport QueryClientProvider from client

* move CodeBlock back to interface

* colocate Explorer, KeyManager + more

* goddamn captialisation

* get toasts out of components

* please eslint

* no more src directory

* $ instead of :

* added back RowHeader component

* fix settings modal padding

* more spacing, less margin

* fix sidebar locations button

* fix tags sidebar link

* clean up back button

* added margin to explorer context menu to prevent contact with edge of viewport

* don't export QueryClientProvider from @sd/client

* basic guidelines

* import interface correctly

* remove old demo data

* fix onboarding layout

* fix onboarding navigation

* fix key manager settings button

---------

Co-authored-by: Jamie Pine <ijamespine@me.com>
2023-02-27 21:29:48 -08:00

46 lines
1.6 KiB
TypeScript

import { useBridgeQuery, useLibraryMutation, useLibraryQuery } from '@sd/client';
import { CodeBlock } from '~/components/Codeblock';
import { usePlatform } from '~/util/Platform';
// TODO: Bring this back with a button in the sidebar near settings at the bottom
export default function DebugScreen() {
const platform = usePlatform();
const { data: nodeState } = useBridgeQuery(['nodeState']);
const { data: libraryState } = useBridgeQuery(['library.list']);
const { data: jobs } = useLibraryQuery(['jobs.getRunning']);
const { data: jobHistory } = useLibraryQuery(['jobs.getHistory']);
// const { mutate: purgeDB } = useBridgeCommand('PurgeDatabase', {
// onMutate: () => {
// alert('Database purged');
// }
// });
const { mutate: identifyFiles } = useLibraryMutation('jobs.identifyUniqueFiles');
return (
<div className="flex flex-col space-y-5 p-5 pt-2 pb-7">
<h1 className="text-lg font-bold ">Developer Debugger</h1>
{/* <div className="flex flex-row pb-4 space-x-2">
<Button
className="w-40"
variant="gray"
size="sm"
onClick={() => {
if (nodeState && appPropsContext?.onOpen) {
appPropsContext.onOpen(nodeState.data_path);
}
}}
>
Open data folder
</Button>
</div> */}
<h1 className="text-sm font-bold ">Running Jobs</h1>
<CodeBlock src={{ ...jobs }} />
<h1 className="text-sm font-bold ">Job History</h1>
<CodeBlock src={{ ...jobHistory }} />
<h1 className="text-sm font-bold ">Node State</h1>
<CodeBlock src={{ ...nodeState }} />
<h1 className="text-sm font-bold ">Libraries</h1>
<CodeBlock src={{ ...libraryState }} />
</div>
);
}