Skip to content

Commit

Permalink
Merge pull request #1695 from deepfence/ui-fix-1124
Browse files Browse the repository at this point in the history
Updated mask/unmask action for an image, image tags, host, across host and images
  • Loading branch information
milan-deepfence authored Oct 27, 2023
2 parents 0382198 + a32326e commit 335f824
Show file tree
Hide file tree
Showing 7 changed files with 712 additions and 139 deletions.
14 changes: 10 additions & 4 deletions deepfence_frontend/apps/dashboard/api-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -12902,12 +12902,18 @@
}
},
"ModelScanResultsMaskRequest": {
"required": ["scan_id", "result_ids", "scan_type"],
"required": ["scan_id", "result_ids", "scan_type", "mask_action"],
"type": "object",
"properties": {
"mask_across_hosts_and_images": { "type": "boolean" },
"mask_in_this_host_or_image_tags": { "type": "boolean" },
"mask_in_this_image_tag": { "type": "boolean" },
"mask_action": {
"enum": [
"mask_global",
"mask_all_image_tag",
"mask_entity",
"mask_image_tag"
],
"type": "string"
},
"result_ids": {
"type": "array",
"items": { "type": "string" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,10 @@ import { exists, mapValues } from '../runtime';
export interface ModelScanResultsMaskRequest {
/**
*
* @type {boolean}
* @memberof ModelScanResultsMaskRequest
*/
mask_across_hosts_and_images?: boolean;
/**
*
* @type {boolean}
* @memberof ModelScanResultsMaskRequest
*/
mask_in_this_host_or_image_tags?: boolean;
/**
*
* @type {boolean}
* @type {string}
* @memberof ModelScanResultsMaskRequest
*/
mask_in_this_image_tag?: boolean;
mask_action: ModelScanResultsMaskRequestMaskActionEnum;
/**
*
* @type {Array<string>}
Expand All @@ -58,6 +46,17 @@ export interface ModelScanResultsMaskRequest {
}


/**
* @export
*/
export const ModelScanResultsMaskRequestMaskActionEnum = {
Global: 'mask_global',
AllImageTag: 'mask_all_image_tag',
Entity: 'mask_entity',
ImageTag: 'mask_image_tag'
} as const;
export type ModelScanResultsMaskRequestMaskActionEnum = typeof ModelScanResultsMaskRequestMaskActionEnum[keyof typeof ModelScanResultsMaskRequestMaskActionEnum];

/**
* @export
*/
Expand All @@ -76,6 +75,7 @@ export type ModelScanResultsMaskRequestScanTypeEnum = typeof ModelScanResultsMas
*/
export function instanceOfModelScanResultsMaskRequest(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "mask_action" in value;
isInstance = isInstance && "result_ids" in value;
isInstance = isInstance && "scan_id" in value;
isInstance = isInstance && "scan_type" in value;
Expand All @@ -93,9 +93,7 @@ export function ModelScanResultsMaskRequestFromJSONTyped(json: any, ignoreDiscri
}
return {

'mask_across_hosts_and_images': !exists(json, 'mask_across_hosts_and_images') ? undefined : json['mask_across_hosts_and_images'],
'mask_in_this_host_or_image_tags': !exists(json, 'mask_in_this_host_or_image_tags') ? undefined : json['mask_in_this_host_or_image_tags'],
'mask_in_this_image_tag': !exists(json, 'mask_in_this_image_tag') ? undefined : json['mask_in_this_image_tag'],
'mask_action': json['mask_action'],
'result_ids': json['result_ids'],
'scan_id': json['scan_id'],
'scan_type': json['scan_type'],
Expand All @@ -111,9 +109,7 @@ export function ModelScanResultsMaskRequestToJSON(value?: ModelScanResultsMaskRe
}
return {

'mask_across_hosts_and_images': value.mask_across_hosts_and_images,
'mask_in_this_host_or_image_tags': value.mask_in_this_host_or_image_tags,
'mask_in_this_image_tag': value.mask_in_this_image_tag,
'mask_action': value.mask_action,
'result_ids': value.result_ids,
'scan_id': value.scan_id,
'scan_type': value.scan_type,
Expand Down
Loading

0 comments on commit 335f824

Please sign in to comment.