diff --git a/html5/css/dashboard.css b/html5/css/dashboard.css index 69861f8..d1905a5 100644 --- a/html5/css/dashboard.css +++ b/html5/css/dashboard.css @@ -7,7 +7,6 @@ body { padding-top: 50px; } - /* * Global add-ons */ diff --git a/html5/index.html b/html5/index.html index f2d7e75..9e81beb 100644 --- a/html5/index.html +++ b/html5/index.html @@ -98,7 +98,7 @@ -
+
@@ -118,12 +118,24 @@
+
+
+ +
+
+ + +
+
+ +
+
@@ -139,6 +151,23 @@ randomFactor = $("#randomFactorInput").val(); $("#currentRandomFactor").text(randomFactor); } + + function zoomIn() { + document.getElementById("gameContainer").style.width = "100%" + document.getElementById("gameContainer").style.height = "100%"; + document.getElementById("zoomInGameScreenInput").disabled = true; + document.getElementById("zoomOutGameScreenInput").disabled = false; + } + + function zoomOut() { + var gameContainerWidth = document.getElementById("gameContainer").style.width; + var gameContainerHeight = document.getElementById("gameContainer").style.height; + document.getElementById("gameContainer").style.width = "50%" + document.getElementById("gameContainer").style.height = "50%" + document.getElementById("zoomInGameScreenInput").disabled = false; + document.getElementById("zoomOutGameScreenInput").disabled = true; + } + function controlAutoPilot() { if (autoPilot) { autoPilot = false; diff --git a/html5/kubeinvaders.js b/html5/kubeinvaders.js index 0cc09ff..1005781 100644 --- a/html5/kubeinvaders.js +++ b/html5/kubeinvaders.js @@ -77,6 +77,8 @@ var help = false; var chaos_nodes = true; var chaos_pods = true; +var alert_div = ''); oReq.open("GET", "https://ENDPOINT_PLACEHOLDER/kube/chaos/nodes?nodename=" + node_name + "&namespace=" + namespace); oReq.send(); } @@ -191,7 +193,7 @@ function deletePods(pod_name) { oReq.onload = function () { //console.log(JSON.parse(this.responseText)) };; - $('#alert_placeholder').replaceWith(''); + $('#alert_placeholder').replaceWith(alert_div + 'Latest action: Kill ' + pod_name + '
'); oReq.open("GET", "https://ENDPOINT_PLACEHOLDER/kube/pods?action=delete&pod_name=" + pod_name + "&namespace=" + namespace); oReq.send(); } @@ -269,13 +271,13 @@ function keyDownHandler(e) { else if(e.keyCode == 83) { if (shuffle) { shuffle = false; - $('#alert_placeholder').replaceWith(''); + $('#alert_placeholder').replaceWith(alert_div + 'Latest action: Disable shuffle
'); //console.log("Deactivate shuffle"); } else { shuffle = true //console.log("Activate shuffle"); - $('#alert_placeholder').replaceWith(''); + $('#alert_placeholder').replaceWith(alert_div + 'Latest action: Enable shuffle
'); } } else if(e.keyCode == 32) { @@ -291,7 +293,7 @@ function keyDownHandler(e) { namespaces_index = 0; } namespace = namespaces[namespaces_index]; - $('#alert_placeholder').replaceWith(''); + $('#alert_placeholder').replaceWith(alert_div + 'Latest action: Change target namespace to ' + namespace + ''); aliens = []; pods = []; } @@ -306,22 +308,22 @@ function keyDownHandler(e) { else if(e.keyCode == 67) { if (chaos_nodes) { chaos_nodes = false; - $('#alert_placeholder').replaceWith(''); + $('#alert_placeholder').replaceWith(alert_div + 'Latest action: Hide nodes'); } else { chaos_nodes = true - $('#alert_placeholder').replaceWith(''); + $('#alert_placeholder').replaceWith(alert_div + 'Latest action: Show nodes'); } } else if(e.keyCode == 80) { if (chaos_pods) { chaos_pods = false; - $('#alert_placeholder').replaceWith(''); + $('#alert_placeholder').replaceWith(alert_div + 'Latest action: Hide pods'); } else { chaos_pods = true - $('#alert_placeholder').replaceWith(''); + $('#alert_placeholder').replaceWith(alert_div + 'Latest action: Show pods'); } } }