trash models added, first attempt for remainign issues
This commit is contained in:
@@ -48,7 +48,7 @@ export default function Home() {
|
||||
const [sites, setSites] = useState<Site[]>([]);
|
||||
const [sitesLoading, setSitesLoading] = useState(true);
|
||||
const [siteFilter, setSiteFilter] = useState<'all' | number>('all');
|
||||
const [aiPeriod, setAIPeriod] = useState<'7d' | '30d' | '90d'>('7d');
|
||||
const [aiPeriod, setAIPeriod] = useState<'today' | '7d' | '30d' | '90d'>('7d');
|
||||
const [showAddSite, setShowAddSite] = useState(false);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [subscription, setSubscription] = useState<Subscription | null>(null);
|
||||
@@ -171,7 +171,7 @@ export default function Home() {
|
||||
setLoading(true);
|
||||
|
||||
const siteId = siteFilter === 'all' ? undefined : siteFilter;
|
||||
const periodDays = aiPeriod === '7d' ? 7 : aiPeriod === '30d' ? 30 : 90;
|
||||
const periodDays = aiPeriod === 'today' ? 1 : aiPeriod === '7d' ? 7 : aiPeriod === '30d' ? 30 : 90;
|
||||
|
||||
// Fetch real dashboard stats from API
|
||||
const stats = await getDashboardStats({
|
||||
|
||||
@@ -423,6 +423,7 @@ export default function Sites() {
|
||||
onToggle={handleToggle}
|
||||
onSettings={handleSettings}
|
||||
onDetails={handleDetails}
|
||||
onDelete={handleDeleteSite}
|
||||
isToggling={togglingSiteId === site.id}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -85,9 +85,9 @@ export default function SiteDashboard() {
|
||||
});
|
||||
const [operations, setOperations] = useState<OperationStat[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [aiPeriod, setAiPeriod] = useState<'7d' | '30d' | '90d'>('7d');
|
||||
const [aiPeriod, setAiPeriod] = useState<'today' | '7d' | '30d' | '90d'>('7d');
|
||||
|
||||
const handlePeriodChange = (period: '7d' | '30d' | '90d') => {
|
||||
const handlePeriodChange = (period: 'today' | '7d' | '30d' | '90d') => {
|
||||
setAiPeriod(period);
|
||||
};
|
||||
|
||||
@@ -180,7 +180,7 @@ export default function SiteDashboard() {
|
||||
|
||||
// Load operation stats from real API data
|
||||
try {
|
||||
const periodDays = aiPeriod === '7d' ? 7 : aiPeriod === '30d' ? 30 : 90;
|
||||
const periodDays = aiPeriod === 'today' ? 1 : aiPeriod === '7d' ? 7 : aiPeriod === '30d' ? 30 : 90;
|
||||
const stats = await getDashboardStats({ site_id: Number(currentSiteId), days: periodDays });
|
||||
|
||||
// Map operation types from API to display types
|
||||
|
||||
Reference in New Issue
Block a user