genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0

[Task] Availbility Traffic Light

This commit is contained in:
mlabusch 2017-04-28 09:03:09 +02:00
parent 49b531e58f
commit 67725d3ed4
1 changed files with 4 additions and 6 deletions

View File

@ -4,18 +4,16 @@
<!-- ex. {procent .Count 10}%--> <!-- ex. {procent .Count 10}%-->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<g class="arcs"> <g class="arcs">
if (.Count < 4){ {{if lt .Count 4}}
<circle cx="50" cy="50" r="40" fill="#fff" stroke="#aaa" stroke-width="5"/> <circle cx="50" cy="50" r="40" fill="#fff" stroke="#aaa" stroke-width="5"/>
<circle cx="50" cy="50" r="40" fill="none" stroke="#b02" stroke-width="5" stroke-dasharray="251.33" stroke-dashoffset="{{process_radius .Count 10 40}}"/> <circle cx="50" cy="50" r="40" fill="none" stroke="#b02" stroke-width="5" stroke-dasharray="251.33" stroke-dashoffset="{{process_radius .Count 10 40}}"/>
} {{ else if and (lt .Count 7) (gt .Count 3)}}
else if (.Count < 7 and .Count > 3){
<circle cx="50" cy="50" r="40" fill="#fff" stroke="#aaa" stroke-width="5"/> <circle cx="50" cy="50" r="40" fill="#fff" stroke="#aaa" stroke-width="5"/>
<circle cx="50" cy="50" r="40" fill="none" stroke="#e72" stroke-width="5" stroke-dasharray="251.33" stroke-dashoffset="{{process_radius .Count 10 40}}"/> <circle cx="50" cy="50" r="40" fill="none" stroke="#e72" stroke-width="5" stroke-dasharray="251.33" stroke-dashoffset="{{process_radius .Count 10 40}}"/>
} {{else}}
else{
<circle cx="50" cy="50" r="40" fill="#fff" stroke="#aaa" stroke-width="5"/> <circle cx="50" cy="50" r="40" fill="#fff" stroke="#aaa" stroke-width="5"/>
<circle cx="50" cy="50" r="40" fill="none" stroke="#6a4" stroke-width="5" stroke-dasharray="251.33" stroke-dashoffset="{{process_radius .Count 10 40}}"/> <circle cx="50" cy="50" r="40" fill="none" stroke="#6a4" stroke-width="5" stroke-dasharray="251.33" stroke-dashoffset="{{process_radius .Count 10 40}}"/>
} {{end}}
</g> </g>
<text x="50" y="65" fill="#555" text-anchor="middle" style="font: 50px Roboto,Verdana,sans-serif;">{{.Count}}</text> <text x="50" y="65" fill="#555" text-anchor="middle" style="font: 50px Roboto,Verdana,sans-serif;">{{.Count}}</text>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB