Feat: update agent version to 1.2.0 and add systemd services listing in VpsCard component
All checks were successful
Build and Push Docker Images / docker (push) Successful in 25s

This commit is contained in:
jeanotx32
2026-06-02 19:59:57 -04:00
parent 57132f92ee
commit b2b660e035
5 changed files with 94 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { Server, Wifi, WifiOff, Trash2, ChevronDown, ChevronUp, RefreshCw, Cpu, MemoryStick, ArrowUp, ArrowDown, Pencil, BarChart2, CloudDownload, Copy, Check } from 'lucide-react'
import { Server, Wifi, WifiOff, Trash2, ChevronDown, ChevronUp, RefreshCw, Cpu, MemoryStick, ArrowUp, ArrowDown, Pencil, BarChart2, CloudDownload, Copy, Check, Activity } from 'lucide-react'
import { useState } from 'react'
import ContainerRow from './ContainerRow'
import { tagColor } from './TagInput'
@@ -19,6 +19,7 @@ export default function VpsCard({ vps, onAction, onLogs, onDelete, onUpdate, onE
const [updatingProject, setUpdatingProject] = useState(null)
const [updatingAgent, setUpdatingAgent] = useState(false)
const [exported, setExported] = useState(false)
const [servicesExpanded, setServicesExpanded] = useState(false)
const handleExport = async () => {
await onExport(vps.id)
@@ -208,6 +209,46 @@ export default function VpsCard({ vps, onAction, onLogs, onDelete, onUpdate, onE
<p className="px-4 py-2 text-xs text-gray-500 border-b border-gray-800/60">{vps.description}</p>
)}
{/* Services systemd */}
{!collapsed && vps.online && vps.services?.length > 0 && (
<div className="border-b border-gray-800/60">
<button
onClick={() => setServicesExpanded(e => !e)}
className="w-full flex items-center justify-between px-4 py-2 text-xs text-gray-400 hover:bg-gray-800/40 transition-colors"
>
<span className="flex items-center gap-1.5">
<Activity size={11} className="text-indigo-400" />
Services systemd
<span className="ml-1 px-1.5 py-0.5 rounded-full bg-gray-800 text-gray-500 text-[10px]">
{vps.services.filter(s => s.active === 'active').length}/{vps.services.length}
</span>
</span>
{servicesExpanded ? <ChevronUp size={12} /> : <ChevronDown size={12} />}
</button>
{servicesExpanded && (
<div className="divide-y divide-gray-800/40 max-h-64 overflow-y-auto">
{vps.services.map(svc => {
const isActive = svc.active === 'active'
const isFailed = svc.active === 'failed'
const dotColor = isActive ? 'bg-emerald-400' : isFailed ? 'bg-red-400' : 'bg-gray-500'
const nameColor = isActive ? 'text-gray-200' : isFailed ? 'text-red-400' : 'text-gray-500'
return (
<div key={svc.name} className="flex items-center gap-2.5 px-4 py-1.5 hover:bg-gray-800/30">
<span className={`w-1.5 h-1.5 rounded-full flex-shrink-0 ${dotColor}`} />
<span className={`text-xs font-mono truncate flex-1 ${nameColor}`}>{svc.name}</span>
<span className={`text-[10px] px-1.5 py-0.5 rounded flex-shrink-0 ${
isActive ? 'bg-emerald-500/10 text-emerald-400' :
isFailed ? 'bg-red-500/10 text-red-400' :
'bg-gray-700/40 text-gray-500'
}`}>{svc.sub}</span>
</div>
)
})}
</div>
)}
</div>
)}
{/* Conteneurs */}
{!collapsed && vps.online && (
<div className="divide-y divide-gray-800/50 flex-1">