1
- /* Not a fan of adding this , mainly doing it because
1
+ /* Not a fan of adding the no-check , mainly doing it because
2
2
the types associated with the blessed packages
3
3
create some type errors
4
4
*/
@@ -153,18 +153,22 @@ async function fetchThreatFeed(
153
153
154
154
const screen = blessed . screen ( )
155
155
156
- var table = contrib . table (
157
- { keys : 'true'
158
- , fg : 'white'
159
- , selectedFg : 'white'
160
- , selectedBg : 'magenta'
161
- , interactive : 'true'
162
- , label : 'Threat feed'
163
- , width : '100%'
164
- , height : '100%'
165
- , border : { type : "line" , fg : "cyan" }
166
- , columnSpacing : 5 //in chars
167
- , columnWidth : [ 10 , 30 , 10 , 20 , 20 ] /*in chars*/ } )
156
+ var table = contrib . table ( {
157
+ keys : 'true' ,
158
+ fg : 'white' ,
159
+ selectedFg : 'white' ,
160
+ selectedBg : 'magenta' ,
161
+ interactive : 'true' ,
162
+ label : 'Threat feed' ,
163
+ width : '100%' ,
164
+ height : '100%' ,
165
+ border : {
166
+ type : "line" ,
167
+ fg : "cyan"
168
+ } ,
169
+ columnSpacing : 5 , //in chars
170
+ columnWidth : [ 10 , 30 , 8 , 20 , 16 , 50 ] /*in chars*/
171
+ } )
168
172
169
173
// allow control the table with the keyboard
170
174
table . focus ( )
@@ -173,8 +177,7 @@ async function fetchThreatFeed(
173
177
174
178
const formattedOutput = formatResults ( data . results )
175
179
176
- table . setData (
177
- { headers : [ 'Ecosystem' , 'Name' , 'Version' , 'Threat type' , 'Detected at' ] , data : formattedOutput } )
180
+ table . setData ( { headers : [ 'Ecosystem' , 'Name' , 'Version' , 'Threat type' , 'Detected at' , 'Details' ] , data : formattedOutput } )
178
181
179
182
screen . render ( )
180
183
@@ -193,7 +196,7 @@ const formatResults = (data: ThreatResult[]) => {
193
196
const diff = getHourDiff ( timeStart , timeEnd )
194
197
const hourDiff = diff > 0 ? `${ diff } hours ago` : `${ getMinDiff ( timeStart , timeEnd ) } minutes ago`
195
198
196
- return [ ecosystem , decodeURIComponent ( name ) , version , d . threatType , hourDiff ]
199
+ return [ ecosystem , decodeURIComponent ( name ) , version , d . threatType , hourDiff , d . locationHtmlUrl ]
197
200
} )
198
201
}
199
202
0 commit comments