Enhance Proxmox components with input validation, error handling, and UI improvements

This commit is contained in:
2026-02-25 07:00:55 -05:00
parent 16cd5f05de
commit 8494f87aae
19 changed files with 182 additions and 64 deletions

View File

@@ -3127,9 +3127,7 @@
$message = $statuses[$server->status]['message'] ?? "This server is currently inactive. Please view the Services tab in the Dashboard to see more information about the current state of this server. If more information is required, please contact support via the support portal under Tickets. This message can be displayed after a service is suspended, cancelled, revoked, or potentially in error. If you believe this message has been displayed in error, please contact us via a ticket and be sure to include the following information: VM{$server->vm_id}-ID{$server->id}-{$server->status}.";
@endphp
<p class="{{ $statuses[$server->status]['color'] ?? 'text-base/80' }}">
{!! $message !!}
</p>
{{ $message }}
</p>
</div>
@endif
@@ -3351,6 +3349,12 @@ window.saveServerIcon = function() {
})
.catch(error => {
console.error('Error saving icon:', error);
const messageEl = document.getElementById('iconMessage');
if (messageEl) {
messageEl.textContent = 'Failed to save icon. Please try again.';
messageEl.classList.remove('hidden');
messageEl.classList.add('text-red-400');
}
});
};
@@ -3409,13 +3413,13 @@ if (!window._proxmoxKeyboardListenerAdded) {
// Ctrl+Shift+S → Start server
if (e.ctrlKey && e.shiftKey && e.key === 'S') {
e.preventDefault();
const startBtn = document.querySelector('[wire\\:click="start"]');
const startBtn = document.querySelector('[wire\\:click="do(\'start\')"]');
if (startBtn && !startBtn.disabled) startBtn.click();
}
// Ctrl+Shift+K → Power off (force stop) — avoids Ctrl+Shift+P browser conflict
if (e.ctrlKey && e.shiftKey && e.key === 'K') {
e.preventDefault();
const stopBtn = document.querySelector('[wire\\:click="kill"]');
const stopBtn = document.querySelector('[wire\\:click="do(\'stop\')"]');
if (stopBtn && !stopBtn.disabled) stopBtn.click();
}
});