Repository navigation
fix(admin): show storage count window and 24h default label (#1322) - #1419
avantikonde wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 5afad25 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; the previous large-date crash is fixed.
|
Description
Displays the query's actual
since/untilbounds beside each storage count row and clearly labels defaulted 24 h windows so a 24-hour slice cannot be misread as an all-time store total:resources/admin/dashboard.html:"optional since/until unix seconds"to state that omittedsince/untilbounds default to the last 24 h.Windowcolumn (<th scope="col">Window</th>) besideCountand updated the initial empty row tocolspan="3".resources/admin/assets/admin-ops.js:formatBoundandformatStorageWindowto formatpayload.since/payload.untilas UTC timestamps (supporting0timestamps) and label defaulted windows (last 24 h (...)when both bounds defaulted,default 24 h (...)when onlysincedefaulted, and(... (until defaulted to now))when onlyuntildefaulted).renderStorageandloadStorageto render theWindowcell beside every row and update the empty-statecolspanto3.crates/nostream-admin/tests/console_parity.rs:the_storage_panel_renders_the_window_it_reports, checking thedashboard.htmlcopy/columns and executingadmin-ops.jsunder Node with mockedfetchresponses for defaulted (last 24 h), explicit bounds,until-only (default 24 h),since = 0, and empty results (colspan="3")..changeset/admin-storage-panel-window.md:rewrite/main.Related Issue
Addresses #1322 (targeting
rewrite/main).Motivation and Context
crates/nostream-admin/src/utils/storage.rsdefaults absentsince/untilquery parameters toDEFAULT_WINDOW_SECONDS(86_400s), andGET /admin/ops/storage/countsreturns bothsinceanduntilin the JSON payload. PreviouslyrenderStoragerendered onlykindsandcountwhiledashboard.htmldescribed bounds as"optional since/until unix seconds", making a 24-hour count look like a total count across the store.How Has This Been Tested?
./node_modules/.bin/biome lint resources/admin/assets/admin-ops.js— passed (0errors).cargo fmt --all --check— passed.cargo clippy -p nostream-admin --all-targets --all-features -- -D warnings— passed.cargo clippy --workspace --lib --bins --all-features -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::todo -D clippy::unimplemented -D clippy::panic— passed.cargo check --workspace --all-features— passed.cargo test -p nostream-admin --test console_parity -- the_parser_reads_the_capture_s_call_shapes a_missing_console_file_is_a_failure the_derivation_finds_every_console_route the_storage_panel_renders_the_window_it_reports— 4 passed, 0 failed (every_console_route_is_servedfiltered out locally because socket binding is restricted in the sandbox).cargo test -p nostream-admin --lib— 61 passed, 0 failed.Screenshots (if appropriate):
Types of changes
Checklist:
Summary by CodeRabbit