(entryId)
| 14186 | return { |
| 14187 | badgeText: 'Switching', |
| 14188 | badgeClass: 'bg-orange-700 text-orange-100', |
| 14189 | alertClass: 'border-orange-500 bg-orange-900/30', |
| 14190 | icon: '🔄' |
| 14191 | }; |
| 14192 | } |
| 14193 | if (state === 'running') { |
| 14194 | return { |
| 14195 | badgeText: 'Running', |
| 14196 | badgeClass: 'bg-green-700 text-green-100', |
| 14197 | alertClass: 'border-green-500 bg-green-900/30', |
| 14198 | icon: '✅' |
| 14199 | }; |
| 14200 | } |
| 14201 | if (state === 'installed') { |
| 14202 | return { |
| 14203 | badgeText: 'Installed', |
| 14204 | badgeClass: 'bg-blue-700 text-blue-100', |
| 14205 | alertClass: 'border-blue-500 bg-blue-900/30', |
| 14206 | icon: 'ℹ️' |
| 14207 | }; |
| 14208 | } |
| 14209 | return { |
| 14210 | badgeText: 'Not Installed', |
| 14211 | badgeClass: 'bg-slate-700 text-slate-200', |
| 14212 | alertClass: 'border-slate-700 bg-slate-900', |
| 14213 | icon: 'ℹ️' |
| 14214 | }; |
| 14215 | } |
| 14216 | |
| 14217 | function formatPwnStateLabel(state) { |
| 14218 | if (!state) { |
| 14219 | return 'Unknown'; |
| 14220 | } |
| 14221 | return state.replace(/_/g, ' ').replace(/\b\w/g, char => char.toUpperCase()); |
| 14222 | } |
| 14223 | |
| 14224 | function formatPwnModeLabel(mode) { |
| 14225 | return mode === 'pwnagotchi' ? 'Pwnagotchi' : 'Ragnar'; |
| 14226 | } |
| 14227 | |
| 14228 | function formatPwnPhaseLabel(phase) { |
| 14229 | if (!phase) { |
| 14230 | return 'Idle'; |
| 14231 | } |
| 14232 | return phase.replace(/_/g, ' ').replace(/\b\w/g, char => char.toUpperCase()); |
| 14233 | } |
| 14234 | |
| 14235 | async function runPwnInstaller(kind) { |
| 14236 | // kind: 'install' | 'repair' | 'reinstall' |
| 14237 | if (pwnStatus.installing) { |
| 14238 | addConsoleMessage('Pwnagotchi installer already running', 'warning'); |
| 14239 | return; |
| 14240 | } |
| 14241 | |
| 14242 | const clean = kind === 'reinstall'; |
| 14243 | const verb = kind === 'repair' ? 'Repair' : (clean ? 'Reinstall' : 'Install'); |
| 14244 | |
| 14245 | if (clean && !confirm('Clean reinstall?\n\nThis wipes /opt/pwnagotchi and reinstalls Pwnagotchi from scratch. Your config.toml is backed up first, and captures/handshakes are left untouched. This can take 20–40 minutes.')) { |
nothing calls this directly
no test coverage detected