Skip to content

Conversation

@KushguptaPST
Copy link

  • Add Assets service to call /assets API endpoint
  • Create Assets page component with table visualization
  • Add Assets route to routing configuration
  • Add Assets navigation item to sidebar with Storage icon
  • Support time window selection and currency conversion
  • Display asset details: name, type, provider, cluster, and total cost
  • Add pagination and error handling

Fixes #28

What does this PR change?

  • Adds a new "Assets" page to the OpenCost UI that visualizes infrastructure assets data from the /assets API endpoint
    Creates src/services/assets.js - a new service class to interact with the Assets API
    Creates src/pages/Assets.js - a new page component displaying assets in a table format with pagination
    Updates src/route.js to include the /assets route
    Updates src/components/Nav/SidebarNav.js to add "Assets" navigation item in the sidebar with Storage icon
    Provides UI visualization for infrastructure assets (nodes, storage, load balancers, etc.) that was previously only available via API

Does this PR relate to any other PRs?

No, this is a standalone feature implementation

How will this PR impact users?

  • Positive Impact: Users can now view and analyze infrastructure assets directly in the UI instead of only through API calls
    New Feature: Adds a new "Assets" page accessible from the sidebar navigation
    User Experience: Provides consistent UI/UX with existing pages (Allocations, Cloud Costs, External Costs)
    Functionality: Users can:
    View infrastructure assets in a table format
    Filter assets by time window (today, 7d, 14d, etc.)
    Convert costs to different currencies
    View total cost across all assets
    Navigate through paginated asset lists
    No Breaking Changes: This is purely additive - no existing functionality is modified or removed

Does this PR address any GitHub or Zendesk issues?

How was this PR tested?

  • Manual Testing:
    Verified Assets page loads correctly and displays assets from the API
    Tested time window selection (today, 7d, 14d, etc.)
    Tested currency conversion functionality
    Tested pagination with different page sizes (10, 25, 50 rows)
    Verified error handling when backend is unavailable
    Tested loading states display correctly
    Verified navigation integration (sidebar link works)
    Confirmed URL parameters persist correctly (window, currency)
    Tested refresh functionality
    Code Review:
    Follows existing code patterns and architecture
    Uses Material-UI components consistently with other pages
    Proper error handling and loading states implemented
    No linter errors
    Integration Testing:
    Verified route configuration works correctly
    Confirmed API service integrates with existing api_client.js
    Tested with different backend configurations

Does this PR require changes to documentation?

  • No documentation changes required - This is a UI feature that doesn't change API behavior or require user configuration
    The Assets API endpoint already exists and is documented
    This PR only adds UI visualization for existing API functionality
    Future consideration: If user-facing documentation exists, it may benefit from mentioning the new Assets page in the UI

Have you labeled this PR and its corresponding Issue as "next release" if it should be part of the next OpenCost release? If not, why not?

  • Issue Support Assets in the UI #28 should be labeled for next release - This addresses a long-standing feature request (opened June 2024) to add UI support for the Assets API
    This PR should be considered for next release because:
    It completes a missing piece of functionality (Assets API was available but not accessible in UI)
    It's a valuable visualization feature for users
    It's necessary for future Carbon Costs feature (/assets/carbon) mentioned in the issue
    No breaking changes, purely additive feature
    Low risk implementation following established patterns

- Add Assets service to call /assets API endpoint
- Create Assets page component with table visualization
- Add Assets route to routing configuration
- Add Assets navigation item to sidebar with Storage icon
- Support time window selection and currency conversion
- Display asset details: name, type, provider, cluster, and total cost
- Add pagination and error handling

Fixes opencost#28
@netlify
Copy link

netlify bot commented Jan 25, 2026

Deploy Preview for opencost-ui ready!

Name Link
🔨 Latest commit 1547bdc
🔍 Latest deploy log https://app.netlify.com/projects/opencost-ui/deploys/69766ce2d6146200085aed54
😎 Deploy Preview https://deploy-preview-164--opencost-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@KushguptaPST
Copy link
Author

Hi maintainers 👋
This is my PR. Please let me know if any changes are needed.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Assets in the UI

1 participant