This commit is contained in:
Eugenio Marzo
2026-03-14 19:14:44 +01:00
parent c036e6a30f
commit 5fb2d9cac6
9 changed files with 269 additions and 31 deletions

View File

@@ -179,10 +179,10 @@
</div>
<div class="sidebar" id="sidebar">
<a id="gameModeButton" onclick="startGameMode()">Game Mode</a>
<a id="programmingModeButton" onclick="startProgrammingMode()" style="font-weight: normal;">Programming Mode</a>
<a href="#" onclick="showSetCurrentChaosContainer()" style="font-weight: normal;">Chaos Container Editor</a>
<a href="#" onclick="showSpecialKeys()" style="font-weight: normal;">Controls and options</a>
<a id="gameModeButton" onclick="saveK8sConnection(); startGameMode()">Enable Game Mode</a>
<a id="programmingModeButton" onclick="saveK8sConnection(); startProgrammingMode()" style="font-weight: normal;">Programming Mode</a>
<a href="#" onclick="saveK8sConnection(); showSetCurrentChaosContainer()" style="font-weight: normal;">Chaos Container Editor</a>
<a href="#" onclick="saveK8sConnection(); showSpecialKeys()" style="font-weight: normal;">Controls and options</a>
</div>
<!-- Main content -->
@@ -191,6 +191,11 @@
<span style="color:white" class="toggler-icon" onclick="toggleSidebar()">
<i class="fas fa-bars"></i>
</span>
<div class="alert alert-warning alert-dismissible fade show" role="alert" style="margin-top: 20px; margin-bottom: 10px;">
Before starting, configure the Kubernetes connection, click <strong>Test Connection</strong>, then <strong>Save Connection</strong>. After that, click <strong>Enable Game Mode</strong> in the sidebar.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div id="main-game-div" style="display: block;">

View File

@@ -107,8 +107,14 @@ function getK8sToken() {
}
function getStoredK8sConnectionConfig() {
var endpointInput = document.getElementById('k8s_api_endpoint');
var inputEndpoint = endpointInput ? endpointInput.value.trim() : '';
var storedEndpoint = (localStorage.getItem('k8s_api_endpoint') || '').trim();
var normalizedInputEndpoint = normalizeK8sEndpoint(inputEndpoint);
var normalizedStoredEndpoint = normalizeK8sEndpoint(storedEndpoint);
return {
target: (localStorage.getItem('k8s_api_endpoint') || '').trim(),
target: normalizedInputEndpoint || normalizedStoredEndpoint || '',
token: getK8sToken().trim(),
caCert: getK8sCaCert()
};