// Info Modal System const infoContent = { 'domains': { title: 'Domains', description: 'Manage domains in the P2NS network', sections: [ { title: 'Overview', content: 'The Domains tab shows all domains registered in the P2NS network. Domains with 🏠 are your local claims that have been validated by the network.' }, { title: 'Local Claims', content: 'Local claims are domains you own and have registered. These are marked with a 🏠 icon. Only local claims can be removed from the system.' }, { title: 'Adding Domains', content: 'Click "Add Domain" to register a new domain. You\'ll need to provide the domain name and its corresponding hash.' }, { title: 'Removing Domains', content: 'You can only remove domains that you own (local claims). Click the "Remove" button next to a local domain to remove it.' }, { title: 'Search', content: 'Use the search box to filter domains by name or hash.' } ] }, 'local-dns': { title: 'Custom Local DNS Records', description: 'Manage custom DNS records served outside of P2NS assignments', sections: [ { title: 'Overview', content: 'Custom Local DNS Records allow you to define DNS entries that are served independently of the P2NS system. These records take precedence over P2NS assignments for local resolution.' }, { title: 'Supported Record Types', content: 'You can create A, AAAA, CNAME, MX, TXT, SRV, SOA, CAA, NS, and PTR records. Each record type has specific fields that need to be filled.' }, { title: 'TTL (Time To Live)', content: 'TTL determines how long DNS resolvers should cache the record. Default is 3600 seconds (1 hour).' }, { title: 'Managing Records', content: 'Use "Add Record" to create new entries, "Edit" to modify existing ones, and "Delete" to remove records.' } ] }, 'dns-conflicts': { title: 'DNS Conflict Selector', description: 'Choose between P2P and public DNS for conflicting domains', sections: [ { title: 'Overview', content: 'When a domain has both P2P and public DNS records, you can choose which one to use for resolution.' }, { title: 'P2P Mode', content: 'P2P mode uses the peer-to-peer network resolution, which connects directly to other nodes in the network.' }, { title: 'Public Mode', content: 'Public mode uses traditional DNS resolution through public DNS servers.' }, { title: 'Switching Modes', content: 'Use the toggle switch to switch between P2P and Public modes for each conflicting domain.' } ] }, 'p2p-domain-conflicts': { title: 'P2P Domain Conflicts', description: 'Manage conflicts between local and network-resolved domain hashes', sections: [ { title: 'Overview', content: 'P2P Domain Conflicts occur when your local hash for a domain differs from the hash resolved by the P2P network consensus. This tab shows all domains where such conflicts exist.' }, { title: 'Local Hash', content: 'The Local Hash is the hash you have stored locally for a domain. This represents your local claim or configuration for that domain.' }, { title: 'Resolved Hash', content: 'The Resolved Hash is the hash determined by the P2P network consensus. This is what the majority of peers in the network have agreed upon for this domain.' }, { title: 'Hash Preference', content: 'Use the toggle switch to choose which hash to use for resolution. "Local" uses your local hash, while "Resolved" uses the network consensus hash. Your preference is saved and will be used for future resolutions.' }, { title: 'When Conflicts Occur', content: 'Conflicts typically occur when you have a local claim for a domain that differs from what the network consensus has resolved, or when network consensus changes after you\'ve set a local preference.' } ] }, 'entries': { title: 'Autopass Entries', description: 'View the P2P network ledger', sections: [ { title: 'Overview', content: 'Autopass Entries show the raw data from Autopass cores serving the P2P Network. This is the ledger of the system containing all votes and claims.' }, { title: 'Ledger Data', content: 'Each entry represents a record in the distributed ledger. The Key-Value pairs show the actual data stored in the network.' }, { title: 'Votes and Claims', content: 'The ledger contains voting records and domain claims that have been validated by the network consensus.' }, { title: 'Search', content: 'Use the search box to find specific entries by key or value.' } ] }, 'peers': { title: 'Connected Peers', description: 'View and manage peer connections', sections: [ { title: 'Overview', content: 'The Peers tab shows all nodes currently connected to your P2NS instance in the peer-to-peer network.' }, { title: 'Peer Connections', content: 'Each peer represents another node in the P2NS network. These connections enable distributed domain resolution and data synchronization.' }, { title: 'Network Topology', content: 'The peer list shows the current state of your network connections. Peers are identified by their unique keys.' }, { title: 'Connection Status', content: 'The count next to "Connected Peers" shows how many active peer connections you currently have.' } ] }, 'certs': { title: 'Domain Certificates', description: 'Manage SSL/TLS certificates for domains', sections: [ { title: 'Overview', content: 'The Certificates tab manages SSL/TLS certificates for domains in your P2NS network.' }, { title: 'Certificate Generation', content: 'Enter a domain name and click "Generate Cert" to create a new certificate. Certificates are automatically signed by the root CA.' }, { title: 'Certificate Management', content: 'You can view certificate details, regenerate certificates, or delete them. Regenerating creates a new certificate with updated validity.' }, { title: 'Certificate Details', content: 'Click on a certificate name to view its full details including issuer, validity dates, and fingerprint.' } ] }, 'ca-management': { title: 'CA Management', description: 'Manage the Certificate Authority', sections: [ { title: 'Overview', content: 'CA Management controls the Root Certificate Authority that signs all domain certificates.' }, { title: 'Regenerate Root CA', content: 'Regenerating the Root CA creates a new CA certificate and key. This invalidates all existing certificates, which will need to be regenerated.' }, { title: 'Install Root CA', content: 'Installing the Root CA adds it to your system\'s trusted certificate store, allowing browsers to trust certificates signed by this CA.' }, { title: 'Security Note', content: 'Only regenerate the CA if necessary, as it will require reinstalling the CA and regenerating all certificates.' } ] }, 'interfaces': { title: 'Virtual Interfaces', description: 'Manage virtual network interfaces', sections: [ { title: 'Overview', content: 'Virtual Interfaces are network interfaces created for each domain to enable local routing and DNS resolution.' }, { title: 'Interface Assignment', content: 'Each domain gets assigned a virtual IP address on a virtual interface. This allows local applications to connect to P2P domains.' }, { title: 'Interface List', content: 'The table shows all active virtual interfaces with their associated domains and IP addresses. Use the search box to filter interfaces, and pagination controls to navigate through the list.' } ] }, 'holesail-servers': { title: 'Holesail Servers', description: 'Manage Holesail tunnel servers', sections: [ { title: 'Overview', content: 'Holesail Servers create tunnels that allow external connections to reach services on your network.' }, { title: 'Server Configuration', content: 'Each server listens on a specific port and can be configured with a name, host, key, and protocol (TCP/UDP).' }, { title: 'Server Status', content: 'The status column shows whether a server is running, stopped, or in an error state.' }, { title: 'Logs', content: 'Click on a server name to view its logs in real-time. This helps with debugging connection issues.' }, { title: 'Restart/Delete', content: 'Use "Restart" to restart a server or "Delete" to permanently remove it.' } ] }, 'holesail-clients': { title: 'Holesail Clients', description: 'Manage Holesail tunnel clients', sections: [ { title: 'Overview', content: 'Holesail Clients create outbound tunnels to connect to external Holesail servers.' }, { title: 'Client Configuration', content: 'Each client connects to a domain using a key and port. The client establishes a tunnel to the server.' }, { title: 'Client Status', content: 'The status column shows whether a client is running, stopped, or in an error state.' }, { title: 'Creating Clients', content: 'Use "Create Client" to add a new client. You\'ll need the domain, key, and port from the server.' }, { title: 'Restart/Delete', content: 'Use "Restart" to restart a client or "Delete" to permanently remove it.' } ] }, 'logs': { title: 'System Logs', description: 'View real-time system logs', sections: [ { title: 'Overview', content: 'The Logs tab shows real-time logs from your P2NS instance. Logs are displayed in a terminal interface.' }, { title: 'Log Levels', content: 'Logs are color-coded by level: INFO (normal), WARN (yellow), ERROR (red), and DEBUG (gray).' }, { title: 'Log Buffer', content: 'The terminal maintains a buffer of the most recent log messages. Older logs are automatically removed to manage memory.' }, { title: 'Real-time Updates', content: 'Logs are updated in real-time via WebSocket connections. If the WebSocket is disconnected, the logs will pause until reconnection.' } ] }, 'stats': { title: 'Statistics', description: 'View system and network statistics', sections: [ { title: 'Overview', content: 'The Stats tab provides detailed statistics about your P2NS instance including system performance, network activity, and resource usage.' }, { title: 'Real-time Data', content: 'Statistics are updated in real-time. Enable auto-refresh to keep data current.' }, { title: 'Historical Data', content: 'Charts show historical trends over time. Use the time range selector to adjust the view window.' }, { title: 'Export Data', content: 'Use "Export Data" to download current statistics as JSON for analysis.' } ] }, 'settings': { title: 'Settings', description: 'Configure P2NS system settings', sections: [ { title: 'Overview', content: 'The Settings tab allows you to configure various aspects of your P2NS instance.' }, { title: 'Live Reload', content: 'Settings marked with "Live Reload" are applied immediately without requiring a restart.' }, { title: 'Restart Required', content: 'Settings marked with "Requires Restart" will only take effect after restarting the P2NS service.' }, { title: 'Subnet Configuration', content: 'Manage IP subnet ranges used for virtual interface assignments. Add, edit, or delete subnet configurations.' }, { title: 'Saving Settings', content: 'Click "Save Settings" to apply your changes. You\'ll be notified which settings require a restart.' } ] }, 'subnets': { title: 'Subnet Configuration', description: 'Manage IP subnet ranges', sections: [ { title: 'Overview', content: 'Subnets define IP address ranges used for virtual interface assignments. Each domain gets assigned an IP from the configured subnets.' }, { title: 'Adding Subnets', content: 'Click "Add Subnet" to create a new subnet. The system will suggest a non-conflicting subnet automatically.' }, { title: 'IP Capacity', content: 'The IP Capacity Estimator shows total available IPs, currently used IPs, and remaining capacity.' }, { title: 'Subnet Management', content: 'Use "Edit" to modify subnet settings or "Delete" to remove a subnet. Changes require a restart to fully apply.' } ] }, 'health': { title: 'Health Monitoring', description: 'Monitor system health and service status', sections: [ { title: 'Overview', content: 'The Health tab provides real-time monitoring of all system services including DNS, Proxy, Swarm, and Corestore.' }, { title: 'Service Status', content: 'Service status cards show the health of each component. Green indicates healthy, red indicates issues.' }, { title: 'Health History', content: 'The health history chart shows the status of services over time, helping you identify patterns and issues.' }, { title: 'Network Diagnostics', content: 'Use the diagnostic tools below to test DNS resolution, ping connectivity, traceroute paths, and connection tests.' }, { title: 'Auto-refresh', content: 'Enable auto-refresh to keep health data updated in real-time. Updates occur every 5 seconds.' } ] }, 'plugins': { title: 'Plugins', description: 'Manage plugins and their registered actions and settings', sections: [ { title: 'Overview', content: 'The Plugins tab shows all plugins loaded from the plugin-sites/ directory. Each plugin can register actions (executable functions) and settings (configurable values) that appear in the admin panel.' }, { title: 'Plugin Cards', content: 'Each plugin is displayed in a card showing its name, version, description, and status. Plugins can have handlers (dynamic request processing), web UIs (www/ directory), and databases (HyperDB integration).' }, { title: 'Actions', content: 'Plugins can register actions that can be executed from the admin panel. Click an action button to execute it. Actions can perform operations like resets, statistics gathering, or other plugin-specific functions.' }, { title: 'Settings', content: 'Plugins can register settings that appear as form fields in the admin panel. Configure plugin behavior by modifying these settings and clicking "Save Settings". Settings support various types: strings, numbers, booleans, selects, and textareas.' }, { title: 'Live Reload', content: 'Click the "Restart" button on any plugin card to reload that plugin without restarting P2NS. This is useful for testing plugin changes during development. The plugin will be shut down, its code reloaded, and re-initialized.' }, { title: 'Search', content: 'Use the search box to filter plugins by name, domain, description, author, or version.' } ] }, 'backups': { title: 'Backup & Restore', description: 'Manage system backups and restore from previous states', sections: [ { title: 'Overview', content: 'The Backups tab allows you to create, restore, and manage backups of your P2NS configuration and data.' }, { title: 'Creating Backups', content: 'Click "Create Backup" to manually create a backup. Backups include domains, local DNS records, and selector cache.' }, { title: 'Automatic Backups', content: 'The system automatically creates backups at regular intervals (configurable in settings). Old backups are automatically cleaned up based on retention settings.' }, { title: 'Restoring Backups', content: 'Click "Restore" on any backup to restore your system to that state. A new backup is automatically created before restoration for safety.' }, { title: 'Backup Details', content: 'Click "Details" to view backup metadata including timestamp, version, files included, and their sizes.' }, { title: 'Deleting Backups', content: 'Use "Delete" to remove old backups and free up disk space. Deleted backups cannot be recovered.' } ] }, 'diagnostics': { title: 'Network Diagnostics', description: 'Test and troubleshoot network connectivity', sections: [ { title: 'Overview', content: 'Network Diagnostics provides tools to test DNS resolution, network connectivity, and troubleshoot connection issues.' }, { title: 'DNS Lookup', content: 'Test DNS resolution for any domain. Supports multiple record types (A, AAAA, MX, TXT, NS, CNAME, SRV, PTR, SOA).' }, { title: 'Ping', content: 'Ping a target domain or IP address to test basic connectivity and measure response times.' }, { title: 'Traceroute', content: 'Trace the network path to a target, showing each hop along the route. Useful for diagnosing routing issues.' }, { title: 'Connection Test', content: 'Test TCP connectivity to a specific domain and port. Verifies if a service is reachable.' }, { title: 'Network Interfaces', content: 'View information about network interfaces on the system, including IP addresses and interface details.' } ] } }; // Open info modal function openInfoModal(tabId) { const modal = document.getElementById('infoModal'); const content = infoContent[tabId]; if (!content) { if (window.showNotification) { window.showNotification('Info content not available for this tab', 'error'); } return; } const titleEl = document.getElementById('info-modal-title'); const contentDiv = document.getElementById('info-modal-content'); if (titleEl) { titleEl.textContent = content.title; } if (contentDiv) { contentDiv.innerHTML = `

${content.description}

${content.sections.map(section => `

${section.title}

${section.content}

`).join('')}
`; } if (modal) { modal.showModal(); } } // Make functions globally accessible window.openInfoModal = openInfoModal; window.infoContent = infoContent;