From e990973fbaf19ce7ef3593173cd8e8dbce81e5ef Mon Sep 17 00:00:00 2001 From: Luckysideburn Date: Fri, 21 Oct 2022 17:18:13 +0000 Subject: [PATCH] fix --- html5/index.html | 10 ++-------- html5/kubeinvaders.js | 8 ++++++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/html5/index.html b/html5/index.html index 2230182..4134598 100644 --- a/html5/index.html +++ b/html5/index.html @@ -169,6 +169,7 @@
Deleted Pod Total:  0 -  Chaos Jobs Total:  0 -  + Current Chaos Jobs:  0 -  Not Running Pods:  0 -  Current Replicas State Delay:  0 sec -  Latest Replicas State Delay:  0 sec  @@ -199,17 +200,10 @@ experiments: - name: cpu-attack-exp job: cpu-attack loop: 5 - after: - check_url: https://google.it - check_payload: '' - check_tls_ignore: true + - name: mem-attack-exp job: mem-attack loop: 5 - after: - check_url: https://google.it - check_payload: '' - check_tls_ignore: true
diff --git a/html5/kubeinvaders.js b/html5/kubeinvaders.js index 37723cf..400c34a 100644 --- a/html5/kubeinvaders.js +++ b/html5/kubeinvaders.js @@ -23,7 +23,7 @@ var randomFactor = 10; var pods = []; var game_mode_switch = false; var programming_mode_switch = false; - +var now = ""; var game_buttons = document.getElementById("game-buttons"); var game_screen = document.getElementById("game-screen"); var chaos_program_screen = document.getElementById("chaos-program-screen"); @@ -132,6 +132,9 @@ function getMetrics() { else if (metric[0] == "pods_not_running_on_selected_ns") { $('#pods_not_running_on').text(metric[1]); } + else if (metric[0] == "chaos_jobs_current") { + $('#chaos_jobs_current').text(metric[1]); + } } };; oReq.open("GET", "https://" + clu_endpoint + "/metrics"); @@ -207,7 +210,8 @@ function runChaosProgram() { oReq.onreadystatechange = function () { if (this.readyState === XMLHttpRequest.DONE && this.status === 200) { //console.log(this.responseText); - $('#alert_placeholder').text(this.responseText); + now = new Date().toLocaleString().replace(',','') + $('#alert_placeholder').replaceWith(alert_div + 'Executed Chaos Program at ' + now + ' '); } };; oReq.setRequestHeader("Content-Type", "application/json");