• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender-server / 10423

11 Nov 2025 04:53PM UTC coverage: 74.435% (-0.1%) from 74.562%
10423

push

gitlab-ci

web-flow
Merge pull request #1071 from mendersoftware/dependabot/npm_and_yarn/frontend/main/development-dependencies-92732187be

3868 of 5393 branches covered (71.72%)

Branch coverage included in aggregate %.

5 of 5 new or added lines in 2 files covered. (100.0%)

176 existing lines in 95 files now uncovered.

64605 of 86597 relevant lines covered (74.6%)

7.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.47
/frontend/src/js/components/deployments/deployment-report/Log.tsx
1
// Copyright 2020 Northern.tech AS
2✔
2
//
2✔
3
//    Licensed under the Apache License, Version 2.0 (the "License");
2✔
4
//    you may not use this file except in compliance with the License.
2✔
5
//    You may obtain a copy of the License at
2✔
6
//
2✔
7
//        http://www.apache.org/licenses/LICENSE-2.0
2✔
8
//
2✔
9
//    Unless required by applicable law or agreed to in writing, software
2✔
10
//    distributed under the License is distributed on an "AS IS" BASIS,
2✔
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2✔
12
//    See the License for the specific language governing permissions and
2✔
13
//    limitations under the License.
2✔
14
import { Button, DialogActions, DialogContent, Divider } from '@mui/material';
2✔
15
import { makeStyles } from 'tss-react/mui';
2✔
16

2✔
17
import CopyCode from '@northern.tech/common-ui/CopyCode';
2✔
18
import { BaseDialog } from '@northern.tech/common-ui/dialogs/BaseDialog';
2✔
19
import { createFileDownload } from '@northern.tech/utils/helpers';
2✔
20

2✔
21
import { AiLogAnalysis } from './AiLogAnalysis';
2✔
22

2✔
23
const useStyles = makeStyles()(() => ({
13✔
24
  codeContainer: {
2✔
25
    overflowY: 'auto',
2✔
26
    '.code': {
2✔
27
      minHeight: '100%'
2✔
28
    }
2✔
29
  },
2✔
30
  wrapper: {
2✔
31
    display: 'grid',
2✔
32
    '&.ai-enabled': {
2✔
33
      gridTemplateRows: 'minmax(70%, 1fr) min-content min-content',
2✔
34
      paddingBottom: 0
2✔
35
    }
2✔
36
  }
2✔
37
}));
2✔
38

2✔
39
const getFilename = ({ device, releaseName, date }) => `deployment-log-${device}-${releaseName}-${date}.log`;
13✔
40

2✔
41
export const LogDialog = ({ canAi, deployment, deviceId, onClose }) => {
13✔
42
  const { classes } = useStyles();
6✔
43
  const { devices = {} } = deployment;
6✔
44
  const { log: logData } = devices[deviceId] || {};
6!
45
  const context = { device: deviceId, releaseName: deployment.artifact_name, date: deployment.finished };
6✔
46

2✔
UNCOV
47
  const exportLog = () => createFileDownload(logData, getFilename(context), '');
2✔
48

2✔
49
  return (
6✔
50
    <BaseDialog open title="Deployment log for device" maxWidth="xl" onClose={onClose}>
2✔
51
      <DialogContent className={`${classes.wrapper} ${canAi ? 'ai-enabled' : ''}`}>
2!
52
        <div className={classes.codeContainer}>
2✔
53
          <CopyCode code={logData} withDescription />
2✔
54
        </div>
2✔
55
        {canAi && (
2✔
56
          <>
2✔
57
            <Divider className="margin-top-small" />
2✔
58
            <AiLogAnalysis deployment={deployment} deviceId={deviceId} />
2✔
59
          </>
2✔
60
        )}
2✔
61
      </DialogContent>
2✔
62
      <DialogActions>
2✔
63
        <Button onClick={onClose}>Cancel</Button>
2✔
64
        <Button variant="contained" onClick={exportLog}>
2✔
65
          Export log
2✔
66
        </Button>
2✔
67
      </DialogActions>
2✔
68
    </BaseDialog>
2✔
69
  );
2✔
70
};
2✔
71

2✔
72
export default LogDialog;
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc