Add pagination support for instances listing in CLI and web interface#3
Merged
Add pagination support for instances listing in CLI and web interface#3
Conversation
Co-authored-by: tayyebi <14053493+tayyebi@users.noreply.github.com>
Co-authored-by: tayyebi <14053493+tayyebi@users.noreply.github.com>
…per-page in CLI hints Co-authored-by: tayyebi <14053493+tayyebi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement pagination for listing instances in CLI and web interface
Add pagination support for instances listing in CLI and web interface
Jan 7, 2026
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.
Implements page-based navigation for instance lists to handle large result sets. Pagination defaults to disabled (showing all instances) to preserve existing behavior.
Changes
Backend (
src/api/instances.rs)PaginatedInstancesstruct returns instances with metadata:total_count,current_page,total_pages,per_pageload_instances_for_usersignature to acceptpageandper_pageparametersWeb Interface
?page=N&per_page=M(defaults: page=1, per_page=20)total_pages > 1:Template updates:
src/handlers/instances.rs- Query parameter extractionsrc/templates/instances_page_template.rs- Added pagination fieldstemplates/instances.html- Pagination UIstatic/styles.css- Pagination stylingCLI
--page <N>(alias-p),--per-page <M>Example:
Screenshot
Empty state shown; pagination controls appear when multiple pages exist
Edge Cases
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.cloudzy.comtarget/debug/zy target/debug/zy serve --host 127.0.0.1 --port 5050 lib/rustlib/x86_/home/REDACTED/work/cli/cli/target/debug/deps/askama_derive-a0d8116b74b54c6a.askam--norc lib/rustlib/x86_/home/REDACTED/work/cli/cli/target/debug/deps/askama_derive-a0d8116b74b54c6a.askam--noprofile c1c51275a3f.thisgit c1c51275a3f.thischeckout c1c51275a3f.thiscopilot/add-pagination-to-instances c1c51275a3f.thiserror_impl.a5ec9bc65d29fa06-cgu.03.rcgu.o c1c5�� c1c51275a3f.thiserror_impl.a5ec9bc65d29fa06-cgu.05.rcgu.o c1c51275a3f.thiserror_impl.a5ec9bc65d29fa06-cgu.06.rcgu.o c1c51275a3f.thiserror_impl.a5ec9bc65d29fa06-cgu.07.rcgu.o c1c51275a3f.thisbash c1c51275a3f.this--norc c1c51275a3f.this--noprofile c1c51275a3f.thiserror_impl.a5ec9bc65d29fa06-cgu.11.rcgu.o(dns block)target/debug/zy target/debug/zy instances list --silent lib/�� lib/rustlib/x86_debuginfo=2 lib/rustlib/x86_--check-cfg f/hex-0.4.3/src/lib.rs lib/rustlib/x86_git lib/rustlib/x86_add lib/rustlib/x86_. lib/rustlib/x86_-v lib/�� lib/rustlib/x86_64-REDACTED-linux-gnu/lib/librustc_std_workspace_alloc-05b02707a5b2a256.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libminiz_oxide-5312b588e5cfab93.rlib _macros-c909fd3ee8b31b7d.time_ma--crate-type b2a256.rlib _macros-c909fd3e--type=utility _macros-c909fd3e--utility-sub-type=network.mojom.NetworkService _macros-c909fd3e--lang=en-US(dns block)target/debug/zy target/debug/zy instances list --page 1 --per-page 10 --silent 5a3956f1.axum_magit 5a3956f1.axum_macommit 5a3956f1.axum_ma-m bin/cargo 5a39�� 5a3956f1.axum_macros.db1037a7690a587-cgu.13.rcgu.o 5a3956f1.axum_macros.db1037a7690a587-cgu.14.rcgu.o 569.rlib 07a.rlib 84a9e5.rlib 42.rlib 9d2.rlib(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.