File size: 2,994 Bytes
c0e8080 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
typescript
import React from 'react'
import { Link } from 'react-router-dom'
import { TrendingUp, TrendingDown, Plus, AlertTriangle } from 'lucide-react'
import KPICard from '../components/KPICard'
import ActivityTimeline from '../components/ActivityTimeline'
const Dashboard: React.FC = () => {
const mockKPIs = [
{
title: 'Total Assets',
value: '247',
change: '+12',
trend: 'up',
icon: Server
},
{
title: 'Active Servers',
value: '89',
change: '+3',
trend: 'up',
icon: TrendingUp
},
{
title: 'Open Problems',
value: '14',
change: '-2',
trend: 'down',
icon: TrendingDown
},
{
title: 'Resolved This Month',
value: '42',
change: '+8',
trend: 'up',
icon: CheckCircle
}
]
return (
<div className="space-y-6">
{/* Page Header */}
<div className="flex flex-col sm:flex-row sm:items-center justify-between">
<div>
<h1 className="text-2xl font-bold text-gray-900">Dashboard</h1>
<p className="mt-1 text-sm text-gray-600">
Overview of your IT infrastructure and recent activity
</p>
</div>
<div className="mt-4 sm:mt-0 flex space-x-3">
<Link to="/assets/new" className="btn-primary">
<Plus className="h-4 w-4 mr-2" />
Add Asset
</Link>
<Link to="/knowledge/new" className="btn-secondary">
<AlertTriangle className="h-4 w-4 mr-2" />
Log Problem
</Link>
</div>
</div>
{/* KPI Grid */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
{mockKPIs.map((kpi, index) => (
<KPICard key={index} {...kpi} />
))}
</div>
{/* Main Content Grid */}
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
{/* Infrastructure Visualization */}
<div className="lg:col-span-2 card p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-4">
Infrastructure Topology
</h2>
<div className="h-80 bg-gray-50 rounded-card border-2 border-dashed border-gray-300 flex items-center justify-center">
<div className="text-center">
<Network className="mx-auto h-12 w-12 text-gray-400" />
<p className="mt-2 text-sm text-gray-500">
Interactive network graph visualization
</p>
<Link to="/map" className="mt-3 btn-primary">
View Full Map
</Link>
</div>
</div>
</div>
{/* Recent Activity */}
<div className="card p-6">
<h2 className="text-lg font-semibold text-gray-900 mb-4">
Recent Activity
</h2>
<ActivityTimeline />
</div>
</div>
</div>
</div>
)
}
export default Dashboard
</html> |