import { Component, Show, Accessor, Setter } from 'solid-js'; import SettingsPanel from '@/components/shared/SettingsPanel'; import { HelpIcon } from '@/components/shared/HelpIcon'; import RefreshCw from 'lucide-solid/icons/refresh-cw'; import CheckCircle from 'lucide-solid/icons/check-circle'; import ArrowRight from 'lucide-solid/icons/arrow-right'; import Package from 'lucide-solid/icons/package'; import Download from 'lucide-solid/icons/download'; import type { UpdateInfo, VersionInfo, UpdatePlan } from '@/api/updates'; import { V6_RC_ANNOUNCEMENT, V5_MAINTENANCE_BRANCH, isV5ReleaseLine, } from '@/constants/releaseAnnouncements'; interface UpdatesSettingsPanelProps { versionInfo: Accessor; updateInfo: Accessor; checkingForUpdates: Accessor; updateChannel: Accessor<'stable' | 'rc'>; setUpdateChannel: Setter<'stable' | 'rc'>; autoUpdateEnabled: Accessor; setAutoUpdateEnabled: Setter; autoUpdateCheckInterval: Accessor; setAutoUpdateCheckInterval: Setter; autoUpdateTime: Accessor; setAutoUpdateTime: Setter; checkForUpdates: () => Promise; setHasUnsavedChanges: Setter; // Update installation props updatePlan: Accessor; onInstallUpdate: () => void; isInstalling: Accessor; } export const UpdatesSettingsPanel: Component = (props) => { return (
} bodyClass="space-y-6" >
Pulse v6 RC testing {V6_RC_ANNOUNCEMENT.tag}

5.1.x {' '} remains the stable line. If you can, test v6 in a staging or non-production environment and use the changelog before upgrading so the move from v5 is deliberate rather than guesswork.

{/* Version Status Section */}
{/* Version Grid */}
{/* Current Version */}

Current Version

{props.versionInfo()?.version || 'Loading...'}

Development Docker Source
{/* Update Status / Arrow */}
Update Ready
{/* Latest Version / Status */}
}>

{props.updateInfo()?.available ? 'Available' : 'Status'}

Up to date

}>

{props.updateInfo()?.latestVersion}

Released {new Date(props.updateInfo()!.releaseDate).toLocaleDateString()}

{/* Check for updates button */}

Auto-check enabled Manual checks only

{/* Docker installation notice - enhanced with copy-able commands */}

Docker Installation

Updates are managed through Docker. Use these commands to check for and apply updates:

docker pull rcourtman/pulse:latest && docker restart pulse

Or with Docker Compose: docker-compose pull && docker-compose up -d

{/* Source build notice */}

Built from source: Pull the latest code from git and rebuild to update.

{/* Warning message */}

{props.updateInfo()?.warning}

{/* Update available */}
{/* Header */}

Update Available

Version {props.updateInfo()?.latestVersion} is ready to install

{/* Automated Install Button */}
{/* Installation Steps */}
{/* Manual Steps Header */}
Follow these steps to update manually:
Click "Install Update" above for automatic installation, or update manually:
{/* ProxmoxVE LXC Installation */}
1 Open your Pulse LXC console
2 Run the update command:
update

The script will automatically download and install the latest version.

{/* Docker Installation */}
1 Pull the latest image
docker pull rcourtman/pulse:{props.updateInfo()?.latestVersion.replace(/^v/, '')}
2 Restart the container
docker restart pulse

Or use Docker Compose: docker-compose pull && docker-compose up -d

{/* Systemd/Manual Installation */}
1 Stop the service
sudo systemctl stop pulse
2 Download and extract the new version
{`curl -LO https://github.com/rcourtman/Pulse/releases/download/v${props.updateInfo()?.latestVersion}/pulse-v${props.updateInfo()?.latestVersion}-linux-amd64.tar.gz sudo tar -xzf pulse-v${props.updateInfo()?.latestVersion}-linux-amd64.tar.gz -C /usr/local/bin pulse`}
3 Start the service
sudo systemctl start pulse
{/* Development Installation */}
1 Pull the latest changes
{`git pull origin ${V5_MAINTENANCE_BRANCH}`}
2 Rebuild and restart
make build && make run
{/* Release notes footer */}
View Release Notes
                        {props.updateInfo()?.releaseNotes}
                      
{/* Update settings */}

Update Preferences

{/* Update Channel */}
{/* Auto Update Toggle */}

Periodically check for new versions (installation is always manual)

{/* Auto update options (shown when enabled) */}
{/* Check Interval */}
{/* Check Time */}
{ props.setAutoUpdateTime(e.currentTarget.value); props.setHasUnsavedChanges(true); }} class="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800" />
); };