This commit is contained in:
Yuri Karamian
2026-05-14 22:57:14 +02:00
parent 372bff51eb
commit 815d1a442b
4 changed files with 54 additions and 3 deletions
@@ -3,7 +3,7 @@
* WHMCS Server Module - Hetzner VPS
*
* @package WHMCS
* @version 1.2.1
* @version 1.2.3
* @copyright Copyright (c) ArkHost 2025
* @author ArkHost <support@arkhost.com>
* @link https://arkhost.com
@@ -1353,6 +1353,10 @@ function ArkHostHetznerVPS_VNC(array $params) {
<style>
body { margin: 0; background-color: #000; height: 100vh; display: flex; flex-direction: column; font-family: Arial, sans-serif; }
#top_bar { background-color: #333; color: white; padding: 10px; text-align: center; font-size: 14px; }
#key_bar { background-color: #2a2a2a; padding: 8px 10px; text-align: center; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
#key_bar button { background-color: #555; color: white; border: 1px solid #777; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; font-family: Arial, sans-serif; }
#key_bar button:hover { background-color: #777; }
#key_bar button:active { background-color: #999; }
#status { text-align: center; padding: 10px; background: #555; color: white; }
#screen { flex: 1; display: flex; width: 100%; height: 100%; background: #000; position: relative; }
#screen canvas { margin: auto; }
@@ -1369,6 +1373,19 @@ function ArkHostHetznerVPS_VNC(array $params) {
Password: <span style="font-family: monospace; background: #444; padding: 2px 6px; border-radius: 3px;">' . htmlspecialchars($vncPassword) . '</span>
</div>
</div>
<div id="key_bar">
<button onclick="sendCtrlAltDel()">Ctrl + Alt + Del</button>
<button onclick="sendKey(0xFFE3, \'ShiftLeft\')">Shift</button>
<button onclick="sendKey(0xFFE9, \'AltLeft\')">Alt</button>
<button onclick="sendKey(0xFFE1, \'ControlLeft\')">Ctrl</button>
<button onclick="sendKey(0xFF09, \'Tab\')">Tab</button>
<button onclick="sendKey(0xFF0D, \'Enter\')">Enter</button>
<button onclick="sendKey(0xFFFF, \'Delete\')">Del</button>
<button onclick="sendKey(0xFF08, \'Backspace\')">Backspace</button>
<button onclick="sendKey(0xFF1B, \'Escape\')">Esc</button>
<button onclick="sendKey(0xFFE3, \'ShiftLeft\'); sendKey(0xFF52, \'ArrowUp\'); sendKey(0xFFE3, \'ShiftLeft\', false);">Shift+Up</button>
<button onclick="toggleFullscreen()">Fullscreen</button>
</div>
<div id="status">Initializing VNC Client...</div>
<div id="screen"></div>
@@ -1393,6 +1410,33 @@ function ArkHostHetznerVPS_VNC(array $params) {
}
}
window.sendCtrlAltDel = function sendCtrlAltDel() {
if (rfb) {
rfb.sendCtrlAltDel();
rfb.focus();
}
};
window.sendKey = function sendKey(keysym, code, down) {
if (rfb) {
if (down === undefined) {
rfb.sendKey(keysym, code, true);
rfb.sendKey(keysym, code, false);
} else {
rfb.sendKey(keysym, code, down);
}
rfb.focus();
}
};
window.toggleFullscreen = function toggleFullscreen() {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen();
} else {
document.exitFullscreen();
}
};
function connect() {
updateStatus("Connecting to VNC server...", "warning");
+1 -1
View File
@@ -3,7 +3,7 @@
* WHMCS Server Module - Hetzner VPS Hooks
*
* @package WHMCS
* @version 1.2.1
* @version 1.2.3
* @copyright Copyright (c) ArkHost 2025
* @author ArkHost <support@arkhost.com>
* @link https://arkhost.com
@@ -13,7 +13,7 @@
<script type="text/javascript">
// Initialize template variables for external script
var productURL = '{$WEB_ROOT}/clientarea.php?action=productdetails&id={$serviceid}';
var serverInfoInitial = JSON.parse('{$serverInfo|@json_encode}');
var serverInfoInitial = JSON.parse('{$serverInfo|json_encode}');
var serviceId = '{$serviceid}';
var csrfToken = '{$token}';
var webRoot = '{$WEB_ROOT}';