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

Display ingested software on host details page. #19576

Merged
merged 8 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Updated frontend to refresh software
  • Loading branch information
getvictor committed Jun 11, 2024
commit fc82ab06fd595fcdc5a23e4d0b19edddf78a4196
1 change: 1 addition & 0 deletions frontend/interfaces/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ export interface IHostIssues {
export interface IHost {
created_at: string;
updated_at: string;
software_updated_at?: string;
id: number;
detail_updated_at: string;
last_restarted_at: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ const DeviceUserPage = ({
<TabPanel>
<SoftwareCard
id={deviceAuthToken}
softwareUpdatedAt={host.software_updated_at}
isFleetdHost={!!host.orbit_version}
router={router}
pathname={location.pathname}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ const HostDetailsPage = ({
<TabPanel>
<SoftwareCard
id={host.id}
softwareUpdatedAt={host.software_updated_at}
isFleetdHost={!!host.orbit_version}
isSoftwareEnabled={featuresConfig?.enable_software_inventory}
router={router}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface ITableSoftware extends Omit<ISoftware, "vulnerabilities"> {
interface IHostSoftwareProps {
/** This is the host id or the device token */
id: number | string;
softwareUpdatedAt?: string;
isFleetdHost: boolean;
router: InjectedRouter;
queryParams: ReturnType<typeof parseHostSoftwareQueryParams>;
Expand Down Expand Up @@ -79,6 +80,7 @@ export const parseHostSoftwareQueryParams = (queryParams: {

const HostSoftware = ({
id,
softwareUpdatedAt,
isFleetdHost,
router,
queryParams,
Expand Down Expand Up @@ -119,6 +121,7 @@ const HostSoftware = ({
{
scope: "host_software",
id: id as number,
softwareUpdatedAt: softwareUpdatedAt,
...queryParams,
},
],
Expand Down Expand Up @@ -149,6 +152,7 @@ const HostSoftware = ({
{
scope: "device_software",
id: id as string,
softwareUpdatedAt: softwareUpdatedAt,
...queryParams,
},
],
Expand Down
1 change: 1 addition & 0 deletions frontend/services/entities/device_user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type ILoadHostDetailsExtension = "device_mapping" | "macadmins";
export interface IDeviceSoftwareQueryKey extends IHostSoftwareQueryParams {
scope: "device_software";
id: string;
softwareUpdatedAt?: string;
}

export interface IGetDeviceSoftwareResponse {
Expand Down
3 changes: 2 additions & 1 deletion frontend/services/entities/hosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export interface IHostSoftwareQueryParams extends QueryParams {
export interface IHostSoftwareQueryKey extends IHostSoftwareQueryParams {
scope: "host_software";
id: number;
softwareUpdatedAt?: string;
}

export type ILoadHostDetailsExtension = "device_mapping" | "macadmins";
Expand Down Expand Up @@ -439,7 +440,7 @@ export default {
},
loadHostDetails: (hostID: number) => {
const { HOSTS } = endpoints;
const path = `${HOSTS}/${hostID}`;
const path = `${HOSTS}/${hostID}?exclude_software=true`;

return sendRequest("GET", path);
},
Expand Down