Merge remote-tracking branch 'origin/master' into prod
* origin/master: fix timespan buttons centralize settings keep start / end settings nice menu fix medal links Conflicts: add
This commit is contained in:
commit
849bf65548
26
README
26
README
@ -1,35 +1,19 @@
|
|||||||
|
settings
|
||||||
|
========
|
||||||
|
|
||||||
|
Edit to your need
|
||||||
|
|
||||||
graph
|
graph
|
||||||
=====
|
=====
|
||||||
|
|
||||||
RRD rendering.
|
RRD rendering.
|
||||||
|
|
||||||
Lines 7-22:
|
|
||||||
Level colors for the AP graph. Same as resonators/bursters for levels 1 to 8
|
|
||||||
(thanks @globulator).
|
|
||||||
Find a nice scheme for higher levels and send me your patch.
|
|
||||||
|
|
||||||
Lines 24,25:
|
|
||||||
You may want to adjust the default view (in seconds relative to the
|
|
||||||
current time).
|
|
||||||
|
|
||||||
Lines 93,95:
|
|
||||||
Choose which stats to show.
|
|
||||||
|
|
||||||
add.html
|
add.html
|
||||||
========
|
========
|
||||||
|
|
||||||
Update form. Should be prefilled with last inserted data.
|
Update form. Should be prefilled with last inserted data.
|
||||||
|
|
||||||
No change needed.
|
|
||||||
|
|
||||||
add
|
add
|
||||||
===
|
===
|
||||||
|
|
||||||
Process POST data and updates RRD file. Optionally clears CGI cache.
|
Process POST data and updates RRD file. Optionally clears CGI cache.
|
||||||
|
|
||||||
Line 14:
|
|
||||||
Set to your CGI/fastcgi cache to enable cache purge on RRD updates
|
|
||||||
|
|
||||||
Line 19,21:
|
|
||||||
Choose the right scheme for the extraction of the username from the
|
|
||||||
URL.
|
|
||||||
|
|||||||
70
add
70
add
@ -1,33 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Path to your fastcgi_cache (optional).
|
. settings
|
||||||
CACHE_DIR=/web/ingress-stats.riquer.fr/cache
|
|
||||||
|
|
||||||
## FIXME change this according to your URLs:
|
if [[ $REQUEST_METHOD != POST ]]
|
||||||
#
|
then
|
||||||
# /$user/add.html
|
cat <<-EOHead
|
||||||
#IFS=/ read garbage webuser garbage <<<"$REQUEST_URI"
|
|
||||||
# /cgi/$user/add.html
|
|
||||||
IFS=/ read garbage garbage webuser garbage <<<"$REQUEST_URI"
|
|
||||||
|
|
||||||
cat <<-EOHead
|
|
||||||
Content-type: text/plain
|
Content-type: text/plain
|
||||||
Last-Modified: $(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z')
|
Last-Modified: $(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z')
|
||||||
Expires: $(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z')
|
Expires: $(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z')
|
||||||
refresh: 0,url=/cgi/$webuser/
|
refresh: 0,url=/cgi/$webuser/add.html
|
||||||
|
|
||||||
EOHead
|
EOHead
|
||||||
|
|
||||||
if [[ $webuser == $AUTH_USER || $webuser == dev ]]
|
|
||||||
then
|
|
||||||
echo "Welcome agent $webuser"$'!\n\n'
|
|
||||||
else
|
|
||||||
echo 'Nice try!'
|
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
declare -A POST
|
declare -A POST
|
||||||
exprdsname='^[[:upper:][:lower:]_]+$'
|
exprdsname='^[[:upper:][:lower:]_]+$'
|
||||||
exprvalue='^[[:digit:]]+$'
|
exprvalue='^-?[[:digit:]]+$'
|
||||||
while read dsname value
|
while read dsname value
|
||||||
do
|
do
|
||||||
if [[ $dsname =~ $exprdsname ]] \
|
if [[ $dsname =~ $exprdsname ]] \
|
||||||
@ -38,37 +27,26 @@ do
|
|||||||
done < <(
|
done < <(
|
||||||
sed 's/&/\n/g;s/=/ /g'
|
sed 's/&/\n/g;s/=/ /g'
|
||||||
)
|
)
|
||||||
|
cat <<-EOHead
|
||||||
|
Content-type: text/plain
|
||||||
|
Last-Modified: $(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z')
|
||||||
|
Expires: $(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z')
|
||||||
|
refresh: 0,url=/cgi/$webuser/?start=${POST["start"]}&end=${POST["end"]}
|
||||||
|
|
||||||
|
EOHead
|
||||||
|
|
||||||
|
if [[ $webuser == $AUTH_USER || $webuser == dev ]]
|
||||||
|
then
|
||||||
|
echo "Welcome agent $webuser"$'!\n\n'
|
||||||
|
else
|
||||||
|
echo 'Nice try!'
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
dsnames=(
|
|
||||||
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
|
|
||||||
)
|
|
||||||
data=N
|
data=N
|
||||||
for dsname in "${dsnames[@]}"
|
for dsname in "${dsnames[@]}"
|
||||||
do
|
do
|
||||||
data+=:${POST["$dsname"]}
|
data+=:${POST["$dsname"]:=U}
|
||||||
echo "$dsname....${POST["$dsname"]}"
|
echo "$dsname....${POST["$dsname"]}"
|
||||||
done
|
done
|
||||||
rrdtool update ingress.rrd "$data"
|
rrdtool update ingress.rrd "$data"
|
||||||
|
|||||||
97
add.html
97
add.html
@ -1,58 +1,26 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
exec 2>&1
|
|
||||||
|
|
||||||
uinames=(
|
. settings
|
||||||
AP
|
|
||||||
"Unique Portals Visited"
|
if [ -n "$QUERY_STRING" ]
|
||||||
"Portals Discovered"
|
then
|
||||||
"XM Collected"
|
query_data="${QUERY_STRING//&/
|
||||||
Hacks
|
}"
|
||||||
"Resonators Deployed"
|
exprtime='[[:alnum:]-]+'
|
||||||
"Links Created"
|
exprgraph='[[:alpha:]_]+'
|
||||||
"Control Fields Created"
|
while read name value
|
||||||
"Mind Units Captured"
|
do
|
||||||
"Longest Link Ever Created"
|
case $name in
|
||||||
"Largest Control Field"
|
start)
|
||||||
"XM Recharged"
|
[[ $value =~ $exprtime ]] && start=$value
|
||||||
"Portals Captured"
|
;;
|
||||||
"Unique Portals Captured"
|
end)
|
||||||
"Resonators Destroyed"
|
[[ $value =~ $exprtime ]] && end=$value
|
||||||
"Portals Neutralized"
|
;;
|
||||||
"Enemy Links Destroyed"
|
esac
|
||||||
"Enemy Control Fields Destroyed"
|
done <<<"${query_data//=/ }"
|
||||||
"Distance Walked"
|
fi
|
||||||
"Max Time Portal Held"
|
|
||||||
"Max Time Link Maintained"
|
|
||||||
"Max Link Length x Days"
|
|
||||||
"Max Time Field Held"
|
|
||||||
"Largest Field MUs x Days"
|
|
||||||
)
|
|
||||||
dsnames=(
|
|
||||||
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
|
|
||||||
)
|
|
||||||
readprevvalues() {
|
readprevvalues() {
|
||||||
shift
|
shift
|
||||||
for arg
|
for arg
|
||||||
@ -75,6 +43,27 @@ Expires: $(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z')
|
|||||||
<title>IngRRD - Add data</title>
|
<title>IngRRD - Add data</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<table style="border:1px solid black; border-collapse:collapse">
|
||||||
|
<tr>
|
||||||
|
<td style="border:1px solid black"><a href="/cgi/$webuser/?start=$start&end=$end">Overview</a></td>
|
||||||
|
<td style="border:1px solid black">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="2"><a href="?hist&start=$start&end=$end">History /</a></td>
|
||||||
|
<td>
|
||||||
|
<a href="?hist&start=$start&end=$end">Medals</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="?hist&show=all&start=$start&end=$end">All</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td style="background:black; color:white">Add data</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
<form method="post" action="add">
|
<form method="post" action="add">
|
||||||
<ul>
|
<ul>
|
||||||
EOHTML
|
EOHTML
|
||||||
@ -87,6 +76,8 @@ done
|
|||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
</ul>
|
</ul>
|
||||||
<input type="hidden" name="time" value="$(date +%s)" />
|
<input type="hidden" name="time" value="$(date +%s)" />
|
||||||
|
<input type="hidden" name="start" value="$start" />
|
||||||
|
<input type="hidden" name="end" value="$end" />
|
||||||
<button type="submit" name="submit" value="send">Send</button>
|
<button type="submit" name="submit" value="send">Send</button>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
206
index
206
index
@ -1,119 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
rrdfile=ingress.rrd
|
. settings
|
||||||
|
|
||||||
graph_width=800
|
|
||||||
|
|
||||||
L1color=FFCF58
|
|
||||||
L2color=FFA52E
|
|
||||||
L3color=FF7110
|
|
||||||
L4color=E70000
|
|
||||||
L5color=FF2691
|
|
||||||
L6color=EF24CE
|
|
||||||
L7color=C221E1
|
|
||||||
L8color=9523F8
|
|
||||||
L9color=000000
|
|
||||||
L10color=000000
|
|
||||||
L11color=000000
|
|
||||||
L12color=000000
|
|
||||||
L13color=000000
|
|
||||||
L14color=000000
|
|
||||||
L15color=000000
|
|
||||||
L16color=000000
|
|
||||||
|
|
||||||
default_start=-604800
|
|
||||||
default_end=1209600
|
|
||||||
|
|
||||||
start=$default_start
|
|
||||||
end=$default_end
|
|
||||||
|
|
||||||
medals=(
|
|
||||||
Explorer
|
|
||||||
Seer
|
|
||||||
Hacker
|
|
||||||
Builder
|
|
||||||
Connector
|
|
||||||
Mind_Controller
|
|
||||||
Recharger
|
|
||||||
Liberator
|
|
||||||
Pioneer
|
|
||||||
Purifier
|
|
||||||
Guardian
|
|
||||||
)
|
|
||||||
|
|
||||||
## (0) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
|
||||||
lvl=( . 0 2500 20000 70000 150000 300000 600000 1200000 2400000 4000000 6000000 8400000 12000000 17000000 24000000 40000000 )
|
|
||||||
lvlsilver=( . 0 0 0 0 0 0 0 0 4 5 6 7 0 0 0 0 )
|
|
||||||
lvlgold=( . 0 0 0 0 0 0 0 0 1 2 4 6 7 0 0 0 )
|
|
||||||
lvlplatinum=( . 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 )
|
|
||||||
lvlblack=( . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 )
|
|
||||||
|
|
||||||
declare -A bronze silver gold platinum black
|
|
||||||
bronze["Explorer"]=100
|
|
||||||
silver["Explorer"]=1000
|
|
||||||
gold["Explorer"]=2000
|
|
||||||
platinum["Explorer"]=10000
|
|
||||||
black["Explorer"]=30000
|
|
||||||
|
|
||||||
bronze["Seer"]=10
|
|
||||||
silver["Seer"]=50
|
|
||||||
gold["Seer"]=200
|
|
||||||
platinum["Seer"]=500
|
|
||||||
black["Seer"]=5000
|
|
||||||
|
|
||||||
bronze["Hacker"]=2000
|
|
||||||
silver["Hacker"]=10000
|
|
||||||
gold["Hacker"]=30000
|
|
||||||
platinum["Hacker"]=100000
|
|
||||||
black["Hacker"]=200000
|
|
||||||
|
|
||||||
bronze["Builder"]=2000
|
|
||||||
silver["Builder"]=10000
|
|
||||||
gold["Builder"]=30000
|
|
||||||
platinum["Builder"]=100000
|
|
||||||
black["Builder"]=200000
|
|
||||||
|
|
||||||
bronze["Connector"]=50
|
|
||||||
silver["Connector"]=1000
|
|
||||||
gold["Connector"]=5000
|
|
||||||
platinum["Connector"]=25000
|
|
||||||
black["Connector"]=100000
|
|
||||||
|
|
||||||
bronze["Mind_Controller"]=100
|
|
||||||
silver["Mind_Controller"]=500
|
|
||||||
gold["Mind_Controller"]=2000
|
|
||||||
platinum["Mind_Controller"]=10000
|
|
||||||
black["Mind_Controller"]=40000
|
|
||||||
|
|
||||||
bronze["Recharger"]=100000
|
|
||||||
silver["Recharger"]=1000000
|
|
||||||
gold["Recharger"]=3000000
|
|
||||||
platinum["Recharger"]=10000000
|
|
||||||
black["Recharger"]=25000000
|
|
||||||
|
|
||||||
bronze["Liberator"]=100
|
|
||||||
silver["Liberator"]=1000
|
|
||||||
gold["Liberator"]=5000
|
|
||||||
platinum["Liberator"]=15000
|
|
||||||
black["Liberator"]=40000
|
|
||||||
|
|
||||||
bronze["Pioneer"]=20
|
|
||||||
silver["Pioneer"]=200
|
|
||||||
gold["Pioneer"]=1000
|
|
||||||
platinum["Pioneer"]=5000
|
|
||||||
black["Pioneer"]=20000
|
|
||||||
|
|
||||||
bronze["Purifier"]=2000
|
|
||||||
silver["Purifier"]=10000
|
|
||||||
gold["Purifier"]=30000
|
|
||||||
platinum["Purifier"]=100000
|
|
||||||
black["Purifier"]=300000
|
|
||||||
|
|
||||||
bronze["Guardian"]=3
|
|
||||||
silver["Guardian"]=10
|
|
||||||
gold["Guardian"]=20
|
|
||||||
platinum["Guardian"]=90
|
|
||||||
black["Guardian"]=150
|
|
||||||
|
|
||||||
if [ -n "$QUERY_STRING" ]
|
if [ -n "$QUERY_STRING" ]
|
||||||
then
|
then
|
||||||
@ -169,11 +56,25 @@ then
|
|||||||
if (( ! show_graphs ))
|
if (( ! show_graphs ))
|
||||||
then
|
then
|
||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
<table>
|
<table style="border:1px solid black; border-collapse:collapse">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="background:black; color:white">Overview</td>
|
<td style="background:black; color:white">Overview</td>
|
||||||
<td><a href="?hist">History / Trend</a></td>
|
<td style="border:1px solid black">
|
||||||
<td><a href="add.html"><b>Add data</b></a></td>
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="2"><a href="?hist&start=$start&end=$end">History /</a></td>
|
||||||
|
<td>
|
||||||
|
<a href="?hist&start=$start&end=$end">Medals</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="?hist&show=all&start=$start&end=$end">All</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td style="border:1px solid black"><a href="add.html?start=$start&end=$end"><b>Add data</b></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
EOHTML
|
EOHTML
|
||||||
@ -249,7 +150,7 @@ then
|
|||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
<a
|
<a
|
||||||
style="color:black;text-decoration:none"
|
style="color:black;text-decoration:none"
|
||||||
href="#$stat">
|
href="?hist&start=$start&end=$end#$stat">
|
||||||
<img
|
<img
|
||||||
width="30"
|
width="30"
|
||||||
height="30"
|
height="30"
|
||||||
@ -269,7 +170,7 @@ then
|
|||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
<a
|
<a
|
||||||
style="color:black;text-decoration:none"
|
style="color:black;text-decoration:none"
|
||||||
href="#$stat">
|
href="?hist&start=$start&end=$end#$stat">
|
||||||
<img
|
<img
|
||||||
width="30"
|
width="30"
|
||||||
height="30"
|
height="30"
|
||||||
@ -289,7 +190,7 @@ then
|
|||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
<a
|
<a
|
||||||
style="color:black;text-decoration:none"
|
style="color:black;text-decoration:none"
|
||||||
href="#$stat">
|
href="?hist&start=$start&end=$end#$stat">
|
||||||
<img
|
<img
|
||||||
width="30"
|
width="30"
|
||||||
height="30"
|
height="30"
|
||||||
@ -309,7 +210,7 @@ then
|
|||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
<a
|
<a
|
||||||
style="color:black;text-decoration:none"
|
style="color:black;text-decoration:none"
|
||||||
href="#$stat">
|
href="?hist&start=$start&end=$end#$stat">
|
||||||
<img
|
<img
|
||||||
width="30"
|
width="30"
|
||||||
height="30"
|
height="30"
|
||||||
@ -353,7 +254,7 @@ then
|
|||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
<a
|
<a
|
||||||
style="background:#$(printf %02x%02x $redlevel $greenlevel )00;color:black;text-decoration:none"
|
style="background:#$(printf %02x%02x $redlevel $greenlevel )00;color:black;text-decoration:none"
|
||||||
href="#$stat">
|
href="?hist&start=$start&end=$end#$stat">
|
||||||
<img
|
<img
|
||||||
width="30"
|
width="30"
|
||||||
height="30"
|
height="30"
|
||||||
@ -382,7 +283,7 @@ then
|
|||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
<a
|
<a
|
||||||
style="background:#$(printf %02x%02x $redlevel $greenlevel )00;color:black;text-decoration:none"
|
style="background:#$(printf %02x%02x $redlevel $greenlevel )00;color:black;text-decoration:none"
|
||||||
href="#$stat">
|
href="?hist&start=$start&end=$end#$stat">
|
||||||
<img
|
<img
|
||||||
width="30"
|
width="30"
|
||||||
height="30"
|
height="30"
|
||||||
@ -411,7 +312,7 @@ then
|
|||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
<a
|
<a
|
||||||
style="background:#$(printf %02x%02x $redlevel $greenlevel )00;color:black;text-decoration:none"
|
style="background:#$(printf %02x%02x $redlevel $greenlevel )00;color:black;text-decoration:none"
|
||||||
href="#$stat">
|
href="?hist&start=$start&end=$end#$stat">
|
||||||
<img
|
<img
|
||||||
width="30"
|
width="30"
|
||||||
height="30"
|
height="30"
|
||||||
@ -440,7 +341,7 @@ then
|
|||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
<a
|
<a
|
||||||
style="background:#$(printf %02x%02x $redlevel $greenlevel )00;color:black;text-decoration:none"
|
style="background:#$(printf %02x%02x $redlevel $greenlevel )00;color:black;text-decoration:none"
|
||||||
href="#$stat">
|
href="?hist&start=$start&end=$end#$stat">
|
||||||
<img
|
<img
|
||||||
width="30"
|
width="30"
|
||||||
height="30"
|
height="30"
|
||||||
@ -461,28 +362,57 @@ then
|
|||||||
EOHTML
|
EOHTML
|
||||||
else
|
else
|
||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
|
<table style="border:1px solid black; border-collapse:collapse">
|
||||||
|
<tr>
|
||||||
|
<td><a href="?start=$start&end=$end">Overview</a></td>
|
||||||
|
<td style="background:black; color:white">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="?">Overview</a></td>
|
<td rowspan="2">History /</td>
|
||||||
<td style="background:black; color:white">History / Trend</td>
|
EOHTML
|
||||||
<td><a href="add.html"><b>Add data</b></a></td>
|
if (( show_all ))
|
||||||
|
then
|
||||||
|
cat <<-EOHTML
|
||||||
|
<td style="background:white; color:black">
|
||||||
|
<a href="?hist&start=$start&end=$end">Medals</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="background:#505050; color:white">All</td>
|
||||||
|
</tr>
|
||||||
|
EOHTML
|
||||||
|
else
|
||||||
|
cat <<-EOHTML
|
||||||
|
<td style="background:#505050; color:white">Medals</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td style="background:white; color:black">
|
||||||
|
<a href="?hist&show=all&start=$start&end=$end">All</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
EOHTML
|
||||||
|
fi
|
||||||
|
cat <<-EOHTML
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td><a href="add.html?start=$start&end=$end"><b>Add data</b></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table style="width:$(( graph_width + 97 ))px">
|
<table style="width:$(( graph_width + 97 ))px">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="?start=$(( start - 604800 ))&end=$end"><<</a>
|
<a href="?hist&start=$(( start - 604800 ))&end=$end"><<</a>
|
||||||
<a href="?start=$(( start - 86400 ))&end=$end"><</a>
|
<a href="?hist&start=$(( start - 86400 ))&end=$end"><</a>
|
||||||
<a href="?start=$default_start&end=$end">R</a>
|
<a href="?hist&start=$default_start&end=$end">R</a>
|
||||||
<a href="?start=$(( start + 86400 ))&end=$end">></a>
|
<a href="?hist&start=$(( start + 86400 ))&end=$end">></a>
|
||||||
<a href="?start=$(( start + 604800 ))&end=$end">>></a>
|
<a href="?hist&start=$(( start + 604800 ))&end=$end">>></a>
|
||||||
</td>
|
</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<a href="?start=$start&end=$(( end - 604800 ))"><<</a>
|
<a href="?hist&start=$start&end=$(( end - 604800 ))"><<</a>
|
||||||
<a href="?start=$start&end=$(( end - 86400 ))"><</a>
|
<a href="?hist&start=$start&end=$(( end - 86400 ))"><</a>
|
||||||
<a href="?start=$start&end=$default_end">R</a>
|
<a href="?hist&start=$start&end=$default_end">R</a>
|
||||||
<a href="?start=$start&end=$(( end + 86400 ))">></a>
|
<a href="?hist&start=$start&end=$(( end + 86400 ))">></a>
|
||||||
<a href="?start=$start&end=$(( end + 604800 ))">>></a>
|
<a href="?hist&start=$start&end=$(( end + 604800 ))">>></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
177
settings
Normal file
177
settings
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
# Path to your fastcgi_cache (optional).
|
||||||
|
#CACHE_DIR=/var/www/ingRRD/cache
|
||||||
|
|
||||||
|
## FIXME change this according to your URLs:
|
||||||
|
#
|
||||||
|
# /$user/add.html
|
||||||
|
#IFS=/ read garbage webuser garbage <<<"$REQUEST_URI"
|
||||||
|
# /cgi/$user/add.html
|
||||||
|
IFS=/ read garbage garbage webuser garbage <<<"$REQUEST_URI"
|
||||||
|
|
||||||
|
rrdfile=ingress.rrd
|
||||||
|
|
||||||
|
graph_width=800
|
||||||
|
|
||||||
|
L1color=FFCF58
|
||||||
|
L2color=FFA52E
|
||||||
|
L3color=FF7110
|
||||||
|
L4color=E70000
|
||||||
|
L5color=FF2691
|
||||||
|
L6color=EF24CE
|
||||||
|
L7color=C221E1
|
||||||
|
L8color=9523F8
|
||||||
|
L9color=000000
|
||||||
|
L10color=000000
|
||||||
|
L11color=000000
|
||||||
|
L12color=000000
|
||||||
|
L13color=000000
|
||||||
|
L14color=000000
|
||||||
|
L15color=000000
|
||||||
|
L16color=000000
|
||||||
|
|
||||||
|
default_start=-604800
|
||||||
|
default_end=1209600
|
||||||
|
|
||||||
|
start=$default_start
|
||||||
|
end=$default_end
|
||||||
|
|
||||||
|
uinames=(
|
||||||
|
AP
|
||||||
|
"Unique Portals Visited"
|
||||||
|
"Portals Discovered"
|
||||||
|
"XM Collected"
|
||||||
|
Hacks
|
||||||
|
"Resonators Deployed"
|
||||||
|
"Links Created"
|
||||||
|
"Control Fields Created"
|
||||||
|
"Mind Units Captured"
|
||||||
|
"Longest Link Ever Created"
|
||||||
|
"Largest Control Field"
|
||||||
|
"XM Recharged"
|
||||||
|
"Portals Captured"
|
||||||
|
"Unique Portals Captured"
|
||||||
|
"Resonators Destroyed"
|
||||||
|
"Portals Neutralized"
|
||||||
|
"Enemy Links Destroyed"
|
||||||
|
"Enemy Control Fields Destroyed"
|
||||||
|
"Distance Walked"
|
||||||
|
"Max Time Portal Held"
|
||||||
|
"Max Time Link Maintained"
|
||||||
|
"Max Link Length x Days"
|
||||||
|
"Max Time Field Held"
|
||||||
|
"Largest Field MUs x Days"
|
||||||
|
)
|
||||||
|
dsnames=(
|
||||||
|
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
|
||||||
|
)
|
||||||
|
medals=(
|
||||||
|
Explorer
|
||||||
|
Seer
|
||||||
|
Hacker
|
||||||
|
Builder
|
||||||
|
Connector
|
||||||
|
Mind_Controller
|
||||||
|
Recharger
|
||||||
|
Liberator
|
||||||
|
Pioneer
|
||||||
|
Purifier
|
||||||
|
Guardian
|
||||||
|
)
|
||||||
|
|
||||||
|
## (0) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
||||||
|
lvl=( . 0 2500 20000 70000 150000 300000 600000 1200000 2400000 4000000 6000000 8400000 12000000 17000000 24000000 40000000 )
|
||||||
|
lvlsilver=( . 0 0 0 0 0 0 0 0 4 5 6 7 0 0 0 0 )
|
||||||
|
lvlgold=( . 0 0 0 0 0 0 0 0 1 2 4 6 7 0 0 0 )
|
||||||
|
lvlplatinum=( . 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 )
|
||||||
|
lvlblack=( . 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 )
|
||||||
|
|
||||||
|
declare -A bronze silver gold platinum black
|
||||||
|
bronze["Explorer"]=100
|
||||||
|
silver["Explorer"]=1000
|
||||||
|
gold["Explorer"]=2000
|
||||||
|
platinum["Explorer"]=10000
|
||||||
|
black["Explorer"]=30000
|
||||||
|
|
||||||
|
bronze["Seer"]=10
|
||||||
|
silver["Seer"]=50
|
||||||
|
gold["Seer"]=200
|
||||||
|
platinum["Seer"]=500
|
||||||
|
black["Seer"]=5000
|
||||||
|
|
||||||
|
bronze["Hacker"]=2000
|
||||||
|
silver["Hacker"]=10000
|
||||||
|
gold["Hacker"]=30000
|
||||||
|
platinum["Hacker"]=100000
|
||||||
|
black["Hacker"]=200000
|
||||||
|
|
||||||
|
bronze["Builder"]=2000
|
||||||
|
silver["Builder"]=10000
|
||||||
|
gold["Builder"]=30000
|
||||||
|
platinum["Builder"]=100000
|
||||||
|
black["Builder"]=200000
|
||||||
|
|
||||||
|
bronze["Connector"]=50
|
||||||
|
silver["Connector"]=1000
|
||||||
|
gold["Connector"]=5000
|
||||||
|
platinum["Connector"]=25000
|
||||||
|
black["Connector"]=100000
|
||||||
|
|
||||||
|
bronze["Mind_Controller"]=100
|
||||||
|
silver["Mind_Controller"]=500
|
||||||
|
gold["Mind_Controller"]=2000
|
||||||
|
platinum["Mind_Controller"]=10000
|
||||||
|
black["Mind_Controller"]=40000
|
||||||
|
|
||||||
|
bronze["Recharger"]=100000
|
||||||
|
silver["Recharger"]=1000000
|
||||||
|
gold["Recharger"]=3000000
|
||||||
|
platinum["Recharger"]=10000000
|
||||||
|
black["Recharger"]=25000000
|
||||||
|
|
||||||
|
bronze["Liberator"]=100
|
||||||
|
silver["Liberator"]=1000
|
||||||
|
gold["Liberator"]=5000
|
||||||
|
platinum["Liberator"]=15000
|
||||||
|
black["Liberator"]=40000
|
||||||
|
|
||||||
|
bronze["Pioneer"]=20
|
||||||
|
silver["Pioneer"]=200
|
||||||
|
gold["Pioneer"]=1000
|
||||||
|
platinum["Pioneer"]=5000
|
||||||
|
black["Pioneer"]=20000
|
||||||
|
|
||||||
|
bronze["Purifier"]=2000
|
||||||
|
silver["Purifier"]=10000
|
||||||
|
gold["Purifier"]=30000
|
||||||
|
platinum["Purifier"]=100000
|
||||||
|
black["Purifier"]=300000
|
||||||
|
|
||||||
|
bronze["Guardian"]=3
|
||||||
|
silver["Guardian"]=10
|
||||||
|
gold["Guardian"]=20
|
||||||
|
platinum["Guardian"]=90
|
||||||
|
black["Guardian"]=150
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user