Commit Graph

81 Commits

Author SHA1 Message Date
Chris
2dd70dceff fix(auth): correct userinfo endpoint fallback for authentik profile enrichment 2026-03-30 03:13:29 +08:00
Chris
94441a4037 refactor(frontend): remove manual admin credential cards from permission pages 2026-03-30 03:06:31 +08:00
Chris
76fd22826b fix(frontend): auto-attach admin api keys and normalize admin list payloads 2026-03-30 03:03:17 +08:00
Chris
f33134ff53 refactor: Redesign navbar to single-row tab layout
- 單列 header(高度 56px),sticky top
- 左:logo 區(固定寬度,方便之後換圖)
- 中:tab 列,active 用藍色底線 + 淡藍底色
- 分隔用細豎線 | 區隔用戶與管理員 tab
- 右:輕量文字登出按鈕,不搶焦點
- NavTab 用行內 defineComponent 封裝,乾淨不額外建檔

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 02:58:38 +08:00
Chris
c85109e09b refactor: Replace admin dropdown with flat tab navigation
導覽列重新設計:
- 上方 bar:品牌名 + 登出按鈕
- 下方 tab 列:我的資料、我的權限 | 權限管理、系統、模組、公司、站台、會員、群組
- 用戶 tab(藍色底線)與管理員 tab(靛色底線)視覺分組
- 支持 overflow-x scroll,小螢幕也可橫滑
- 移除 el-dropdown 依賴,改用純 router-link + button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 02:56:19 +08:00
Chris
4bb6ecf887 refactor: Fix UI/UX issues across admin pages
- App.vue: max-w-4xl → max-w-6xl(讓表格不被截斷)
- 新增 AdminCredsCard.vue 共用元件,消除兩個頁面的重複認證卡片
- PermissionAdminPage / PermissionGroupsPage 改用 AdminCredsCard
- 所有 el-table 的 slot="empty" 換成 <template #empty>(Vue 3 正確用法)
- 4 個管理頁 Dialog 補 el-form rules + formRef.validate()(取代手動 if 檢查)
- MembersPage: authentik_sub / email 欄位加 show-overflow-tooltip
- PermissionGroupsPage: 成功/失敗訊息由 <p> 改為 el-alert(統一樣式)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 02:53:54 +08:00
Chris
c3f6293c83 fix(frontend): validate oidc state in callback flow 2026-03-30 02:47:16 +08:00
Chris
70b5f34a74 fix(frontend): harden auth routing and callback error handling 2026-03-30 02:46:35 +08:00
Chris
23baceed71 docs: Update TASKPLAN_FRONTEND and FRONTEND_HANDOFF_SCHEMA_V2 - mark Schema v2 as complete 2026-03-30 02:39:58 +08:00
Chris
c4b9789df7 Upgrade frontend to Schema V2: Admin management pages
新增功能:
- OIDC 登入流程完整實現(LoginPage → AuthCallbackPage)
- 6 個管理頁面:系統、模組、公司、站台、會員、權限群組
- 權限群組管理:群組 CRUD + 綁定會員 + 群組授權/撤銷
- 新 API 層:systems、modules、companies、sites、members、permission-groups
- admin store:統一管理公共清單資料

調整既有頁面:
- PermissionSnapshotPage:表格新增 system 欄位
- PermissionAdminPage:
  - 新增 system 必填欄位
  - scope_type 改為 company/site 下拉選單
  - module 改為選填(空值代表系統層權限)
- Router:補 6 條新管理路由
- App.vue:導覽列新增管理員群組下拉菜單

驗收條件達成:
✓ 可新增 system/module/company/site
✓ 可做用戶直接 grant/revoke(新 payload)
✓ 可建立 permission-group、加會員、群組 grant/revoke
✓ /me/permissions/snapshot 表格可顯示 system + module + action

Build:成功(0 errors)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-30 02:37:46 +08:00
Chris
d79ed7c6fc fix: finalize unified schema and correct permission snapshot mapping 2026-03-30 02:22:27 +08:00
Chris
42f9124f77 chore: consolidate full database schema into single init_schema.sql 2026-03-30 02:14:26 +08:00
Chris
f9ad9417ba refactor: align backend with company-site-member schema and system-level RBAC groups 2026-03-30 01:59:50 +08:00
Chris
f5848a360f feat: add organization and member management APIs for admin and internal use 2026-03-30 01:23:02 +08:00
Chris
c6cb9d6818 fix: enrich me profile via userinfo and add org-member management plan 2026-03-30 01:14:02 +08:00
Chris
1ec132184f fix: use stable callback redirect_uri for oidc login 2026-03-30 01:08:08 +08:00
Chris
42f04ef961 fix: switch frontend login to authentik auth-code flow 2026-03-30 01:04:28 +08:00
Chris
096136e9d5 fix: allow login by email via authentik username resolution 2026-03-30 00:54:15 +08:00
Chris
ad6d16c97e feat: add username-password login flow via authentik token endpoint 2026-03-30 00:52:09 +08:00
Chris
7ddf66dfdd fix: enable CORS for configured frontend origins 2026-03-30 00:46:02 +08:00
Chris
5170787d43 docs: add database schema snapshot and validation index links 2026-03-30 00:42:48 +08:00
Chris
ddaaadfe5b feat: configure authentik member oidc and local dev token compatibility 2026-03-30 00:34:59 +08:00
Chris
0e9ce1cd32 chore: add local development env files and startup script 2026-03-29 23:34:34 +08:00
Chris
db0b4545cb docs: add frontend and backend task plans 2026-03-29 23:29:49 +08:00
Chris
d26762be5d Init frontend: Vue 3 + Vite member.ose.tw
建立完整前端架構:
- 配置 Vite + Vue 3 + Element Plus + Tailwind
- 實作 API 模層(axios interceptor + Bearer/Key 認證)
- 狀態管理:auth store(用戶登入狀態)、permission store(權限快照 & Admin 認證)
- 路由守衛:/me* 需 Bearer token,/admin* 不強制
- 完成三個頁面:登入、我的資料、我的權限快照、權限 grant/revoke 管理
- 全面錯誤處理與 UI 提示(401/403/404/503 對應訊息)

Checklist 完成度:
✓ A.初始化(http.js、auth/permission store、.env)
✓ B.API 對接(/me、/me/permissions/snapshot、grant、revoke)
✓ C.頁面三組件
✓ D.行為驗證(Token 過期、自動刷新、錯誤提示)
✓ E.交付條件(獨立刷新、錯誤 UI、loading/success 狀態)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-29 23:26:58 +08:00
Chris
d1a5ad2819 docs: switch frontend handoff docs to pure javascript 2026-03-29 23:18:08 +08:00
Chris
a880c99857 docs: add frontend handoff architecture and index 2026-03-29 23:15:15 +08:00
Chris
dbd2ccf43f feat: add authentik admin user sync endpoint 2026-03-29 23:08:52 +08:00
Chris
5790878c87 feat: add authentik jwt verification and me endpoints 2026-03-29 23:06:19 +08:00
Chris
970693a6d5 chore: track .env in repository 2026-03-29 23:02:24 +08:00
Chris
e9717d5214 feat: bootstrap backend MVP and architecture docs 2026-03-29 23:01:34 +08:00