fixed position of alien ships when replica of pod is greater then 15

This commit is contained in:
Eugenio Marzo
2019-04-20 10:52:09 +02:00
parent 2a4f6d9d7b
commit a44eae7a67
15 changed files with 28 additions and 20 deletions

View File

@@ -1,15 +0,0 @@
server {
listen 8080 default_server;
listen [::]:8080 default_server;
root /var/www/html/;
index index.html;
location / {
try_files $uri $uri/ =404;
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -213,8 +213,8 @@ nodes {
}
nodes {
position {
x: 100.0
y: 500.0
x: 300.0
y: 407.0
z: 0.0
w: 1.0
}

View File

@@ -144,17 +144,40 @@ function http_pod_result(self, _, response)
pods = json.decode(response.response)
pod_items_size = table.getn(pods["items"])
pod_items = pods["items"]
check_above = false
a = 0
distance_between_pods = 1000 / pod_items_size
y_pos = 600
space_between_factor = 0
if pod_items_size <= 15 then
space_between_factor = pod_items_size
else
space_between_factor = 15
end
while( a <= pod_items_size )
do
if pod_items[a] ~= nil then
this_pod = pod_items[a]
phase = this_pod["status"]["phase"]
local pos = go.get_position()
pos.x = 100 + ( a * (1000 / pod_items_size) )
pos.y = 600
if a <= 15 then
pos.x = 100 + ( a * (1000 / space_between_factor) )
end
if (a % 15 == 0) then
y_pos = y_pos - (( a / 15 ) * 50)
check_above = true
end
if check_above == true then
pos_of_pod_above = go.get_position(current_pods[a - 14]['id'])
pos.x = pos_of_pod_above.x
end
pos.y = y_pos
if phase == "Running" then
local pod = factory.create("/pod#podfactory", pos)
table.insert(current_pods, { id = pod , color = "white" })