Update system-logs.tsx

This commit is contained in:
MacRimi
2025-10-18 11:41:49 +02:00
parent a8a4d029f8
commit 7a664ec4ec

View File

@@ -1050,53 +1050,57 @@ export function SystemLogs() {
</Card> </Card>
<Dialog open={isLogModalOpen} onOpenChange={setIsLogModalOpen}> <Dialog open={isLogModalOpen} onOpenChange={setIsLogModalOpen}>
<DialogContent className="max-w-3xl max-h-[80vh] overflow-y-auto"> <DialogContent className="max-w-3xl max-h-[85vh] overflow-y-auto w-[96vw] sm:w-full mx-2 sm:mx-auto">
<DialogHeader> <DialogHeader>
<DialogTitle className="flex items-center gap-2"> <DialogTitle className="flex items-center gap-2 text-base sm:text-lg pr-8">
<FileText className="h-5 w-5" /> <FileText className="h-4 w-4 sm:h-5 sm:w-5 flex-shrink-0" />
Log Details <span className="truncate">Log Details</span>
</DialogTitle> </DialogTitle>
<DialogDescription>Complete information about this log entry</DialogDescription> <DialogDescription className="text-xs sm:text-sm">
Complete information about this log entry
</DialogDescription>
</DialogHeader> </DialogHeader>
{selectedLog && ( {selectedLog && (
<div className="space-y-4"> <div className="space-y-4">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4"> <div className="grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4">
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">Level</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Level</div>
<Badge variant="outline" className={getLevelColor(selectedLog.level)}> <Badge variant="outline" className={`${getLevelColor(selectedLog.level)} text-xs`}>
{getLevelIcon(selectedLog.level)} {getLevelIcon(selectedLog.level)}
{selectedLog.level.toUpperCase()} {selectedLog.level.toUpperCase()}
</Badge> </Badge>
</div> </div>
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">Service</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Service</div>
<div className="text-sm text-foreground break-words">{selectedLog.service}</div> <div className="text-xs sm:text-sm text-foreground break-words">{selectedLog.service}</div>
</div> </div>
<div className="sm:col-span-2"> <div className="md:col-span-2">
<div className="text-sm font-medium text-muted-foreground mb-1">Timestamp</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Timestamp</div>
<div className="text-sm text-foreground font-mono break-words">{selectedLog.timestamp}</div> <div className="text-xs sm:text-sm text-foreground font-mono break-all">{selectedLog.timestamp}</div>
</div> </div>
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">Source</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Source</div>
<div className="text-sm text-foreground break-words">{selectedLog.source}</div> <div className="text-xs sm:text-sm text-foreground break-words">{selectedLog.source}</div>
</div> </div>
{selectedLog.pid && ( {selectedLog.pid && (
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">Process ID</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Process ID</div>
<div className="text-sm text-foreground font-mono">{selectedLog.pid}</div> <div className="text-xs sm:text-sm text-foreground font-mono">{selectedLog.pid}</div>
</div> </div>
)} )}
{selectedLog.hostname && ( {selectedLog.hostname && (
<div className="sm:col-span-2"> <div className="md:col-span-2">
<div className="text-sm font-medium text-muted-foreground mb-1">Hostname</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Hostname</div>
<div className="text-sm text-foreground break-words">{selectedLog.hostname}</div> <div className="text-xs sm:text-sm text-foreground break-words">{selectedLog.hostname}</div>
</div> </div>
)} )}
</div> </div>
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-2">Message</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-2">Message</div>
<div className="p-4 rounded-lg bg-muted/50 border border-border"> <div className="p-3 sm:p-4 rounded-lg bg-muted/50 border border-border max-h-[180px] sm:max-h-[300px] overflow-y-auto">
<pre className="text-sm text-foreground whitespace-pre-wrap break-words">{selectedLog.message}</pre> <pre className="text-xs sm:text-sm text-foreground whitespace-pre-wrap break-all font-mono">
{selectedLog.message}
</pre>
</div> </div>
</div> </div>
</div> </div>
@@ -1105,20 +1109,20 @@ export function SystemLogs() {
</Dialog> </Dialog>
<Dialog open={isEventModalOpen} onOpenChange={setIsEventModalOpen}> <Dialog open={isEventModalOpen} onOpenChange={setIsEventModalOpen}>
<DialogContent className="max-w-3xl max-h-[80vh] overflow-y-auto"> <DialogContent className="max-w-3xl max-h-[85vh] overflow-y-auto w-[96vw] sm:w-full mx-2 sm:mx-auto">
<DialogHeader> <DialogHeader>
<DialogTitle className="flex items-center gap-2"> <DialogTitle className="flex items-center gap-2 text-base sm:text-lg pr-8">
<Activity className="h-5 w-5" /> <Activity className="h-4 w-4 sm:h-5 sm:w-5 flex-shrink-0" />
Event Details <span className="truncate">Event Details</span>
</DialogTitle> </DialogTitle>
<DialogDescription>Complete information about this event</DialogDescription> <DialogDescription className="text-xs sm:text-sm">Complete information about this event</DialogDescription>
{selectedEvent && ( {selectedEvent && (
<div className="flex gap-2 mt-2"> <div className="flex gap-2 mt-2">
<Badge variant="outline" className={getLevelColor(selectedEvent.level)}> <Badge variant="outline" className={`${getLevelColor(selectedEvent.level)} text-xs`}>
{getLevelIcon(selectedEvent.level)} {getLevelIcon(selectedEvent.level)}
{selectedEvent.level.toUpperCase()} {selectedEvent.level.toUpperCase()}
</Badge> </Badge>
<Badge variant="outline" className="bg-purple-500/10 text-purple-500 border-purple-500/20"> <Badge variant="outline" className="bg-purple-500/10 text-purple-500 border-purple-500/20 text-xs">
<Activity className="h-3 w-3 mr-1" /> <Activity className="h-3 w-3 mr-1" />
EVENT EVENT
</Badge> </Badge>
@@ -1127,46 +1131,46 @@ export function SystemLogs() {
</DialogHeader> </DialogHeader>
{selectedEvent && ( {selectedEvent && (
<div className="space-y-4"> <div className="space-y-4">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4"> <div className="grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4">
<div className="sm:col-span-2"> <div className="md:col-span-2">
<div className="text-sm font-medium text-muted-foreground mb-1">Message</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Message</div>
<div className="text-sm text-foreground break-words">{selectedEvent.status}</div> <div className="text-xs sm:text-sm text-foreground break-words">{selectedEvent.status}</div>
</div> </div>
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">Type</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Type</div>
<div className="text-sm text-foreground break-words">{selectedEvent.type}</div> <div className="text-xs sm:text-sm text-foreground break-words">{selectedEvent.type}</div>
</div> </div>
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">Node</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Node</div>
<div className="text-sm text-foreground">{selectedEvent.node}</div> <div className="text-xs sm:text-sm text-foreground">{selectedEvent.node}</div>
</div> </div>
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">User</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">User</div>
<div className="text-sm text-foreground break-words">{selectedEvent.user}</div> <div className="text-xs sm:text-sm text-foreground break-words">{selectedEvent.user}</div>
</div> </div>
{selectedEvent.vmid && ( {selectedEvent.vmid && (
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">VM/CT ID</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">VM/CT ID</div>
<div className="text-sm text-foreground font-mono">{selectedEvent.vmid}</div> <div className="text-xs sm:text-sm text-foreground font-mono">{selectedEvent.vmid}</div>
</div> </div>
)} )}
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">Duration</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Duration</div>
<div className="text-sm text-foreground">{selectedEvent.duration}</div> <div className="text-xs sm:text-sm text-foreground">{selectedEvent.duration}</div>
</div> </div>
<div className="sm:col-span-2"> <div className="md:col-span-2">
<div className="text-sm font-medium text-muted-foreground mb-1">Start Time</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Start Time</div>
<div className="text-sm text-foreground break-words">{selectedEvent.starttime}</div> <div className="text-xs sm:text-sm text-foreground break-words">{selectedEvent.starttime}</div>
</div> </div>
<div className="sm:col-span-2"> <div className="md:col-span-2">
<div className="text-sm font-medium text-muted-foreground mb-1">End Time</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">End Time</div>
<div className="text-sm text-foreground break-words">{selectedEvent.endtime}</div> <div className="text-xs sm:text-sm text-foreground break-words">{selectedEvent.endtime}</div>
</div> </div>
</div> </div>
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-2">UPID</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-2">UPID</div>
<div className="p-4 rounded-lg bg-muted/50 border border-border"> <div className="p-3 sm:p-4 rounded-lg bg-muted/50 border border-border max-h-[180px] sm:max-h-[300px] overflow-y-auto">
<pre className="text-sm text-foreground font-mono whitespace-pre-wrap break-all"> <pre className="text-xs sm:text-sm text-foreground font-mono whitespace-pre-wrap break-all">
{selectedEvent.upid} {selectedEvent.upid}
</pre> </pre>
</div> </div>
@@ -1177,54 +1181,54 @@ export function SystemLogs() {
</Dialog> </Dialog>
<Dialog open={isBackupModalOpen} onOpenChange={setIsBackupModalOpen}> <Dialog open={isBackupModalOpen} onOpenChange={setIsBackupModalOpen}>
<DialogContent className="max-w-3xl max-h-[80vh] overflow-y-auto"> <DialogContent className="max-w-3xl max-h-[85vh] overflow-y-auto w-[96vw] sm:w-full mx-2 sm:mx-auto">
<DialogHeader> <DialogHeader>
<DialogTitle className="flex items-center gap-2"> <DialogTitle className="flex items-center gap-2 text-base sm:text-lg pr-8">
<Database className="h-5 w-5" /> <Database className="h-4 w-4 sm:h-5 sm:w-5 flex-shrink-0" />
Backup Details <span className="truncate">Backup Details</span>
</DialogTitle> </DialogTitle>
<DialogDescription>Complete information about this backup</DialogDescription> <DialogDescription className="text-xs sm:text-sm">Complete information about this backup</DialogDescription>
</DialogHeader> </DialogHeader>
{selectedBackup && ( {selectedBackup && (
<div className="space-y-4"> <div className="space-y-4">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4"> <div className="grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4">
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">Type</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Type</div>
<Badge variant="outline" className={getBackupTypeColor(selectedBackup.volid)}> <Badge variant="outline" className={`${getBackupTypeColor(selectedBackup.volid)} text-xs`}>
{getBackupTypeLabel(selectedBackup.volid)} {getBackupTypeLabel(selectedBackup.volid)}
</Badge> </Badge>
</div> </div>
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">Storage Type</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Storage Type</div>
<Badge variant="outline" className={getBackupStorageColor(selectedBackup.volid)}> <Badge variant="outline" className={`${getBackupStorageColor(selectedBackup.volid)} text-xs`}>
{getBackupStorageLabel(selectedBackup.volid)} {getBackupStorageLabel(selectedBackup.volid)}
</Badge> </Badge>
</div> </div>
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">Storage</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Storage</div>
<div className="text-sm text-foreground break-words">{selectedBackup.storage}</div> <div className="text-xs sm:text-sm text-foreground break-words">{selectedBackup.storage}</div>
</div> </div>
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">Size</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Size</div>
<Badge variant="outline" className="bg-green-500/10 text-green-500 border-green-500/20"> <Badge variant="outline" className="bg-green-500/10 text-green-500 border-green-500/20 text-xs">
{selectedBackup.size_human} {selectedBackup.size_human}
</Badge> </Badge>
</div> </div>
{selectedBackup.vmid && ( {selectedBackup.vmid && (
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-1">VM/CT ID</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">VM/CT ID</div>
<div className="text-sm text-foreground font-mono">{selectedBackup.vmid}</div> <div className="text-xs sm:text-sm text-foreground font-mono">{selectedBackup.vmid}</div>
</div> </div>
)} )}
<div className="sm:col-span-2"> <div className="md:col-span-2">
<div className="text-sm font-medium text-muted-foreground mb-1">Created</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-1.5">Created</div>
<div className="text-sm text-foreground break-words">{selectedBackup.created}</div> <div className="text-xs sm:text-sm text-foreground break-words">{selectedBackup.created}</div>
</div> </div>
</div> </div>
<div> <div>
<div className="text-sm font-medium text-muted-foreground mb-2">Volume ID</div> <div className="text-xs sm:text-sm font-medium text-muted-foreground mb-2">Volume ID</div>
<div className="p-4 rounded-lg bg-muted/50 border border-border"> <div className="p-3 sm:p-4 rounded-lg bg-muted/50 border border-border max-h-[180px] sm:max-h-[300px] overflow-y-auto">
<pre className="text-sm text-foreground font-mono whitespace-pre-wrap break-all"> <pre className="text-xs sm:text-sm text-foreground font-mono whitespace-pre-wrap break-all">
{selectedBackup.volid} {selectedBackup.volid}
</pre> </pre>
</div> </div>