Skip to content

Conversation

@rudream
Copy link
Contributor

@rudream rudream commented Dec 5, 2025

Purpose

This PR is part of #60528

This PR adds the new "Instance Inventory" page to the Web UI, which allows users to list instances and bot instances with support for search, sorting, and filtering by various criteria.

Figma mockups

Required merges

Implementation

A new type of filter component was created for filtering by versions, this contains some preset version filters based on common use-cases as well as the option for a custom filter where the user can enter their own. This filter control works under the hood by appending a predicate query for that given filter selection to the request, it will combine with any other search/predicate query entered by the user, however it will not populate the advanced search bar.

For bot instances, the services column contains a deeplink button which takes the user to the Bot Instances dashboard with that bot instance in view.

The language for the upgraders differs slightly from those shown in the Figma mockup, as the ones used there are not very accurate and the autoupdate team suggested to use different labels.

Demo

Example default view

image

Multiple filters and search active

image

Filter controls

image image image image image

@rudream rudream added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v18 labels Dec 5, 2025
@public-teleport-github-review-bot

@rudream - this PR will require admin approval to merge due to its size. Consider breaking it up into a series smaller changes.

1 similar comment
@public-teleport-github-review-bot

@rudream - this PR will require admin approval to merge due to its size. Consider breaking it up into a series smaller changes.

@rudream rudream force-pushed the yassine/inventory-frontend branch from 884f7a8 to b9f9ff1 Compare December 5, 2025 15:56
// fully initialized.
func (ic *InventoryCache) ListUnifiedInstances(ctx context.Context, req *inventoryv1.ListUnifiedInstancesRequest) (*inventoryv1.ListUnifiedInstancesResponse, error) {
if !ic.IsHealthy() {
// Keep this error message in sync with web/Instances.tsx(isCacheInitializing)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the HTTP status code instead of the specific error message text to identify this case?

Bots ResourceAccess `json:"bots"`
// BotInstances defines access to manage bot instances
BotInstances ResourceAccess `json:"botInstances"`
// Instances defines access to manage instances
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Instances defines access to manage instances
// Instances defines access to view instance inventory.

const location = useLocation();
const queryParams = new URLSearchParams(location.search);
const query = queryParams.get('query') ?? '';
const isAdvancedQuery = queryParams.get('is_advanced') ?? '';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "is advanced" makes it sound like this is a boolean field, and we do treat it like a boolean, but it looks like it actually holds a string.

<Alert kind="info" mt={3} mb={3}>
You do not have permission to view instances. This list will only
show bot instances. Missing permissions: <code>instance.list</code>{' '}
and/or <code>instance.read</code>.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and/or is confusing.

Do they need both list and read or just one of them?

Comment on lines +358 to +378
export function getMajorVersion(version: string): string {
const parts = version.split('.');
return `${parts[0]}.0.0`;
}

export function getMinorVersion(version: string): string {
const parts = version.split('.');
return `${parts[0]}.${parts[1]}.0`;
}

export function getPreviousMajorVersion(version: string): string {
const parts = version.split('.');
const major = parseInt(parts[0]);
return `${major - 1}.0.0`;
}

export function getNextMajorVersion(version: string): string {
const parts = version.split('.');
const major = parseInt(parts[0]);
return `${major + 1}.0.0`;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything in shared/utils/semver that helps with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/branch/v18 no-changelog Indicates that a PR does not require a changelog entry size/xl ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants