Commit Graph
38 Commits
Author SHA1 Message Date
jialinandjialin 4a86b71018 fix: ignore request errors on setup 2026-06-06 14:29:49 +08:00
gitlawrandjialin be40692773 feat(login): add onUserFetched plugin hook
The host's access function is memoized on `initialState` and runs
exactly once per commit. Plugins that maintain identity-scoped
caches the access predicate reads from (e.g. an org context cache)
had no way to seed those caches synchronously before the caller's
`setInitialState({currentUser: ...})` fired — any post-commit hydrate
couldn't widen the predicate, leaving the sidebar in a stale view
until the next identity change.

Add `LoginPlugin.onUserFetched(userInfo, ctx)` and call it inside
`fetchUserInfo` after the server confirms identity but before
returning. Also commit the identity to `userAtom` storage here so
localStorage's identity marker is in lockstep with whatever caches
the plugin seeds — the predicate's first evaluation then sees a
consistent view rather than the prior session's data.

Errors thrown from the hook are swallowed and logged; they never
block fetchUserInfo.
2026-06-05 18:55:46 +08:00
jialinandjialin 46f859cc3c fix: no need to show error in login for first 2026-06-05 16:24:46 +08:00
micheliaandjialin 62f34ffcaf feat(usage): resource usage metering page
Add the Usage page with Summary / Tokens / GPU Instances / Storage / Resource
Events tabs over the new metering endpoints: per-resource breakdowns with
date / scope / user / resource filters, trend charts, server-side sortable
tables (GPU-Hours, Instance-Hours, GB-Days, GB-Hours), Excel export with an
in-dialog preview, and KPI cards with help tooltips explaining each metric.

MaaS-only users (no Kubernetes cluster and no resource events) get a
tokens-only view with the tab bar dropped; GPU Service / the full page unlock
for admins, cluster owners, or anyone who has run a resource. Instance-type
rows reuse the GPU Instances list styling, and deleted users / instances /
volumes are flagged in breakdowns and filters.
2026-06-04 19:52:52 +08:00
jialinandjialin 9705818b15 fix: wrap fetch for injecting headers 2026-06-03 15:50:06 +08:00
gitlawrandjialin 96e6ddfe8a fix: collapse GPU Service menu in Personal Org; add K8s-direct CTA
Two follow-ups to the GPU Service gating:

- In Personal-Org view the access extension was stripping
  canSeeAdmin/canSeeOrgAdmin but leaving canSeeGpuService at its
  admin-shortcut value, so platform admins switched into Personal
  still saw the menu even though Personal scope can't host a K8s
  cluster. Mirror the probe result through sessionStorage so the
  extension can fall back to the strict cluster-availability signal
  in that branch.

- The empty-state CTA now reads 'Add a Kubernetes Cluster' and, on
  click, opens the cluster-create flow with Kubernetes preselected
  via clusterSession.providerHint. ClusterCreate consumes the hint
  on mount: it seeds extraData.provider and starts at the configure
  step instead of the provider catalog, so the user lands one click
  closer to the form they actually need.
2026-05-27 13:41:32 +08:00
gitlawrandjialin 6b47bacfac feat: gate GPU Service on Kubernetes cluster availability
GPU Service today only schedules on Kubernetes clusters; Docker / cloud
clusters can't host the CRDs. Without any awareness of that, Org
members whose Org has no K8s cluster (and no cluster_access grant on
one) saw a menu they couldn't use and a form that bottomed out with
backend errors.

Two changes lock the UX down:

- Boot probes the caller's cluster list once and stashes
  hasKubernetesCluster in initialState. A new canSeeGpuService
  predicate gates the menu — admins and Org owners always see it
  (they can add the cluster); everyone else only sees it when a
  reachable K8s cluster actually exists.

- The instances page filters its own cluster list to Kubernetes
  before deciding what to show. With nothing reachable we render the
  Deployments-style 'No clusters available. Add a Kubernetes cluster
  to get started.' empty state and hide the create-instance CTA;
  admins and Org owners additionally get the 'Add cluster' button
  that jumps to cluster management.
2026-05-27 13:41:32 +08:00
jialinandjialin 7c15bb6ef6 chore(deps): update ui 1.0.5 2026-04-29 18:09:55 +08:00
jialinandjialin e4992e8313 fix: custom logos 2026-04-27 21:10:34 +08:00
jialinandjialin 16449613e0 chore: core-ui deps 2026-04-24 14:28:30 +08:00
jialinandjialin 6c161c6ae7 build: sync config 2026-04-24 14:28:30 +08:00
jialin 4e8b5e26ae feat: monitor button 2026-02-04 20:14:25 +08:00
jialin a274349ace chore: upgrade info 2025-12-04 16:43:33 +08:00
jialin f963b3a000 chore: config base url 2025-11-13 12:22:16 +08:00
jialin b4b25d4300 fix: default enter page for user 2025-11-10 20:40:15 +08:00
jialin ba80ade643 fix: my models status 2025-10-24 16:11:12 +08:00
jialin 1a082529c6 fix: skip error handler in root path 2025-10-23 17:09:30 +08:00
jialin ab93c53092 chore: default cluster by state 2025-10-22 12:13:01 +08:00
jialin f017d609fb fix: skip user api error 2025-10-21 13:26:06 +08:00
jialin ccb6e72057 fix: textarea scroll bar, deactive count message 2025-10-21 13:24:21 +08:00
jialin 60ee9f1a15 fix: catalog jump to deployments route error 2025-07-10 17:50:21 +08:00
jialin 51450c2b02 style: flatten menu items 2025-07-10 09:47:12 +08:00
jialin e1959f74aa chore: first login to default page by localhost 2025-02-25 15:04:05 +08:00
jialin e7de1896ea chore: display the direct command in add worker 2024-12-23 16:33:08 +08:00
jialin 386f2969eb chore: upgrade check 2024-10-18 19:35:47 +08:00
jialin 9bd6dedd90 chore: add english comment 2024-08-28 14:51:20 +08:00
jialin 9a0aeb491a fix: initialState refresh 2024-08-27 14:15:29 +08:00
jialin a27fa9d56c fix: list pagination 2024-07-16 15:27:54 +08:00
jialin 7e06a56c12 fix: build file warnings 2024-07-15 19:04:03 +08:00
jialin 320db56fbe chore: version info modal 2024-07-12 12:06:17 +08:00
jialin cf0113e8d8 chore: watch api 2024-06-28 17:14:34 +08:00
jialin de96c3d81d chore: remove patch client routes 2024-06-24 09:35:11 +08:00
jialin 9e471eafa7 fix: redirect default path after login 2024-06-23 21:30:20 +08:00
jialin ff1cf01edf chore: user apikeys 2024-06-23 15:15:12 +08:00
jialin b523076a5d fix: global css miss 2024-06-21 00:02:58 +08:00
jialin 405d95c81f feat: custom table with row children 2024-06-12 09:26:17 +08:00
jialin f491b5dfb1 chore: api request 2024-06-10 21:14:37 +08:00
jialin 3120f5ee3a style: common component style 2024-05-27 19:29:03 +08:00