feat(admin): upgrade admin console UI widgets, add plan & status management, and redesign system status dashboard

This commit is contained in:
Blizzard
2026-07-18 22:18:12 +08:00
parent 197531ea33
commit 0d2929931f
16 changed files with 1979 additions and 503 deletions
+17
View File
@@ -386,3 +386,20 @@ func (p *Postgres) ResolveBillingTenantID(ctx context.Context, userID, activeTen
}
return activeTenantID
}
// SetTenantPlan 更改租户方案等级。
func (p *Postgres) SetTenantPlan(ctx context.Context, tenantID string, plan string) error {
if p.db == nil {
return errStoreDisabled
}
return p.db.WithContext(ctx).Model(&Tenant{}).Where("id = ?", tenantID).Update("plan", plan).Error
}
// SetTenantStatus 更改租户状态(active / suspended)。
func (p *Postgres) SetTenantStatus(ctx context.Context, tenantID string, status string) error {
if p.db == nil {
return errStoreDisabled
}
return p.db.WithContext(ctx).Model(&Tenant{}).Where("id = ?", tenantID).Update("status", status).Error
}