mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use Paper component
This commit is contained in:
parent
e43a3d89eb
commit
53b3228519
1 changed files with 9 additions and 11 deletions
|
@ -7,13 +7,13 @@ import Alert from '@mui/material/Alert';
|
||||||
import Box from '@mui/material/Box';
|
import Box from '@mui/material/Box';
|
||||||
import Button from '@mui/material/Button';
|
import Button from '@mui/material/Button';
|
||||||
import ButtonGroup from '@mui/material/ButtonGroup';
|
import ButtonGroup from '@mui/material/ButtonGroup';
|
||||||
import Card from '@mui/material/Card';
|
|
||||||
import CardContent from '@mui/material/CardContent';
|
|
||||||
import Container from '@mui/material/Container';
|
import Container from '@mui/material/Container';
|
||||||
|
import Paper from '@mui/material/Paper';
|
||||||
import Typography from '@mui/material/Typography';
|
import Typography from '@mui/material/Typography';
|
||||||
import { ContentCopy, FileDownload } from '@mui/icons-material';
|
import { ContentCopy, FileDownload } from '@mui/icons-material';
|
||||||
import globalize from 'lib/globalize';
|
import globalize from 'lib/globalize';
|
||||||
import toast from 'components/toast/toast';
|
import toast from 'components/toast/toast';
|
||||||
|
import { copy } from 'scripts/clipboard';
|
||||||
|
|
||||||
export const Component = () => {
|
export const Component = () => {
|
||||||
const { file: fileName } = useParams();
|
const { file: fileName } = useParams();
|
||||||
|
@ -27,8 +27,8 @@ export const Component = () => {
|
||||||
const retry = useCallback(() => refetch(), [refetch]);
|
const retry = useCallback(() => refetch(), [refetch]);
|
||||||
|
|
||||||
const copyToClipboard = useCallback(async () => {
|
const copyToClipboard = useCallback(async () => {
|
||||||
if ('clipboard' in navigator && log) {
|
if (log) {
|
||||||
await navigator.clipboard.writeText(log);
|
await copy(log);
|
||||||
toast({ text: globalize.translate('CopyLogSuccess') });
|
toast({ text: globalize.translate('CopyLogSuccess') });
|
||||||
}
|
}
|
||||||
}, [log]);
|
}, [log]);
|
||||||
|
@ -94,13 +94,11 @@ export const Component = () => {
|
||||||
</Button>
|
</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|
||||||
<Card sx={{ mt: 2 }}>
|
<Paper sx={{ mt: 2 }}>
|
||||||
<CardContent>
|
<code>
|
||||||
<code>
|
<pre style={{ overflow:'auto', margin: 0, padding: '16px' }}>{log}</pre>
|
||||||
<pre style={{ margin: 0 }}>{log}</pre>
|
</code>
|
||||||
</code>
|
</Paper>
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue