diff --git a/dev-tools/yamls/deploymentns1ns2.yaml b/dev-tools/yamls/deploymentns1ns2.yaml index 814990121..62955abb0 100644 --- a/dev-tools/yamls/deploymentns1ns2.yaml +++ b/dev-tools/yamls/deploymentns1ns2.yaml @@ -1,3 +1,4 @@ +ddd apiVersion: apps/v1 kind: Deployment metadata: diff --git a/html5/index.html b/html5/index.html index 468214067..202b05e7e 100644 --- a/html5/index.html +++ b/html5/index.html @@ -472,6 +472,13 @@

diff --git a/html5/kubeinvaders.js b/html5/kubeinvaders.js index c664fb560..e4dd52842 100644 --- a/html5/kubeinvaders.js +++ b/html5/kubeinvaders.js @@ -51,6 +51,8 @@ var log_tail_screen = document.getElementById("logTailScreen"); var random_code = (Math.random() + 1).toString(36).substring(7); var change_codename = false; var latest_sent_chaos_program = ""; +var editor = null; + // nodes list from kubernetes var nodes = []; diff --git a/html5/mode_controls.js b/html5/mode_controls.js index 820212746..fe0fc8a14 100644 --- a/html5/mode_controls.js +++ b/html5/mode_controls.js @@ -67,10 +67,10 @@ function startProgrammingMode() { game_buttons.style.display = "none"; game_screen.style.display = "none"; - // var editor = CodeMirror.fromTextArea(chaosProgramTextArea, { - // lineNumbers: true, - // theme: "dracula" - // }); - //editor.setSize("100%", "100%"); + editor = CodeMirror.fromTextArea(chaosProgramTextArea, { + lineNumbers: true, + theme: "dracula" + }); + editor.setSize("100%", "100%"); } \ No newline at end of file diff --git a/html5/programming_mode.js b/html5/programming_mode.js index 0072e6c86..c1c7fd1d6 100644 --- a/html5/programming_mode.js +++ b/html5/programming_mode.js @@ -3,9 +3,11 @@ function replaceDivWithContent(divId, content) { } function getChaosProgTextAreaValue() { - const chaosProgramTextArea = document.getElementById('chaosProgramTextArea'); - const textValue = chaosProgramTextArea.value; - return textValue; + return editor.getValue(); +// const chaosProgramTextArea = document.getElementById('chaosProgramTextArea'); +// const textValue = chaosProgramTextArea.value; +// console.log("[GET-CHAOS-PROGRAM-TEXT-AREA-VALUE] " + textValue); +// return textValue; } /* Programming Mode Functions */ function IsJsonString(str) { @@ -204,7 +206,7 @@ loop: 5`); function drawChaosProgramFlow() { //var chaosProgram = ""; - chaosProgram = $('#chaosProgramTextArea').val(); + chaosProgram = getChaosProgTextAreaValue(); var oReq = new XMLHttpRequest(); oReq.open("POST", k8s_url + "/chaos/programs/json-flow", true); @@ -220,8 +222,8 @@ function drawChaosProgramFlow() { } var flow = JSON.parse(this.responseText); - // console.log("[DRAW-PROGRAM-FLOW] Drawing flow for " + codename); - // console.log("[DRAW-PROGRAM-FLOW] Drawing: " + JSON.stringify(flow)); + console.log("[DRAW-PROGRAM-FLOW] Drawing flow for " + codename); + console.log("[DRAW-PROGRAM-FLOW] Drawing: " + JSON.stringify(flow)); var flow_html = ""; let i = 0; var times = "";