mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix copying logs (#5373)
This commit is contained in:
parent
66881eb89f
commit
74d6ab0555
@ -4,6 +4,7 @@ import { useCallback, useEffect, useState } from 'preact/hooks';
|
|||||||
import ButtonsTabbed from '../components/ButtonsTabbed';
|
import ButtonsTabbed from '../components/ButtonsTabbed';
|
||||||
import useSWR from 'swr';
|
import useSWR from 'swr';
|
||||||
import Button from '../components/Button';
|
import Button from '../components/Button';
|
||||||
|
import copy from 'copy-to-clipboard';
|
||||||
|
|
||||||
export default function Logs() {
|
export default function Logs() {
|
||||||
const [logService, setLogService] = useState('frigate');
|
const [logService, setLogService] = useState('frigate');
|
||||||
@ -14,10 +15,7 @@ export default function Logs() {
|
|||||||
const { data: nginxLogs } = useSWR('logs/nginx');
|
const { data: nginxLogs } = useSWR('logs/nginx');
|
||||||
|
|
||||||
const handleCopyLogs = useCallback(() => {
|
const handleCopyLogs = useCallback(() => {
|
||||||
async function copy() {
|
copy(logs);
|
||||||
await window.navigator.clipboard.writeText(logs);
|
|
||||||
}
|
|
||||||
copy();
|
|
||||||
}, [logs]);
|
}, [logs]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user