Remove debug config from system page

This commit is contained in:
Nick Mowen 2022-12-06 06:52:46 -07:00
parent 2fe85084ba
commit 5ea60a3c31

View File

@ -7,7 +7,7 @@ import { useWs } from '../api/ws';
import useSWR from 'swr';
import axios from 'axios';
import { Table, Tbody, Thead, Tr, Th, Td } from '../components/Table';
import { useCallback, useState } from 'preact/hooks';
import { useState } from 'preact/hooks';
import Dialog from '../components/Dialog';
const emptyObject = Object.freeze({});
@ -34,13 +34,6 @@ export default function System() {
const gpuNames = Object.keys(gpu_usages || emptyObject);
const cameraNames = Object.keys(cameras || emptyObject);
const handleCopyConfig = useCallback(() => {
async function copy() {
await window.navigator.clipboard.writeText(JSON.stringify(config, null, 2));
}
copy();
}, [config]);
const onHandleFfprobe = async (camera, e) => {
if (e) {
e.stopPropagation();
@ -267,16 +260,6 @@ export default function System() {
<p>System stats update automatically every {config.mqtt.stats_interval} seconds.</p>
</Fragment>
)}
<div className="relative">
<Heading size="sm">Config</Heading>
<Button className="absolute top-8 right-4" onClick={handleCopyConfig}>
Copy to Clipboard
</Button>
<pre className="overflow-auto font-mono text-gray-900 dark:text-gray-100 rounded bg-gray-100 dark:bg-gray-800 p-2 max-h-96">
{JSON.stringify(config, null, 2)}
</pre>
</div>
</div>
);
}