import React, { useState } from 'react'; import { GitBranch, GitCommit as GitCommitIcon, RotateCcw, CheckCircle2, RefreshCw, ExternalLink, Shield, Zap, } from 'lucide-react'; import type { GitOpsStatus, GitCommit } from '../types/index.js'; interface GitOpsViewProps { status: GitOpsStatus | null; commits: GitCommit[]; onRollback: (commitSha: string) => Promise; onTriggerRebuild: () => void; } export const GitOpsView: React.FC = ({ status, commits, onRollback, onTriggerRebuild, }) => { const [selectedChannel, setSelectedChannel] = useState<'stable' | 'beta' | 'nightly'>('stable'); const [rollingBackSha, setRollingBackSha] = useState(null); const handleRollback = async (sha: string) => { if (!confirm(`Are you sure you want to rollback appliance configuration to commit ${sha.slice(0, 7)}?`)) { return; } setRollingBackSha(sha); try { await onRollback(sha); onTriggerRebuild(); } finally { setRollingBackSha(null); } }; return (
{/* Header */}

GitOps Engine & OS Updates

Declarative infrastructure-as-code version control, disaster recovery, and automated updates

{/* GitOps Status Cards */}
Remote Synchronization
{status?.branch || 'main'}
{status?.remoteUrl || 'ssh://git@git.lholz.de:2222/naxos/naxos-config.git'}
Current Head Commit
{status?.lastCommitSha?.slice(0, 7) || '5da58ae'}
{status?.lastCommitMessage || 'feat(storage): updated tank/backup quota'}
OS Update Channel
Appliance is up to date
{/* Commit History & Rollback Table */}

Declarative Configuration Audit Trail

Total {commits.length} generations
{commits.map((c, i) => (
{c.hash.slice(0, 7)} {i === 0 && ( ACTIVE GENERATION )} {c.message}
Author: {c.author} Date: {c.date}
{i !== 0 && ( )}
))}
); };