Skip to content

Commit e5207bd

Browse files
committed
Finished with button and results display
1 parent 05efb56 commit e5207bd

File tree

2 files changed

+48
-32
lines changed

2 files changed

+48
-32
lines changed

src/panel/components/searchResultComponents/virusTotalSearchResults.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ function createRow(file: any, name: string, i: number) {
2424
<React.Fragment key={i}>
2525
<TableRow sx={{borderBottom: 'none', paddingBottom: '2px'}}>
2626
<TableCell sx={{color: '#b3b3b5', fontSize: '16px', borderBottom: 'none', paddingBottom: '3px'}} >{name}</TableCell>
27-
<TableCell align='left' sx={{color: file?.status === 'completed' ? '#b3b3b5' : '#2196f3', borderBottom: 'none', paddingBottom: '3px',marginBottom: 'none', fontSize: '14px'}} >{file?.status || 'Scanning...'}</TableCell>
28-
<TableCell align='left' sx={{color: mali > 0 ? '#F56960' : '#2196f3' , borderBottom: 'none', paddingBottom: '3px', width: 'auto', fontSize: '14px'}} >{mali}</TableCell>
27+
<TableCell align='left' sx={{color: file?.status === 'completed' ? '#b3b3b5' : '#33ab9f', borderBottom: 'none', paddingBottom: '3px',marginBottom: 'none', fontSize: '14px'}} >{file?.status || 'Scanning...'}</TableCell>
28+
<TableCell align='left' sx={{color: mali > 0 ? '#F56960' : '#33ab9f' , borderBottom: 'none', paddingBottom: '3px', width: 'auto', fontSize: '14px'}} >{mali}</TableCell>
2929
<TableCell align='center' sx={{borderBottom: 'none', paddingBottom: '3px'}}>
3030
{/* perhaps this below can be conditional if I find any errors. */}
3131
<IconButton onClick={() => setOpen(!open)}>
@@ -56,7 +56,7 @@ function createRow(file: any, name: string, i: number) {
5656
return <Box key={index}><strong>{scan.engine_name}</strong> found {scan.category}: {scan.result}</Box>;
5757
})
5858
) : (
59-
<Typography sx={{color: '#2196f3', fontSize: '14px', marginTop: 'none', paddingLeft: '20px', paddingTop: '0px'}}>No threats found</Typography>
59+
<Typography sx={{color: '#33ab9f', fontSize: '14px', marginTop: 'none', paddingLeft: '20px', paddingTop: '0px'}}>No threats found</Typography>
6060
)}
6161
</Collapse>
6262
</TableCell>
@@ -82,13 +82,7 @@ export default function VirusTotalResults(props: any) {
8282
{/* <TableCell /> */}
8383
<TableCell sx={{color: '#b3b3b5', fontSize: '16px'}}>FILE NAME</TableCell>
8484
<TableCell sx={{color: '#b3b3b5', marginTop: '0px', fontSize: '16px'}} align="left">STATUS</TableCell>
85-
<TableCell align="left"><Chip
86-
label='POTENTIAL THREATS FOUND'
87-
variant='outlined'
88-
sx={{color: '#2196f3'}}
89-
color='primary'
90-
91-
/></TableCell>
85+
<TableCell sx={{color: '#b3b3b5', fontSize: '16px'}} align="left">POTENTIAL THREATS FOUND</TableCell>
9286
{/* <TableCell align="right">Carbs&nbsp;(g)</TableCell>
9387
<TableCell align="right">Protein&nbsp;(g)</TableCell> */}
9488
</TableRow>

src/panel/components/tabPanels.tsx

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import PatternInfo from './patternInfo';
88
import DependencyChecker from './dependencyChecker';
99
import Divider from '@mui/material/Divider';
1010
import Chip from '@mui/material/Chip';
11+
import Link from '@mui/material/Link';
1112
import Button from '@mui/material/Button';
1213
import PatternSearchResults from './searchResultComponents/patternSearchResults';
1314
import TelemetrySearchResults from './searchResultComponents/telemetrySearchResults';
@@ -17,6 +18,7 @@ import Paper from '@mui/material/Paper';
1718
import { virusTotalScan } from '../../workers/virusTotalScan';
1819
import { useState, useEffect, FormEvent } from 'react';
1920
import { AnalysisResponse } from '../../types';
21+
import { Typography } from '@mui/material';
2022
// import { Input } from '@mui/material';
2123

2224
const vscode = acquireVsCodeApi();
@@ -219,33 +221,53 @@ export default function TabPanels(props: any) {
219221
>
220222
<DependencyChecker depResults={patternMatchPanel.depVulns} />
221223
</Paper>
222-
<Box>
223-
224-
<Box sx={{
225-
// height: "150px",
226-
width: "150px",
227-
mt: "30px",
228-
marginBottom: '-3px',
229-
// bgcolor: "purple"
230-
}}>
231-
<Button sx={{
232-
bgcolor: virusTotal[extensionName] !== undefined ? '#3D3D3D' : '#1769aa', color: virusTotal[extensionName] !== undefined ? '#33ab9f' : '#b3b3b5', boxShadow: virusTotal[extensionName] !== undefined ? 'none' : 1, width: '220px','&:hover': {
233-
bgcolor: '#33ab9f',
234-
color: 'black',
235-
},
236-
}} variant="contained" id='virusScanBtn' onClick={() => {
237-
console.log('the button got clicked');
238-
// setClicked(true);
239-
setModalOpen(true);
240-
handleClicking(extensionName);
241-
}} >Run VirusTotal Scan</Button>
224+
{/* <Box> */}
225+
<Divider sx={{ marginTop: '8px', marginBottom: '8px' }}>
226+
<Chip label='EXTERNAL SCANS' variant='outlined' color='primary' />
227+
</Divider>
228+
<Paper
229+
style={{
230+
maxHeight: virusTotal[extensionName] === undefined ? 50 : 500,
231+
overflow: virusTotal[extensionName] === undefined ? 'hidden' : 'auto',
232+
background: 'inherit',
233+
padding: 20,
234+
}}
235+
elevation={4}
236+
>
237+
<Box sx={{ display: 'flex', alignItems: 'center', gap: '20px', border: 'none', marginBottom: virusTotal[extensionName] !== undefined ? '-7px' : '10px'}} >
238+
<Button sx={{
239+
bgcolor: virusTotal[extensionName] !== undefined ? '#3D3D3D' : '#1769aa',
240+
color: virusTotal[extensionName] !== undefined ? '#33ab9f' : '#b3b3b5',
241+
boxShadow: virusTotal[extensionName] !== undefined ? 'none' : 1,
242+
marginBottom: '-3px',
243+
width: '220px','&:hover': {
244+
bgcolor: '#33ab9f',
245+
color: 'black'},
246+
247+
}} variant="contained" id='virusScanBtn' onClick={() => {
248+
console.log('the button got clicked');
249+
// setClicked(true);
250+
// setModalOpen(true);
251+
handleClicking(extensionName);
252+
}} >Run VirusTotal Scan</Button>
253+
<Typography sx={{ visibility: virusTotal[extensionName] !== undefined ? 'hidden' : 'visible',
254+
color: '#b3b3b5',
255+
fontSize: '16px',
256+
maxWidth: 1000,
257+
}} >VirusTotal is an external resource that
258+
"...inspects items with over 70 antivirus scanners and URL/domain blocklisting services,
259+
in addition to a myriad of tools to extract signals from the studied content."
260+
If you's like to sus them out yourself, click {' '}
261+
<Link href="https://www.virustotal.com/gui/home/upload">HERE</Link>.</Typography>
262+
242263
</Box>
243-
<Paper sx={{marginTop: 0, paddingTop: 0, marginBottom: 0}} >
264+
<Paper sx={{marginTop: 0, paddingTop: 0, marginBottom: 2}} >
244265
<VirusTotalHowToModal modalOpen={modalOpen} setModalOpen={setModalOpen} vscode={vscode} extensionName={extensionName} />
245266
<VirusTotalResults keyError={keyError} modalOpen={modalOpen} VTResults={virusTotal[extensionName] || {}} loading={loading} />
246267
</Paper>
268+
</Paper>
247269
<Box sx={{height: '200px'}}></Box>
248-
</Box>
270+
{/* </Box> */}
249271
</TabPanel>
250272
);
251273
});

0 commit comments

Comments
 (0)