Skip to content

Commit

Permalink
Add copy logs button
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlampley committed Mar 11, 2022
1 parent e92632b commit d12cac5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ui/components/CardTitle/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const CardTitle: FunctionComponent<CardTitleProps> = memo(({ icon, title }) => {
<CardContent>
<Grid container spacing={1} alignItems="center">
<Grid item>{icon}</Grid>
<Grid item>
<Grid item flexGrow={1}>
<Typography variant="h6">{title}</Typography>
</Grid>
</Grid>
Expand Down
22 changes: 20 additions & 2 deletions src/ui/views/ConfiguratorView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ import {
DialogContentText,
DialogTitle,
Divider,
IconButton,
Tooltip,
} from '@mui/material';
import SettingsIcon from '@mui/icons-material/Settings';
import { ipcRenderer } from 'electron';
import { NetworkWifi } from '@mui/icons-material';
import { ContentCopy, NetworkWifi } from '@mui/icons-material';
import FirmwareVersionForm from '../../components/FirmwareVersionForm';
import DeviceTargetForm from '../../components/DeviceTargetForm';
import DeviceOptionsForm, {
Expand Down Expand Up @@ -1003,7 +1004,24 @@ const ConfiguratorView: FunctionComponent<ConfiguratorViewProps> = (props) => {

{logs.length > 0 && (
<>
<CardTitle icon={<SettingsIcon />} title="Logs" />
<CardTitle
icon={<SettingsIcon />}
title={
<Box display="flex" justifyContent="space-between">
<Box>Logs</Box>
<Box>
<IconButton
aria-label="Copy the logs"
onClick={async () => {
await navigator.clipboard.writeText(logs);
}}
>
<ContentCopy />
</IconButton>
</Box>
</Box>
}
/>
<Divider />
<CardContent>
<Box sx={styles.longBuildDurationWarning}>
Expand Down

0 comments on commit d12cac5

Please sign in to comment.