show=all option

This commit is contained in:
Vincent Riquer 2014-06-11 16:19:55 +02:00
parent 2f2af69e93
commit 70324a7b8f

59
graph
View File

@ -27,6 +27,20 @@ default_end=1209600
start=$default_start
end=$default_end
medals=(
Explorer
Seer
Hacker
Builder
Connector
Mind_Controller
Recharger
Liberator
Pioneer
Purifier
Guardian
)
if [ -n "$QUERY_STRING" ]
then
query_data="${QUERY_STRING//&/
@ -45,6 +59,9 @@ then
graph)
[[ $value =~ $exprgraph ]] && graph=$value
;;
show)
[[ $value == all ]] && show_all=1
;;
esac
done <<<"${query_data//=/ }"
fi
@ -90,16 +107,48 @@ then
</table>
EOHTML
# Show all stats
#for stat in AP Explorer Seer XM Hacker Builder Connector Mind_Controller MU Longest_Link Largest_Field Recharger Liberator Pioneer Purifier Neutralized Links_Destroyed Fields_Destroyed Walked Guardian Link_Maintained Link_Length_x_Days Field_Held Field_x_Days
# Show only AP and medals
for stat in AP Explorer Seer Hacker Builder Connector Mind_Controller Recharger Liberator Pioneer Purifier Guardian
if (( show_all ))
then
stats=(
AP
Explorer
Seer
XM
Hacker
Builder
Connector
Mind_Controller
MU
Longest_Link
Largest_Field
Recharger
Liberator
Pioneer
Purifier
Neutralized
Links_Destroyed
Fields_Destroyed
Walked
Guardian
Link_Maintained
Link_Length_x_Days
Field_Held
Field_x_Days
)
else
stats=(
AP
"${medals[@]}"
)
fi
for stat in "${stats[@]}"
do
cat <<-EOHTML
<div>
<img
src="graph?graph=$stat&amp;start=$start&amp;end=$end"
alt="Ingress $graph evolution" />
alt="Ingress $stat evolution" />
</div>
EOHTML
done