From f18d4ebbbac4261b57481366cfc718e469720161 Mon Sep 17 00:00:00 2001 From: erio Date: Sat, 11 Apr 2026 18:13:38 +0800 Subject: [PATCH] chore: remove all sora dead code and fork-specific sora_client_enabled Upstream removed sora feature (090_drop_sora.sql) but left i18n keys and wire.go references. Clean up: - Remove entire sora i18n block from en.ts and zh.ts (~190 lines) - Remove sora nav key and unused 'data' settings tab key - Remove sora_client_enabled from settings (fork-specific) - Remove SoraMediaCleanupService from wire.go --- backend/cmd/server/wire.go | 7 -- frontend/src/api/admin/settings.ts | 1 - frontend/src/i18n/locales/en.ts | 98 ----------------------- frontend/src/i18n/locales/zh.ts | 98 ----------------------- frontend/src/views/admin/SettingsView.vue | 1 - 5 files changed, 205 deletions(-) diff --git a/backend/cmd/server/wire.go b/backend/cmd/server/wire.go index 655461f4a7..64709b5b1c 100644 --- a/backend/cmd/server/wire.go +++ b/backend/cmd/server/wire.go @@ -78,7 +78,6 @@ func provideCleanup( opsCleanup *service.OpsCleanupService, opsScheduledReport *service.OpsScheduledReportService, opsSystemLogSink *service.OpsSystemLogSink, - soraMediaCleanup *service.SoraMediaCleanupService, schedulerSnapshot *service.SchedulerSnapshotService, tokenRefresh *service.TokenRefreshService, accountExpiry *service.AccountExpiryService, @@ -128,12 +127,6 @@ func provideCleanup( } return nil }}, - {"SoraMediaCleanupService", func() error { - if soraMediaCleanup != nil { - soraMediaCleanup.Stop() - } - return nil - }}, {"OpsAlertEvaluatorService", func() error { if opsAlertEvaluator != nil { opsAlertEvaluator.Stop() diff --git a/frontend/src/api/admin/settings.ts b/frontend/src/api/admin/settings.ts index 71bde0d1cc..a4ee114041 100644 --- a/frontend/src/api/admin/settings.ts +++ b/frontend/src/api/admin/settings.ts @@ -38,7 +38,6 @@ export interface SystemSettings { doc_url: string home_content: string hide_ccs_import_button: boolean - sora_client_enabled: boolean backend_mode_enabled: boolean custom_menu_items: CustomMenuItem[] custom_endpoints: CustomEndpoint[] diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts index 73ddc1ed53..7c2df8df57 100644 --- a/frontend/src/i18n/locales/en.ts +++ b/frontend/src/i18n/locales/en.ts @@ -358,7 +358,6 @@ export default { mySubscriptions: 'My Subscriptions', buySubscription: 'Recharge / Subscription', docs: 'Docs', - sora: 'Sora Studio', myOrders: 'My Orders', orderManagement: 'Orders', paymentDashboard: 'Payment Dashboard', @@ -4148,7 +4147,6 @@ export default { gateway: 'Gateway', email: 'Email', backup: 'Backup', - data: 'Sora Storage', payment: 'Payment', }, emailTabDisabledTitle: 'Email Verification Not Enabled', @@ -4973,102 +4971,6 @@ export default { } }, - // Sora Studio - sora: { - title: 'Sora Studio', - description: 'Generate videos and images with Sora AI', - notEnabled: 'Feature Not Available', - notEnabledDesc: 'The Sora Studio feature has not been enabled by the administrator. Please contact your admin.', - tabGenerate: 'Generate', - tabLibrary: 'Library', - noActiveGenerations: 'No active generations', - startGenerating: 'Enter a prompt below to start creating', - storage: 'Storage', - promptPlaceholder: 'Describe what you want to create...', - generate: 'Generate', - generating: 'Generating...', - selectModel: 'Select Model', - statusPending: 'Pending', - statusGenerating: 'Generating', - statusCompleted: 'Completed', - statusFailed: 'Failed', - statusCancelled: 'Cancelled', - cancel: 'Cancel', - delete: 'Delete', - save: 'Save to Cloud', - saved: 'Saved', - retry: 'Retry', - download: 'Download', - justNow: 'Just now', - minutesAgo: '{n} min ago', - hoursAgo: '{n} hr ago', - noSavedWorks: 'No saved works', - saveWorksHint: 'Save your completed generations to the library', - filterAll: 'All', - filterVideo: 'Video', - filterImage: 'Image', - confirmDelete: 'Are you sure you want to delete this work?', - loading: 'Loading...', - loadMore: 'Load More', - noStorageWarningTitle: 'No Storage Configured', - noStorageWarningDesc: 'Generated content is only available via temporary upstream links that expire in ~15 minutes. Consider configuring S3 storage.', - mediaTypeVideo: 'Video', - mediaTypeImage: 'Image', - notificationCompleted: 'Generation Complete', - notificationFailed: 'Generation Failed', - notificationCompletedBody: 'Your {model} task has completed', - notificationFailedBody: 'Your {model} task has failed', - upstreamExpiresSoon: 'Expiring soon', - upstreamExpired: 'Link expired', - upstreamCountdown: '{time} remaining', - previewTitle: 'Preview', - closePreview: 'Close', - beforeUnloadWarning: 'You have unsaved generated content. Are you sure you want to leave?', - downloadTitle: 'Download Generated Content', - downloadExpirationWarning: 'This link expires in approximately 15 minutes. Please download and save promptly.', - downloadNow: 'Download Now', - referenceImage: 'Reference Image', - removeImage: 'Remove', - imageTooLarge: 'Image size cannot exceed 20MB', - // Sora dark theme additions - welcomeTitle: 'Turn your imagination into video', - welcomeSubtitle: 'Enter a description and Sora will create realistic videos or images for you. Try the examples below to get started.', - queueTasks: 'tasks', - queueWaiting: 'Queued', - waiting: 'Waiting', - waited: 'Waited', - errorCategory: 'Content Policy Violation', - savedToCloud: 'Saved to Cloud', - downloadLocal: 'Download', - canDownload: 'to download', - regenrate: 'Regenerate', - regenerate: 'Regenerate', - creatorPlaceholder: 'Describe the video or image you want to create...', - videoModels: 'Video Models', - imageModels: 'Image Models', - noStorageConfigured: 'No Storage', - selectCredential: 'Select Credential', - apiKeys: 'API Keys', - subscriptions: 'Subscriptions', - subscription: 'Subscription', - noCredentialHint: 'Please create an API Key or contact admin for subscription', - uploadReference: 'Upload reference image', - generatingCount: 'Generating {current}/{max}', - noStorageToastMessage: 'Cloud storage is not configured. Please use "Download" to save files after generation, otherwise they will be lost.', - galleryCount: '{count} works', - galleryEmptyTitle: 'No works yet', - galleryEmptyDesc: 'Your creations will be displayed here. Go to the generate page to start your first creation.', - startCreating: 'Start Creating', - yesterday: 'Yesterday', - landscape: 'Landscape', - portrait: 'Portrait', - square: 'Square', - examplePrompt1: 'A golden Shiba Inu walking through the streets of Shibuya, Tokyo, camera following, cinematic shot, 4K', - examplePrompt2: 'Drone aerial view, green aurora reflecting on a glacial lake in Iceland, slow push-in', - examplePrompt3: 'Cyberpunk futuristic city, neon lights reflected in rain puddles, nightscape, cinematic colors', - examplePrompt4: 'Chinese ink painting style, a small boat drifting among misty mountains and rivers, classical atmosphere' - }, - // Payment System payment: { title: 'Recharge / Subscription', diff --git a/frontend/src/i18n/locales/zh.ts b/frontend/src/i18n/locales/zh.ts index 2039b90f82..77c780d80c 100644 --- a/frontend/src/i18n/locales/zh.ts +++ b/frontend/src/i18n/locales/zh.ts @@ -358,7 +358,6 @@ export default { mySubscriptions: '我的订阅', buySubscription: '充值/订阅', docs: '文档', - sora: 'Sora 创作', myOrders: '我的订单', orderManagement: '订单管理', paymentDashboard: '支付概览', @@ -4322,7 +4321,6 @@ export default { gateway: '网关服务', email: '邮件设置', backup: '数据备份', - data: 'Sora 存储', payment: '支付设置', }, emailTabDisabledTitle: '邮箱验证未启用', @@ -5170,102 +5168,6 @@ export default { } }, - // Sora 创作 - sora: { - title: 'Sora 创作', - description: '使用 Sora AI 生成视频与图片', - notEnabled: '功能未开放', - notEnabledDesc: '管理员尚未启用 Sora 创作功能,请联系管理员开通。', - tabGenerate: '生成', - tabLibrary: '作品库', - noActiveGenerations: '暂无生成任务', - startGenerating: '在下方输入提示词,开始创作', - storage: '存储', - promptPlaceholder: '描述你想创作的内容...', - generate: '生成', - generating: '生成中...', - selectModel: '选择模型', - statusPending: '等待中', - statusGenerating: '生成中', - statusCompleted: '已完成', - statusFailed: '失败', - statusCancelled: '已取消', - cancel: '取消', - delete: '删除', - save: '保存到云端', - saved: '已保存', - retry: '重试', - download: '下载', - justNow: '刚刚', - minutesAgo: '{n} 分钟前', - hoursAgo: '{n} 小时前', - noSavedWorks: '暂无保存的作品', - saveWorksHint: '生成完成后,将作品保存到作品库', - filterAll: '全部', - filterVideo: '视频', - filterImage: '图片', - confirmDelete: '确定删除此作品?', - loading: '加载中...', - loadMore: '加载更多', - noStorageWarningTitle: '未配置存储', - noStorageWarningDesc: '生成的内容仅通过上游临时链接提供,约 15 分钟后过期。建议管理员配置 S3 存储。', - mediaTypeVideo: '视频', - mediaTypeImage: '图片', - notificationCompleted: '生成完成', - notificationFailed: '生成失败', - notificationCompletedBody: '您的 {model} 任务已完成', - notificationFailedBody: '您的 {model} 任务失败了', - upstreamExpiresSoon: '即将过期', - upstreamExpired: '链接已过期', - upstreamCountdown: '剩余 {time}', - previewTitle: '作品预览', - closePreview: '关闭', - beforeUnloadWarning: '您有未保存的生成内容,确定要离开吗?', - downloadTitle: '下载生成内容', - downloadExpirationWarning: '此链接约 15 分钟后过期,请尽快下载保存。', - downloadNow: '立即下载', - referenceImage: '参考图', - removeImage: '移除', - imageTooLarge: '图片大小不能超过 20MB', - // Sora 暗色主题新增 - welcomeTitle: '将你的想象力变成视频', - welcomeSubtitle: '输入一段描述,Sora 将为你创作逼真的视频或图片。尝试以下示例开始创作。', - queueTasks: '个任务', - queueWaiting: '队列中等待', - waiting: '等待中', - waited: '已等待', - errorCategory: '内容策略限制', - savedToCloud: '已保存到云端', - downloadLocal: '本地下载', - canDownload: '可下载', - regenrate: '重新生成', - regenerate: '重新生成', - creatorPlaceholder: '描述你想要生成的视频或图片...', - videoModels: '视频模型', - imageModels: '图片模型', - noStorageConfigured: '存储未配置', - selectCredential: '选择凭证', - apiKeys: 'API 密钥', - subscriptions: '订阅', - subscription: '订阅', - noCredentialHint: '请先创建 API Key 或联系管理员分配订阅', - uploadReference: '上传参考图片', - generatingCount: '正在生成 {current}/{max}', - noStorageToastMessage: '管理员未开通云存储,生成完成后请使用"本地下载"保存文件,否则将会丢失。', - galleryCount: '共 {count} 个作品', - galleryEmptyTitle: '还没有任何作品', - galleryEmptyDesc: '你的创作成果将会展示在这里。前往生成页,开始你的第一次创作吧。', - startCreating: '开始创作', - yesterday: '昨天', - landscape: '横屏', - portrait: '竖屏', - square: '方形', - examplePrompt1: '一只金色的柴犬在东京涩谷街头散步,镜头跟随,电影感画面,4K 高清', - examplePrompt2: '无人机航拍视角,冰岛极光下的冰川湖面反射绿色光芒,慢速推进', - examplePrompt3: '赛博朋克风格的未来城市,霓虹灯倒映在雨后积水中,夜景,电影级色彩', - examplePrompt4: '水墨画风格,一叶扁舟在山水间漂泊,薄雾缭绕,中国古典意境' - }, - // Payment System payment: { title: '充值/订阅', diff --git a/frontend/src/views/admin/SettingsView.vue b/frontend/src/views/admin/SettingsView.vue index 85f168521b..ca9257114b 100644 --- a/frontend/src/views/admin/SettingsView.vue +++ b/frontend/src/views/admin/SettingsView.vue @@ -2174,7 +2174,6 @@ const form = reactive({ backend_mode_enabled: false, hide_ccs_import_button: false, payment_enabled: false, payment_min_amount: 1, payment_max_amount: 10000, payment_daily_limit: 50000, payment_max_pending_orders: 3, payment_order_timeout_minutes: 30, payment_balance_disabled: false, payment_enabled_types: [], payment_help_image_url: '', payment_help_text: '', payment_product_name_prefix: '', payment_product_name_suffix: '', payment_load_balance_strategy: 'round-robin', payment_cancel_rate_limit_enabled: false, payment_cancel_rate_limit_max: 10, payment_cancel_rate_limit_window: 1, payment_cancel_rate_limit_unit: 'day', payment_cancel_rate_limit_window_mode: 'rolling', - sora_client_enabled: false, custom_menu_items: [] as Array<{id: string; label: string; icon_svg: string; url: string; visibility: 'user' | 'admin'; sort_order: number}>, custom_endpoints: [] as Array<{name: string; endpoint: string; description: string}>, frontend_url: '',