This commit is contained in:
luckysideburn
2024-08-20 12:39:26 +00:00
parent 3801a51f63
commit fa06ce76f5
5 changed files with 23 additions and 18 deletions
+1
View File
@@ -1,3 +1,4 @@
ddd
apiVersion: apps/v1
kind: Deployment
metadata:
+7 -7
View File
@@ -472,6 +472,13 @@
<label for="chaosProgramTextArea"></label>
<textarea class="form-control chaos-prog-area" id="chaosProgramTextArea" rows="50" style="min-width: 100%; font-family: Courier, monospace;">
chaos-codename: CODENAME_PLACEHOLDER
experiments:
- name: cpu_attack_exp
k8s_job: cpu-attack-job
loop: 5
- name: mem_attack_exp
k8s_job: mem-attack-job
loop: 5
k8s_jobs:
cpu-attack-job:
additional-labels:
@@ -489,13 +496,6 @@ k8s_jobs:
command: "stress-ng"
args:
- --version
experiments:
- name: cpu_attack_exp
k8s_job: cpu-attack-job
loop: 5
- name: mem_attack_exp
k8s_job: mem-attack-job
loop: 5
</textarea>
</div>
</form>
+2
View File
@@ -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 = [];
+5 -5
View File
@@ -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%");
}
+8 -6
View File
@@ -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 = "";