Skip to content

Commit

Permalink
update reporting spec
Browse files Browse the repository at this point in the history
  • Loading branch information
manV committed Nov 11, 2024
1 parent 157c1cf commit 16efd86
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
25 changes: 14 additions & 11 deletions deepfence_frontend/apps/dashboard/api-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -16663,17 +16663,20 @@
"include_dead_nodes": { "type": "boolean" },
"most_exploitable_report": { "type": "boolean" },
"node_type": {
"enum": [
"host",
"container",
"container_image",
"linux",
"cluster",
"aws",
"gcp",
"azure"
],
"type": "string"
"type": "array",
"items": {
"enum": [
"host",
"container",
"container_image",
"linux",
"cluster",
"aws",
"gcp",
"azure"
]
},
"nullable": true
},
"scan_id": { "type": "string" },
"scan_type": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ export interface UtilsReportFilters {
most_exploitable_report?: boolean;
/**
*
* @type {string}
* @type {Array<string>}
* @memberof UtilsReportFilters
*/
node_type: UtilsReportFiltersNodeTypeEnum;
node_type: Array<UtilsReportFiltersNodeTypeEnum>;
/**
*
* @type {string}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const action = async ({ request }: ActionFunctionArgs): Promise<null> =>
const getReportIdApiResponse = await getReportIdApi({
modelGenerateReportReq: {
filters: {
node_type: nodeType,
node_type: [nodeType],
scan_type: scanType,
scan_id: scanId,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const action = async ({ request }: ActionFunctionArgs): Promise<null> =>
const getReportIdApiResponse = await getReportIdApi({
modelGenerateReportReq: {
filters: {
node_type: nodeType,
node_type: [nodeType],
scan_type: scanType,
scan_id: scanId,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ export const ReportTable = ({
}
if (
nodeTypeFilter?.length &&
(!nodeTypeFilter.includes(filters?.node_type) || isNil(filters?.node_type))
(!nodeTypeFilter.some((filter) =>
filters?.node_type?.includes(filter as UtilsReportFiltersNodeTypeEnum),
) ||
isNil(filters?.node_type))
) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const action = async ({ request }: ActionFunctionArgs): Promise<ActionData> => {
filters: {
advanced_report_filters: advanced_report_filters,
include_dead_nodes: body.deadNodes === 'on',
node_type: _nodeType,
node_type: [_nodeType],
scan_type: _resource,
severity_or_check_type:
severitiesOrCheckTypes as UtilsReportFiltersSeverityOrCheckTypeEnum,
Expand Down

0 comments on commit 16efd86

Please sign in to comment.