feat(DIARCHERS-1650): add Project Token creation entry to My Tokens page - #633
Open
Jiachen0715 wants to merge 6 commits into
Open
feat(DIARCHERS-1650): add Project Token creation entry to My Tokens page#633Jiachen0715 wants to merge 6 commits into
Jiachen0715 wants to merge 6 commits into
Conversation
added 6 commits
August 11, 2026 10:30
The Project Tokens section of the My Tokens page was read-only, forcing
users into each project's Settings → Tokens page to create a token. Add
an inline create form (project selector + description) that reuses the
existing Project.addToken() → POST /api/v1/projects/{id}/tokens, so both
entries share the same backend and logic. Frontend-only; no backend change.
The project dropdown in the new Project Token create form rendered with a transparent menu, so option text overlapped the "Project" label. Add the global bg-white class to md-option (matching every other md-select in the dashboard) and name/id attributes for consistency. The dropdown's built-in max-height + scroll handles long project lists.
The project token list depends on store.state.projects, which is populated asynchronously. Opening My Tokens directly (e.g. on refresh) ran created() before projects loaded, so the list stayed empty until an unrelated action forced a re-render. Extract the load into loadProjectTokens() and watch adminProjects.length so the list populates once projects arrive, guarded by projectTokensLoaded to avoid reloading on later changes.
Address review findings on the project-token loading path: - The permanent projectTokensLoaded gate blocked the watcher's catch-up, so admin projects arriving in a later store commit never got their tokens loaded. Track loaded project ids instead and fetch only not-yet-loaded projects, so late arrivals are picked up while avoiding duplicate GETs. - Use _reloadTokens() (returns a real Promise) rather than _loadTokens() (returns undefined on cache hit), so projectTokensLoading stays on until the GETs actually complete — no premature "No project tokens found." flash — and the list is fresh on every visit. - Hide the create form (not just the note) when the user has no admin-rights projects.
…s page
Add an Actions column with a delete button to the Project Tokens table, plus
a confirmation dialog (mirrors the MCP/Viewer revoke dialogs — shows only the
description, no token value). Deletion reuses Project.deleteToken() -> DELETE
projects/{id}/tokens/{tid}, the same call used by project settings, which
reloads the project's token list on success. Frontend-only; no backend change.
…headers vue-material renders header text in .md-table-head-text (which has padding-left: 24px) but cell content in .md-table-cell-container (no left padding), so the Read/Write check icons sat to the left of their header labels. A plain text-center/text-align on the cell has no effect because the inner container controls layout. Add a scoped deep rule giving the Read/Write cells' inner container the same 24px left padding as the header text, so the icons line up under their column titles. Actions is left unchanged.
Jiachen0715
force-pushed
the
feat/DIARCHERS-1650-mytokens-project-token
branch
from
August 13, 2026 07:37
9517920 to
3d2ba31
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Project Tokens section on the My Tokens page (
/user/tokens) wasread-only — it listed existing project tokens but only hinted "Manage
individual project tokens in each project's settings". Creating a project
token required navigating into each project's Settings → Tokens page
individually.
This PR adds an inline creation entry to that section, consistent with the
MCP Token and Global Viewer Token create forms already on the same page.
Changes
Frontend-only, single file (
UserGlobalTokens.vue):(populated from the user's admin-rights projects) + description input
Project.addToken()model method,which posts to
POST /api/v1/projects/{id}/tokensand reloads thatproject's token list on success — the same call used by project
settings. No logic divergence.
value once (
INFRABOX_CLI_TOKEN).admin-rights projects.
What is NOT changed