fix: add sudo fallback to agent installer + improve error output
- AgentService: try sudo -n first, fall back to bash without sudo - AgentService: add sudo to uninstall command - AgentService: trim error output to last 20 lines for readability - View: show SSH output inline in error toast - Fix undefined $path variable in success path
This commit is contained in:
@@ -445,8 +445,9 @@ function confirmAgentAction() {
|
||||
showToast('success', action === 'install' ? 'Agent installed successfully.' : 'Agent uninstalled successfully.');
|
||||
setTimeout(() => location.reload(), 1500);
|
||||
} else {
|
||||
showToast('error', data.error || (action === 'install' ? 'Installation failed.' : 'Uninstallation failed.'));
|
||||
if (data.output) console.log('Output:', data.output);
|
||||
let msg = data.error || (action === 'install' ? 'Installation failed.' : 'Uninstallation failed.');
|
||||
if (data.output) msg += ' Output: ' + data.output.replace(/\n/g, ' | ');
|
||||
showToast('error', msg);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
|
||||
Reference in New Issue
Block a user