mirror of
https://github.com/lucky-sideburn/kubeinvaders.git
synced 2026-08-23 21:46:21 +00:00
fix
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 196 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 258 KiB After Width: | Height: | Size: 309 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 258 KiB |
+16
-16
@@ -10,7 +10,7 @@
|
||||
|
||||
.custom-btn-group {
|
||||
margin-top: 2%;
|
||||
border: 5px solid #969696;
|
||||
border: 5px solid #b2afaf;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 15px;
|
||||
-webkit-border-radius: 15px;
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
.logtail-group {
|
||||
margin-top: 0%;
|
||||
border: 5px solid #969696;
|
||||
border: 5px solid #b2afaf;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 15px;
|
||||
-webkit-border-radius: 15px;
|
||||
@@ -29,7 +29,7 @@
|
||||
}
|
||||
|
||||
.chaos-prog-area {
|
||||
border: 5px solid #969696;
|
||||
border: 5px solid #b2afaf;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 15px;
|
||||
-webkit-border-radius: 15px;
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
.btn-light:hover, .btn-light:focus, .btn-light:active, .btn-light.active, .open .dropdown-toggle.btn-default {
|
||||
background-color: #7304b3;
|
||||
background-color: #06812f;
|
||||
color:#FFF;
|
||||
border-color: #000000;
|
||||
}
|
||||
@@ -58,21 +58,21 @@
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #ededed;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background-color: #ededed;
|
||||
background-color: #ffffff;
|
||||
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background-color: #ededed;
|
||||
background-color: #ffffff;
|
||||
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
background-color: #ededed;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
div {
|
||||
@@ -293,14 +293,14 @@
|
||||
<div class="row" align="center">
|
||||
<div style="margin-top: 1%;" class="custom-btn-group">
|
||||
|
||||
<span style="color: #000000;">Deleted Pod Total: <span id="deleted_pods_total" style="color: #8f00bb">0</span></span><br>
|
||||
<span style="color: #000000">Chaos Jobs Total: <span id="chaos_jobs_total" style="color: #8f00bb">0</span></span><br>
|
||||
<span style="color: #000000;">Deleted Pod Total: <span id="deleted_pods_total" style="color: #028320">0</span></span><br>
|
||||
<span style="color: #000000">Chaos Jobs Total: <span id="chaos_jobs_total" style="color: #028320">0</span></span><br>
|
||||
|
||||
<span style="color: #000000">Current Chaos Pods: <span id="current_chaos_job_pod" style="color: #8f00bb">0</span></span><br>
|
||||
<span style="color: #000000">Not Running Pods: <span id="pods_not_running_on" style="color: #8f00bb">0</span></span><br>
|
||||
<span style="color: #000000">Current Chaos Pods: <span id="current_chaos_job_pod" style="color: #028320">0</span></span><br>
|
||||
<span style="color: #000000">Not Running Pods: <span id="pods_not_running_on" style="color: #028320">0</span></span><br>
|
||||
|
||||
<span style="color: #000000">Current Replicas State Delay: </span><span id="fewer_replicas_seconds" style="color: #8f00bb">0</span><font color="#4f4f4f"> sec</font></span><br>
|
||||
<span style="color: #000000">Latest Replicas State Delay: <span id="latest_fewer_replicas_seconds" style="color: #8f00bb">0</span><font color="#4f4f4f"> sec</font> </span>
|
||||
<span style="color: #000000">Current Replicas State Delay: </span><span id="fewer_replicas_seconds" style="color: #028320">0</span><font color="#4f4f4f"> sec</font></span><br>
|
||||
<span style="color: #000000">Latest Replicas State Delay: <span id="latest_fewer_replicas_seconds" style="color: #028320">0</span><font color="#4f4f4f"> sec</font> </span>
|
||||
|
||||
</div>
|
||||
<div class="">
|
||||
@@ -372,9 +372,9 @@ experiments:
|
||||
</div>
|
||||
<div class="col" style="margin-top: 4%; overflow-y: scroll; height:900px;">
|
||||
<div id="chaosProgramFlow">
|
||||
<div class="row"><div class="alert alert-dark" role="alert">test attack 1</div></div>
|
||||
<div class="row"><div class="alert alert-light" role="alert" style="border-color: #000000; border-width: 1.5px;">test attack 1</div></div>
|
||||
<img src="images/down-arrow.png" width="30" height="30" style="margin-bottom: 2%;">
|
||||
<div class="row"><div class="alert alert-dark" role="alert">test attack 2</div></div>
|
||||
<div class="row"><div class="alert alert-light" role="alert" style="border-color: #000000; border-width: 1.5px;">test attack 2</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -174,7 +174,7 @@ experiments:
|
||||
|
||||
function drawChaosProgramFlow() {
|
||||
var chaosProgram = "";
|
||||
chaosProgram = $('#chaosProgramTextArea').text();
|
||||
chaosProgram = $('#chaosProgramTextArea').val();
|
||||
|
||||
// var chaosProgramWithCodename = chaosProgram.replace('CODENAME_PLACEHOLDER', codename);
|
||||
// console.log(chaosProgramWithCodename);
|
||||
@@ -200,15 +200,18 @@ function drawChaosProgramFlow() {
|
||||
times = "twice"
|
||||
}
|
||||
else {
|
||||
times = "times"
|
||||
times = flow["experiments"][i]["loop"] + " times"
|
||||
}
|
||||
|
||||
flow_html = flow_html + '<div class="row"><div class="alert alert-light" role="alert">Do ' + flow["experiments"][i]["name"] + ' ' + flow["experiments"][i]["loop"] + ' ' + times + '</div></div>';
|
||||
flow_html = flow_html + '<div class="row"><div class="alert alert-light" role="alert" style="border-color: #000000; border-width: 1.5px;">Do ' + flow["experiments"][i]["name"] + ' ' + times + '</div></div>';
|
||||
search_job = codename + ":" + flow["experiments"][i]["name"]
|
||||
|
||||
flow_html = flow_html + '<img src="images/down-arrow.png" width="30" height="30" style="margin-bottom: 2%;">';
|
||||
|
||||
//console.log("Search " + search_job);
|
||||
for (let [key, value] of chaos_jobs_status) {
|
||||
if (key.search(search_job)) {
|
||||
flow_html = flow_html + '<div class="row"><div class="alert alert-light" role="alert">[' + key.split(":")[2] + '] Status: ' + value + '</div></div>';
|
||||
flow_html = flow_html + '<div class="row"><div class="alert alert-light" role="alert" style="border-color: #000000; border-width: 1.5px;">[' + key.split(":")[2] + '] Status: ' + value + '</div></div>';
|
||||
}
|
||||
}
|
||||
i++;
|
||||
|
||||
+10
-24
@@ -75,26 +75,10 @@ server {
|
||||
local open = io.open
|
||||
|
||||
local function read_rand_line_from_file(path)
|
||||
local word_array_index = 0
|
||||
local word_array = {}
|
||||
local file = open(path, "rb") -- r read mode and b binary mode
|
||||
|
||||
if not file then return nil end
|
||||
local content = file:read "*a" -- *a or *all reads the whole file
|
||||
file:close()
|
||||
|
||||
for word in string.gmatch(content, "%S+") do
|
||||
word_array[word_array_index] = word
|
||||
word_array_index = word_array_index + 1
|
||||
end
|
||||
|
||||
while (type(rand) ~= "number")
|
||||
do
|
||||
math.randomseed(os.clock()*100000000000)
|
||||
rand = math.random(0, word_array_index - 1)
|
||||
end
|
||||
|
||||
return word_array[rand]
|
||||
local handle = io.popen("shuf -n 1 " .. path)
|
||||
local result = handle:read("*a")
|
||||
local rc = handle:close()
|
||||
return result
|
||||
end
|
||||
|
||||
local random_word = read_rand_line_from_file("/usr/local/openresty/nginx/conf/kubeinvaders/data/codenames.txt")
|
||||
@@ -106,13 +90,15 @@ server {
|
||||
ngx.header['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS'
|
||||
ngx.header['Access-Control-Allow-Headers'] = 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'
|
||||
ngx.header['Access-Control-Expose-Headers'] = 'Content-Length,Content-Range';
|
||||
|
||||
while (red:get("programming_mode_codename:" .. random_word) == nil)
|
||||
|
||||
while (red:get("latest_codename") == random_word)
|
||||
do
|
||||
random_word = read_rand_line_from_file("/usr/local/openresty/nginx/conf/kubeinvaders/data/codenames.txt")
|
||||
end
|
||||
|
||||
red:set("programming_mode_codename:" .. random_word, "active")
|
||||
|
||||
red:set("latest_codename", random_word)
|
||||
|
||||
ngx.log(ngx.ERR, "[programming_mode_codename] Choosing random word " .. random_word)
|
||||
ngx.say(random_word)
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<head><title>500 Internal Server Error</title></head>
|
||||
<body>
|
||||
<center><h1>500 Internal Server Error</h1></center>
|
||||
<hr><center>openresty/1.21.4.1</center>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user