Commit Graph
446 Commits
Author SHA1 Message Date
Andrey Kolkov f4330867ea feat(dashboard): let a login link pick the Keycloak identity provider (#5286)
## What this PR does

A login link into the dashboard can now name the Keycloak identity
provider, so a user who comes from a portal brokered into Keycloak skips
the realm login page:

```
https://dashboard.<host>/oauth2/start?kc_idp_hint=<idp-alias>&rd=/admin/tenants
```

The motivating case is a billing portal registered in the realm as an
OIDC identity provider. Its "Open dashboard" button today lands every
client on "Sign in to <realm>", where they must pick the portal's
provider by hand on every new browser or session. Keycloak skips that
page when the auth request carries `kc_idp_hint`. The gatekeeper,
however, builds the request from a fixed `--login-url`, and
oauth2-proxy's flags forward only `acr_values`, `prompt` and
`approval_prompt` from `/oauth2/start`. Putting the hint into
`--login-url` would force every dashboard login, administrators
included, through that one provider.

oauth2-proxy can forward an allowed parameter through
`providers[].loginURLParameters`, but only in its alpha configuration.
The OIDC gatekeeper therefore now runs from one:

- `templates/gatekeeper-config.yaml` (new, OIDC only) holds the
provider, upstream, listen address and injected headers. The values are
exactly what `oauth2-proxy --convert-config-to-alpha` (v7.12.0) produces
for the previous flags, both the in-cluster Keycloak branch and the
external-discovery branch. On top of those, `kc_idp_hint` is allowed
when it matches `^[A-Za-z0-9._-]+$`. That rule and `clientSecretFile` in
place of the inline `clientSecret` are the only hand-written lines;
everything else, `scope`, `approval_prompt`, `insecureSkipNonce`,
`flushInterval` and `timeout` included, is the converter output
unchanged.
- `templates/gatekeeper.yaml` keeps the flags the alpha configuration
does not own (redirect URL, whitelist domain, email domain, API routes,
cookie options, `--skip-provider-button`, `--ssl-insecure-skip-verify`).
It mounts the config and the `dashboard-client` secret as files
(`clientSecretFile`). A checksum annotation restarts the pod when the
config changes.
- The token-proxy branch (OIDC disabled) is unchanged.

A login without the parameter behaves as before. oauth2-proxy logs a
warning on start that the alpha configuration format may change between
releases.

Tests:
- **Chart suite.** The gatekeeper suite loads the config template as
well, because the deployment checksums it. The "no branding volume" test
now asserts the branding volume is absent, not that the pod has no
volumes. The five tests that read Keycloak URLs from the container args
are removed: those values now sit in the alpha configuration. `helm
unittest .` passes, 23 tests.
- **E2E.** After the gatekeeper rolls out with OIDC enabled, the in-tree
install suite requests `/oauth2/start` through a port-forward and checks
the redirect: `kc_idp_hint=e2e-idp` reaches the `cozy` realm's auth URL,
and a value outside the allow pattern (`e2e%26prompt%3Dnone`) is
dropped. This covers the realm path and the allow rule that the removed
chart tests no longer pin.
- **Gatekeeper login (`hack/dashboard-gatekeeper-login.bats`).** Renders
the chart for a realm other than `cozy`, starts the auth-proxy image
with the rendered args and alpha config, and checks the `/oauth2/start`
redirect: on the in-cluster Keycloak branch the hint reaches that
realm's auth URL, a value outside the allow pattern is dropped, and a
login without it carries none; on the external-discovery branch the
gatekeeper discovers that realm from a local Keycloak stub and passes
the hint. The image is read from the render, so an oauth2-proxy bump
re-checks the alpha configuration. Needs docker, like
`hack/etcd-grpc-alerts.bats`.
- **Real oauth2-proxy v7.12.0 on the rendered config.** Ran with the
rendered args and checked:
  - `/ping` answers OK;
- `/oauth2/start?kc_idp_hint=whmcs` puts `kc_idp_hint=whmcs` into the
Keycloak auth URL;
- `/oauth2/start` without the parameter, or with a value outside the
pattern, does not;
  - a protected path redirects without it;
  - `/apis/*` stays 401;
  - `--ssl-insecure-skip-verify` starts fine alongside `--alpha-config`.
- **Live cluster.** Swapped in the rendered gatekeeper with the
HelmRelease suspended, then reverted:
- a brokered user who was already signed in at the portal went from the
hinted link straight to the dashboard;
  - a plain visit still showed the realm login page;
- a hinted visit without a portal session went straight to the portal's
own login;
- API calls from the console worked, so the `Authorization` header
injection is intact.

### Screenshots

N/A — no console UI changes. The change removes the Keycloak login page
from the hinted flow.

### Downstream repositories

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

The diff touches only the dashboard gatekeeper templates and their
tests. It adds no value, schema, package or platform component. I walked
the trigger map against it, and no entry matches.

### Release note

```release-note
feat(dashboard): a dashboard login link can name the Keycloak identity provider with `/oauth2/start?kc_idp_hint=<alias>`, so users coming from a brokered portal skip the realm login page. The OIDC gatekeeper now runs oauth2-proxy from an alpha configuration kept in a ConfigMap; logins without the parameter are unchanged.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* OIDC-enabled clusters now use updated dashboard sign-in settings,
forwarding identity and token information to the dashboard.
* Authentication requests use Keycloak’s internal URL when configured;
otherwise, logout uses the public Keycloak URL.
  * Sign-in requests include the OpenID, email, and profile scopes.
* Supported identity-provider hints are preserved in sign-in redirects,
while invalid hints are excluded.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-20 17:05:43 +07:00
Aleksei Sviridkin 6edd4a0d72 chore(deps): update container base images
Refresh the base image digests and move each tag to a newer release
that builds: node 24 for the dashboard console and its UI test job,
nginx-unprivileged 1.31, the dockerfile 1.28 frontend and alpine 3.24
for the cilium patch stage.

The kubevirt CSI driver stays on AlmaLinux 9: AlmaLinux 10 builds its
amd64 userland for x86-64-v3, and on a tenant vCPU without it every
mkfs, blkid and mount the node service runs would fail. shadowbox stays
on node 18 because outline-server declares engines node 18.x. The e2e
sandbox stays on Ubuntu 24.04: 26.04 ships uutils coreutils, whose
`date` costs about 4x per call, and the test harness forks it per
traced line, which adds about ten minutes to the install phase. Bases
whose version is the upstream component itself, or that upstream's
build pins, are not touched.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 01:07:39 +03:00
Aleksei Sviridkin ee0071dd1b chore(deps): update Go modules and move them to go 1.27.2
The five Go modules move to go 1.27.2. The root module moves to
controller-runtime v0.25.2, gateway-api v1.6.3 on the minor of the
installed v1.6.1 CRDs, grpc v1.84.0, etcd v3.7.2, cert-manager v1.21.2
and newer golang.org/x modules; prometheus/client_golang v1.25.0 raises
klauspost/compress to v1.20.1 by minimal version selection.
kubevirt-csi-driver builds upstream csi-driver f10ae94 against
Kubernetes v0.37.1, with its require and replace now naming the same
commit, kubeovn-webhook moves to client-go v0.37.1, and token-proxy to
newer releases of its dependencies.

Several stay behind, each for a stated reason. cel-go stops at v0.30.0:
its old repository has no tag past it, and v0.32 declares a module path
k8s.io/apiserver does not import. kube-openapi past the pinned commit
needs structured-merge-diff v7, which k8s.io/apimachinery v0.37 does not
compile against. The Flux API modules stay on the Flux v2.8 line the
platform installs. kubevirt.io/api and the CDI API stay on the releases
upstream csi-driver builds against, and jwx stays on v3 because v4
removes the jwk.Cache the proxy's JWKS refresh uses.

cert-manager v1.21 drops the deprecated ObjectReference alias, so the
gateway controller names IssuerReference directly; the Certificate
objects serialize the same for the installed v1.20 chart. gateway-api
marks SchemeGroupVersion deprecated, so a gateway test builds its
GroupKind from GroupName.

api/apps/v1alpha1 moves to go 1.27.2 with the rest, so a module that
imports the published types needs Go 1.27.2 or later.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 01:07:38 +03:00
Aleksei Sviridkin 2a04bfd0db build(go): move the builder images to Go 1.27.2
The golang builder images move to the 1.27.2 digests of their 1.27
tags, and the one image pinned to golang:1.27.1 moves to
golang:1.27.2. Builds that reproduce an upstream release keep the Go
that upstream uses.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 01:07:37 +03:00
Aleksei Sviridkin 29fb27461e fix(dashboard): refresh the token proxy session cookie
securecookie encodes sessions with gob, so the issued and expires times
come back as int64. The refresh looked for a float64, found none and
never fired, so --cookie-refresh=1h, which the chart sets, did nothing.
The times are now read in either form.

A refreshed cookie keeps the token's expiry: it gets a new issued time
and a fresh securecookie timestamp, never a longer life than the token
inside it.

Encoding a session fails when it outgrows securecookie's maximum
length, which a large token can reach. Sign-in set an empty cookie in
that case, and the refresh, now that it runs, would have replaced a
working cookie with an empty one. Sign-in now shows an error instead,
and a refresh that cannot encode leaves the current cookie in place.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 01:07:35 +03:00
Maxim Belyy e123cef283 Merge branch 'main' into feat/console-observability
Assisted-by: LLM
Signed-off-by: Maxim Belyy <maximbel2003@gmail.com>
2026-11-13 16:07:32 +07:00
Andrey Kolkov 2527baf115 feat(dashboard): let a login link pick the Keycloak identity provider
A link to the dashboard from an external portal, such as a billing
system brokered into Keycloak as an identity provider, always lands on
the realm login page first: the user has to pick that provider by
hand, even though the link already knows which one they came from.
Keycloak skips the page when the auth request carries kc_idp_hint, but
the gatekeeper builds that request from a fixed login URL and its flags
cannot pass a parameter through.

The OIDC gatekeeper now runs oauth2-proxy from an alpha configuration,
which allows kc_idp_hint on /oauth2/start to reach the login URL, so
/oauth2/start?kc_idp_hint=<alias>&rd=<path> goes straight to that
provider. A login without the parameter is unchanged. Provider,
upstream, listen address and injected headers move into a ConfigMap,
because oauth2-proxy refuses them as flags alongside the alpha
configuration; the values are those its --convert-config-to-alpha
produces for the previous flags, and the pod restarts when they change.
The client secret is mounted as a file.

The tests that read the Keycloak URLs from the container args go with
the flags; the rest of the gatekeeper suite now also loads the config
template the deployment checksums.

Assisted-By: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-12 15:02:33 +07:00
ZverGuy 7105364161 test(dashboard): pin when the previous-lines note goes away
The note must leave as soon as the new result lands and must not appear
over live lines while following; neither was exercised, since the only
test kept the longer range pending forever.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 01:02:17 +07:00
ZverGuy 051442b318 fix(dashboard): mark previous log lines while a new query replaces them
The previous result stays on screen while a new range or filter loads,
with nothing saying those lines answer the old query. A status line now
says so until the new result arrives. The empty case reads a placeholder
as loading whether or not the request is in flight, so a paused query
does not claim that nothing matched either.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:58:29 +07:00
ZverGuy 48f459e103 fix(dashboard): say the logs are loading while an empty result stands in
The previous result stays on screen while a new range or filter loads.
When that result was empty, the query reports success, so the view said
no lines matched the range it had not read yet.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:54:51 +07:00
ZverGuy 7eff63b028 refactor(dashboard): drop the scope-keyed placeholder from the logs view
The logs view remounts under a key per scope, so its queries start with
no previous result to carry over and the scope check never had anything
to refuse. The key is the one guard, and the tenant-switch tests fail
without it.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:51:01 +07:00
ZverGuy f2944c572d fix(dashboard): answer not-installed when the observability proxy is absent
The proxy can be left out of an installation, and then the console
nginx answered the observability roots with its own 502. The console
read that as an unreachable store: three errors, a Retry button and a
live tail reconnecting forever, instead of a notice that the feature
is not available on this cluster.

nginx now turns the 502 and 504 it generates itself, when it cannot
resolve or reach the proxy, into a 404 Kubernetes Status, which the
console already treats as not installed. Upstream errors are not
intercepted, so the proxy's own 502 and 504 for a store still reach
the console unchanged. The bats test runs the extracted locations in a
real nginx when one is installed.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:06 +07:00
ZverGuy 4be80657be test(dashboard): prove /observability/logs opens the application page
The list page shows the same "Loading…" text as the detail page, so the
previous check could not tell which route matched. A missing instance
makes only the detail page answer with its own name, and the GET it
issues names the plural and the application.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:41:10 +07:00
ZverGuy 74a7a44423 feat(dashboard): route the observability proxy roots from the console
The logs and metrics roots under /apis/cozystack.io and
/apis/apps.cozystack.io are served by the observability proxy, not by
the API server, so the console nginx sends them there ahead of its
/apis prefix location, unbuffered and with the same long timeouts, so
that a live tail reaches the browser as it is written.

nginx resolves a literal upstream once at startup and refuses to start
when the name does not resolve, which would take the console down on
every cluster that does not run the proxy. The upstream is therefore a
variable resolved per request, and such a cluster answers 502 on those
paths only. That resolver does not apply the pod's search domains, so
the config becomes a template the image's entrypoint renders with the
pod's nameservers and the platform cluster domain, which the chart now
passes to the console.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-09 15:48:57 +07:00
ZverGuy 2e5a3bd6a7 fix(dashboard): keep the tenant logs page off application URLs
Every console path of one or two segments belongs to an application
list or detail page, so /console/observability/logs took the Overview
of an application named logs whose kind has the plural observability.
Kubernetes names must start with an alphanumeric character, so the
reserved "-" segment cannot collide with any application.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-09 15:47:34 +07:00
ZverGuy 32a466fb14 fix(dashboard): scope the logs and metrics tabs to the selected app
The provider keeps a query's previous result while its key changes, so
while the next application's GET is pending the detail page still holds
the previous instance. The Logs and Metrics tabs took the application
name from that instance, so their proxy root did not change and the
previous application's lines and series stayed under the new heading
until the GET completed.

Take the name from the route instead, which is the identity the user
selected, and cover the pending GET at the route level with the real
page, router and production query defaults.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 18:10:35 +07:00
ZverGuy 89194b4f88 fix(dashboard): reset the log filters when the tenant or app changes
LogsView kept its filter, pod and container across a scope switch, so
the first request for the new tenant still asked for the previous
tenant's pod before the picker fell back to All. The view's state is
now keyed on the proxy root, so a new tenant or application starts
with no filter and All selected.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 06:17:48 +07:00
ZverGuy 711a82eaaf refactor(dashboard): drop the scoped placeholder from metrics panels
useQueries creates a new observer for every new key, so the metrics
panels never carried a previous result across scopes and the scoped
placeholder there did nothing. The switch test for the panels stays
and passes without it; the helper's comment now says which queries it
is for.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 06:15:06 +07:00
ZverGuy 9c111b3a95 fix(dashboard): keep placeholder results within one observability scope
The provider keeps a query's previous result while its key changes, so
switching tenants showed the first tenant's log lines and pod names
under the second tenant's heading until its request returned. Every
observability query now keeps the previous result only while the
proxy root is the same, so a new filter or range still shows the old
lines, but a new tenant or application starts empty. Tests render with
the provider's own query defaults.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 06:11:34 +07:00
ZverGuy 311cb1c90b fix(dashboard): skip tail dedup for rows without a stream ID
A pipe such as `delete _stream_id` leaves rows from different streams
that share a timestamp with the same dedup key, so a resumed tail
dropped a record it had never shown. Only rows that still carry both
_stream_id and _time are deduplicated now, as the accepted logs design
specifies.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 06:10:02 +07:00
ZverGuy bfa85e57bf fix(dashboard): show sample times the same way in legend and table
The legend used a fixed US date format while the data table used the
reader's locale, so one panel showed the same instant two ways. Both
now use one locale-aware format. A test also pins that the data
toggle stays disabled for a panel with no series or an error.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 00:56:26 +07:00
ZverGuy 046df7fe96 fix(dashboard): say the legend shows the latest sample
In the browser the legend's time still read "--" next to the latest
values, and the data table repeated the same minute on every row at
the one-hour range, whose step is 15 seconds. The legend's time now
reads "latest" until a point is hovered, and the table shows seconds.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 00:53:06 +07:00
ZverGuy 601c9ece3f docs(dashboard): note why the metrics panels refresh on an interval
The console rule against refetchInterval assumes a watch is available,
which holds for Kubernetes lists but not for the proxy's Prometheus
query API. Record the exception so the metrics panels' refresh does
not read as a rule violation.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 00:18:47 +07:00
ZverGuy 7d43c3bcd6 fix(dashboard): open each new log result at its newest line
The console keeps a query's previous data as placeholder while the next
one loads, so the log list was never remounted between queries. After
a reader scrolled up, a new filter or range opened at the old scroll
offset instead of the newest lines. The list is now keyed on the query
and range as well.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 00:18:38 +07:00
ZverGuy ef7312579d fix(dashboard): offer a retry when the log query fails
The console does not refetch on window focus and must not poll, so a
failed history query stayed failed until the filter or range changed,
even after the store recovered. The failed state now has a Retry
button that runs the same query again.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 00:18:33 +07:00
ZverGuy 52087d92dc fix(dashboard): keep the logs view when only the pod list is refused
The pod picker's values query counted as a scope-wide refusal, so a
proxy that refused only that path replaced the whole view, filter and
lines included, with a notice even though the log query itself worked.
A real scope-wide refusal still reaches the history or tail query and
shows the notice from there.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 00:18:25 +07:00
ZverGuy e65d827cf9 fix(dashboard): move the tenant logs page under observability/
The fixed /console/logs route came before the generic :plural route,
so an application kind with the plural "logs" would have its list page
replaced by the logs page. A two-segment path cannot shadow an
application list, the same way the backups and migration pages avoid
it.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 00:16:49 +07:00
ZverGuy 8e6048eb4a fix(dashboard): make metric samples readable without a pointer
The charts are a canvas and their legend showed dashes until a point
was hovered, so keyboard and screen-reader users could not read any
sample. The legend now shows each series' latest value when nothing is
hovered, and every panel has a Show data toggle that opens a focusable
table of all samples, newest first, in the chart's units.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 00:16:04 +07:00
ZverGuy 1e1fdb740c fix(dashboard): show log rows a pipe stripped of their timestamp
A LogsQL pipe such as `fields _msg` or `stats` returns rows without
_time, and the console dropped every one of them, so a successful
query read as "no lines matched". Such rows are now kept in the order
the store sent them, shown without a timestamp, and never
deduplicated on a tail resume. A row without _msg shows its remaining
fields instead of an empty line.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-05 00:14:24 +07:00
ZverGuy 2a473086cf fix(dashboard): advise a shorter range unless the proxy already did
Any "; " in a 422 message was taken as the proxy's own remedy, but the
proxy passes vmselect's 422 bodies through, and their advice (raise
the -search.max* flags) is for operators. Those lost the one thing a
tenant can do. Only the remedies the proxy itself appends now replace
the console's advice.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 19:11:05 +07:00
ZverGuy 76441871b8 fix(dashboard): keep caller headers of any shape in the k8s client
The client spread init.headers as a plain object, so a Headers
instance or a list of pairs passed by a caller was silently dropped
and the request went out without them. Headers are now built with the
Headers constructor, which accepts every shape fetch does.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 19:06:59 +07:00
ZverGuy 9498c9bff5 fix(dashboard): keep the proxy's own advice on a limit refusal
The notice appended "Choose a shorter range." to every 422, so a
message that already ended in "use a shorter range" said it twice and
one that ended in "raise step" got advice that contradicted it. The
console's own advice is now added only when the proxy gave none.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 19:05:42 +07:00
ZverGuy 881eea5246 fix(dashboard): suggest a longer log range only when there is one
On 24h, the longest range the log view offers, the empty console still
told the reader to try a longer range. It now suggests only a broader
filter there, as the metrics panels already do.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 19:04:58 +07:00
ZverGuy fca5ca78de fix(dashboard): treat an open log tail as live before its first line
The tail counted as live, cleared its error and reset its backoff only
when a line arrived. A quiet application therefore showed "Connecting"
forever, a 429 warning stuck after the retry succeeded, and every idle
close by the proxy (its tail idle timeout) raised the backoff towards
30s and reconnected without since, losing lines written in the gap.

The tail now reports when the response opens. That marks it live,
clears the error and resets the backoff; a clean close reconnects at
the base delay; and with no line seen yet the reconnect resumes from
the time the stream opened.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 19:04:29 +07:00
ZverGuy c9a15cb8ae fix(dashboard): suggest a longer metrics range only when there is one
With the longest range already picked, the empty panel still told the
reader to try a longer range, which the picker cannot offer.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 18:56:01 +07:00
ZverGuy 554dad87bb fix(dashboard): give the range picker the toolbar's focus ring offset
The range buttons drew their focus ring flush against the button while
the Select and Input next to them offset it, so keyboard focus looked
different from one control to the next. The empty metrics hint also
repeated its title; it now suggests the one thing that can help.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 18:53:58 +07:00
ZverGuy 6740ed4458 fix(dashboard): offer All once when a log stream has no pod name
VictoriaLogs can return an empty value for the pod or container field
when some streams lack the label. That empty value is the picker's own
"All" sentinel, so the list showed two selected "All" entries with the
same key. Empty values are dropped from the field values.

The tests now also pin what the log console says when Follow stops
before any line and when the history query fails, so those messages
cannot silently swap with the empty-result one.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 18:53:47 +07:00
ZverGuy 05b0ea0c45 fix(dashboard): hold each metrics chart's place while empty or loading
A metrics panel with no series, or still loading, shrank to one line of
small text or a bare spinner, so the tab jumped by the chart's height
when data arrived and an empty range looked like a broken panel. Both
states now fill the chart's slot and say what is going on, the same way
the log console does.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 18:49:39 +07:00
ZverGuy f5ebb43c4b fix(dashboard): match the range picker to the log toolbar controls
Next to the new Select and Input the range picker was shorter, lighter
bordered and had no focus ring, so the toolbar looked uneven and a
keyboard user could not see which range had focus. It now shares their
height, border and focus ring, and its buttons are grouped under one
accessible name.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 18:48:43 +07:00
ZverGuy b88ad09678 fix(dashboard): keep the log console on screen when it has no lines
With no matching lines, while loading, and while Follow waits for the
first line, the dark log console vanished and left a line of small
grey text or a bare spinner, so the page jumped and an empty result
looked like a broken view. The console frame now keeps a fixed height
in every state and says inside it what is going on.

The pod and container pickers move to the console Select and the
filter to the console Input, so the toolbar is keyboard and screen
reader friendly and a long pod name truncates instead of widening it.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 18:47:25 +07:00
ZverGuy f500aa955a feat(dashboard): add a text Input matching the console select
Every text field in the console restyles a bare input by hand, each a
little differently. A toolbar that mixes a text filter with the new
Select needs the two at the same height, border and focus ring, so the
styling lives in one place next to the Select instead of being copied.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 18:46:15 +07:00
ZverGuy 3b1302ba8e feat(dashboard): add an accessible Select to the console
The console has no select primitive: form widgets fall back to the
native element, and the shared Dropdown has no listbox roles, no
keyboard navigation and no label association. Base UI, already a
dependency, ships one; this wraps it the same way dialog.tsx wraps the
Base UI dialog so pickers get a labelled, keyboard-driven listbox that
matches the console's buttons.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 18:45:36 +07:00
ZverGuy 2b823ab79f fix(dashboard): rate over at least 5m and four steps
Long metric ranges are served by the longterm store, which keeps one
sample per 5m, so a rate window narrower than that can hold no samples
and the chart comes back empty. Four steps also keep every sample
between two points inside some window.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 05:53:50 +07:00
ZverGuy ebdd74ce4e fix(dashboard): name the proxy's real load status for a refused tail
The proxy caps rate and concurrent tails with 429, so the retry
reasoning and its test now say so. Leaving Follow also remounts the
log list, so the history it falls back to opens at the newest line
even when the reader had scrolled up while following.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 05:53:23 +07:00
ZverGuy 1b4ce7433e fix(dashboard): keep retrying a log tail refused for load
The proxy answers a tail over its rate or concurrent-tail cap with a
4xx, and a reconnect can arrive before the previous tail's slot is
freed. Treating that as final left Follow stopped for good, while the
existing backoff already waits long enough for the cap to clear.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 05:50:33 +07:00
ZverGuy 84ed3aaefd fix(dashboard): follow the newest line again after the log list clears
A reader who scrolled up stayed unpinned across a new follow run or a
new filter, so the fresh list sat at its top while lines streamed in
below. An empty list now means the reader is back at the bottom.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 05:50:33 +07:00
ZverGuy b05323f6be docs(dashboard): note the observability proxy client in the console guide
The next session needs to know why one module bypasses the typed
Kubernetes client and where the charting dependency is loaded.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 05:47:28 +07:00
ZverGuy 290490769e fix(dashboard): let the reader scroll up while logs stream
The viewer jumped to the newest line on every 100 ms flush, so a line
could not be read on a busy application. It now follows the bottom
only while the reader is already there, and says when a refused tail
has stopped instead of showing it as connecting.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 05:47:13 +07:00
ZverGuy 4b44971d12 fix(dashboard): start each log follow run with its own buffer
Turning Follow off and on again reused the previous run's buffer, so
new lines were appended after a silent gap and, on a quick toggle,
duplicated. A follow run is now identified by a session value, so the
buffer starts empty each time.

A resume now uses the newest _time seen rather than the last line
received, so an out-of-order line cannot move since backwards, and
the backoff sleep no longer leaves an abort listener per retry.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 05:47:13 +07:00
ZverGuy 97dcf4c4f0 fix(dashboard): treat an apiserver answer on a proxy path as no proxy
Until the console nginx routes the proxy roots, those paths reach
kube-apiserver, which RBAC-denies the namespace root with 403 for a
tenant, so the Logs page told every tenant they lacked permission. The
proxy itself answers in plain text, so a Kubernetes Status body is a
reliable sign that the path did not reach it.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-04 05:45:42 +07:00