This commit is contained in:
Mateusz Gruszczyński committed 2026-11-25 12:24:26 +01:00
1 parent f3ad1c9d35
commit c0fac56520
19 files changed
+250 -33

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
# RustProxy source and documentation maintenance # RustProxy source and documentation maintenance
Current source version: **0.41.3**. The Cargo package and binary are named `rust-proxy`. Current source version: **0.41.4**. The Cargo package and binary are named `rust-proxy`.
Before editing, read [README.md](README.md), the relevant [documentation guide](docs/README.md) and the actual code and tests. Historical release experiments are not current specifications. Use the bundled `src/admin/openapi.json` for API routes and payloads; the source implementation is authoritative for runtime behavior. Before editing, read [README.md](README.md), the relevant [documentation guide](docs/README.md) and the actual code and tests. Historical release experiments are not current specifications. Use the bundled `src/admin/openapi.json` for API routes and payloads; the source implementation is authoritative for runtime behavior.
+4
View File
@@ -2,6 +2,10 @@
Release history focused on **features, settings, default behavior, compatibility and fixes**. Changes to internal code structure and preliminary performance experiments are intentionally omitted. Historical descriptions reflect their respective releases; consult the current documentation for the settings available in the latest release. Release history focused on **features, settings, default behavior, compatibility and fixes**. Changes to internal code structure and preliminary performance experiments are intentionally omitted. Historical descriptions reflect their respective releases; consult the current documentation for the settings available in the latest release.
## 0.41.4 — Responsive backend charts and table layout fix
- **Backends table:** optional **Columns → Responsive charts** expands and shrinks the Requests, Latency and Traffic mini charts with the available width and UI scale. Defaults to off; saved per administrator. Error causes now retain native table-cell layout, removing the misaligned internal row border. No change to metrics or proxy behavior. Rebuild and run regression tests before deployment.
## 0.41.3 — Practical dashboard presets and stored-log domains ## 0.41.3 — Practical dashboard presets and stored-log domains
- **Hotfix:** cache outcome charts and domain counters count each client request once at its final response, including collapsed fills, stale fallback and revalidation; background refresh does not count as a client HIT. Cache operations retain their own counters. Error share uses completed exchanges, protocol shares use protocol totals, and HTTP/1.0 is included in H1. Additive status/Cache API and Prometheus metrics; no configuration or storage migration. Source-level hotfix; rebuild and run Rust regression tests before deployment. - **Hotfix:** cache outcome charts and domain counters count each client request once at its final response, including collapsed fills, stale fallback and revalidation; background refresh does not count as a client HIT. Cache operations retain their own counters. Error share uses completed exchanges, protocol shares use protocol totals, and HTTP/1.0 is included in H1. Additive status/Cache API and Prometheus metrics; no configuration or storage migration. Source-level hotfix; rebuild and run Rust regression tests before deployment.
Generated
+1 -1
View File
@@ -1914,7 +1914,7 @@ dependencies = [
[[package]] [[package]]
name = "rust-proxy" name = "rust-proxy"
version = "0.41.3" version = "0.41.4"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"arc-swap", "arc-swap",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "rust-proxy" name = "rust-proxy"
version = "0.41.3" version = "0.41.4"
edition = "2021" edition = "2021"
rust-version = "1.99.1" rust-version = "1.99.1"
description = "RustProxy - independent reverse proxy with local administration" description = "RustProxy - independent reverse proxy with local administration"
+19 -18
View File
@@ -1,10 +1,10 @@
61bf40a0572889dc8b0dda9eae4e93e44b0de9364b3c798106c85700ffb37c23 .dockerignore 61bf40a0572889dc8b0dda9eae4e93e44b0de9364b3c798106c85700ffb37c23 .dockerignore
4140a2956264b44f259e6a37fc00ba02097bbe68b09296e04d3d243c1287129b .env.example 4140a2956264b44f259e6a37fc00ba02097bbe68b09296e04d3d243c1287129b .env.example
e76e688874828e3743d03693b1d2872b9633b4db09909673786caf30f7cfe489 .gitignore 0a5e87541831edca0e7164c6469dba01a8a7053ab14dbfb8019c83e4db10edc2 .gitignore
45bf3959f2bd53a08db232fd518f390d455a45501f98bd3c97e71e22dad90bd6 AGENTS.md fdd8a547e8ab715bdd227b7280320c509bd7659d31e61aa8212fd7a32308aa6e AGENTS.md
a7451a7a092c52b573ae5e5279bc316323163320e95c4fb2e86d85f0dd0236a5 CHANGELOG.md 3ee40d0f4181b5ebdde703cc8ef5453e9b1ec5679f1927dc9a3ff2ee9511e933 CHANGELOG.md
3396712e5842af47d4fa8a428fac5fff2f73110380f172c2a33ef7149c2f10ff Cargo.lock 4f02d7725c286a546f8e6e272318a0c01c4e9d4de7226b93ce6f7e881e197723 Cargo.lock
f2f82427377eb5264b8a6150797e3543858c781d49044404bbf46021885ddb02 Cargo.toml d84476e0fe880b9c930a4eb7c0c4da690683b70ce1c20590b6ce2e739c08f69d Cargo.toml
788745d4f70a0382c6280020afbd48844bb2af65e835a826852143f8132cdeca Dockerfile 788745d4f70a0382c6280020afbd48844bb2af65e835a826852143f8132cdeca Dockerfile
0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 LICENSE 0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0 LICENSE
82d1dee2fc68158f0ea73259151461e64c8b18d807cd1fecfb1ed99dc30cf5f4 README.md 82d1dee2fc68158f0ea73259151461e64c8b18d807cd1fecfb1ed99dc30cf5f4 README.md
@@ -46,9 +46,9 @@ c0940a4b323d71931cf2ad4ad24d58b6d6bfd49af90c6e3fc91fcbe2b4cf312f docs/ACCESS.md
31285f000cf725d018a926023fe608fec983b959053f7a55e0954b962a8bc20c docs/CERTIFICATES.md 31285f000cf725d018a926023fe608fec983b959053f7a55e0954b962a8bc20c docs/CERTIFICATES.md
6aa83366ad45227d10ebe121ed2c4f690ebcb826939ec2b2eafb40bfd714ac69 docs/CONFIGURATION.md 6aa83366ad45227d10ebe121ed2c4f690ebcb826939ec2b2eafb40bfd714ac69 docs/CONFIGURATION.md
08fd05b08c7b0a749ebf2337e4243f6aba6f654eaee5398a3f478c720df4e4dd docs/CUSTOM_LOCATIONS.md 08fd05b08c7b0a749ebf2337e4243f6aba6f654eaee5398a3f478c720df4e4dd docs/CUSTOM_LOCATIONS.md
3c11b55f4a43f66e1a6e105492ef442e39025de0d07e4d93db97dcc2544d08eb docs/DASHBOARD.md 16d4510e38d43c3bbde9b7dab7af3aeb0cb837dc2f1956cfaad7a9a11bea3bfc docs/DASHBOARD.md
81bd7a901619092e2a5a5fb7e4edd2157f2b5ce7e0483c24581ec290080446c0 docs/DOCKER_DISCOVERY.md 81bd7a901619092e2a5a5fb7e4edd2157f2b5ce7e0483c24581ec290080446c0 docs/DOCKER_DISCOVERY.md
d97c448de8f0c6d8a8a426d76e535e58a41f332adcc475fbc1ba4a4d58a76e62 docs/FEATURES.md b43a03fa804b1dbc4ee64f8f17fd9fa5c2f76306af3c8897897668cea2069c97 docs/FEATURES.md
5e12c541648ca382366f999e93b8ae434603e5c750f6fad3bd6a8df81e3724a1 docs/HEADLESS.md 5e12c541648ca382366f999e93b8ae434603e5c750f6fad3bd6a8df81e3724a1 docs/HEADLESS.md
4282602f0b814841f71282040003bec91c24611e5152b33407b76e62357f8d3a docs/INSTALL.md 4282602f0b814841f71282040003bec91c24611e5152b33407b76e62357f8d3a docs/INSTALL.md
3268808766ad66263e465f251dce18cff2e7ede355638dc2b0975870b1a5eead docs/LOAD_BALANCING.md 3268808766ad66263e465f251dce18cff2e7ede355638dc2b0975870b1a5eead docs/LOAD_BALANCING.md
@@ -57,7 +57,7 @@ d97c448de8f0c6d8a8a426d76e535e58a41f332adcc475fbc1ba4a4d58a76e62 docs/FEATURES.
48105c4303401aa99ffff00d3ebaf3024535a492a4a7b883c6803e4732b37434 docs/MONITORING.md 48105c4303401aa99ffff00d3ebaf3024535a492a4a7b883c6803e4732b37434 docs/MONITORING.md
6d3937088eeb67a9f690d44ebe0b6e660b68116dbf69091ac7816bdc52cec2b6 docs/PERFORMANCE.md 6d3937088eeb67a9f690d44ebe0b6e660b68116dbf69091ac7816bdc52cec2b6 docs/PERFORMANCE.md
d5894c07c68ec4230987767198434abee13b0e525842fea21bcbe752fa82742b docs/PHP_FPM.md d5894c07c68ec4230987767198434abee13b0e525842fea21bcbe752fa82742b docs/PHP_FPM.md
1282e8d3e2ee044316e5536acaecc041eb7e1098965b4a657b0f1b00fe4a688f docs/README.md f6ff6dc567870fc3a03b7d51f8b53a262402cbfac08dcecf2d6f0b62cebe868b docs/README.md
b731219c844841c925abc522c7e09432795f591dd5bddd49ffafe013b550f736 docs/RESPONSE_DELIVERY.md b731219c844841c925abc522c7e09432795f591dd5bddd49ffafe013b550f736 docs/RESPONSE_DELIVERY.md
95ab4786792d5920a2e109b7d196838057f24b512a69d713fb5884dc75c84339 docs/SCREENSHOTS.md 95ab4786792d5920a2e109b7d196838057f24b512a69d713fb5884dc75c84339 docs/SCREENSHOTS.md
3a48184b36d225757fc5e2d22c629f89bfe5d4007ff087f0be0ce02a5fb04c28 docs/SECURITY.md 3a48184b36d225757fc5e2d22c629f89bfe5d4007ff087f0be0ce02a5fb04c28 docs/SECURITY.md
@@ -132,8 +132,8 @@ e9cbb0224c4a3d23a6019ba557e0cd568c1ad5e1582ff1e335fb7d99b7a1055d integrations/r
3f092a9ab80221eddd67be4d1a776acbc6e04c1eb6011b588280c28e83b2582f integrations/routeros-oci-build/build-routeros-oci.sh 3f092a9ab80221eddd67be4d1a776acbc6e04c1eb6011b588280c28e83b2582f integrations/routeros-oci-build/build-routeros-oci.sh
3f267cafa16006e5456ade78ee2d5fae02cc7ce747839523068ffd8d7c98798a integrations/routeros-oci-build/docker-entrypoint.sh 3f267cafa16006e5456ade78ee2d5fae02cc7ce747839523068ffd8d7c98798a integrations/routeros-oci-build/docker-entrypoint.sh
ae2ee2887fcba096d0de25edcc18faa1ffec35759274518db1bf6d6982f7176c langs/README.md ae2ee2887fcba096d0de25edcc18faa1ffec35759274518db1bf6d6982f7176c langs/README.md
de011f823f6a9a8be25c11293a3d2e2fa82678f5fabe951dc074c560a43c0bdb langs/en_US.json 74112fd556f321382627294f9adf140855201326cdfc40eb21fa184402f048f1 langs/en_US.json
888171b50ff58d55935def6813dc8c1feb21b4bc43d131f8205b14f1102124af langs/pl_pl.json bfc84663e9e0ad666cc5daefed920927ae53cd2365dbcf8cea95935f8e6d176f langs/pl_pl.json
8ed80f14633970899d56f4ea72684a8d4b1f2843c1c78bfacc4cbb5f7ce9ef4b make_zip.py 8ed80f14633970899d56f4ea72684a8d4b1f2843c1c78bfacc4cbb5f7ce9ef4b make_zip.py
e830d37dd1f81a4b0aa7d535f5bba69e34e433b0fd99cc8ee0b296786c32379a migrations/0002_admin.sql e830d37dd1f81a4b0aa7d535f5bba69e34e433b0fd99cc8ee0b296786c32379a migrations/0002_admin.sql
20112cc82192098b8d602f1c4f7ca08712e9e1366c845fabb92753187c370d35 migrations/0003_certificate_renewals.sql 20112cc82192098b8d602f1c4f7ca08712e9e1366c845fabb92753187c370d35 migrations/0003_certificate_renewals.sql
@@ -207,11 +207,11 @@ b9c2952e3fcfca540d0ad64f2d3acc5c1f5240e707f4f23ef4d452f46fcb520f src/admin/docu
e2253599b5e39510946729920d240711403a3889cc495eb49824296228f1d080 src/admin/file_logs_query.rs e2253599b5e39510946729920d240711403a3889cc495eb49824296228f1d080 src/admin/file_logs_query.rs
1594c8666991c1d07487a6a718211ef404cf49114721960f7e119bb7f605e3d2 src/admin/logging_api.rs 1594c8666991c1d07487a6a718211ef404cf49114721960f7e119bb7f605e3d2 src/admin/logging_api.rs
51228956c33358278ebed62941da273e1e87d0b5c5d1c40cc0d2c91aec9d7362 src/admin/mod.rs 51228956c33358278ebed62941da273e1e87d0b5c5d1c40cc0d2c91aec9d7362 src/admin/mod.rs
9c45eff3550e15a706ff10ead33dbcef766f01ba3da238026bafa9d7981373d3 src/admin/openapi.json a53150853e1fffc086a915365f83726e2185bf09e78cf5a50484dc978367dd7f src/admin/openapi.json
9f8842cdec27d703d1795dd6eb37d9420e9f5a2e56a0df93278c92bace5d1f4c src/admin/operations.rs 9f8842cdec27d703d1795dd6eb37d9420e9f5a2e56a0df93278c92bace5d1f4c src/admin/operations.rs
257d93a29d0bda96462bcf695aba8d0ec0f9412c379e066ec46ae8ee034e3a53 src/admin/panel_assets.rs 257d93a29d0bda96462bcf695aba8d0ec0f9412c379e066ec46ae8ee034e3a53 src/admin/panel_assets.rs
f5127855c2994d052678865df36d703b74f4a0afc633daf7718b10da18d26e37 src/admin/panel_content.rs f5127855c2994d052678865df36d703b74f4a0afc633daf7718b10da18d26e37 src/admin/panel_content.rs
77a23c54a9dc7ac2c2525d223fc4656e3c447b7ba32c96dd698b3ffb18ef1a69 src/admin/preferences.rs 229bbdf33d54bda51950358aff812f4a90944f13147c1225c23eff855bf8bb69 src/admin/preferences.rs
f3635b624cf48598d68274a470d84d15ef9f6070d56e437a0031afa724471d5e src/admin/preferences_columns.rs f3635b624cf48598d68274a470d84d15ef9f6070d56e437a0031afa724471d5e src/admin/preferences_columns.rs
ea202c67d9acb7614046f153beecdff10d5822b3d5627eaf2ebda33954b36474 src/admin/preferences_tests.rs ea202c67d9acb7614046f153beecdff10d5822b3d5627eaf2ebda33954b36474 src/admin/preferences_tests.rs
62ecbae5dee00aeeca3eb806e2605372471dfab971cde8f66f11e711df8fcea1 src/admin/public/mod.rs 62ecbae5dee00aeeca3eb806e2605372471dfab971cde8f66f11e711df8fcea1 src/admin/public/mod.rs
@@ -223,7 +223,7 @@ fba52102e77ca8871a42f97c91be8f10a9aa4f997868652d550fff3fbd41b66e src/admin/sess
9b5bc1a439c5e5611c47732fe86097877b50b09b10a0838d9813314ea6232d0c src/admin/status_live.rs 9b5bc1a439c5e5611c47732fe86097877b50b09b10a0838d9813314ea6232d0c src/admin/status_live.rs
c20f214e2ec2a14d8a88d07a63a27d9396a7a6bf9446f6ee31dbd77b12e4b585 src/admin/status_system.rs c20f214e2ec2a14d8a88d07a63a27d9396a7a6bf9446f6ee31dbd77b12e4b585 src/admin/status_system.rs
ea1d0b8ff69157215f9358f0de35b91462ab2bf1fb97f9ce9b37846d0432c56b src/admin/tail.rs ea1d0b8ff69157215f9358f0de35b91462ab2bf1fb97f9ce9b37846d0432c56b src/admin/tail.rs
db398ca764c60ad5f067d1c1e4bb47c00a7060f281a710f33844f758f443d6d0 src/admin/tests.rs df5a27217dddb114fa7612332232f6315bad7870112e5686b2613ba293614f83 src/admin/tests.rs
d6c7ef48325c8f4f7ae7504827c0255c263b41c838f61960381907ca78eb9b95 src/admin/web/acl-picker.js d6c7ef48325c8f4f7ae7504827c0255c263b41c838f61960381907ca78eb9b95 src/admin/web/acl-picker.js
1e46ac359a11a85374d93936fb849864bea43021c20770fff5076acd846e8859 src/admin/web/acme.js 1e46ac359a11a85374d93936fb849864bea43021c20770fff5076acd846e8859 src/admin/web/acme.js
30a71c399e9a2cd9a4c1830568e4767f219ce09bca35f6d5fd22424f1a6617ac src/admin/web/admin_origin_rejected.html 30a71c399e9a2cd9a4c1830568e4767f219ce09bca35f6d5fd22424f1a6617ac src/admin/web/admin_origin_rejected.html
@@ -262,8 +262,8 @@ fe7982223b9b3ba70a18c28a09659884cd7277f8d152c851f4db1d482ab5ea04 src/admin/web/
f554ca7179fe4d97ae24aa004d4bc9ada5f84fc78257891933a7fed728006ef8 src/admin/web/css/00-tokens.css f554ca7179fe4d97ae24aa004d4bc9ada5f84fc78257891933a7fed728006ef8 src/admin/web/css/00-tokens.css
fd33db7132f8d6f98c46b60e882d1521cdae905176900fc50cfc7cc58d22d7b3 src/admin/web/css/10-base.css fd33db7132f8d6f98c46b60e882d1521cdae905176900fc50cfc7cc58d22d7b3 src/admin/web/css/10-base.css
2e163a7f82c51525df24fb7895c8f6d9cb374fd58544b3f4516882c6003ab316 src/admin/web/css/20-shell.css 2e163a7f82c51525df24fb7895c8f6d9cb374fd58544b3f4516882c6003ab316 src/admin/web/css/20-shell.css
ab5a74e9eaf0cd3f12df5ae9db9b45311ff453f235bb5acea2b0a8b2a980fe61 src/admin/web/css/30-overview.css 5c2b8f73624d83801ad7f408680e93f7761749f221791995da52f0bb475c9037 src/admin/web/css/30-overview.css
61709bb506ff9e1333d64df5687c71eb04493857dad848c0690e7bb1122ed735 src/admin/web/css/40-editors.css 585c5146f86c5bb91e0e5167c57cbc441bb4d46bffcaa01bf34ff636af70672d src/admin/web/css/40-editors.css
53ceb0dc4b958f1eded1e1a0e58e585ef13e4ebb45b797ba1b8534b552ea6c16 src/admin/web/css/50-settings.css 53ceb0dc4b958f1eded1e1a0e58e585ef13e4ebb45b797ba1b8534b552ea6c16 src/admin/web/css/50-settings.css
6c369dc95db9f60680f38218fb504eb552bb05da3e819eeca44527f14a23d51e src/admin/web/css/60-monitoring.css 6c369dc95db9f60680f38218fb504eb552bb05da3e819eeca44527f14a23d51e src/admin/web/css/60-monitoring.css
5ca5f911d7ded39a34c5c65980f82cc4d39cfa911cb9554550dfc78bba48461d src/admin/web/css/70-responsive.css 5ca5f911d7ded39a34c5c65980f82cc4d39cfa911cb9554550dfc78bba48461d src/admin/web/css/70-responsive.css
@@ -294,7 +294,7 @@ e6c4d91d1542d0a5b47bb8736f9539d43a6713df5a473b635519d5b7eac2eb9c src/admin/web/
0a5fff35555153f59d4346933030a67b6e1a8768cee7a47cfa2fcf1a2c564f63 src/admin/web/favicon.svg 0a5fff35555153f59d4346933030a67b6e1a8768cee7a47cfa2fcf1a2c564f63 src/admin/web/favicon.svg
e0f0b302092ced1c84ef7e99864984444f0e9d4e3b7d85e74d3507d566952a7f src/admin/web/file-logs.js e0f0b302092ced1c84ef7e99864984444f0e9d4e3b7d85e74d3507d566952a7f src/admin/web/file-logs.js
85f54ce519140a38e31fb1b3d5974585748d7162f0499aa63703c1db56334b2c src/admin/web/host404.js 85f54ce519140a38e31fb1b3d5974585748d7162f0499aa63703c1db56334b2c src/admin/web/host404.js
524045fc91975149b810914654902b9653004e657aab9ebdeca754dd243aabce src/admin/web/index.html 25885b9c756fd9ade8b99cf8b89cad8c89d208205f905d37d1d484d46f1187d1 src/admin/web/index.html
be9999a001c59630963d60539e860b59999dcf74c5ff0087b12a6fb69b4e7bd2 src/admin/web/integrations.js be9999a001c59630963d60539e860b59999dcf74c5ff0087b12a6fb69b4e7bd2 src/admin/web/integrations.js
7a12f020fc587205694978ab41b660e9a80487d413fbf6e34fc525eabc58308f src/admin/web/login-keys.json 7a12f020fc587205694978ab41b660e9a80487d413fbf6e34fc525eabc58308f src/admin/web/login-keys.json
ac9f667273918e18406df06cb2613c923f50a88897693a03a18f500e22dc6ec2 src/admin/web/login.html ac9f667273918e18406df06cb2613c923f50a88897693a03a18f500e22dc6ec2 src/admin/web/login.html
@@ -318,7 +318,7 @@ b2944b302f4abe21f649ec7abced34d2d49f97e1e01d9f26ae4d4b29b7a8538d src/admin/web/
3776f72d7051af86ac5fbdd4581040dd88a424c0c6cde789301b032b159094d8 src/admin/web/vhosts/health.js 3776f72d7051af86ac5fbdd4581040dd88a424c0c6cde789301b032b159094d8 src/admin/web/vhosts/health.js
b3239e67901f1796d7a974ade0796f2e3590ff8064628a5629b78c7f6ce2f32e src/admin/web/vhosts/protocol.js b3239e67901f1796d7a974ade0796f2e3590ff8064628a5629b78c7f6ce2f32e src/admin/web/vhosts/protocol.js
8c3da49973c62333559b0e3588c02beb0b425c025eac5cfa82a1bb968f70d9dd src/admin/web/vhosts/rates.js 8c3da49973c62333559b0e3588c02beb0b425c025eac5cfa82a1bb968f70d9dd src/admin/web/vhosts/rates.js
a8ff02101d2f3b09265ad2606b7e1b455a644184238d3e7acb24bd244af70bd6 src/admin/web/vhosts/render.js 812349f5a83c324f626ead937a791a97b50c8ab92f1e66b0fc798d417b752269 src/admin/web/vhosts/render.js
90684f1bfb0e079438654e1f8c5b9ee1b4f74e49126a82c88768f3ae209a1875 src/admin/web/vhosts/routing.js 90684f1bfb0e079438654e1f8c5b9ee1b4f74e49126a82c88768f3ae209a1875 src/admin/web/vhosts/routing.js
683b6506989d6ca9f3a0b1da7c1c931dce3ea3fbcb95dd9c56b038ac9a1c977c src/admin/web/web-server-profiles.js 683b6506989d6ca9f3a0b1da7c1c931dce3ea3fbcb95dd9c56b038ac9a1c977c src/admin/web/web-server-profiles.js
f9854526ff1567de47ecb02af872bca6e13c0adb984ad5ef0c256e5fdbb3902e src/admin/web/web-server.js f9854526ff1567de47ecb02af872bca6e13c0adb984ad5ef0c256e5fdbb3902e src/admin/web/web-server.js
@@ -482,7 +482,7 @@ f8a9541b568ade946dfc0b3353548a773a0126f705b537815ce0523439b07ef4 src/prometheus
12cf2b67072b10bcb163eeef76efc298dae1d9598ea6bb8a441f735339c1c467 src/prometheus/vhosts_backends.rs 12cf2b67072b10bcb163eeef76efc298dae1d9598ea6bb8a441f735339c1c467 src/prometheus/vhosts_backends.rs
f1b0254f53b1a4336bd8170ad441ba072b49a114e497b985cb20699b4e375044 src/prometheus/web_php.rs f1b0254f53b1a4336bd8170ad441ba072b49a114e497b985cb20699b4e375044 src/prometheus/web_php.rs
0907577a636a330b3c82c3f68b820c019088199b06ac824df23eaf47dff2633f src/proxy/body/mod.rs 0907577a636a330b3c82c3f68b820c019088199b06ac824df23eaf47dff2633f src/proxy/body/mod.rs
a45365167ff1ad1129631bd1bbc915d77fb2ef55df68a51cc32e4f3b0e965ce4 src/proxy/body/tests.rs f882bd071bf83a71e6786dd426a62b3a11ab022715d14f2f95b956b0ccee757b src/proxy/body/tests.rs
1af4712b76c5fd1f1248db8f3aa32a53019e20aeb1d62a34792ee539ed8e5d80 src/proxy/cache_helpers.rs 1af4712b76c5fd1f1248db8f3aa32a53019e20aeb1d62a34792ee539ed8e5d80 src/proxy/cache_helpers.rs
2d39552aa01ce3d048560944975243d0a58ae762d838e547f5fa65007d871dc4 src/proxy/cache_http_invalidation.rs 2d39552aa01ce3d048560944975243d0a58ae762d838e547f5fa65007d871dc4 src/proxy/cache_http_invalidation.rs
a86b10ce0707b51e925e11ea14f7f40fa108a196166f62cf40007a97f9e17203 src/proxy/cache_http_invalidation_tests.rs a86b10ce0707b51e925e11ea14f7f40fa108a196166f62cf40007a97f9e17203 src/proxy/cache_http_invalidation_tests.rs
@@ -639,6 +639,7 @@ f51b881c441fe8cab388c744911671ff925694b650e5ae7a5072cfdceb9ddaa4 third_party/sw
63818894e4b04cd0e3180d9cb20761e227a939121e7484f8e1d528227c756f89 third_party/swagger-ui-5.33.1/swagger-ui-bundle.js.LICENSE.txt 63818894e4b04cd0e3180d9cb20761e227a939121e7484f8e1d528227c756f89 third_party/swagger-ui-5.33.1/swagger-ui-bundle.js.LICENSE.txt
1ac324f7dcd27e4b9386b4bd6421271ec147e922a22c05ba24b11515e9aa6321 third_party/swagger-ui-5.33.1/swagger-ui.css 1ac324f7dcd27e4b9386b4bd6421271ec147e922a22c05ba24b11515e9aa6321 third_party/swagger-ui-5.33.1/swagger-ui.css
758351c494333d103c39c90afa44dcd2d59d2018b88e8f0947d2b02c317a7a34 tools/README.md 758351c494333d103c39c90afa44dcd2d59d2018b88e8f0947d2b02c317a7a34 tools/README.md
e6ee754a853d70e5a12b9884bfc813f63f83cdaf253590059b8b795e6caca4f0 tools/dev/backend_overview_smoke.py
3abb2bc94709baae3b962242a7f7322a7264a35365dd8559e9f6a7d59b33bb51 tools/dev/cache_edge_smoke.py 3abb2bc94709baae3b962242a7f7322a7264a35365dd8559e9f6a7d59b33bb51 tools/dev/cache_edge_smoke.py
7c30c280d0b0a8bf855eeffab583ca34dc161255f7ef6124148aa979c17c26d3 tools/dev/memory_load.py 7c30c280d0b0a8bf855eeffab583ca34dc161255f7ef6124148aa979c17c26d3 tools/dev/memory_load.py
d1418f8e574a7390fd45a2aa879bdf5720b773162d65e295ab0350506aa5220a tools/dev/mock_auth.py d1418f8e574a7390fd45a2aa879bdf5720b773162d65e295ab0350506aa5220a tools/dev/mock_auth.py
+2
View File
@@ -29,6 +29,8 @@ Optional Docker cards (since 0.37.0, hidden by default): **Docker agents**, **Do
In the **Backends** table with **Table density: Ultra compact**, the backend name line under each vhost is hidden to save space; hover the vhost name (dotted underline) to see the vhost and backend names in a tooltip. In the **Backends** table with **Table density: Ultra compact**, the backend name line under each vhost is hidden to save space; hover the vhost name (dotted underline) to see the vhost and backend names in a tooltip.
In **Overview → Backends → Columns**, enable **Responsive charts** to let the Requests, Latency and Traffic sparklines expand into the available table width. The charts also shrink when the card, browser window or interface scale changes; numeric values and a minimum chart width remain visible. On narrow screens the table still scrolls horizontally if needed. Chart height follows the selected table density. Turning the option off (the default, including existing accounts) restores the fixed chart widths. The setting is saved per administrator immediately (`backend_table_responsive_charts` in `/api/preferences`).
The Overview history sample count is saved in the browser immediately when the selection changes; no separate confirmation button is required. The Overview history sample count is saved in the browser immediately when the selection changes; no separate confirmation button is required.
The sidebar application-status indicator runs a lightweight self-check from the live status already used by the dashboard. Green means healthy, amber means attention is needed, and red means a problem was detected; click it to see API, listener, backend and logging details. The sidebar application-status indicator runs a lightweight self-check from the live status already used by the dashboard. Green means healthy, amber means attention is needed, and red means a problem was detected; click it to see API, listener, backend and logging details.
+1
View File
@@ -82,6 +82,7 @@ RustProxy is a single service that combines a reverse proxy, a static/PHP web se
- Overview dashboard with requests per second, bandwidth, status codes, completed-exchange error share, final-request cache hit ratio and outcomes, protocol mix, system load, backend health, requests rejected by limits and nearest certificate expiry. - Overview dashboard with requests per second, bandwidth, status codes, completed-exchange error share, final-request cache hit ratio and outcomes, protocol mix, system load, backend health, requests rejected by limits and nearest certificate expiry.
- Optional **Memory breakdown** card: process RSS split into cache data, cache bookkeeping, cache buffers, allocator-held free memory, mapped files and the rest of the process, with glibc heap statistics and an "outside cache" trend for spotting leaks. - Optional **Memory breakdown** card: process RSS split into cache data, cache bookkeeping, cache buffers, allocator-held free memory, mapped files and the rest of the process, with glibc heap statistics and an "outside cache" trend for spotting leaks.
- Optional responsive Requests, Latency and Traffic mini charts in the Backends table, saved per administrator.
- Customizable dashboard layouts (drag-and-drop with a live drop placeholder, keyboard moves, per-block width, explicit gap filling), 18 built-in layouts and up to 16 saved presets per administrator. - Customizable dashboard layouts (drag-and-drop with a live drop placeholder, keyboard moves, per-block width, explicit gap filling), 18 built-in layouts and up to 16 saved presets per administrator.
- Per-Vhost, per-backend, per-Web-Service and per-Stream statistics. - Per-Vhost, per-backend, per-Web-Service and per-Stream statistics.
- Live request log in the browser and in the terminal (`--livelogs`). - Live request log in the browser and in the terminal (`--livelogs`).
+1 -1
View File
@@ -46,7 +46,7 @@ Guides for operating RustProxy: installation, publishing services, security, cer
## Operations ## Operations
- [Dashboard](DASHBOARD.md) — Overview cards, layouts, 18 built-in presets, saved layouts and configuration history. - [Dashboard](DASHBOARD.md) — Overview cards, responsive backend mini charts, layouts, 18 built-in presets, saved layouts and configuration history.
- [Monitoring](MONITORING.md) — Prometheus exporter, JSON metrics, Grafana and Nagios. - [Monitoring](MONITORING.md) — Prometheus exporter, JSON metrics, Grafana and Nagios.
- [Logs](LOGS.md) — live, stored and error logs, per-site domain labels and rotation. - [Logs](LOGS.md) — live, stored and error logs, per-site domain labels and rotation.
- [Backup and recovery](BACKUP.md) — encrypted backups, restore and the Secret Store. - [Backup and recovery](BACKUP.md) — encrypted backups, restore and the Secret Store.
+1
View File
@@ -2398,6 +2398,7 @@
"backendSortAscending": "Ascending sort", "backendSortAscending": "Ascending sort",
"backendSortDescending": "Descending sort", "backendSortDescending": "Descending sort",
"backendColumns": "Columns", "backendColumns": "Columns",
"backendResponsiveCharts": "Responsive charts",
"backendSearchEmpty": "No backends match the current search.", "backendSearchEmpty": "No backends match the current search.",
"vhQuickEnable": "Enable", "vhQuickEnable": "Enable",
"vhQuickDisable": "Disable", "vhQuickDisable": "Disable",
+1
View File
@@ -2398,6 +2398,7 @@
"backendSortAscending": "Sortowanie rosnące", "backendSortAscending": "Sortowanie rosnące",
"backendSortDescending": "Sortowanie malejące", "backendSortDescending": "Sortowanie malejące",
"backendColumns": "Kolumny", "backendColumns": "Kolumny",
"backendResponsiveCharts": "Responsywne wykresy",
"backendSearchEmpty": "Brak backendów pasujących do wyszukiwania.", "backendSearchEmpty": "Brak backendów pasujących do wyszukiwania.",
"vhQuickEnable": "Włącz", "vhQuickEnable": "Włącz",
"vhQuickDisable": "Wyłącz", "vhQuickDisable": "Wyłącz",
Regular → Executable
View File
File mode changed.
+6 -1
View File
@@ -2,7 +2,7 @@
"openapi": "3.0.3", "openapi": "3.0.3",
"info": { "info": {
"title": "RustProxy Administration API", "title": "RustProxy Administration API",
"version": "0.41.3", "version": "0.41.4",
"description": "Administration API for the active panel origin. Sign in through the panel; the same-origin HttpOnly cookie authenticates all private operations. Mutations also require the exact Origin, X-RustProxy-Request: 1 and a session-bound X-CSRF-Token. Loopback HTTP is the default; Settings can enable HTTPS before using a non-loopback administration bind. This document contains no live configuration or credentials. Object schemas marked extensible are summaries: full configuration validation is authoritative in Rust. The API also permits explicitly scoped GeneralApiBearer tokens on a narrow route allowlist, with RO/RW and source CIDR checks; API-token management and Prometheus-token management are browser-session-only." "description": "Administration API for the active panel origin. Sign in through the panel; the same-origin HttpOnly cookie authenticates all private operations. Mutations also require the exact Origin, X-RustProxy-Request: 1 and a session-bound X-CSRF-Token. Loopback HTTP is the default; Settings can enable HTTPS before using a non-loopback administration bind. This document contains no live configuration or credentials. Object schemas marked extensible are summaries: full configuration validation is authoritative in Rust. The API also permits explicitly scoped GeneralApiBearer tokens on a narrow route allowlist, with RO/RW and source CIDR checks; API-token management and Prometheus-token management are browser-session-only."
}, },
"servers": [ "servers": [
@@ -4889,6 +4889,11 @@
"default": false, "default": false,
"description": "Account-scoped sort direction for the Backends diagnostics table." "description": "Account-scoped sort direction for the Backends diagnostics table."
}, },
"backend_table_responsive_charts": {
"type": "boolean",
"default": false,
"description": "Account-scoped option to expand the Requests, Latency and Traffic mini charts to the available Backends table column width."
},
"vhost_list_sort": { "vhost_list_sort": {
"type": "string", "type": "string",
"enum": [ "enum": [
+3
View File
@@ -201,6 +201,8 @@ struct AdminPreferences {
backend_table_sort: String, backend_table_sort: String,
#[serde(default)] #[serde(default)]
backend_table_descending: bool, backend_table_descending: bool,
#[serde(default)]
backend_table_responsive_charts: bool,
#[serde(default = "default_vhost_list_sort")] #[serde(default = "default_vhost_list_sort")]
vhost_list_sort: String, vhost_list_sort: String,
#[serde(default)] #[serde(default)]
@@ -261,6 +263,7 @@ impl Default for AdminPreferences {
backend_table_columns: default_backend_table_columns(), backend_table_columns: default_backend_table_columns(),
backend_table_sort: default_backend_table_sort(), backend_table_sort: default_backend_table_sort(),
backend_table_descending: false, backend_table_descending: false,
backend_table_responsive_charts: false,
vhost_list_sort: default_vhost_list_sort(), vhost_list_sort: default_vhost_list_sort(),
vhost_list_descending: false, vhost_list_descending: false,
docker_vhost_sort: default_docker_vhost_sort(), docker_vhost_sort: default_docker_vhost_sort(),
+4 -1
View File
@@ -2201,6 +2201,7 @@ mod tests {
.any(|column| column == "probe")); .any(|column| column == "probe"));
assert_eq!(initial["backend_table_sort"], "vhost"); assert_eq!(initial["backend_table_sort"], "vhost");
assert_eq!(initial["backend_table_descending"], false); assert_eq!(initial["backend_table_descending"], false);
assert_eq!(initial["backend_table_responsive_charts"], false);
assert!(store assert!(store
.save_admin_preferences("owner", r#"{"live_log_columns":["time","status"]}"#) .save_admin_preferences("owner", r#"{"live_log_columns":["time","status"]}"#)
@@ -2243,6 +2244,7 @@ mod tests {
); );
assert_eq!(legacy["backend_table_sort"], "vhost"); assert_eq!(legacy["backend_table_sort"], "vhost");
assert_eq!(legacy["backend_table_descending"], false); assert_eq!(legacy["backend_table_descending"], false);
assert_eq!(legacy["backend_table_responsive_charts"], false);
let selected = json!({ let selected = json!({
"refresh":{"live_enabled":false,"overview_seconds":10,"traffic_seconds":0,"cache_seconds":3,"system_info_seconds":300}, "refresh":{"live_enabled":false,"overview_seconds":10,"traffic_seconds":0,"cache_seconds":3,"system_info_seconds":300},
@@ -2267,7 +2269,8 @@ mod tests {
"file_log_columns":["time","event","client_ip","record"], "file_log_columns":["time","event","client_ip","record"],
"backend_table_columns":["vhost","backend","status","requests","latency"], "backend_table_columns":["vhost","backend","status","requests","latency"],
"backend_table_sort":"requests", "backend_table_sort":"requests",
"backend_table_descending":true "backend_table_descending":true,
"backend_table_responsive_charts":true
}); });
let normalized = serde_json::to_value( let normalized = serde_json::to_value(
serde_json::from_value::<AdminPreferences>(selected.clone()).unwrap(), serde_json::from_value::<AdminPreferences>(selected.clone()).unwrap(),
+39 -2
View File
@@ -3101,7 +3101,7 @@ html[data-dashboard-density] #panel-overview .stat :is(.stat-chart-legend, .over
font-variant-numeric: tabular-nums; font-variant-numeric: tabular-nums;
} }
.bo-latency>span { .bo-latency-content>span {
display: inline-block; display: inline-block;
min-width: 62px; min-width: 62px;
} }
@@ -3808,7 +3808,7 @@ html[data-table-density=ultra] .bo-traffic-text {
font-weight: 500; font-weight: 500;
} }
.bo-causes { .bo-causes-content {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
align-items: center; align-items: center;
@@ -3840,6 +3840,43 @@ html[data-table-density=ultra] .bo-traffic-text {
font: 11px var(--mono); font: 11px var(--mono);
} }
/* Keep the ordinary table layout when the option is disabled. In responsive
mode only the three sparkline columns consume surplus table width. Native
table sizing still preserves intrinsic text widths and horizontal scrolling. */
.bo-table.bo-responsive-charts {
min-width: 0;
}
.bo-table.bo-responsive-charts :is(th, td)[data-bo-column]:not([data-bo-column="requests"], [data-bo-column="latency"], [data-bo-column="traffic"]) {
width: 1px;
}
.bo-table.bo-responsive-charts :is(.bo-requests, .bo-latency, .bo-traffic) {
min-width: 0;
max-width: none;
}
.bo-table.bo-responsive-charts .bo-latency-content {
display: flex;
align-items: center;
gap: 6px;
}
.bo-table.bo-responsive-charts :is(.bo-requests .bo-chartcell>span, .bo-latency-content>span, .bo-traffic-text) {
flex: 0 0 auto;
}
.bo-table.bo-responsive-charts .bo-spark {
width: 0;
min-width: 44px;
margin-left: 0;
flex: 1 1 0;
}
.bo-table.bo-responsive-charts .bo-spark :is(polyline, line) {
vector-effect: non-scaling-stroke;
}
html[data-table-density=ultra] .bo-pair small { html[data-table-density=ultra] .bo-pair small {
display: inline; display: inline;
margin-left: 6px; margin-left: 6px;
+7
View File
@@ -286,6 +286,13 @@
font-size: 11px; font-size: 11px;
} }
.backend-column-options .bo-responsive-option {
grid-column: 1 / -1;
padding-bottom: 8px;
margin-bottom: 4px;
border-bottom: 1px solid var(--row-line);
}
.location-summary { .location-summary {
overflow-wrap: anywhere; overflow-wrap: anywhere;
cursor: pointer; cursor: pointer;
+6 -1
View File
@@ -715,7 +715,12 @@
id="bo-sort-direction" type="button">↑</button> id="bo-sort-direction" type="button">↑</button>
<details class="backend-column-picker"> <details class="backend-column-picker">
<summary class="quiet" data-i18n="backendColumns">Columns</summary> <summary class="quiet" data-i18n="backendColumns">Columns</summary>
<div class="backend-column-options" id="bo-column-options"></div> <div class="backend-column-options" id="bo-column-options">
<label class="check bo-responsive-option">
<input class="switch" id="bo-responsive-charts" type="checkbox" />
<span data-i18n="backendResponsiveCharts">Responsive charts</span>
</label>
</div>
</details> </details>
<button class="quiet" data-i18n="vhManage" id="bo-open" type="button">Manage <button class="quiet" data-i18n="vhManage" id="bo-open" type="button">Manage
vhosts</button> vhosts</button>
+19 -6
View File
@@ -155,7 +155,7 @@ const poolColumns = ["vhost", "backend", "status", "active", "requests", "errors
const poolOptionalColumns = ["rate", "p95", "probe", "causes", "protocol"]; const poolOptionalColumns = ["rate", "p95", "probe", "causes", "protocol"];
const vhostSortColumns = ["id", "hostname", "status", "listeners", "certificate", "backends"]; const vhostSortColumns = ["id", "hostname", "status", "listeners", "certificate", "backends"];
const defaultPoolColumns = () => poolColumns.filter(key => !poolOptionalColumns.includes(key)); const defaultPoolColumns = () => poolColumns.filter(key => !poolOptionalColumns.includes(key));
const defaultPoolTablePrefs = () => ({ sort: "vhost", descending: false, columns: defaultPoolColumns() }); const defaultPoolTablePrefs = () => ({ sort: "vhost", descending: false, columns: defaultPoolColumns(), responsiveCharts: false });
const defaultVhostListPrefs = () => ({ sort: "id", descending: false }); const defaultVhostListPrefs = () => ({ sort: "id", descending: false });
let poolTablePrefs = defaultPoolTablePrefs(), vhostListPrefs = defaultVhostListPrefs(), poolPreferenceSaveRunning = false, poolPreferenceSaveQueued = false; let poolTablePrefs = defaultPoolTablePrefs(), vhostListPrefs = defaultVhostListPrefs(), poolPreferenceSaveRunning = false, poolPreferenceSaveQueued = false;
function normalizePoolTablePrefs(preferences) { function normalizePoolTablePrefs(preferences) {
@@ -164,6 +164,7 @@ function normalizePoolTablePrefs(preferences) {
sort: poolColumns.includes(preferences?.backend_table_sort) ? preferences.backend_table_sort : "vhost", sort: poolColumns.includes(preferences?.backend_table_sort) ? preferences.backend_table_sort : "vhost",
descending: preferences?.backend_table_descending === true, descending: preferences?.backend_table_descending === true,
columns: selected.length ? selected : defaultPoolColumns(), columns: selected.length ? selected : defaultPoolColumns(),
responsiveCharts: preferences?.backend_table_responsive_charts === true,
}; };
} }
function normalizeVhostListPrefs(preferences) { function normalizeVhostListPrefs(preferences) {
@@ -175,7 +176,8 @@ function syncVhostSortDirection() {
control.setAttribute("aria-label", t(vhostListPrefs.descending ? "backendSortDescending" : "backendSortAscending")); control.setAttribute("aria-label", t(vhostListPrefs.descending ? "backendSortDescending" : "backendSortAscending"));
} }
function applyPreferences(preferences) { function applyPreferences(preferences) {
poolTablePrefs = normalizePoolTablePrefs(preferences); // A queued local change must survive the response to an earlier save.
if (!poolPreferenceSaveQueued) poolTablePrefs = normalizePoolTablePrefs(preferences);
vhostListPrefs = normalizeVhostListPrefs(preferences); vhostListPrefs = normalizeVhostListPrefs(preferences);
const poolSort = $("pool-sort"); if (poolSort) poolSort.value = poolTablePrefs.sort; const poolSort = $("pool-sort"); if (poolSort) poolSort.value = poolTablePrefs.sort;
const vhostSort = $("vhost-sort"); if (vhostSort) vhostSort.value = vhostListPrefs.sort; const vhostSort = $("vhost-sort"); if (vhostSort) vhostSort.value = vhostListPrefs.sort;
@@ -200,6 +202,7 @@ async function savePoolTablePrefs() {
backend_table_columns: poolColumns.filter(key => poolTablePrefs.columns.includes(key)), backend_table_columns: poolColumns.filter(key => poolTablePrefs.columns.includes(key)),
backend_table_sort: poolTablePrefs.sort, backend_table_sort: poolTablePrefs.sort,
backend_table_descending: poolTablePrefs.descending, backend_table_descending: poolTablePrefs.descending,
backend_table_responsive_charts: poolTablePrefs.responsiveCharts,
}); });
if (!authenticated) return; if (!authenticated) return;
if (!poolPreferenceSaveQueued) poolTablePrefs = normalizePoolTablePrefs(saved); if (!poolPreferenceSaveQueued) poolTablePrefs = normalizePoolTablePrefs(saved);
@@ -212,6 +215,8 @@ function syncPoolColumns() {
const visible = new Set(poolTablePrefs.columns); const visible = new Set(poolTablePrefs.columns);
document.querySelectorAll("[data-pool-column]").forEach(node => { node.hidden = !visible.has(node.dataset.poolColumn); }); document.querySelectorAll("[data-pool-column]").forEach(node => { node.hidden = !visible.has(node.dataset.poolColumn); });
document.querySelectorAll("[data-pool-column-toggle]").forEach(input => { input.checked = visible.has(input.dataset.poolColumnToggle); }); document.querySelectorAll("[data-pool-column-toggle]").forEach(input => { input.checked = visible.has(input.dataset.poolColumnToggle); });
const responsive = $("bo-responsive-charts"); if (responsive) responsive.checked = poolTablePrefs.responsiveCharts;
$("bo-rows")?.closest(".bo-table")?.classList.toggle("bo-responsive-charts", poolTablePrefs.responsiveCharts && ["requests", "latency", "traffic"].some(key => visible.has(key)));
} }
function syncPoolSortDirection() { function syncPoolSortDirection() {
for (const id of ["pool-sort-direction", "bo-sort-direction"]) { for (const id of ["pool-sort-direction", "bo-sort-direction"]) {
@@ -257,6 +262,10 @@ function initPoolTableTools() {
$("pool-search")?.addEventListener("input", applyPoolTableView); $("pool-search")?.addEventListener("input", applyPoolTableView);
$("bo-search")?.addEventListener("input", applyBackendOverviewView); $("bo-search")?.addEventListener("input", applyBackendOverviewView);
$("bo-open")?.addEventListener("click", () => setPanel("vhosts")); $("bo-open")?.addEventListener("click", () => setPanel("vhosts"));
$("bo-responsive-charts")?.addEventListener("change", event => {
poolTablePrefs.responsiveCharts = event.currentTarget.checked;
syncPoolColumns(); applyBackendOverviewView(); void savePoolTablePrefs();
});
document.querySelectorAll("[data-pool-column-toggle]").forEach(input => input.addEventListener("change", () => { document.querySelectorAll("[data-pool-column-toggle]").forEach(input => input.addEventListener("change", () => {
const visible = new Set(poolTablePrefs.columns); const visible = new Set(poolTablePrefs.columns);
if (input.checked) visible.add(input.dataset.poolColumnToggle); else visible.delete(input.dataset.poolColumnToggle); if (input.checked) visible.add(input.dataset.poolColumnToggle); else visible.delete(input.dataset.poolColumnToggle);
@@ -274,7 +283,7 @@ let boItems = [], boFilter = "all", boHasProxy = true;
function buildBackendOverviewTools() { function buildBackendOverviewTools() {
const sort = $("bo-sort"), options = $("bo-column-options"); const sort = $("bo-sort"), options = $("bo-column-options");
if (sort && !sort.options.length) for (const key of poolColumns) { const option = el("option", t(BO_SORT_LABELS[key])); option.value = key; option.dataset.i18n = BO_SORT_LABELS[key]; sort.append(option); } if (sort && !sort.options.length) for (const key of poolColumns) { const option = el("option", t(BO_SORT_LABELS[key])); option.value = key; option.dataset.i18n = BO_SORT_LABELS[key]; sort.append(option); }
if (options && !options.children.length) for (const key of poolColumns) { if (options && !options.querySelector("[data-pool-column-toggle]")) for (const key of poolColumns) {
const label = el("label", undefined, "check"), input = el("input"), text = el("span", t(BO_SORT_LABELS[key])); const label = el("label", undefined, "check"), input = el("input"), text = el("span", t(BO_SORT_LABELS[key]));
input.type = "checkbox"; input.dataset.poolColumnToggle = key; text.dataset.i18n = BO_SORT_LABELS[key]; label.append(input, text); options.append(label); input.type = "checkbox"; input.dataset.poolColumnToggle = key; text.dataset.i18n = BO_SORT_LABELS[key]; label.append(input, text); options.append(label);
} }
@@ -337,6 +346,7 @@ const BO_SVG = "http://www.w3.org/2000/svg";
function boSvg(width, kind) { function boSvg(width, kind) {
const svg = document.createElementNS(BO_SVG, "svg"); const svg = document.createElementNS(BO_SVG, "svg");
svg.setAttribute("viewBox", `0 0 ${width} 20`); svg.setAttribute("class", `bo-spark bo-spark-${kind}`); svg.setAttribute("aria-hidden", "true"); svg.setAttribute("viewBox", `0 0 ${width} 20`); svg.setAttribute("class", `bo-spark bo-spark-${kind}`); svg.setAttribute("aria-hidden", "true");
if (poolTablePrefs.responsiveCharts) svg.setAttribute("preserveAspectRatio", "none");
boBaseline(svg, width, kind === "latency" ? 10 : 19); boBaseline(svg, width, kind === "latency" ? 10 : 19);
return svg; return svg;
} }
@@ -449,8 +459,10 @@ const BO_EXTRA_CELLS = {
causes(cell, extra) { causes(cell, extra) {
cell.className = "bo-causes"; cell.title = extra.text.causes; cell.className = "bo-causes"; cell.title = extra.text.causes;
if (!extra.causes.length) { cell.append(el("span", "-", "is-zero")); return; } if (!extra.causes.length) { cell.append(el("span", "-", "is-zero")); return; }
for (const cause of extra.causes.slice(0, 3)) { const chip = el("span", undefined, `bo-cause${cause.label === "retry" ? " is-soft" : ""}`); chip.append(cause.label, el("b", String(cause.value))); cell.append(chip); } const wrap = el("div", undefined, "bo-causes-content");
if (extra.causes.length > 3) cell.append(el("small", `+${extra.causes.length - 3}`)); for (const cause of extra.causes.slice(0, 3)) { const chip = el("span", undefined, `bo-cause${cause.label === "retry" ? " is-soft" : ""}`); chip.append(cause.label, el("b", String(cause.value))); wrap.append(chip); }
if (extra.causes.length > 3) wrap.append(el("small", `+${extra.causes.length - 3}`));
cell.append(wrap);
}, },
protocol(cell, extra) { protocol(cell, extra) {
cell.className = "bo-pair"; cell.title = `H1 ${extra.h1} · H2 ${extra.h2}`; cell.className = "bo-pair"; cell.title = `H1 ${extra.h1} · H2 ${extra.h2}`;
@@ -520,7 +532,8 @@ function applyBackendOverviewView() {
top.append(el("span", String(item.errors), item.errors ? "" : "is-zero"), el("small", item.errors ? (pct < 0.1 ? "<0.1%" : `${pct.toFixed(pct < 10 ? 1 : 0)}%`) : "0%")); top.append(el("span", String(item.errors), item.errors ? "" : "is-zero"), el("small", item.errors ? (pct < 0.1 ? "<0.1%" : `${pct.toFixed(pct < 10 ? 1 : 0)}%`) : "0%"));
fill.style.width = `${item.errors ? Math.min(100, Math.max(4, pct)) : 0}%`; if (pct >= 5) fill.className = "is-high"; track.append(fill); cell.className = "bo-errors"; cell.append(top, track); fill.style.width = `${item.errors ? Math.min(100, Math.max(4, pct)) : 0}%`; if (pct >= 5) fill.className = "is-high"; track.append(fill); cell.className = "bo-errors"; cell.append(top, track);
} else if (id === "latency") { } else if (id === "latency") {
cell.className = "bo-latency"; cell.append(el("span", item.latency > 0 ? `${item.latency.toFixed(1)} ms` : "-", item.latency > 0 ? "" : "is-zero"), boSparkline(boSeriesOf(item).latency, item.latency)); cell.className = "bo-latency"; const wrap = el("div", undefined, "bo-latency-content");
wrap.append(el("span", item.latency > 0 ? `${item.latency.toFixed(1)} ms` : "-", item.latency > 0 ? "" : "is-zero"), boSparkline(boSeriesOf(item).latency, item.latency)); cell.append(wrap);
} else if (id === "traffic") { } else if (id === "traffic") {
cell.className = "bo-traffic"; const wrap = el("div", undefined, "bo-chartcell"), text = el("div", undefined, "bo-traffic-text"); wrap.title = `${rateBytes(item.traffic)}/s`; cell.className = "bo-traffic"; const wrap = el("div", undefined, "bo-chartcell"), text = el("div", undefined, "bo-traffic-text"); wrap.title = `${rateBytes(item.traffic)}/s`;
const line = (kind, label, value) => { const row = el("div", undefined, `bo-${kind}`); row.append(el("span", label), el("b", `${rateBytes(value)}/s`, value > 0 ? "" : "is-zero")); return row; }; const line = (kind, label, value) => { const row = el("div", undefined, `bo-${kind}`); row.append(el("span", label), el("b", `${rateBytes(value)}/s`, value > 0 ? "" : "is-zero")); return row; };
+134
View File
@@ -0,0 +1,134 @@
#!/usr/bin/env python3
"""Browser regression for Backends table layout, using source assets and a mock preference API.
Optional development dependencies: pip install playwright; playwright install chromium
(or a system chromium binary). This does not test the compiled RustProxy server.
"""
from pathlib import Path
import json
import re
import shutil
from playwright.sync_api import sync_playwright
ROOT = Path(__file__).resolve().parents[2]
WEB = ROOT / "src/admin/web"
def main():
html = (WEB / "index.html").read_text(encoding="utf-8")
article = re.search(r'<article class="card pool-card backend-overview-card".*?</article>', html, re.S).group()
manifest = json.loads((WEB / "css/manifest.json").read_text(encoding="utf-8"))
styles = "\n".join((WEB / "css" / name).read_text(encoding="utf-8") for name in manifest["files"])
source = (WEB / "vhosts/render.js").read_text(encoding="utf-8")
# Isolate the actual table renderer from the unrelated Vhost editor.
renderer = "const poolColumns =" + source.split("const poolColumns =", 1)[1].split("async function toggleVhostEnabled", 1)[0]
translations = json.loads((ROOT / "langs/en_US.json").read_text(encoding="utf-8"))["translations"]
stubs = "const translations = " + json.dumps(translations) + ";\n" + """
const $ = id => document.getElementById(id);
const el = (tag, text, cls) => { const node = document.createElement(tag); if (text !== undefined) node.textContent = text; if (cls) node.className = cls; return node; };
const t = key => translations[key] || key;
const rateBytes = value => value.toFixed(1) + ' KiB', bytes = rateBytes;
const compareText = (a,b) => String(a).localeCompare(String(b));
const authenticated = true, render = () => {}, toast = message => { throw Error(message); };
window.saved = {};
window.rustProxyPreferences = { update: async patch => {
await new Promise(resolve => setTimeout(resolve, 30));
Object.assign(window.saved, patch);
applyPreferences(window.saved);
return {...window.saved};
}};
"""
fixture = """
initPoolTableTools();
const testColumns = ['vhost','status','active','requests','statuses','latency','traffic','causes','lastFailure'];
const extra = {text:{causes:'5xx 5'},classes:[0,95,0,0,5],classTotal:100,causes:[{label:'5xx',value:5}]};
boItems = Array.from({length:3}, (_,i) => ({
key:String(i),group:'up',tone:'up',vhost:'example-'+i,backend:'origin',label:'UP',title:'healthy',activeText:'17/∞',requests:156901,errors:5,latency:48.8,traffic:15,trafficIn:5,trafficOut:10,sort:{},search:'example',
extra:i===1?{...extra,causes:[],text:{causes:'-'}}:extra,
series:{latency:[45,21,34,48.8],requests:[2,1,5,8,3],inRate:[0,2,4,5],outRate:[5,1,3,10]}
}));
applyPreferences({backend_table_columns:testColumns});
window.measure = () => ({
available:document.querySelector('.table-scroll').clientWidth,
table:document.querySelector('.bo-table').offsetWidth,
charts:Object.fromEntries(['bars','latency','traffic'].map(type => {
const svg = document.querySelector('.bo-spark-'+type);
return [type,svg?{width:svg.getBoundingClientRect().width,height:svg.getBoundingClientRect().height,aspect:svg.getAttribute('preserveAspectRatio')}:null];
})),
causes:[...document.querySelectorAll('td.bo-causes')].map(td => ({
display:getComputedStyle(td).display,top:td.getBoundingClientRect().top,rowTop:td.parentElement.getBoundingClientRect().top,height:td.getBoundingClientRect().height,rowHeight:td.parentElement.getBoundingClientRect().height,text:td.textContent
}))
});
"""
with sync_playwright() as playwright:
browser = playwright.chromium.launch(executable_path=shutil.which("chromium"), headless=True)
page = browser.new_page(viewport={"width":1800,"height":800})
errors = []
page.on("pageerror", lambda error: errors.append(str(error)))
page.set_content('<html data-theme="dark" data-table-density="normal"><head><style>' + styles + '</style></head><body><div id="panel-overview">' + article + '</div></body></html>')
page.add_script_tag(content=stubs + renderer + "\n" + fixture)
measure = lambda: page.evaluate("measure()")
def widths():
return [chart["width"] for chart in measure()["charts"].values()]
def settled():
page.wait_for_function("!poolPreferenceSaveRunning && !poolPreferenceSaveQueued")
def cause_layout():
causes = measure()["causes"]
assert len(causes) == 3 and causes[1]["text"] == "-"
for cell in causes:
assert cell["display"] == "table-cell"
assert abs(cell["top"] - cell["rowTop"]) < 0.1
assert abs(cell["height"] - cell["rowHeight"]) < 0.1
switch = page.locator("#bo-responsive-charts")
page.locator(".backend-column-picker summary").click()
assert not switch.is_checked() and widths() == [84,120,96]
cause_layout()
switch.check()
settled()
assert page.evaluate("saved.backend_table_responsive_charts") is True
assert all(chart["aspect"] == "none" for chart in measure()["charts"].values())
wide = widths()
assert all(a > b for a,b in zip(wide,[84,120,96]))
cause_layout()
# Resize with no rerender; the native table and CSS flex layout do the work.
page.set_viewport_size({"width":2400,"height":800})
assert all(a > b for a,b in zip(widths(),wide))
page.set_viewport_size({"width":600,"height":800})
narrow = measure()
assert narrow["table"] > narrow["available"]
assert all(chart["width"] >= 44 for chart in narrow["charts"].values())
page.set_viewport_size({"width":1800,"height":800})
# Hidden columns free space for each remaining chart.
page.locator('[data-pool-column-toggle="statuses"]').uncheck()
settled()
assert all(a > b for a,b in zip(widths(),wide))
for density,height in [("normal",22),("compact",18),("ultra",14)]:
page.evaluate("density=>document.documentElement.dataset.tableDensity=density",density)
assert all(chart["height"] == height for chart in measure()["charts"].values())
cause_layout()
before_scale = widths()
page.evaluate("document.documentElement.style.setProperty('--ui-scale','.7')")
assert all(a > b for a,b in zip(widths(),before_scale))
page.evaluate("document.documentElement.style.removeProperty('--ui-scale')")
page.evaluate("document.documentElement.dataset.tableDensity='normal'")
# Simulate two changes before the first save has returned.
page.evaluate("""() => { const input = $('bo-responsive-charts'); for (const checked of [false,true,false]) { input.checked = checked; input.dispatchEvent(new Event('change')); } }""")
settled()
assert page.evaluate("saved.backend_table_responsive_charts") is False
assert not switch.is_checked() and widths() == [84,120,96]
assert all(chart["aspect"] is None for chart in measure()["charts"].values())
# Loading account preferences restores the selected mode and absent legacy fields default off.
page.evaluate("applyPreferences({...saved,backend_table_responsive_charts:true})")
assert switch.is_checked()
page.evaluate("applyPreferences({backend_table_columns:testColumns})")
assert not switch.is_checked() and widths() == [84,120,96]
cause_layout()
assert not errors, errors
browser.close()
print("Backends browser regression passed (mock preference API, real source assets).")
if __name__ == "__main__":
main()