@@ -10,7 +10,7 @@ interface HelpModalProps {
1010 initialSection ?: string ;
1111}
1212
13- type HelpSection = 'server-settings' | 'general-settings' | 'sync-button' | 'available-scripts' | 'downloaded-scripts' | 'installed-scripts' | 'update-system' ;
13+ type HelpSection = 'server-settings' | 'general-settings' | 'sync-button' | 'available-scripts' | 'downloaded-scripts' | 'installed-scripts' | 'lxc-settings' | ' update-system';
1414
1515export function HelpModal ( { isOpen, onClose, initialSection = 'server-settings' } : HelpModalProps ) {
1616 const [ activeSection , setActiveSection ] = useState < HelpSection > ( initialSection as HelpSection ) ;
@@ -24,6 +24,7 @@ export function HelpModal({ isOpen, onClose, initialSection = 'server-settings'
2424 { id : 'available-scripts' as HelpSection , label : 'Available Scripts' , icon : Package } ,
2525 { id : 'downloaded-scripts' as HelpSection , label : 'Downloaded Scripts' , icon : HardDrive } ,
2626 { id : 'installed-scripts' as HelpSection , label : 'Installed Scripts' , icon : FolderOpen } ,
27+ { id : 'lxc-settings' as HelpSection , label : 'LXC Settings' , icon : Settings } ,
2728 { id : 'update-system' as HelpSection , label : 'Update System' , icon : Download } ,
2829 ] ;
2930
@@ -501,6 +502,131 @@ export function HelpModal({ isOpen, onClose, initialSection = 'server-settings'
501502 </ div >
502503 ) ;
503504
505+ case 'lxc-settings' :
506+ return (
507+ < div className = "space-y-6" >
508+ < div >
509+ < h3 className = "text-xl font-semibold text-foreground mb-4" > LXC Settings</ h3 >
510+ < p className = "text-muted-foreground mb-6" >
511+ Edit LXC container configuration files directly from the installed scripts interface. This feature allows you to modify container settings without manually accessing the Proxmox VE server.
512+ </ p >
513+ </ div >
514+
515+ < div className = "space-y-4" >
516+ < div className = "p-4 border border-border rounded-lg" >
517+ < h4 className = "font-medium text-foreground mb-2" > Overview</ h4 >
518+ < p className = "text-sm text-muted-foreground mb-3" >
519+ The LXC Settings modal provides a user-friendly interface to edit container configuration files. It parses common settings into editable fields while preserving advanced configurations.
520+ </ p >
521+ < ul className = "text-sm text-muted-foreground space-y-1" >
522+ < li > • < strong > Common Settings:</ strong > Edit basic container parameters like cores, memory, network, and storage</ li >
523+ < li > • < strong > Advanced Settings:</ strong > Raw text editing for lxc.* entries and other advanced configurations</ li >
524+ < li > • < strong > Database Caching:</ strong > Configurations are cached locally for faster access</ li >
525+ < li > • < strong > Change Detection:</ strong > Warns when cached config differs from server version</ li >
526+ </ ul >
527+ </ div >
528+
529+ < div className = "p-4 border border-border rounded-lg" >
530+ < h4 className = "font-medium text-foreground mb-2" > Common Settings Tab</ h4 >
531+ < div className = "space-y-3" >
532+ < div >
533+ < h5 className = "font-medium text-sm text-foreground mb-1" > Basic Configuration</ h5 >
534+ < ul className = "text-sm text-muted-foreground space-y-1" >
535+ < li > • < strong > Architecture:</ strong > Container architecture (usually amd64)</ li >
536+ < li > • < strong > Cores:</ strong > Number of CPU cores allocated to the container</ li >
537+ < li > • < strong > Memory:</ strong > RAM allocation in megabytes</ li >
538+ < li > • < strong > Swap:</ strong > Swap space allocation in megabytes</ li >
539+ < li > • < strong > Hostname:</ strong > Container hostname</ li >
540+ < li > • < strong > OS Type:</ strong > Operating system type (e.g., debian, ubuntu)</ li >
541+ < li > • < strong > Start on Boot:</ strong > Whether to start container automatically on host boot</ li >
542+ < li > • < strong > Unprivileged:</ strong > Whether the container runs in unprivileged mode</ li >
543+ </ ul >
544+ </ div >
545+
546+ < div >
547+ < h5 className = "font-medium text-sm text-foreground mb-1" > Network Configuration</ h5 >
548+ < ul className = "text-sm text-muted-foreground space-y-1" >
549+ < li > • < strong > IP Configuration:</ strong > Choose between DHCP or static IP assignment</ li >
550+ < li > • < strong > IP Address:</ strong > Static IP with CIDR notation (e.g., 10.10.10.164/24)</ li >
551+ < li > • < strong > Gateway:</ strong > Network gateway for static IP configuration</ li >
552+ < li > • < strong > Bridge:</ strong > Network bridge interface (usually vmbr0)</ li >
553+ < li > • < strong > MAC Address:</ strong > Hardware address for the network interface</ li >
554+ < li > • < strong > VLAN Tag:</ strong > Optional VLAN tag for network segmentation</ li >
555+ </ ul >
556+ </ div >
557+
558+ < div >
559+ < h5 className = "font-medium text-sm text-foreground mb-1" > Storage & Features </ h5 >
560+ < ul className = "text-sm text-muted-foreground space-y-1" >
561+ < li > • < strong > Root Filesystem:</ strong > Storage location and disk identifier</ li >
562+ < li > • < strong > Size:</ strong > Disk size allocation (e.g., 4G, 8G)</ li >
563+ < li > • < strong > Features:</ strong > Container capabilities (keyctl, nesting, fuse)</ li >
564+ < li > • < strong > Tags:</ strong > Comma-separated tags for organization</ li >
565+ </ ul >
566+ </ div >
567+ </ div >
568+ </ div >
569+
570+ < div className = "p-4 border border-border rounded-lg" >
571+ < h4 className = "font-medium text-foreground mb-2" > Advanced Settings Tab</ h4 >
572+ < p className = "text-sm text-muted-foreground mb-3" >
573+ The Advanced Settings tab provides raw text editing for configurations not covered in the Common Settings tab.
574+ </ p >
575+ < ul className = "text-sm text-muted-foreground space-y-1" >
576+ < li > • < strong > lxc.* entries:</ strong > Low-level LXC configuration options</ li >
577+ < li > • < strong > Comments:</ strong > Configuration file comments and documentation</ li >
578+ < li > • < strong > Custom settings:</ strong > Any other configuration parameters</ li >
579+ < li > • < strong > Preservation:</ strong > All content is preserved when switching between tabs</ li >
580+ </ ul >
581+ </ div >
582+
583+ < div className = "p-4 border border-border rounded-lg" >
584+ < h4 className = "font-medium text-foreground mb-2" > Saving Changes</ h4 >
585+ < div className = "space-y-3" >
586+ < p className = "text-sm text-muted-foreground" >
587+ To save configuration changes, you must type the container ID exactly as shown to confirm your changes.
588+ </ p >
589+ < div className = "bg-yellow-50 dark:bg-yellow-950/20 border border-yellow-200 dark:border-yellow-800 rounded-md p-3" >
590+ < h5 className = "font-medium text-yellow-800 dark:text-yellow-200 mb-2" > ⚠️ Important Warnings</ h5 >
591+ < ul className = "text-sm text-yellow-700 dark:text-yellow-300 space-y-1" >
592+ < li > • Modifying LXC configuration can break your container</ li >
593+ < li > • Some changes may require container restart to take effect</ li >
594+ < li > • Always backup your configuration before making changes</ li >
595+ < li > • Test changes in a non-production environment first</ li >
596+ </ ul >
597+ </ div >
598+ </ div >
599+ </ div >
600+
601+ < div className = "p-4 border border-border rounded-lg" >
602+ < h4 className = "font-medium text-foreground mb-2" > Sync from Server</ h4 >
603+ < p className = "text-sm text-muted-foreground mb-3" >
604+ The "Sync from Server" button allows you to refresh the configuration from the actual server file, useful when:
605+ </ p >
606+ < ul className = "text-sm text-muted-foreground space-y-1" >
607+ < li > • Configuration was modified outside of this interface</ li >
608+ < li > • You want to discard local changes and get the latest server version</ li >
609+ < li > • The warning banner indicates the cached config differs from server</ li >
610+ < li > • You want to ensure you're working with the most current configuration</ li >
611+ </ ul >
612+ </ div >
613+
614+ < div className = "p-4 border border-border rounded-lg" >
615+ < h4 className = "font-medium text-foreground mb-2" > Database Caching</ h4 >
616+ < p className = "text-sm text-muted-foreground mb-3" >
617+ LXC configurations are cached in the database for improved performance and offline access.
618+ </ p >
619+ < ul className = "text-sm text-muted-foreground space-y-1" >
620+ < li > • < strong > Automatic caching:</ strong > Configs are cached during auto-detection and after saves</ li >
621+ < li > • < strong > Cache expiration:</ strong > Cached configs expire after 5 minutes for freshness</ li >
622+ < li > • < strong > Change detection:</ strong > Hash comparison detects external modifications</ li >
623+ < li > • < strong > Manual sync:</ strong > Always available via the "Sync from Server" button</ li >
624+ </ ul >
625+ </ div >
626+ </ div >
627+ </ div >
628+ ) ;
629+
504630 default :
505631 return null ;
506632 }
0 commit comments