Files
ProxMenux/AppImage/components/release-notes-modal.tsx

204 lines
7.7 KiB
TypeScript
Raw Normal View History

2025-11-11 19:20:59 +01:00
"use client"
2025-11-11 19:36:37 +01:00
import { useState, useEffect } from "react"
2025-11-11 19:20:59 +01:00
import { Button } from "./ui/button"
2025-11-11 19:36:37 +01:00
import { Dialog, DialogContent } from "./ui/dialog"
2025-11-11 21:12:09 +01:00
import { X, Sparkles, Link2, Shield, Zap, HardDrive, Gauge, Wrench, Settings } from "lucide-react"
2025-11-11 19:36:37 +01:00
import { Checkbox } from "./ui/checkbox"
const APP_VERSION = "1.0.1" // Sync with AppImage/package.json
interface ReleaseNote {
date: string
changes: {
added?: string[]
changed?: string[]
fixed?: string[]
}
}
2025-11-11 19:20:59 +01:00
2025-11-11 19:36:37 +01:00
export const CHANGELOG: Record<string, ReleaseNote> = {
2025-11-11 19:20:59 +01:00
"1.0.1": {
2025-11-11 19:36:37 +01:00
date: "November 11, 2025",
2025-11-11 19:20:59 +01:00
changes: {
added: [
2025-11-11 19:36:37 +01:00
"Proxy Support - Access ProxMenux through reverse proxies with full functionality",
"Authentication System - Secure your dashboard with password protection",
"PCIe Link Speed Detection - View NVMe drive connection speeds and detect performance issues",
"Enhanced Storage Display - Better formatting for disk sizes (auto-converts GB to TB when needed)",
"SATA/SAS Information - View detailed interface information for all storage devices",
"Two-Factor Authentication (2FA) - Enhanced security with TOTP support",
"Health Monitoring System - Comprehensive system health checks with dismissible warnings",
"Release Notes Modal - Automatic notification of new features and improvements",
2025-11-11 19:20:59 +01:00
],
changed: [
2025-11-11 19:36:37 +01:00
"Optimized VM & LXC page - Reduced CPU usage by 85% through intelligent caching",
"Storage metrics now separate local and remote storage for clarity",
"Update warnings now appear only after 365 days instead of 30 days",
"API intervals staggered to distribute server load (23s and 37s)",
2025-11-11 19:20:59 +01:00
],
fixed: [
2025-11-11 19:36:37 +01:00
"Fixed dark mode text contrast issues in various components",
"Corrected storage calculation discrepancies between Overview and Storage pages",
"Resolved JSON stringify error in VM control actions",
"Improved IP address fetching for LXC containers",
2025-11-11 19:20:59 +01:00
],
},
},
"1.0.0": {
2025-11-11 19:36:37 +01:00
date: "October 15, 2025",
2025-11-11 19:20:59 +01:00
changes: {
added: [
2025-11-11 19:36:37 +01:00
"Initial release of ProxMenux Monitor",
"Real-time system monitoring dashboard",
"Storage management with SMART health monitoring",
"Network metrics and bandwidth tracking",
"VM & LXC container management",
"Hardware information display",
"System logs viewer with filtering",
2025-11-11 19:20:59 +01:00
],
},
},
}
2025-11-11 19:36:37 +01:00
const CURRENT_VERSION_FEATURES = [
{
icon: <Link2 className="h-5 w-5" />,
text: "Proxy Support - Access ProxMenux through reverse proxies with full functionality",
},
{
icon: <Shield className="h-5 w-5" />,
2025-11-11 21:12:09 +01:00
text: "Two-Factor Authentication (2FA) - Enhanced security with TOTP support for login protection",
2025-11-11 19:36:37 +01:00
},
{
2025-11-11 21:12:09 +01:00
icon: <Zap className="h-5 w-5" />,
text: "Performance Improvements - Optimized loading times and reduced CPU usage by 85%",
2025-11-11 19:36:37 +01:00
},
{
icon: <HardDrive className="h-5 w-5" />,
2025-11-11 21:12:09 +01:00
text: "Storage Enhancements - Improved disk space consumption display with local and remote storage separation",
},
{
icon: <Gauge className="h-5 w-5" />,
text: "PCIe Link Speed Detection - View NVMe drive connection speeds and identify performance bottlenecks",
},
{
icon: <Wrench className="h-5 w-5" />,
text: "Hardware Page Improvements - Enhanced hardware information display with detailed PCIe and interface data",
2025-11-11 19:36:37 +01:00
},
{
2025-11-11 21:12:09 +01:00
icon: <Settings className="h-5 w-5" />,
text: "New Settings Page - Centralized configuration for authentication, optimizations, and system preferences",
2025-11-11 19:36:37 +01:00
},
]
2025-11-11 19:20:59 +01:00
interface ReleaseNotesModalProps {
open: boolean
2025-11-11 19:36:37 +01:00
onClose: () => void
2025-11-11 19:20:59 +01:00
}
2025-11-11 19:36:37 +01:00
export function ReleaseNotesModal({ open, onClose }: ReleaseNotesModalProps) {
const [dontShowAgain, setDontShowAgain] = useState(false)
2025-11-11 19:20:59 +01:00
2025-11-11 19:36:37 +01:00
const handleClose = () => {
if (dontShowAgain) {
localStorage.setItem("proxmenux-last-seen-version", APP_VERSION)
}
onClose()
2025-11-11 19:20:59 +01:00
}
return (
2025-11-11 19:36:37 +01:00
<Dialog open={open} onOpenChange={handleClose}>
2025-11-11 21:30:57 +01:00
<DialogContent className="max-w-2xl max-h-[85vh] p-0 gap-0 border-0 bg-transparent">
<div className="relative bg-card rounded-lg shadow-2xl h-full flex flex-col max-h-[85vh]">
2025-11-11 19:36:37 +01:00
<Button
variant="ghost"
size="icon"
className="absolute top-4 right-4 z-50 h-8 w-8 rounded-full bg-background/80 backdrop-blur-sm hover:bg-background"
onClick={handleClose}
>
<X className="h-4 w-4" />
</Button>
2025-11-11 21:25:10 +01:00
<div className="relative h-32 md:h-40 bg-gradient-to-br from-amber-500 via-orange-500 to-red-500 flex items-center justify-center overflow-hidden flex-shrink-0">
2025-11-11 19:36:37 +01:00
<div className="absolute inset-0 bg-black/10" />
<div className="absolute inset-0 bg-[radial-gradient(circle_at_50%_120%,rgba(255,255,255,0.1),transparent)]" />
<div className="relative z-10 text-white animate-pulse">
2025-11-11 21:25:10 +01:00
<Sparkles className="h-12 w-12 md:h-14 md:w-14" />
2025-11-11 19:36:37 +01:00
</div>
<div className="absolute top-10 left-10 w-20 h-20 bg-white/10 rounded-full blur-2xl" />
<div className="absolute bottom-10 right-10 w-32 h-32 bg-white/10 rounded-full blur-3xl" />
2025-11-11 19:20:59 +01:00
</div>
2025-11-11 19:36:37 +01:00
2025-11-11 21:30:57 +01:00
<div className="flex-1 overflow-y-auto p-6 md:p-8 space-y-4 md:space-y-6 min-h-0">
2025-11-11 19:36:37 +01:00
<div className="space-y-2">
2025-11-11 21:25:10 +01:00
<h2 className="text-xl md:text-2xl font-bold text-foreground text-balance">
2025-11-11 19:36:37 +01:00
What's New in Version {APP_VERSION}
</h2>
2025-11-11 21:25:10 +01:00
<p className="text-sm text-muted-foreground leading-relaxed">
2025-11-11 19:36:37 +01:00
We've added exciting new features and improvements to make ProxMenux Monitor even better!
</p>
</div>
2025-11-11 21:25:10 +01:00
<div className="space-y-2">
2025-11-11 19:36:37 +01:00
{CURRENT_VERSION_FEATURES.map((feature, index) => (
<div
key={index}
2025-11-11 21:25:10 +01:00
className="flex items-start gap-2 md:gap-3 p-3 rounded-lg bg-muted/50 border border-border/50 hover:bg-muted/70 transition-colors"
2025-11-11 19:36:37 +01:00
>
<div className="text-orange-500 mt-0.5 flex-shrink-0">{feature.icon}</div>
<p className="text-xs md:text-sm text-foreground leading-relaxed">{feature.text}</p>
2025-11-11 19:20:59 +01:00
</div>
2025-11-11 19:36:37 +01:00
))}
2025-11-11 19:20:59 +01:00
</div>
2025-11-11 21:25:10 +01:00
</div>
2025-11-11 19:20:59 +01:00
2025-11-11 21:25:10 +01:00
<div className="flex-shrink-0 p-6 md:p-8 pt-4 border-t border-border/50 bg-card">
<div className="flex flex-col gap-3">
2025-11-11 19:36:37 +01:00
<Button
onClick={handleClose}
className="w-full bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600"
>
<Sparkles className="h-4 w-4 mr-2" />
Got it!
</Button>
<div className="flex items-center justify-center gap-2">
<Checkbox
id="dont-show-version-again"
checked={dontShowAgain}
onCheckedChange={(checked) => setDontShowAgain(checked as boolean)}
/>
<label
htmlFor="dont-show-version-again"
className="text-xs md:text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer select-none"
>
Don't show again for this version
</label>
</div>
</div>
</div>
2025-11-11 19:20:59 +01:00
</div>
</DialogContent>
</Dialog>
)
}
export function useVersionCheck() {
const [showReleaseNotes, setShowReleaseNotes] = useState(false)
useEffect(() => {
const lastSeenVersion = localStorage.getItem("proxmenux-last-seen-version")
2025-11-11 19:36:37 +01:00
if (lastSeenVersion !== APP_VERSION) {
2025-11-11 19:20:59 +01:00
setShowReleaseNotes(true)
}
}, [])
return { showReleaseNotes, setShowReleaseNotes }
}
2025-11-11 19:36:37 +01:00
export { APP_VERSION }