Commit Graph

27 Commits

Author SHA1 Message Date
Hungerdream 90434ee39b feat(frontend): unify authenticated requests with 401 session handling
- add utils/session.ts: on 401 clear auth state and redirect to SSO or /login with return path; singleton promise prevents duplicate redirects; typed AuthenticationRequiredError for callers
- add api/authRequest.ts: shared generic authRequest with token injection, response parsing and 401 hook
- migrate businessLine/containerService/delivery/machine/subsystemAuth/taskLog api modules to the shared helper, removing six duplicated implementations; keep getToken only for EventSource query-param auth
- Catalog: silence session-expiry error in instance-name precheck; prefer mysql delivery target by exact template name (matches backend DELIVERY_MYSQL_TEMPLATE_NAME default)
2026-07-30 18:14:09 +08:00
mac 1aa984c7e5 feat(delivery): sync mysql service ledger and credentials 2026-07-30 16:09:13 +08:00
Hungerdream 8b1ed20145 feat(frontend): drive delivery steps by backend stage events
- Map precheck/install/configure/healthcheck/register stage events to
  workbench step states instead of guess-based progression, and prefer
  callback-enabled AWX templates so stage events actually flow
- Replay task events silently on workbench restore to rebuild step
  states without duplicating logs; only reset seen events for new tasks
- Unify instance name generation with a random 6-char suffix (replacing
  the hardcoded -billing-02) and cap the business-line segment so the
  63-char DNS label limit never truncates the suffix
2026-07-30 15:02:52 +08:00
Hungerdream 2de6a1f498 feat(frontend): adapt delivery form to single root account and credential_available
- Remove mysql_admin_password from CreateMySQLDeliveryPayload;
  the delivery form submits a single root password only
- Wire the task's credential_available boolean into the Catalog
  workbench: sync on create/poll/restore, and hide the one-time
  credential entry once it has been claimed
- Preview mock credential account_host changed from localhost to %
2026-07-29 18:39:37 +08:00
mac 35875218c9 feat(delivery): refine base service integrations 2026-07-29 16:47:41 +08:00
Hungerdream 5715379a26 refactor(ui): embed delivery records into the service ledger
Replace the separate delivery records tab with a per-service dropdown column in the ledger table that opens the existing detail dialog with one-time credential claim. Sync now refreshes ledger, container services and delivery records together; errors surface via message toast. components.d.ts regenerated (dropdown components in, tabs out).
2026-07-29 13:50:29 +08:00
Hungerdream 244f6adfb8 feat(ui): harden MySQL delivery workbench session and credential flow
- Persist workbench state (form, view, task progress) per user/service in sessionStorage; restore on reload re-fetches the task and resumes polling, never persisting the root password itself
- Gate the result tab behind resultReady so an unfinished task cannot show a stale result view
- Add random instance name generation and an async precheck that detects name conflicts against active tasks and delivered instances, mirroring the backend occupancy rules
- Guarantee all four character classes in generated root passwords
- Fetch credentials via the one-time reveal endpoint instead of caching plaintext passwords in localStorage; sanitize legacy history entries and clear the form password once the task is created
2026-07-29 13:50:18 +08:00
Hungerdream 08e9466bad feat(ui): add delivery records tab to service management
Management.vue gains a second tab listing MySQL delivery tasks from the backend (search, status filter, detail dialog, one-time credential reveal with copy/download). components.d.ts regenerated for the new Element Plus components.

Also add narrow-viewport (<=760px) style tweaks to AppHeader/AppMain/DefaultLayout; these are partial small-screen optimizations, not a full mobile adaptation.
2026-07-28 19:15:29 +08:00
Hungerdream f01398cc67 feat(ui): rework MySQL delivery workbench form and flow
Rebuild the MySQL standardized delivery form in Catalog.vue: sectioned layout (scope/resources/db config/advanced params), client-generated root password with regenerate/copy, storage slider, install/data path hints, inline field validation, delivery history and task polling.

Align CreateMySQLDeliveryPayload with the backend MySQLDeliveryInput contract (cpu_milli/memory_mi/storage_gi required, legacy fields optional, drop nonexistent param_template) and send mysql_root_password/mysql_admin_password as a pair so the credential shown to the user is the one actually deployed.
2026-07-28 19:15:14 +08:00
mac 93981b9aad feat: update delivery and resource frontends 2026-07-28 17:56:58 +08:00
mac 897670b721 Merge remote-tracking branch 'upstream/main' into feat/base-service-delivery
# Conflicts:
#	ansible/mysql-deploy.yml
#	frontend/src/api/delivery.ts
#	frontend/src/views/service/Catalog.vue
#	server/.env.example
#	server/internal/config/config.go
#	server/internal/handler/task_log.go
#	server/internal/service/delivery.go
2026-07-28 15:08:37 +08:00
mac 8e09c30d21 feat: wire mysql delivery to awx callbacks 2026-07-28 14:45:17 +08:00
Hungerdream d5bf42ad01 feat(ui): surface rollback actions in the service catalog
Add retryRollback / releaseRollback / retryCloudDMRegistration API
bindings and wire the corresponding actions and status presentation
into the delivery task view.
2026-07-28 14:29:34 +08:00
mac 5a260c443f feat(delivery): stream task updates with SSE 2026-07-28 09:55:04 +08:00
mac 7b4b9d2ee7 Merge remote-tracking branch 'upstream/main' into feat/base-service-delivery
# Conflicts:
#	server/.env.example
#	server/internal/config/config.go
#	server/internal/service/delivery.go
#	server/internal/service/delivery_test.go
2026-07-28 09:34:37 +08:00
mac 6ddba9aa03 feat(delivery): restore active MySQL tasks 2026-07-27 15:20:03 +08:00
mac a934380c9c feat: switch base delivery to awx task logs 2026-07-23 18:36:24 +08:00
mac 7f6f6fa41e feat(container): show business line workloads from Wayne 2026-07-22 15:05:41 +08:00
mac 2db8264c8e feat(service): add deployment task integration 2026-07-21 18:26:50 +08:00
mac 981e9557fe feat(frontend): make mock panels follow business line 2026-07-17 19:28:19 +08:00
wonder a31f274153 feat(frontend): 新增服务管理入口并统一按钮样式
- 侧边栏「机器管理」下方新增「服务管理」导航项(图标 ◈,badge Consul)
- 服务管理页同步按钮文案改为「同步」,添加 type=primary
- 监控看板刷新按钮改为 el-button type=primary,与全局风格统一
2026-07-17 16:00:06 +08:00
wonder 3842a81cb2 refactor(router): 统一前端路由命名与层级
## 背景
前端路由存在层级不一致、英文缩写混用、name 与 sidebar 文本不匹配等问题。

## 变更内容
- 统一使用全称命名(Mgmt → Management, Ops → Operation)
- 统一带前缀路径(/cluster → /infrastructure/cluster)
- 合并可观测性模块(/monitor、/alert → /observable/*)
- 修正 router name 与侧边栏中文标题对应关系

## 路由对照
- /tasks → /task/log (TaskLog)
- /resource/mgmt → /resource/management (ResourceManagement)
- /service/mgmt → /service/management (ServiceManagement)
- /audit/ops → /audit/operation (OperationAudit)
- /cluster → /infrastructure/cluster (InfrastructureCluster)
- /tenants → /business/quota (BusinessQuota)
- /monitor → /observable/monitoring (MonitoringDashboard)
- /alert → /observable/alert (AlertInformation)
- /subsystem/authz → /subsystem/authorization (SubsystemAuthorization)
2026-07-17 14:50:41 +08:00
wonder 1a125e154c feat(service): 容器服务部署独立板块并使用 SSO 跳转
- 新增「容器服务部署」页面板块,与「基础服务目录」同级
- 将容器服务(Wayne)迁移到容器服务部署板块
- Wayne 卡片使用与子系统详情页相同的 SSO 跳转逻辑
- 移除 Wayne 弹窗,改为直接跳转 Wayne 平台
2026-07-17 14:35:37 +08:00
wonder f327f41733 feat(service-catalog): 对齐基础服务目录交互逻辑
- 更新 6 张服务卡片数据(Wayne/MySQL/openresty/PgSQL/Redis/接入新服务)
- 容器服务(Wayne)点击打开发布弹窗(业务线/命名空间/集群/规格/服务名)
- MySQL 点击打开标准化交付弹窗(架构/规格/版本/实例名 + YAML 预览)
- openresty 可点击但提示"功能对接中"
- PgSQL/Redis 置灰不可点击,提示"功能规划中"
- 接入新服务置灰(0.5)无响应
- 弹窗确认后 toast 提示并跳转任务中心
2026-07-17 10:37:52 +08:00
wonder 3144a50ef5 fix(frontend): 统一重构前端样式系统,消除重复、添加响应式、修复硬编码
Closes #61

## 变更内容

### CSS 变量扩展
- 新增 --radius-sm / --radius-lg / --radius-xl 圆角变量
- 新增 --accent-end 渐变终点色(浅色/深色模式)

### 公共样式提取到 global.css
- 提取 15+ 组重复样式:.page-head / .panel / .stat-row / table / .tag
  / .status-text / .bar-wrap / .cols-2 / .pagination / .log-stream 等
- 所有 border-radius 硬编码值改用 CSS 变量
- 新增工具类:.text-xs / .text-dim / .cols-2-equal / .panel-body.padded
  / .search-input / .accent-pill

### 响应式设计
- @media (max-width: 1024px):stat-row 3 列,双栏布局单列化
- @media (max-width: 768px):page-head 纵向排列,stat-row 2 列,
  表格横向滚动,卡片网格单列化

### 内联 style 清理
- 非动态绑定的 style="color: ..." / style="font-size: ..."
  / style="flex: 1" / style="padding: ..." 改为 CSS 类

### 硬编码颜色修复
- ConfigCenter.vue: #1C2A3A/#8EC8FF 改用 CSS 变量
- Login.vue: #1C8F69 改用 --accent-end 变量

### 页面组件 scoped 样式精简
- 13 个页面组件删除已提取的重复样式,净减少 1070 行
2026-07-15 15:11:55 +08:00
wonder f1a63ee473 feat(frontend): 支持深色/浅色模式切换,统一主题变量体系
- 新增 useTheme composable,支持 light/dark 双主题,默认浅色模式
- 主题偏好持久化到 localStorage,支持跟随系统主题
- AppHeader 顶栏添加 Moon/Sunny 切换图标,带旋转过渡动效
- variables.css 重构为 :root(浅色)/:root.dark(深色)双套变量
- 新增标签色系(蓝/紫/琥珀/绿)、节点色系、阴影、发光效果等语义化变量
- 全组件硬编码颜色替换为 CSS 变量,消除跨主题不一致
- global.css 添加主题切换过渡动画(background/border/box-shadow)
- 涉及组件:AppHeader、AppSidebar、SubsystemCard、AuditLogTable
- 涉及页面:Dashboard、Resource、Cluster、Config、Task、Service、Login
2026-07-15 14:38:58 +08:00
wonder 31ca405492 feat(frontend): 添加服务管理页面骨架
页面:
- views/service/Catalog.vue,基础服务目录(Ansible Playbook 一键部署)
- views/service/Management.vue,服务管理(Consul 注册中心同步)

服务目录:
- MySQL、Redis、openresty、dpvs、PgSQL

功能:
- 服务卡片展示(图标、描述、Playbook、版本)
- 服务台账表格(按机房、业务标签筛选)
- 健康状态展示
2026-07-14 15:40:21 +08:00