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 start=$default_start
end=$default_end end=$default_end
medals=(
Explorer
Seer
Hacker
Builder
Connector
Mind_Controller
Recharger
Liberator
Pioneer
Purifier
Guardian
)
if [ -n "$QUERY_STRING" ] if [ -n "$QUERY_STRING" ]
then then
query_data="${QUERY_STRING//&/ query_data="${QUERY_STRING//&/
@ -45,6 +59,9 @@ then
graph) graph)
[[ $value =~ $exprgraph ]] && graph=$value [[ $value =~ $exprgraph ]] && graph=$value
;; ;;
show)
[[ $value == all ]] && show_all=1
;;
esac esac
done <<<"${query_data//=/ }" done <<<"${query_data//=/ }"
fi fi
@ -90,16 +107,48 @@ then
</table> </table>
EOHTML EOHTML
# Show all stats if (( show_all ))
#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 then
# Show only AP and medals stats=(
for stat in AP Explorer Seer Hacker Builder Connector Mind_Controller Recharger Liberator Pioneer Purifier Guardian 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 do
cat <<-EOHTML cat <<-EOHTML
<div> <div>
<img <img
src="graph?graph=$stat&amp;start=$start&amp;end=$end" src="graph?graph=$stat&amp;start=$start&amp;end=$end"
alt="Ingress $graph evolution" /> alt="Ingress $stat evolution" />
</div> </div>
EOHTML EOHTML
done done