Commit Graph
102 Commits
Author SHA1 Message Date
jialinandjialin ed06d57a31 feat: add slots 2026-05-11 14:27:49 +08:00
gitlawr 168c55990f fix: pick landing route by access predicate to avoid redirect loop
Access extensions can narrow ``canSeeAdmin`` to ``false`` even when
``currentUser.is_admin`` is ``true``. The default-landing logic
keyed off ``is_admin`` and pushed admin to ``/dashboard``; when
``canSeeAdmin`` is narrowed there, ``Exception`` 403-redirects to
``/``, which re-pushes ``/dashboard``, looping into a blank screen.
Switch the landing pick (and the masthead-click handler) to consult
the resolved ``access.canSeeAdmin`` predicate instead.

Behavior is unchanged for the default access module, where
``canSeeAdmin`` mirrors ``is_admin``.
2026-05-09 17:22:27 +08:00
gitlawrandjialin 2889ba7c78 feat: plugin extension slots for access, request interceptors, Users actions, and form fields
Four purely-additive seams that let build-time tooling extend host
behaviour without forking files:

* `src/access.extensions.ts` — identity `applyAccessExtensions`
  (mirrors `config/routes.extensions.ts`). `src/access.ts` runs the
  resolved predicate object through it. Adds two new predicates,
  `canSeeOrgAdmin` and `canManageCurrentOrg`, alongside the existing
  `canSeeAdmin`. Resources, Models children, Cluster Management, and
  Resources/Backends are retagged from `canSeeAdmin` to
  `canSeeOrgAdmin`. Users and Dashboard stay strict.
* `src/request.extensions.ts` — identity-empty
  `extraRequestInterceptors`. `src/request-config.tsx` spreads it
  into the existing `requestInterceptors` list so extensions can
  inject context-aware headers without forking the request config.
* Users page action column — renders
  `getGPUStackPlugin()?.components?.UserRowActions` next to the
  existing DropdownButtons inside a Space when a plugin component
  is registered. If absent, the cell renders exactly as before.
* `src/components/plugin-extra-fields.tsx` — generic component-slot
  helper. Renders `pluginManager.components.<name>` if registered,
  forwarding a `context` payload. Used by create/edit forms to let
  plugins inject extra `Form.Item` fields. Mounted in the relevant
  create forms — API Keys, Cloud Credentials, Clusters, Model
  Routes, Model Providers, and Inference Backends — under the slot
  name `CreateOrgScopeField`. Resources whose org is implicit from a
  parent (Models / Workers / Benchmarks / Worker Pools / Model Files
  inherit from the chosen Cluster) deliberately don't mount the slot.
2026-05-08 18:29:52 +08:00
gitlawrandjialin 896b8ef326 feat: expose useTableFetch via CoreUIProvider
Inject the host's `useTableFetch` hook into the CoreUIProvider's
`hooks` prop alongside the already-wired `useCurrentUser`, so plugins
that import `useTableFetch` from `@gpustack/core-ui` resolve it through
the host instead of throwing
"`hooks.useTableFetch is not a function`" at the first list-page render.

Companion to the earlier `feat: add use current user` change — core-ui
exposes both hooks as host-injected, but only the user hook had been
plumbed.
2026-05-08 14:46:35 +08:00
jialinandjialin 4be5fb4d3d feat: add use current user 2026-05-07 18:26:48 +08:00
gitlawrandjialin b6bbe880a0 feat(plugin): expose OrgSwitcher slot in extraRender
Add a single host-side mount point in extraRender.tsx:

    const OrgSwitcher = pluginManager?.components?.OrgSwitcher;
    ...
    {OrgSwitcher && <OrgSwitcher />}

A registered plugin can supply an Org switcher via
components.OrgSwitcher. When no plugin provides it, the host
renders nothing here, so the build is visually unchanged.
2026-05-07 18:16:42 +08:00
jialinandjialin ac99156c90 feat: ip access control 2026-04-29 18:09:55 +08:00
jialinandjialin e4992e8313 fix: custom logos 2026-04-27 21:10:34 +08:00
jialinandjialin 6fccee3711 fix: impoer external components 2026-04-24 14:28:30 +08:00
jialinandjialin 597a86562a fix: rebase main 2026-04-24 14:28:30 +08:00
jialinandjialin 6c161c6ae7 build: sync config 2026-04-24 14:28:30 +08:00
jialinandjialin 8711c27b78 chore: replace components with core-ui, upgrade eslint 2026-04-24 14:28:30 +08:00
jialinandjialin 144914110a feat: more filters component 2026-04-08 18:54:06 +08:00
jialinandjialin c73609d155 fix: adjust border raduis 2026-04-08 18:54:06 +08:00
jialinandjialin 1c09cc6c8c refactor: ui/ux 2026-04-08 18:54:06 +08:00
jialinandjialin a95b7e9561 feat: add instance view 2026-03-26 18:20:55 +08:00
jialin 8f2eea70f6 chore: detail api 2026-01-30 18:48:55 +08:00
jialin 342d977fe4 fix: -custom error message on creating backend 2026-01-13 18:43:11 +08:00
jialin 89fe8e68f4 feat: playground video 2026-01-12 20:30:24 +08:00
jialin cd3b0607a5 style: modal drawer blur 2026-01-12 20:30:24 +08:00
jialin 2e5b075d1b fix: header bg color 2026-01-12 12:24:34 +08:00
jialin 28a73d2a6e chore: use drawer for creation 2026-01-07 15:55:26 +08:00
jialin 0eba1da6c4 style: cluster creation steps 2026-01-06 17:21:32 +08:00
jialin d51f00d35d style: cluster creation modal 2026-01-06 17:21:32 +08:00
jialin d8b3331648 style: slider handle color 2026-01-06 17:21:32 +08:00
jialin 2816fedc36 refactor: catalog fetch data 2026-01-06 17:21:32 +08:00
jialin 17de9d98f4 chore(deps): upgrade antd to v6 2026-01-06 17:21:32 +08:00
jialin 530e8f7537 fix: replicas, ready_replicas sorting 2025-12-23 18:35:33 +08:00
jialin 711b3fee98 fix: user guidance when no resource 2025-12-22 18:11:46 +08:00
jialin 7e25b64689 fix: remove instance from cache after deleting 2025-12-22 16:19:47 +08:00
jialin a68e3ff9da fix: no spec list for catalog 2025-12-12 17:22:28 +08:00
jialin 0500dd2e35 fix: query catalog spec, default_version check 2025-12-12 17:08:30 +08:00
jialin 7fdabd90a5 fix: update add worker command 2025-12-10 15:50:53 +08:00
jialin dda2213593 style: workers page no page container 2025-12-10 15:50:53 +08:00
jialin a274349ace chore: upgrade info 2025-12-04 16:43:33 +08:00
jialin f49001b742 chore: access setting notes 2025-11-21 20:10:21 +08:00
jialin 864cf76c07 feat: worker maintenance 2025-11-13 21:00:35 +08:00
jialin aee9566bbb fix: yaml editor do not update when upload same file 2025-11-13 16:53:11 +08:00
jialin b4b25d4300 fix: default enter page for user 2025-11-10 20:40:15 +08:00
jialin 285e274818 fix: display image menu 2025-11-10 10:07:25 +08:00
jialin 4c22d08da5 refactor: page layout 2025-11-05 10:02:25 +08:00
jialin 43936e21d9 feat: instances on worker 2025-09-16 11:26:17 +08:00
jialin b631b4c7b7 chore: remove menu data render 2025-07-10 14:52:08 +08:00
jialin 51450c2b02 style: flatten menu items 2025-07-10 09:47:12 +08:00
jialin fd3d7a6f29 style: side menu style 2025-06-23 15:13:49 +08:00
jialin 00a60b8948 chore: update error components for loading file failed 2025-05-15 22:57:24 +08:00
jialin 17ec70f839 chore: init mask theme 2025-05-15 19:04:40 +08:00
jialin ac03a93c64 chore: add dark mask, remove clear button in audio and image 2025-05-15 18:02:07 +08:00
jialin 954b034b8b fix(style): dark style 2025-04-29 18:05:43 +08:00
jialin fb90d79eb3 chore: custom brand color 2025-04-28 10:05:06 +08:00