diff --git a/app/(app)/analytics/devices/page.tsx b/app/(app)/analytics/devices/page.tsx index 6d7779f..4f8ab74 100644 --- a/app/(app)/analytics/devices/page.tsx +++ b/app/(app)/analytics/devices/page.tsx @@ -1,7 +1,6 @@ "use client"; import { useState, useEffect, useRef } from 'react'; -import { fetchData } from '@/app/api/utils'; import { DeviceAnalytics } from '@/app/api/types'; import { Chart, PieController, ArcElement, Tooltip, Legend, CategoryScale, LinearScale } from 'chart.js'; @@ -91,7 +90,7 @@ export default function DeviceAnalyticsPage() { legend: { position: 'bottom', labels: { - color: 'white' + color: 'currentColor' } }, tooltip: { @@ -132,7 +131,7 @@ export default function DeviceAnalyticsPage() { legend: { position: 'bottom', labels: { - color: 'white' + color: 'currentColor' } }, tooltip: { @@ -173,7 +172,7 @@ export default function DeviceAnalyticsPage() { legend: { position: 'bottom', labels: { - color: 'white' + color: 'currentColor' } }, tooltip: { @@ -211,27 +210,27 @@ export default function DeviceAnalyticsPage() {
{/* 页面标题 */}
-

Device Analytics

-

Analyze visitor distribution by devices, browsers, and operating systems

+

Device Analytics

+

Analyze visitor distribution by devices, browsers, and operating systems

{/* 时间范围选择器 */}
- + setDateRange(prev => ({ ...prev, from: new Date(e.target.value) }))} />
- + setDateRange(prev => ({ ...prev, to: new Date(e.target.value) }))} /> @@ -243,13 +242,13 @@ export default function DeviceAnalyticsPage() {
{/* 设备类型 */}
-

Device Types

+

Device Types

{deviceData && deviceData.deviceTypes.length > 0 ? (
) : ( -
+
No data available
)} @@ -257,13 +256,13 @@ export default function DeviceAnalyticsPage() { {/* 浏览器 */}
-

Browsers

+

Browsers

{deviceData && deviceData.browsers.length > 0 ? (
) : ( -
+
No data available
)} @@ -271,13 +270,13 @@ export default function DeviceAnalyticsPage() { {/* 操作系统 */}
-

Operating Systems

+

Operating Systems

{deviceData && deviceData.operatingSystems.length > 0 ? (
) : ( -
+
No data available
)} @@ -300,7 +299,7 @@ export default function DeviceAnalyticsPage() { {/* 无数据状态 */} {!isLoading && !error && !deviceData && ( -
+

No device data available

)} diff --git a/app/(app)/analytics/geo/page.tsx b/app/(app)/analytics/geo/page.tsx index 7bccb5e..8cb0897 100644 --- a/app/(app)/analytics/geo/page.tsx +++ b/app/(app)/analytics/geo/page.tsx @@ -37,27 +37,27 @@ export default function GeoAnalyticsPage() {
{/* 页面标题 */}
-

Geographic Analysis

-

Analyze visitor distribution by location

+

Geographic Analysis

+

Analyze visitor distribution by location

{/* 时间范围选择器 */}
- + setDateRange(prev => ({ ...prev, from: new Date(e.target.value) }))} />
- + setDateRange(prev => ({ ...prev, to: new Date(e.target.value) }))} /> @@ -71,33 +71,33 @@ export default function GeoAnalyticsPage() { - - - - + + + + {geoData.map(item => ( - - - @@ -122,14 +122,14 @@ export default function GeoAnalyticsPage() { {/* 无数据状态 */} {!isLoading && !error && geoData.length === 0 && ( -
+

No geographic data available

)}
{/* 提示信息 */} -
+

Note: Geographic data is based on IP addresses and may not be 100% accurate.

diff --git a/app/api/types.ts b/app/api/types.ts index ce7e665..76a8970 100644 --- a/app/api/types.ts +++ b/app/api/types.ts @@ -93,13 +93,9 @@ export interface TimeSeriesData { } export interface GeoData { - location?: string; - country?: string; - region?: string; - city?: string; + location: string; visits: number; - uniqueVisitors?: number; - visitors?: number; + visitors: number; percentage: number; } diff --git a/app/components/layout/Navbar.tsx b/app/components/layout/Navbar.tsx index 573dc9b..807187b 100644 --- a/app/components/layout/Navbar.tsx +++ b/app/components/layout/Navbar.tsx @@ -1,7 +1,6 @@ 'use client'; import Link from 'next/link'; -import ThemeToggle from "../ui/ThemeToggle"; export default function Navbar() { return ( @@ -40,7 +39,6 @@ export default function Navbar() {
- diff --git a/app/components/ui/ThemeToggle.tsx b/app/components/ui/ThemeToggle.tsx deleted file mode 100644 index 1b6618c..0000000 --- a/app/components/ui/ThemeToggle.tsx +++ /dev/null @@ -1,64 +0,0 @@ -"use client"; - -import { useState, useEffect } from 'react'; - -export default function ThemeToggle() { - const [darkMode, setDarkMode] = useState(false); - - // Initialize theme on component mount - useEffect(() => { - const isDarkMode = localStorage.getItem('darkMode') === 'true'; - setDarkMode(isDarkMode); - - if (isDarkMode) { - document.documentElement.classList.add('dark'); - } else { - document.documentElement.classList.remove('dark'); - } - }, []); - - // Update theme when darkMode state changes - const toggleTheme = () => { - const newDarkMode = !darkMode; - setDarkMode(newDarkMode); - localStorage.setItem('darkMode', newDarkMode.toString()); - - if (newDarkMode) { - document.documentElement.classList.add('dark'); - } else { - document.documentElement.classList.remove('dark'); - } - }; - - return ( - - ); -} \ No newline at end of file diff --git a/app/globals.css b/app/globals.css index b739895..d568578 100644 --- a/app/globals.css +++ b/app/globals.css @@ -30,30 +30,6 @@ --gradient-red: linear-gradient(135deg, #f43f5e, #e11d48); } -.dark { - /* Dark Mode */ - --background: #0f172a; - --foreground: #ffffff; - - /* Card colors */ - --card-bg: #1e293b; - --card-border: #334155; - - /* Vibrant accent colors */ - --accent-blue: #3b82f6; - --accent-green: #10b981; - --accent-red: #f43f5e; - --accent-yellow: #f59e0b; - --accent-purple: #8b5cf6; - --accent-pink: #ec4899; - --accent-teal: #14b8a6; - --accent-orange: #f97316; - - /* UI colors */ - --text-secondary: #94a3b8; - --progress-bg: #334155; -} - @theme inline { --color-background: var(--background); --color-foreground: var(--foreground); diff --git a/tailwind.config.ts b/tailwind.config.ts index c43c707..dca00d8 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -6,7 +6,6 @@ const config: Config = { "./components/**/*.{js,ts,jsx,tsx,mdx}", "./app/**/*.{js,ts,jsx,tsx,mdx}", ], - darkMode: 'class', theme: { extend: { colors: {
LocationVisitsUnique VisitorsPercentageLocationVisitsUnique VisitorsPercentage
+ {item.location} + {item.visits} + {item.visitors}
-
+ {item.percentage.toFixed(1)}% +
- {item.percentage.toFixed(1)}%