- Updated serverplaceholder.blade.php to enhance loading skeletons for server details. - Added navigation breadcrumbs to statistics, subdomain, and system views for better user experience. - Improved loading indicators for CPU, network, memory, and disk charts in statistics.blade.php. - Refined storage.blade.php layout with section dividers and improved drive display, including bus type indicators and quota usage. - Enhanced VNC and Xterm popups with a new header design, loading animations, and reconnect functionality. - Added error handling for VNC and Xterm connections to inform users when unable to connect.
42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Paymenter\Extensions\Servers\Proxmox\Livewire;
|
|
|
|
use Paymenter\Extensions\Servers\Proxmox\Models\Server;
|
|
use Paymenter\Extensions\Servers\Proxmox\Proxmox;
|
|
|
|
class XTerm extends Component
|
|
{
|
|
public function mount(Server $server): void
|
|
{
|
|
parent::mount($server);
|
|
|
|
// Check if server node has VNC enabled (xterm uses the same VNC authentication)
|
|
if (!$this->server->node->vnc_enabled) {
|
|
abort(403, 'Console access is not enabled on this server node.');
|
|
}
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
try {
|
|
$proxmox = new Proxmox;
|
|
|
|
return view('proxmox::xterm', [
|
|
'xterm' => $proxmox->xterm($this->server),
|
|
])->layoutData([
|
|
'sidebar' => true,
|
|
]);
|
|
} catch (\Throwable $e) {
|
|
$this->notify('Failed to connect to console: ' . $e->getMessage(), 'error');
|
|
|
|
return view('proxmox::xterm', [
|
|
'xterm' => null,
|
|
])->layoutData([
|
|
'sidebar' => true,
|
|
]);
|
|
}
|
|
}
|
|
}
|
|
|