Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add refresh status info message for cloud posture accounts #2321

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion deepfence_frontend/apps/dashboard/api-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -13955,6 +13955,7 @@
"node_id": { "type": "string" },
"node_name": { "type": "string" },
"refresh_message": { "type": "string" },
"refresh_metadata": { "type": "string" },
"refresh_status": { "type": "string" },
"refresh_status_map": {
"type": "object",
Expand All @@ -13975,14 +13976,17 @@
"host_node_id",
"account_id",
"cloud_provider",
"version"
"version",
"installation_id"
],
"type": "object",
"properties": {
"account_id": { "type": "string" },
"account_name": { "type": "string" },
"cloud_provider": { "enum": ["aws", "gcp", "azure"], "type": "string" },
"host_node_id": { "type": "string" },
"initial_request": { "type": "boolean" },
"installation_id": { "type": "string" },
"is_organization_deployment": { "type": "boolean" },
"monitored_accounts": {
"type": "array",
Expand All @@ -13991,6 +13995,7 @@
},
"node_id": { "type": "string" },
"organization_account_id": { "type": "string" },
"persistent_volume_supported": { "type": "boolean" },
"version": { "type": "string" }
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ export interface ModelCloudNodeAccountInfo {
* @memberof ModelCloudNodeAccountInfo
*/
refresh_message?: string;
/**
*
* @type {string}
* @memberof ModelCloudNodeAccountInfo
*/
refresh_metadata?: string;
/**
*
* @type {string}
Expand Down Expand Up @@ -149,6 +155,7 @@ export function ModelCloudNodeAccountInfoFromJSONTyped(json: any, ignoreDiscrimi
'node_id': !exists(json, 'node_id') ? undefined : json['node_id'],
'node_name': !exists(json, 'node_name') ? undefined : json['node_name'],
'refresh_message': !exists(json, 'refresh_message') ? undefined : json['refresh_message'],
'refresh_metadata': !exists(json, 'refresh_metadata') ? undefined : json['refresh_metadata'],
'refresh_status': !exists(json, 'refresh_status') ? undefined : json['refresh_status'],
'refresh_status_map': !exists(json, 'refresh_status_map') ? undefined : json['refresh_status_map'],
'scan_status_map': !exists(json, 'scan_status_map') ? undefined : json['scan_status_map'],
Expand All @@ -175,6 +182,7 @@ export function ModelCloudNodeAccountInfoToJSON(value?: ModelCloudNodeAccountInf
'node_id': value.node_id,
'node_name': value.node_name,
'refresh_message': value.refresh_message,
'refresh_metadata': value.refresh_metadata,
'refresh_status': value.refresh_status,
'refresh_status_map': value.refresh_status_map,
'scan_status_map': value.scan_status_map,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ export interface ModelCloudNodeAccountRegisterReq {
* @memberof ModelCloudNodeAccountRegisterReq
*/
host_node_id: string;
/**
*
* @type {boolean}
* @memberof ModelCloudNodeAccountRegisterReq
*/
initial_request?: boolean;
/**
*
* @type {string}
* @memberof ModelCloudNodeAccountRegisterReq
*/
installation_id: string;
/**
*
* @type {boolean}
Expand All @@ -74,6 +86,12 @@ export interface ModelCloudNodeAccountRegisterReq {
* @memberof ModelCloudNodeAccountRegisterReq
*/
organization_account_id?: string;
/**
*
* @type {boolean}
* @memberof ModelCloudNodeAccountRegisterReq
*/
persistent_volume_supported?: boolean;
/**
*
* @type {string}
Expand Down Expand Up @@ -102,6 +120,7 @@ export function instanceOfModelCloudNodeAccountRegisterReq(value: object): boole
isInstance = isInstance && "account_id" in value;
isInstance = isInstance && "cloud_provider" in value;
isInstance = isInstance && "host_node_id" in value;
isInstance = isInstance && "installation_id" in value;
isInstance = isInstance && "node_id" in value;
isInstance = isInstance && "version" in value;

Expand All @@ -122,10 +141,13 @@ export function ModelCloudNodeAccountRegisterReqFromJSONTyped(json: any, ignoreD
'account_name': !exists(json, 'account_name') ? undefined : json['account_name'],
'cloud_provider': json['cloud_provider'],
'host_node_id': json['host_node_id'],
'initial_request': !exists(json, 'initial_request') ? undefined : json['initial_request'],
'installation_id': json['installation_id'],
'is_organization_deployment': !exists(json, 'is_organization_deployment') ? undefined : json['is_organization_deployment'],
'monitored_accounts': !exists(json, 'monitored_accounts') ? undefined : (json['monitored_accounts'] === null ? null : (json['monitored_accounts'] as Array<any>).map(ModelCloudNodeMonitoredAccountFromJSON)),
'node_id': json['node_id'],
'organization_account_id': !exists(json, 'organization_account_id') ? undefined : json['organization_account_id'],
'persistent_volume_supported': !exists(json, 'persistent_volume_supported') ? undefined : json['persistent_volume_supported'],
'version': json['version'],
};
}
Expand All @@ -143,10 +165,13 @@ export function ModelCloudNodeAccountRegisterReqToJSON(value?: ModelCloudNodeAcc
'account_name': value.account_name,
'cloud_provider': value.cloud_provider,
'host_node_id': value.host_node_id,
'initial_request': value.initial_request,
'installation_id': value.installation_id,
'is_organization_deployment': value.is_organization_deployment,
'monitored_accounts': value.monitored_accounts === undefined ? undefined : (value.monitored_accounts === null ? null : (value.monitored_accounts as Array<any>).map(ModelCloudNodeMonitoredAccountToJSON)),
'node_id': value.node_id,
'organization_account_id': value.organization_account_id,
'persistent_volume_supported': value.persistent_volume_supported,
'version': value.version,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { ArrowUpCircleLine } from '@/components/icons/common/ArrowUpCircleLine';
import { EllipsisIcon } from '@/components/icons/common/Ellipsis';
import { ErrorStandardLineIcon } from '@/components/icons/common/ErrorStandardLine';
import { FilterIcon } from '@/components/icons/common/Filter';
import { InfoStandardIcon } from '@/components/icons/common/InfoStandard';
import { PlusIcon } from '@/components/icons/common/Plus';
import { RefreshIcon } from '@/components/icons/common/Refresh';
import { TimesIcon } from '@/components/icons/common/Times';
Expand Down Expand Up @@ -1428,11 +1429,21 @@ const AccountTable = ({
});
return <div className="space-y-1.5 py-1">{statuses}</div>;
} else {
const refreshMessage = info.row.original.refresh_message;
return (
<ScanStatusBadge
status={info.getValue() ?? ''}
errorMessage={info.row.original.refresh_message}
/>
<div className="flex gap-2 items-center">
<ScanStatusBadge
status={info.getValue() ?? ''}
errorMessage={info.row.original.refresh_message}
/>
{refreshMessage?.length ? (
<Tooltip content={refreshMessage} triggerAsChild>
<span className="h-4 w-4 shrink-0 cursor-pointer">
<InfoStandardIcon />
</span>
</Tooltip>
) : null}
</div>
);
}
},
Expand Down
Loading