feat: add Sora admin backend and fix type inconsistencies
Backend changes: - Add SoraHandler for admin Sora management APIs - GET /api/v1/admin/sora/stats - system statistics - GET /api/v1/admin/sora/users - user storage stats - GET /api/v1/admin/sora/generations - generation records - DELETE /api/v1/admin/sora/users/:id/storage - clear user storage - Add sora_storage_quota_bytes to AdminUser DTO - Add SoraStorageQuotaBytes to UpdateUserInput for admin user updates - Add comprehensive tests for SoraHandler Frontend changes: - Add soraAdminAPI for Sora management - Add sora_storage_quota_bytes and sora_storage_used_bytes to AdminUser type - Add Sora storage quota field to UserEditModal (GB unit) - Fix UsageLog type: add media_type, fix duration_ms to optional - Fix AdminUsageLog type: add channel_id, billing_tier Test fixes: - Add window.matchMedia mock to AccountUsageCell.spec.ts - Add tlsFingerprintProfileAPI mock to EditAccountModal.spec.ts - Fix loadTLSProfiles function order in EditAccountModal.vue - Fix translation key references in AccountStatusIndicator.spec.ts
This commit is contained in:
@@ -59,9 +59,11 @@ func UserFromServiceAdmin(u *service.User) *AdminUser {
|
||||
return nil
|
||||
}
|
||||
return &AdminUser{
|
||||
User: *base,
|
||||
Notes: u.Notes,
|
||||
GroupRates: u.GroupRates,
|
||||
User: *base,
|
||||
Notes: u.Notes,
|
||||
GroupRates: u.GroupRates,
|
||||
SoraStorageQuotaBytes: u.SoraStorageQuotaBytes,
|
||||
SoraStorageUsedBytes: u.SoraStorageUsedBytes,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,10 @@ type AdminUser struct {
|
||||
// GroupRates 用户专属分组倍率配置
|
||||
// map[groupID]rateMultiplier
|
||||
GroupRates map[int64]float64 `json:"group_rates,omitempty"`
|
||||
|
||||
// Sora 存储配额
|
||||
SoraStorageQuotaBytes int64 `json:"sora_storage_quota_bytes"`
|
||||
SoraStorageUsedBytes int64 `json:"sora_storage_used_bytes"`
|
||||
}
|
||||
|
||||
type APIKey struct {
|
||||
|
||||
Reference in New Issue
Block a user