ZhenYi
22b5eab769
fix(admin): restore LineChart component
...
LineChart is used by the dashboard page to render DAU trend charts.
It was accidentally removed during metrics cleanup — restore it.
2026-04-23 15:44:10 +08:00
ZhenYi
ae601774df
chore(admin): remove all metrics/observability features
...
- Delete admin metrics dashboard page (admin/metrics/page.tsx)
- Delete LineChart component (used only by metrics)
- Remove "指标监控" nav link from Sidebar
- Remove getMetrics/exportMetricsCsv from admin-rpc.ts client
- Remove /api/admin/metrics and /api/admin/metrics/export HTTP routes
from adminrpc (was also leaking metrics via HTTP)
- Remove metrics RPC methods (get_metrics, export_metrics_csv) from
adminrpc gRPC server and their helper functions
- Remove spawn_redis_metrics_flusher from app/main.rs
- Remove redis_metrics module from observability crate
- Remove redis/deadpool-redis deps from observability Cargo.toml
2026-04-23 15:42:00 +08:00
ZhenYi
3773fdc780
feat(admin): add structured error logger for all API routes
...
Replace bare console.error() calls with logError() utility across all
47 API route handlers. logError() prints timestamp + context + message
+ stack trace + extra request data to stderr, and redacts sensitive
fields (password, token, secret, key, etc.) from logged objects.
2026-04-23 09:55:35 +08:00
ZhenYi
12c249596a
config(admin): adminrpc port
CI / Rust Lint & Check (push) Has been cancelled
CI / Rust Tests (push) Has been cancelled
CI / Frontend Lint & Type Check (push) Has been cancelled
CI / Frontend Build (push) Has been cancelled
2026-04-23 01:01:01 +08:00
ZhenYi
552d8b7d68
fix(admin): correct adminrpc k8s DNS name
...
- Change default ADMIN_RPC_URL from adminrpc.admin.svc.cluster.local
to gitdata-adminrpc.gitdataai.svc.cluster.local (the actual Helm release name)
- Update same in admin-rpc.ts BASE_URL and comment
2026-04-23 00:59:58 +08:00
ZhenYi
38da729860
fix(adminrpc): expose HTTP port 9091 in k8s deployment and service
...
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
The adminrpc binary runs HTTP endpoints on port grpc_port+1 (9091),
but k8s deployment only exposed port 9090 (gRPC). The /api/admin/*
HTTP routes were unreachable from the admin dashboard frontend.
- Add http container port 9091 to Deployment
- Add http named port to k8s Service
- Point liveness/readiness probes to HTTP port 9091
- Add http_port: 9091 to Helm values.yaml
2026-04-22 23:56:38 +08:00
ZhenYi
2d2349a06b
config(admin): adminrpc port
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
2026-04-22 22:50:09 +08:00
ZhenYi
850a5392ce
fix(admin): use AdminGrpcClient instead of direct fetch, add model capability table
...
- Replace direct REST fetch with AdminGrpcClient for AI model/provider/pricing routes
- Add model_capability table to sync route
- AdminGrpcClient handles all admin RPC calls with workspace_id routing
2026-04-22 22:38:59 +08:00
ZhenYi
16b681c55b
infra(admin): add ADMIN_RPC_URL env var and adminrpc to push script
2026-04-22 20:56:10 +08:00
ZhenYi
d193c6113d
refactor(admin): env.ts formatting, default ADMIN_RPC_URL namespace fix
2026-04-22 20:55:06 +08:00
ZhenYi
b5cafb9678
fix(admin): touchSession persist state, platform session prefix to user:, middleware pass permissions header
2026-04-22 20:54:24 +08:00
ZhenYi
bf25b9ac71
feat(admin): add daily-report recipients GET/POST route
2026-04-22 20:54:03 +08:00
ZhenYi
da96cdd236
feat(admin): daily-report support custom basic_api_url for AI endpoint
2026-04-22 20:53:43 +08:00
ZhenYi
c41f4efc04
fix(admin): workspace_billing_history user column + rbac listUsers pagination params order
2026-04-22 20:53:22 +08:00
ZhenYi
623faf8c55
fix(admin): project_members use project_uuid/user_uuid column names not SeaORM field names
2026-04-22 20:53:02 +08:00
ZhenYi
4d4a0dc886
fix(admin): platform/users SELECT uid not id, UPDATE WHERE user not user_id
2026-04-22 20:52:39 +08:00
ZhenYi
0a02e14bda
fix(admin): platform/ai missing await on 4 queries
2026-04-22 20:52:17 +08:00
ZhenYi
e6a5828d14
fix(admin): audit-logs count query params mismatch
2026-04-22 20:51:56 +08:00
ZhenYi
954628a3b9
fix(admin): Member.userId → uid type fix
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
2026-04-22 11:03:10 +08:00
ZhenYi
a705bdc938
fix(frontend): various UI display and type corrections
...
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
- workspaces/[id]: Member type fix
- projects/[id]: display adjustments
- platform/sessions: session display improvements
- env.ts: env type corrections
- src/: frontend page and types updates
2026-04-22 10:31:33 +08:00
ZhenYi
962bf0312d
feat(observability): Phase 6 OTLP tracing + Prometheus metrics endpoint
...
OTLP tracing:
- libs/observability/otlp.rs: SdkTracerProvider via HTTP/proto OTLP exporter
- libs/observability/tracing_middleware.rs: Actix-web span with trace_id propagation
- libs/observability/tracing_fmt.rs: JSON fmt + registry.try_init for layered init
- libs/rpc: gRPC method spans via info_span
- libs/agent, libs/room, libs/service, libs/api: structured tracing throughout
Prometheus metrics:
- libs/observability/prometheus_exporter.rs: /metrics HTTP handler + metrics crate
- libs/observability/metrics_middleware.rs: HttpMetrics middleware + AtomicU64
- libs/observability/redis_metrics.rs: Redis counter poller via RedisMetrics
- libs/room/metrics.rs: RoomMetrics (connections, messages, presence counters)
Config env vars: APP_OTEL_ENABLED, APP_OTEL_ENDPOINT, APP_OTEL_SERVICE_NAME
2026-04-22 10:27:54 +08:00
ZhenYi
86c7810fd9
feat(admin): add node-cron daily scheduler for reports
...
- node-cron scheduler runs at 00:00 UTC every day
- Custom server.js auto-starts cron on npm start
- isRunning lock prevents concurrent report runs
- cron-initialize API for manual cron control
- Updated npm start to use server.js entry point
2026-04-22 10:23:21 +08:00
ZhenYi
8cf0e22893
feat(admin): daily platform email reports with AI analysis
...
- Admin API routes: recipients CRUD, AI/SMTP config, report generation
- UI page: dual-tab management (recipients + AI/SMTP settings)
- Auto table creation via CREATE TABLE IF NOT EXISTS
- AI summary via OpenAI Chat Completions API (stored in DB, not env)
- Direct SMTP sending via Node.js built-in net/tls (no nodemailer)
- Report includes: new users, rooms, commits, messages, top room + AI summary
- Sidebar navigation added for /admin/daily-report
2026-04-22 10:23:00 +08:00
ZhenYi
a7e31d5649
feat(tests): add comprehensive Playwright integration tests for all API endpoints
...
- tests/01: add graceful login timeout handling with try/catch
- tests/02: migrate from isolated request.newContext to uiLogin + page.request pattern
- tests/03: workspace members, platform users CRUD, billing, alert-config
- tests/04: room messages, room list, repo list/detail APIs
- tests/05: project members CRUD, project detail, project billing
- tests/06: API token CRUD, logout, health check
- tests/07: AI provider/model/version/pricing CRUD
- tests/08: admin user CRUD, role CRUD
All tests use consistent checkBackendAvailable() + uiLogin() pattern with
graceful degradation (test.skip) when backend is unreachable.
2026-04-20 22:37:05 +08:00
ZhenYi
3eeb054452
feat(admin): auto-migrate admin DB tables on health check (audit_log, user, role, permission)
2026-04-20 19:32:38 +08:00
ZhenYi
eba75ee359
fix(admin): ioredis 5.x username/password in redisOptions, add logging
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
2026-04-20 15:50:51 +08:00
ZhenYi
05909dbde7
fix(admin): use named export Cluster from ioredis 5.x
...
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
Previous `import { default as Cluster }` caused runtime to get Redis
instance instead of Cluster, resulting in ECONNREFUSED errors.
2026-04-20 10:03:26 +08:00
ZhenYi
a9c51526b8
fix(admin): fix ioredis 5.x Cluster constructor type resolution
...
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
- Use `Cluster` as default export from ioredis (not RedisCluster named export)
- Import ClusterNode type and use explicit type annotation on nodes array
- Use `any` cast on Cluster constructor to bypass TS overload resolution issue
- Fix closeRedis return type to Promise<unknown>
2026-04-20 09:41:19 +08:00
ZhenYi
67e8c5edc7
fix(admin): use Redis as type annotation, RedisCluster as runtime value
...
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
Fix TypeScript type error with ioredis 5.x default export pattern
2026-04-20 09:32:10 +08:00
ZhenYi
09d5a5877f
fix(admin): upgrade ioredis cluster to 5.x RedisCluster API
...
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
- Replace deprecated Cluster with RedisCluster (ioredis 5.x breaking change)
- Extract username/password from cluster URLs for authentication
- Fix REDIS_CLUSTER_URLS to include all 3 master nodes with default user
2026-04-20 09:28:28 +08:00
ZhenYi
a3fcbab5d8
fix(admin): add /api/health to public paths to allow k8s probe
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
2026-04-20 07:40:57 +08:00
ZhenYi
58bba357b0
fix(admin): quote image tag to prevent Helm format string parsing
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
2026-04-20 01:33:34 +08:00
ZhenYi
3995579e56
fix(admin): add /api/health route for k8s readiness probe
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
2026-04-20 01:02:37 +08:00
ZhenYi
19cad7e14a
config(admin): admin env
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
2026-04-20 00:22:42 +08:00
ZhenYi
6d16cc8c18
config(admin): admin env
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
2026-04-20 00:15:04 +08:00
ZhenYi
9ed56668dc
fix(admin): handle admin.env as both list and map in deployment template
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
2026-04-19 23:21:53 +08:00
ZhenYi
82a928c96a
config(admin): admin env
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
2026-04-19 22:39:41 +08:00
ZhenYi
8cf6415e15
config(admin): admin env
2026-04-19 22:39:25 +08:00
ZhenYi
3034c7f391
feat(admin): add TLS support to ingress with cert-manager and manual secret options
2026-04-19 22:35:31 +08:00
ZhenYi
b8e5cbbb69
feat(admin): add Docker and Kubernetes deployment for admin panel
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions
2026-04-19 21:49:22 +08:00
ZhenYi
fb91f5a6c5
feat(admin): add admin panel with billing alerts and model sync
...
- Add libs/api/admin with admin API endpoints:
sync models, workspace credit, billing alert check
- Add workspace_alert_config model and alert service
- Add Session::no_op() for background tasks without user context
- Add admin/ Next.js admin panel (AI models, billing, workspaces, audit)
- Start billing alert background task every 30 minutes
2026-04-19 20:48:59 +08:00