feat: 重构前端代码结构并添加Java后端支持
- 重构前端导入和组件结构,优化代码组织 - 添加Java后端基础框架和API实现 - 修复类型定义和接口兼容性问题 - 新增测试页面和工具函数 - 优化国际化支持和错误处理 - 更新依赖配置和构建脚本 新增Java后端模块: - 实现基础认证、订单、支付等服务 - 添加Swagger API文档支持 - 配置数据库连接和缓存 - 实现国际化消息处理 - 添加安全过滤器和限流控制
This commit is contained in:
@@ -207,7 +207,6 @@ const zhCN = {
|
||||
'product.publish.cancel': '取消',
|
||||
// Product publish form additional translations
|
||||
'product.publish.productImages': '商品图片',
|
||||
'product.publish.images': '图片',
|
||||
'product.publish.upload': '上传',
|
||||
'product.publish.pricing': '定价',
|
||||
'product.publish.profitMarginValidation': '利润率验证',
|
||||
@@ -327,7 +326,6 @@ const zhCN = {
|
||||
'autopilot.type': '类型',
|
||||
'autopilot.task': '任务',
|
||||
'autopilot.status': '状态',
|
||||
'autopilot.description': '描述',
|
||||
'autopilot.duration': '持续时间',
|
||||
'autopilot.auto': '自动',
|
||||
'autopilot.enabledFeatures': '已启用功能',
|
||||
@@ -453,16 +451,12 @@ const zhCN = {
|
||||
'taskCenter.actualDuration': '实际持续时间',
|
||||
'taskCenter.result': '结果',
|
||||
'taskCenter.createNewTask': '创建新任务',
|
||||
'taskCenter.editTask': '编辑任务',
|
||||
'taskCenter.taskName': '任务名称',
|
||||
'taskCenter.enterTaskName': '请输入任务名称',
|
||||
'taskCenter.taskType': '任务类型',
|
||||
'taskCenter.selectTaskType': '请选择任务类型',
|
||||
'taskCenter.priority': '优先级',
|
||||
'taskCenter.selectPriority': '请选择优先级',
|
||||
'taskCenter.scheduleType': '调度类型',
|
||||
'taskCenter.selectScheduleType': '请选择调度类型',
|
||||
'taskCenter.scheduleTime': '调度时间',
|
||||
'taskCenter.maxRetries': '最大重试次数',
|
||||
'taskCenter.enterMaxRetries': '请输入最大重试次数',
|
||||
|
||||
@@ -501,23 +495,15 @@ const zhCN = {
|
||||
'aiActionTaskManager.aiSuggestion': 'AI 建议',
|
||||
'aiActionTaskManager.executionResult': '执行结果',
|
||||
'aiActionTaskManager.taskTimeline': '任务时间线',
|
||||
'aiActionTaskManager.createTask': '创建任务',
|
||||
'aiActionTaskManager.editTask': '编辑任务',
|
||||
'aiActionTaskManager.taskName': '任务名称',
|
||||
'aiActionTaskManager.enterTaskName': '请输入任务名称',
|
||||
'aiActionTaskManager.actionType': '行动类型',
|
||||
'aiActionTaskManager.selectActionType': '请选择行动类型',
|
||||
'aiActionTaskManager.priority': '优先级',
|
||||
'aiActionTaskManager.selectPriority': '请选择优先级',
|
||||
'aiActionTaskManager.maxRetries': '最大重试次数',
|
||||
'aiActionTaskManager.enterMaxRetries': '请输入最大重试次数',
|
||||
'aiActionTaskManager.estimatedDuration': '预计持续时间(分钟)',
|
||||
'aiActionTaskManager.enterEstimatedDuration': '请输入预计持续时间',
|
||||
'aiActionTaskManager.all': '全部',
|
||||
'aiActionTaskManager.pending': '待处理',
|
||||
'aiActionTaskManager.analyzing': '分析中',
|
||||
'aiActionTaskManager.pendingReview': '待审核',
|
||||
'aiActionTaskManager.executing': '执行中',
|
||||
'aiActionTaskManager.completed': '已完成',
|
||||
'aiActionTaskManager.failed': '失败',
|
||||
'aiActionTaskManager.taskCreated': '任务创建成功',
|
||||
@@ -620,9 +606,6 @@ const zhCN = {
|
||||
'humanApproval.custom': '自定义操作',
|
||||
'humanApproval.pending': '待处理',
|
||||
'humanApproval.aiAnalyzing': 'AI 分析中',
|
||||
'humanApproval.pendingReview': '待审核',
|
||||
'humanApproval.approved': '已批准',
|
||||
'humanApproval.rejected': '已拒绝',
|
||||
'humanApproval.aiExecuting': 'AI 执行中',
|
||||
'humanApproval.completed': '已完成',
|
||||
'humanApproval.failed': '失败',
|
||||
@@ -810,7 +793,6 @@ const zhCN = {
|
||||
'abTest.config.review': '最终检查',
|
||||
'abTest.config.testName': '测试名称',
|
||||
'abTest.config.enterTestName': '请输入测试名称',
|
||||
'abTest.config.description': '描述',
|
||||
'abTest.config.enterDescription': '请输入测试描述',
|
||||
'abTest.config.testType': '测试类型',
|
||||
'abTest.config.selectTestType': '请选择测试类型',
|
||||
@@ -834,8 +816,6 @@ const zhCN = {
|
||||
'abTest.config.reviewConfiguration': '审核配置',
|
||||
'abTest.config.reviewDesc': '请在启动测试前审核所有设置。',
|
||||
'abTest.config.testDetails': '测试详情',
|
||||
'abTest.config.variants': '变体',
|
||||
'abTest.config.audience': '受众',
|
||||
'abTest.config.saveLaunch': '保存并启动',
|
||||
'abTest.config.previous': '上一步',
|
||||
'abTest.config.next': '下一步',
|
||||
@@ -867,7 +847,6 @@ const zhCN = {
|
||||
'abTest.results.confidenceLevel': '置信水平',
|
||||
'abTest.results.testCompleted': '测试已完成',
|
||||
'abTest.results.variantPerformance': '变体性能',
|
||||
'abTest.results.visitors': '访问者',
|
||||
'abTest.results.conversions': '转化',
|
||||
'abTest.results.conversionRate': '转化率',
|
||||
'abTest.results.improvement': '改进',
|
||||
@@ -902,11 +881,9 @@ const zhCN = {
|
||||
'aiDecisionLog.query': '查询',
|
||||
'aiDecisionLog.refresh': '刷新',
|
||||
'aiDecisionLog.decisionId': '决策 ID',
|
||||
'aiDecisionLog.decisionType': '决策类型',
|
||||
'aiDecisionLog.businessType': '业务类型',
|
||||
'aiDecisionLog.decisionContent': '决策内容',
|
||||
'aiDecisionLog.confidence': '置信度',
|
||||
'aiDecisionLog.status': '状态',
|
||||
'aiDecisionLog.executionTime': '执行时间',
|
||||
'aiDecisionLog.createdTime': '创建时间',
|
||||
'aiDecisionLog.actions': '操作',
|
||||
@@ -943,9 +920,7 @@ const zhCN = {
|
||||
'ad.status': '状态',
|
||||
'ad.filter': '筛选',
|
||||
'ad.adName': '广告名称',
|
||||
'ad.platform': '平台',
|
||||
'ad.campaign': '活动',
|
||||
'ad.status': '状态',
|
||||
'ad.budget': '预算',
|
||||
'ad.spend': '支出',
|
||||
'ad.gmv': 'GMV',
|
||||
@@ -958,10 +933,7 @@ const zhCN = {
|
||||
'ad.edit': '编辑',
|
||||
'ad.delete': '删除',
|
||||
'ad.editAd': '编辑广告',
|
||||
'ad.createAd': '创建广告',
|
||||
'ad.adName': '广告名称',
|
||||
'ad.enterAdName': '请输入广告名称',
|
||||
'ad.platform': '平台',
|
||||
'ad.selectPlatform': '请选择平台',
|
||||
'ad.gmvMaxType': 'GMV Max 类型',
|
||||
'ad.selectGmvMaxType': '请选择 GMV Max 类型',
|
||||
@@ -983,7 +955,6 @@ const zhCN = {
|
||||
'ad.budgetSettings': '预算设置',
|
||||
'ad.campaignName': '活动名称',
|
||||
'ad.enterCampaignName': '请输入活动名称',
|
||||
'ad.status': '状态',
|
||||
'ad.selectStatus': '请选择状态',
|
||||
'ad.active': '活跃',
|
||||
'ad.paused': '暂停',
|
||||
@@ -993,7 +964,6 @@ const zhCN = {
|
||||
'ad.dailyBudget': '日预算 ($)',
|
||||
'ad.enterDailyBudget': '请输入日预算',
|
||||
'ad.bidStrategy': '出价策略',
|
||||
'ad.autoBid': '自动出价',
|
||||
'ad.manualBid': '手动出价',
|
||||
'ad.targetCpa': '目标CPA',
|
||||
'ad.targetRoas': '目标ROAS',
|
||||
@@ -1266,7 +1236,6 @@ const enUS = {
|
||||
'abTest.config.review': 'Final Check',
|
||||
'abTest.config.testName': 'Test Name',
|
||||
'abTest.config.enterTestName': 'Please enter test name',
|
||||
'abTest.config.description': 'Description',
|
||||
'abTest.config.enterDescription': 'Please enter test description',
|
||||
'abTest.config.testType': 'Test Type',
|
||||
'abTest.config.selectTestType': 'Please select test type',
|
||||
@@ -1290,8 +1259,6 @@ const enUS = {
|
||||
'abTest.config.reviewConfiguration': 'Review Configuration',
|
||||
'abTest.config.reviewDesc': 'Please review all settings before launching the test.',
|
||||
'abTest.config.testDetails': 'Test Details',
|
||||
'abTest.config.variants': 'Variants',
|
||||
'abTest.config.audience': 'Audience',
|
||||
'abTest.config.saveLaunch': 'Save & Launch',
|
||||
'abTest.config.previous': 'Previous',
|
||||
'abTest.config.next': 'Next',
|
||||
@@ -1323,7 +1290,6 @@ const enUS = {
|
||||
'abTest.results.confidenceLevel': 'Confidence Level',
|
||||
'abTest.results.testCompleted': 'Test Completed',
|
||||
'abTest.results.variantPerformance': 'Variant Performance',
|
||||
'abTest.results.visitors': 'Visitors',
|
||||
'abTest.results.conversions': 'Conversions',
|
||||
'abTest.results.conversionRate': 'Conversion Rate',
|
||||
'abTest.results.improvement': 'Improvement',
|
||||
@@ -1358,11 +1324,9 @@ const enUS = {
|
||||
'aiDecisionLog.query': 'Query',
|
||||
'aiDecisionLog.refresh': 'Refresh',
|
||||
'aiDecisionLog.decisionId': 'Decision ID',
|
||||
'aiDecisionLog.decisionType': 'Decision Type',
|
||||
'aiDecisionLog.businessType': 'Business Type',
|
||||
'aiDecisionLog.decisionContent': 'Decision Content',
|
||||
'aiDecisionLog.confidence': 'Confidence',
|
||||
'aiDecisionLog.status': 'Status',
|
||||
'aiDecisionLog.executionTime': 'Execution Time',
|
||||
'aiDecisionLog.createdTime': 'Created Time',
|
||||
'aiDecisionLog.actions': 'Actions',
|
||||
@@ -1399,9 +1363,7 @@ const enUS = {
|
||||
'ad.status': 'Status',
|
||||
'ad.filter': 'Filter',
|
||||
'ad.adName': 'Ad Name',
|
||||
'ad.platform': 'Platform',
|
||||
'ad.campaign': 'Campaign',
|
||||
'ad.status': 'Status',
|
||||
'ad.budget': 'Budget',
|
||||
'ad.spend': 'Spend',
|
||||
'ad.gmv': 'GMV',
|
||||
@@ -1414,10 +1376,7 @@ const enUS = {
|
||||
'ad.edit': 'Edit',
|
||||
'ad.delete': 'Delete',
|
||||
'ad.editAd': 'Edit Ad',
|
||||
'ad.createAd': 'Create Ad',
|
||||
'ad.adName': 'Ad Name',
|
||||
'ad.enterAdName': 'Please enter ad name',
|
||||
'ad.platform': 'Platform',
|
||||
'ad.selectPlatform': 'Please select platform',
|
||||
'ad.gmvMaxType': 'GMV Max Type',
|
||||
'ad.selectGmvMaxType': 'Please select GMV Max type',
|
||||
@@ -1439,7 +1398,6 @@ const enUS = {
|
||||
'ad.budgetSettings': 'Budget Settings',
|
||||
'ad.campaignName': 'Campaign Name',
|
||||
'ad.enterCampaignName': 'Please enter campaign name',
|
||||
'ad.status': 'Status',
|
||||
'ad.selectStatus': 'Please select status',
|
||||
'ad.active': 'Active',
|
||||
'ad.paused': 'Paused',
|
||||
@@ -1449,7 +1407,6 @@ const enUS = {
|
||||
'ad.dailyBudget': 'Daily Budget ($)',
|
||||
'ad.enterDailyBudget': 'Please enter daily budget',
|
||||
'ad.bidStrategy': 'Bid Strategy',
|
||||
'ad.autoBid': 'Auto Bid',
|
||||
'ad.manualBid': 'Manual Bid',
|
||||
'ad.targetCpa': 'Target CPA',
|
||||
'ad.targetRoas': 'Target ROAS',
|
||||
@@ -1541,7 +1498,6 @@ const enUS = {
|
||||
'product.publish.cancel': 'Cancel',
|
||||
// Product publish form additional translations
|
||||
'product.publish.productImages': 'Product Images',
|
||||
'product.publish.images': 'Images',
|
||||
'product.publish.upload': 'Upload',
|
||||
'product.publish.pricing': 'Pricing',
|
||||
'product.publish.profitMarginValidation': 'Profit Margin Validation',
|
||||
@@ -1662,7 +1618,6 @@ const enUS = {
|
||||
'autopilot.type': 'Type',
|
||||
'autopilot.task': 'Task',
|
||||
'autopilot.status': 'Status',
|
||||
'autopilot.description': 'Description',
|
||||
'autopilot.duration': 'Duration',
|
||||
'autopilot.auto': 'Auto',
|
||||
'autopilot.enabledFeatures': 'Enabled Features',
|
||||
@@ -1787,16 +1742,12 @@ const enUS = {
|
||||
'taskCenter.actualDuration': 'Actual Duration',
|
||||
'taskCenter.result': 'Result',
|
||||
'taskCenter.createNewTask': 'Create New Task',
|
||||
'taskCenter.editTask': 'Edit Task',
|
||||
'taskCenter.taskName': 'Task Name',
|
||||
'taskCenter.enterTaskName': 'Please enter task name',
|
||||
'taskCenter.taskType': 'Task Type',
|
||||
'taskCenter.selectTaskType': 'Please select task type',
|
||||
'taskCenter.priority': 'Priority',
|
||||
'taskCenter.selectPriority': 'Please select priority',
|
||||
'taskCenter.scheduleType': 'Schedule Type',
|
||||
'taskCenter.selectScheduleType': 'Please select schedule type',
|
||||
'taskCenter.scheduleTime': 'Schedule Time',
|
||||
'taskCenter.maxRetries': 'Max Retries',
|
||||
'taskCenter.enterMaxRetries': 'Please enter max retries',
|
||||
|
||||
@@ -1835,23 +1786,15 @@ const enUS = {
|
||||
'aiActionTaskManager.aiSuggestion': 'AI Suggestion',
|
||||
'aiActionTaskManager.executionResult': 'Execution Result',
|
||||
'aiActionTaskManager.taskTimeline': 'Task Timeline',
|
||||
'aiActionTaskManager.createTask': 'Create Task',
|
||||
'aiActionTaskManager.editTask': 'Edit Task',
|
||||
'aiActionTaskManager.taskName': 'Task Name',
|
||||
'aiActionTaskManager.enterTaskName': 'Please enter task name',
|
||||
'aiActionTaskManager.actionType': 'Action Type',
|
||||
'aiActionTaskManager.selectActionType': 'Please select action type',
|
||||
'aiActionTaskManager.priority': 'Priority',
|
||||
'aiActionTaskManager.selectPriority': 'Please select priority',
|
||||
'aiActionTaskManager.maxRetries': 'Max Retries',
|
||||
'aiActionTaskManager.enterMaxRetries': 'Please enter max retries',
|
||||
'aiActionTaskManager.estimatedDuration': 'Estimated Duration (minutes)',
|
||||
'aiActionTaskManager.enterEstimatedDuration': 'Please enter estimated duration',
|
||||
'aiActionTaskManager.all': 'All',
|
||||
'aiActionTaskManager.pending': 'Pending',
|
||||
'aiActionTaskManager.analyzing': 'Analyzing',
|
||||
'aiActionTaskManager.pendingReview': 'Pending Review',
|
||||
'aiActionTaskManager.executing': 'Executing',
|
||||
'aiActionTaskManager.completed': 'Completed',
|
||||
'aiActionTaskManager.failed': 'Failed',
|
||||
'aiActionTaskManager.taskCreated': 'Task created successfully',
|
||||
@@ -1954,9 +1897,6 @@ const enUS = {
|
||||
'humanApproval.custom': 'Custom Action',
|
||||
'humanApproval.pending': 'Pending',
|
||||
'humanApproval.aiAnalyzing': 'AI Analyzing',
|
||||
'humanApproval.pendingReview': 'Pending Review',
|
||||
'humanApproval.approved': 'Approved',
|
||||
'humanApproval.rejected': 'Rejected',
|
||||
'humanApproval.aiExecuting': 'AI Executing',
|
||||
'humanApproval.completed': 'Completed',
|
||||
'humanApproval.failed': 'Failed',
|
||||
|
||||
@@ -37,62 +37,68 @@ export const ThemeProvider: FC<ThemeProviderProps> = ({ children }) => {
|
||||
});
|
||||
|
||||
const [resolvedTheme, setResolvedTheme] = useState<'light' | 'dark'>(() => {
|
||||
if (theme === 'auto') {
|
||||
if (typeof window !== 'undefined' && theme === 'auto') {
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
}
|
||||
return theme;
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
|
||||
const handleChange = (e: MediaQueryListEvent) => {
|
||||
if (theme === 'auto') {
|
||||
setResolvedTheme(e.matches ? 'dark' : 'light');
|
||||
}
|
||||
};
|
||||
if (typeof window !== 'undefined') {
|
||||
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
|
||||
const handleChange = (e: MediaQueryListEvent) => {
|
||||
if (theme === 'auto') {
|
||||
setResolvedTheme(e.matches ? 'dark' : 'light');
|
||||
}
|
||||
};
|
||||
|
||||
mediaQuery.addEventListener('change', handleChange);
|
||||
return () => mediaQuery.removeEventListener('change', handleChange);
|
||||
mediaQuery.addEventListener('change', handleChange);
|
||||
return () => mediaQuery.removeEventListener('change', handleChange);
|
||||
}
|
||||
}, [theme]);
|
||||
|
||||
useEffect(() => {
|
||||
const applyTheme = (isDark: boolean) => {
|
||||
const root = document.documentElement;
|
||||
|
||||
if (isDark) {
|
||||
root.classList.add('dark');
|
||||
root.style.setProperty('--text-primary', '#e5e7eb');
|
||||
root.style.setProperty('--text-secondary', '#d1d5db');
|
||||
root.style.setProperty('--text-tertiary', '#9ca3af');
|
||||
root.style.setProperty('--background-light', '#1f2937');
|
||||
root.style.setProperty('--background-white', '#111827');
|
||||
root.style.setProperty('--background-gray', '#374151');
|
||||
root.style.setProperty('--background-dark', '#0f172a');
|
||||
root.style.setProperty('--border-color', '#374151');
|
||||
root.style.setProperty('--border-hover', '#4b5563');
|
||||
} else {
|
||||
root.classList.remove('dark');
|
||||
root.style.setProperty('--text-primary', '#262626');
|
||||
root.style.setProperty('--text-secondary', '#595959');
|
||||
root.style.setProperty('--text-tertiary', '#8c8c8c');
|
||||
root.style.setProperty('--background-light', '#f5f5f5');
|
||||
root.style.setProperty('--background-white', '#ffffff');
|
||||
root.style.setProperty('--background-gray', '#f0f0f0');
|
||||
root.style.setProperty('--background-dark', '#1f2937');
|
||||
root.style.setProperty('--border-color', '#e8e8e8');
|
||||
root.style.setProperty('--border-hover', '#d9d9d9');
|
||||
}
|
||||
};
|
||||
if (typeof window !== 'undefined') {
|
||||
const applyTheme = (isDark: boolean) => {
|
||||
const root = document.documentElement;
|
||||
|
||||
if (isDark) {
|
||||
root.classList.add('dark');
|
||||
root.style.setProperty('--text-primary', '#e5e7eb');
|
||||
root.style.setProperty('--text-secondary', '#d1d5db');
|
||||
root.style.setProperty('--text-tertiary', '#9ca3af');
|
||||
root.style.setProperty('--background-light', '#1f2937');
|
||||
root.style.setProperty('--background-white', '#111827');
|
||||
root.style.setProperty('--background-gray', '#374151');
|
||||
root.style.setProperty('--background-dark', '#0f172a');
|
||||
root.style.setProperty('--border-color', '#374151');
|
||||
root.style.setProperty('--border-hover', '#4b5563');
|
||||
} else {
|
||||
root.classList.remove('dark');
|
||||
root.style.setProperty('--text-primary', '#262626');
|
||||
root.style.setProperty('--text-secondary', '#595959');
|
||||
root.style.setProperty('--text-tertiary', '#8c8c8c');
|
||||
root.style.setProperty('--background-light', '#f5f5f5');
|
||||
root.style.setProperty('--background-white', '#ffffff');
|
||||
root.style.setProperty('--background-gray', '#f0f0f0');
|
||||
root.style.setProperty('--background-dark', '#1f2937');
|
||||
root.style.setProperty('--border-color', '#e8e8e8');
|
||||
root.style.setProperty('--border-hover', '#d9d9d9');
|
||||
}
|
||||
};
|
||||
|
||||
const isDark = theme === 'dark' || (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
setResolvedTheme(isDark ? 'dark' : 'light');
|
||||
applyTheme(isDark);
|
||||
const isDark = theme === 'dark' || (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
setResolvedTheme(isDark ? 'dark' : 'light');
|
||||
applyTheme(isDark);
|
||||
}
|
||||
}, [theme]);
|
||||
|
||||
const setTheme = (newTheme: Theme) => {
|
||||
setThemeState(newTheme);
|
||||
localStorage.setItem('theme', newTheme);
|
||||
if (typeof window !== 'undefined') {
|
||||
localStorage.setItem('theme', newTheme);
|
||||
}
|
||||
};
|
||||
|
||||
const toggleTheme = () => {
|
||||
|
||||
Reference in New Issue
Block a user