Files
towercontrol/src/app/settings/advanced/page.tsx
Julien Froidefond f5417040fd feat: complete Phase 4 of service refactoring
- Marked tasks in `TODO.md` as completed for moving task-related files to the `task-management` directory and correcting imports across the codebase.
- Updated imports in `seed-data.ts`, `seed-tags.ts`, API routes, and various components to reflect the new structure.
- Removed obsolete `daily.ts`, `tags.ts`, and `tasks.ts` files to streamline the codebase.
- Added new tasks in `TODO.md` for future cleaning and organization of service imports.
2025-09-23 10:25:41 +02:00

44 lines
1.3 KiB
TypeScript

import { tasksService } from '@/services/task-management/tasks';
import { tagsService } from '@/services/task-management/tags';
import { backupService } from '@/services/data-management/backup';
import { backupScheduler } from '@/services/data-management/backup-scheduler';
import { AdvancedSettingsPageClient } from '@/components/settings/AdvancedSettingsPageClient';
// Force dynamic rendering for real-time data
export const dynamic = 'force-dynamic';
export default async function AdvancedSettingsPage() {
// Fetch all data server-side
const [taskStats, tags] = await Promise.all([
tasksService.getTaskStats(),
tagsService.getTags()
]);
// Compose backup data like the API does
const backups = await backupService.listBackups();
const schedulerStatus = backupScheduler.getStatus();
const config = backupService.getConfig();
const backupData = {
backups,
scheduler: {
...schedulerStatus,
nextBackup: schedulerStatus.nextBackup?.toISOString() || null
},
config
};
const dbStats = {
taskCount: taskStats.total,
tagCount: tags.length,
completionRate: taskStats.completionRate
};
return (
<AdvancedSettingsPageClient
initialDbStats={dbStats}
initialBackupData={backupData}
/>
);
}