Conversation
- Introduced a new utility function `format_status` to standardize status display across the application. - Updated the `InstanceView` model to include a `status_display` field for formatted status representation. - Modified API handlers and templates to utilize the new `status_display` for improved user experience and consistency in status presentation. - Adjusted CSS styles for status badges to reflect the new status formatting.
- Refactored `load_instances_for_user` to implement pagination using bookmarks, improving data retrieval efficiency. - Updated `InstanceView` model to include `main_ipv6` alongside `main_ip` for better network information representation. - Introduced `load_ssh_keys_paginated` function to support client-side pagination for SSH keys, enhancing user experience. - Modified SSH keys handler and templates to accommodate pagination, including controls for navigating through pages. - Adjusted instance templates to display both IPv4 and IPv6 addresses, improving clarity in network information.
…plates - Replaced the existing list filters with a new per-page selector for improved layout and usability. - Enhanced pagination controls to include ellipsis for better navigation between pages. - Updated CSS styles for pagination elements to ensure consistent design across templates.
There was a problem hiding this comment.
Pull request overview
This PR implements pagination for SSH keys and instances, adds IPv6 network display, and introduces a status formatter utility to improve status display consistency across the application.
Key Changes:
- Added pagination controls with ellipsis support for SSH keys and instances pages
- Introduced a status formatter utility to convert raw status values (e.g., "preparing_disk") to human-readable formats (e.g., "Preparing Disk")
- Added IPv6 address display in the instances table's Network column
- Refactored instances API to use bookmark-based pagination for retrieving all instances
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/ssh_keys.html | Added pagination UI with per-page selector and page navigation |
| templates/instances.html | Moved per-page selector into pagination container, added Network column with IPv4/IPv6 display, updated pagination with ellipsis support |
| templates/instance_detail.html | Added status badge styling to the detail page status field |
| static/styles.css | Updated status badge classes to match new status values, added pagination ellipsis styling, removed unused list-filters styles |
| src/utils/status_formatter.rs | New utility to format raw status strings into display-friendly format |
| src/utils/mod.rs | Exported the new status_formatter module |
| src/models/instance_view.rs | Added status_display and main_ipv6 fields to InstanceView struct |
| src/templates/ssh_keys_page_template.rs | Added pagination fields to template struct |
| src/templates/instance_detail_template.rs | Added status field for badge rendering |
| src/handlers/ssh_keys.rs | Implemented pagination using new query struct and paginated API wrapper |
| src/handlers/instances.rs | Updated handlers to use status_display and populate IPv6 addresses |
| src/handlers/access.rs | Updated to populate status_display and network fields for instances |
| src/handlers/helpers.rs | Added load_ssh_keys_paginated_wrapper function |
| src/api/ssh_keys.rs | Implemented client-side pagination for SSH keys, changed API limit parameter |
| src/api/instances.rs | Refactored to use bookmark-based pagination for fetching all instances |
| src/api/mod.rs | Exported PaginatedSshKeys struct |
| src/services/instance_service.rs | Updated get_instance_for_action to populate new fields |
Comments suppressed due to low confidence (1)
src/services/instance_service.rs:73
- This default InstanceView initialization is duplicated across multiple files and functions. Consider extracting this into a helper function like
InstanceView::default_with_id(instance_id)or a method on InstanceView to improve maintainability and reduce code duplication.
let mut instance = InstanceView {
id: instance_id.to_string(),
hostname: "(no hostname)".into(),
region: "".into(),
main_ip: None,
main_ipv6: None,
status: "".into(),
status_display: "".into(),
vcpu_count_display: "—".into(),
ram_display: "—".into(),
disk_display: "—".into(),
os: None,
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Introduced a new route for upcoming features in the application, allowing users to access a dedicated page for features under development. - Created a 'Coming Soon' template to display feature information, including a user-friendly message and a link back to the instances page. - Updated the main application router to include the new route and modified the base template to link to various upcoming features. - Added CSS styles for the new button and adjusted existing styles for better layout consistency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.