1import React, { useEffect, useState } from 'react';
2import { Download, Terminal, CheckCircle, Info } from 'lucide-react';
4const AgentV3Download = () => {
5 const [downloads, setDownloads] = useState(null);
6 const [loading, setLoading] = useState(true);
7 const [error, setError] = useState(null);
13 const fetchDownloads = async () => {
15 const token = localStorage.getItem('token');
16 const response = await fetch('/api/agent-v3/downloads', {
18 'Authorization': `Bearer ${token}`
22 if (!response.ok) throw new Error('Failed to fetch downloads');
24 const data = await response.json();
27 setError(err.message);
33 const handleDownload = async (url, filename) => {
35 const token = localStorage.getItem('token');
36 const response = await fetch(url, {
38 'Authorization': `Bearer ${token}`
42 if (!response.ok) throw new Error('Download failed');
44 const blob = await response.blob();
45 const downloadUrl = window.URL.createObjectURL(blob);
46 const link = document.createElement('a');
47 link.href = downloadUrl;
48 link.download = filename;
49 document.body.appendChild(link);
51 document.body.removeChild(link);
52 window.URL.revokeObjectURL(downloadUrl);
54 console.error('Download error:', err);
55 alert(`Download failed: ${err.message}`);
59 const PlatformCard = ({ title, icon, items, instructions }) => (
60 <div className="bg-white rounded-lg shadow-md p-6">
61 <div className="flex items-center gap-3 mb-4">
62 <div className="text-blue-600">{icon}</div>
63 <h3 className="text-xl font-semibold">{title}</h3>
66 <div className="space-y-3">
67 {items.map((item, index) => (
70 onClick={() => handleDownload(item.url, `everydaytech-agent-v3.${item.type.toLowerCase()}`)}
71 className="w-full flex items-center justify-between p-3 bg-gray-50 hover:bg-gray-100 rounded-lg transition-colors text-left"
73 <div className="flex items-center gap-2">
74 <Download size={18} className="text-gray-600" />
75 <span className="font-medium">{item.name}</span>
77 <span className="text-sm text-gray-500 uppercase">{item.type}</span>
83 <div className="mt-4 p-3 bg-blue-50 rounded-lg text-sm text-blue-800">
84 <div className="flex gap-2">
85 <Info size={16} className="flex-shrink-0 mt-0.5" />
87 <span className="font-semibold">Installation: </span>
98 <div className="flex items-center justify-center min-h-screen">
99 <div className="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"></div>
106 <div className="flex items-center justify-center min-h-screen">
107 <div className="bg-red-50 border border-red-200 rounded-lg p-6 max-w-md">
108 <h3 className="text-red-800 font-semibold mb-2">Error Loading Downloads</h3>
109 <p className="text-red-600">{error}</p>
116 <div className="min-h-screen bg-gray-50 py-8 px-4">
117 <div className="max-w-6xl mx-auto">
119 <div className="text-center mb-12">
120 <h1 className="text-4xl font-bold text-gray-900 mb-4">
121 EverydayTech Agent v3
123 <p className="text-lg text-gray-600 mb-6">
124 Next-generation remote management agent powered by MeshCentral
127 <div className="inline-flex items-center gap-2 px-4 py-2 bg-green-50 border border-green-200 rounded-lg text-green-800">
128 <CheckCircle size={20} />
129 <span className="font-semibold">Production Ready</span>
133 {/* Device Types Supported */}
134 <div className="bg-gradient-to-r from-blue-50 to-indigo-50 rounded-lg shadow-md p-6 mb-8 border border-blue-200">
135 <h2 className="text-2xl font-semibold mb-4 text-blue-900">🖥️ Supported Devices</h2>
136 <div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4">
138 { icon: '💻', name: 'Windows PC', desc: 'Desktop & Laptop' },
139 { icon: '🐧', name: 'Linux', desc: 'Servers & Workstations' },
140 { icon: '🍎', name: 'macOS', desc: 'Intel & Apple Silicon' },
141 { icon: '🖨️', name: 'Printers', desc: 'Network Printers' },
142 { icon: '📡', name: 'Routers', desc: 'Network Devices' },
143 { icon: '⚙️', name: 'SNMP', desc: 'Monitoring Devices' },
144 { icon: '📱', name: 'IoT', desc: 'Smart Devices' },
145 { icon: '☁️', name: 'VMs', desc: 'Virtual Machines' },
146 { icon: '🔌', name: 'NAS', desc: 'Network Storage' },
147 { icon: '🎮', name: 'Embedded', desc: 'Custom Hardware' }
148 ].map((device, index) => (
149 <div key={index} className="bg-white rounded-lg p-4 text-center shadow-sm hover:shadow-md transition-shadow">
150 <div className="text-3xl mb-2">{device.icon}</div>
151 <div className="font-semibold text-gray-900 text-sm">{device.name}</div>
152 <div className="text-xs text-gray-600 mt-1">{device.desc}</div>
159 <div className="bg-white rounded-lg shadow-md p-6 mb-8">
160 <h2 className="text-2xl font-semibold mb-4">✨ Features</h2>
161 <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
163 'Remote Desktop (High Performance)',
164 'Terminal/SSH/PowerShell Access',
165 'File Transfer (Drag & Drop)',
166 'System Information Collection',
167 'Hardware Inventory',
169 'Cross-Platform Support',
170 'Real-time Connection Status',
171 'Event Logging & Alerts',
173 'Two-Factor Authentication',
175 ].map((feature, index) => (
176 <div key={index} className="flex items-center gap-2 text-gray-700">
177 <CheckCircle size={18} className="text-green-600 flex-shrink-0" />
178 <span>{feature}</span>
184 {/* Download Sections */}
185 <div className="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8">
189 icon={<Download size={24} />}
192 name: downloads?.downloads?.windows?.x64?.name || 'Windows 64-bit (EXE)',
194 url: downloads?.downloads?.windows?.x64?.exe
197 name: downloads?.downloads?.windows?.x64?.name || 'Windows 64-bit (MSI)',
199 url: downloads?.downloads?.windows?.x64?.msi
202 name: downloads?.downloads?.windows?.x86?.name || 'Windows 32-bit',
204 url: downloads?.downloads?.windows?.x86?.exe
207 instructions={downloads?.instructions?.windows || 'Run installer as Administrator'}
213 icon={<Terminal size={24} />}
216 name: downloads?.downloads?.linux?.x64?.name || 'Linux 64-bit',
218 url: downloads?.downloads?.linux?.x64?.sh
221 name: downloads?.downloads?.linux?.arm?.name || 'Linux ARM',
223 url: downloads?.downloads?.linux?.arm?.sh
226 instructions={downloads?.instructions?.linux || 'Run: wget [URL] | sudo bash'}
232 icon={<Download size={24} />}
235 name: downloads?.downloads?.macos?.x64?.name || 'macOS Intel',
237 url: downloads?.downloads?.macos?.x64?.pkg
240 name: downloads?.downloads?.macos?.arm64?.name || 'macOS Apple Silicon',
242 url: downloads?.downloads?.macos?.arm64?.pkg
245 instructions={downloads?.instructions?.macos || 'Double-click PKG to install'}
249 {/* Quick Install Commands */}
250 <div className="bg-gray-900 rounded-lg shadow-md p-6 text-white mb-8">
251 <h2 className="text-2xl font-semibold mb-4">⚡ Quick Install</h2>
253 <div className="space-y-4">
255 <h3 className="text-sm font-semibold text-gray-400 mb-2">Linux / macOS</h3>
256 <div className="bg-gray-800 p-3 rounded font-mono text-sm overflow-x-auto">
257 <code>curl -s https://rmm-psa-backend-t9f7k.ondigitalocean.app/api/agent-v3/install-script | sudo bash</code>
262 <h3 className="text-sm font-semibold text-gray-400 mb-2">Windows (PowerShell as Admin)</h3>
263 <div className="bg-gray-800 p-3 rounded font-mono text-sm overflow-x-auto">
264 <code>iwr -useb https://rmm-psa-backend-t9f7k.ondigitalocean.app/api/agent-v3/install-script/windows | iex</code>
271 <div className="bg-yellow-50 border border-yellow-200 rounded-lg p-6">
272 <div className="flex gap-3">
273 <Info size={24} className="text-yellow-600 flex-shrink-0" />
275 <h3 className="font-semibold text-yellow-900 mb-2">Automatic Registration</h3>
276 <p className="text-yellow-800 mb-2">
277 After installation, the agent will automatically:
279 <ul className="list-disc list-inside space-y-1 text-yellow-800 text-sm">
280 <li>Connect to MeshCentral</li>
281 <li>Send device information to the dashboard</li>
282 <li>Appear in your Agents page within 30 seconds</li>
283 <li>Link to existing agent records by hostname/MAC address</li>
284 <li>Create a new agent record if none exists</li>
290 {/* What Happened to Agent v1/v2? */}
291 <div className="mt-8 bg-blue-50 border border-blue-200 rounded-lg p-6">
292 <h3 className="font-semibold text-blue-900 mb-2">🤔 What happened to Agent v1 and v2?</h3>
293 <p className="text-blue-800 text-sm">
294 Agent v3 replaces our custom-built agents with a proven, production-ready solution.
295 Instead of maintaining custom agent code, we white-labeled the industry-standard MeshCentral agent,
296 giving you enterprise features out of the box. Your existing agents will continue to work,
297 but we recommend upgrading to v3 for the best experience.
305export default AgentV3Download;