Merge remote-tracking branch 'origin/master' into prod
* origin/master: 304: take "settings" mtime into account import 0 as unknown Only show "real" DS
This commit is contained in:
commit
da162f3690
5
add.html
5
add.html
@ -154,9 +154,10 @@ cat <<-EOHTML
|
|||||||
<ul>
|
<ul>
|
||||||
EOHTML
|
EOHTML
|
||||||
|
|
||||||
for indice in ${!uinames[@]}
|
for indice in ${dsnames[@]}
|
||||||
do
|
do
|
||||||
echo "<li><input type=\"text\" name=\"${dsnames[indice]}\" value=\"${last["${dsnames[indice]}"]}\" /> ${uinames[indice]}</li>"
|
[[ -z "${uinames[$indice]}" ]] && continue
|
||||||
|
echo "<li><input type=\"text\" name=\"$indice\" value=\"${last["$indice"]}\" /> ${uinames[$indice]}</li>"
|
||||||
done
|
done
|
||||||
|
|
||||||
cat <<-EOHTML
|
cat <<-EOHTML
|
||||||
|
|||||||
2
import
2
import
@ -79,7 +79,7 @@ then
|
|||||||
while read date hour data
|
while read date hour data
|
||||||
do
|
do
|
||||||
data=$(date -d "$date $hour" +%s):${data// /:}
|
data=$(date -d "$date $hour" +%s):${data// /:}
|
||||||
rrdtool update "$rrdfile" -t $template "$data" 2>&1
|
rrdtool update "$rrdfile" -t $template "${data//:0/:U}" 2>&1
|
||||||
done <<<"${POST["data"]}"
|
done <<<"${POST["data"]}"
|
||||||
|
|
||||||
if [ -n "$CACHE_DIR" ]
|
if [ -n "$CACHE_DIR" ]
|
||||||
|
|||||||
3
index
3
index
@ -415,6 +415,7 @@ then
|
|||||||
|
|
||||||
for stat in "${stats[@]}"
|
for stat in "${stats[@]}"
|
||||||
do
|
do
|
||||||
|
[[ -z "${uinames[$stat]}" ]] && continue
|
||||||
if [[ $stat == AP ]] || (( bronze["$stat"] ))
|
if [[ $stat == AP ]] || (( bronze["$stat"] ))
|
||||||
then
|
then
|
||||||
height=169
|
height=169
|
||||||
@ -627,7 +628,7 @@ else
|
|||||||
rrdtool graph - \
|
rrdtool graph - \
|
||||||
-a PNG \
|
-a PNG \
|
||||||
-w $graph_width \
|
-w $graph_width \
|
||||||
-v $graph \
|
-v "${uinames[$graph]}" \
|
||||||
-s $start -e $end \
|
-s $start -e $end \
|
||||||
DEF:data=$rrdfile:$graph:AVERAGE:step=3600${datastart+:start=$datastart}${dataend+:end=$dataend} \
|
DEF:data=$rrdfile:$graph:AVERAGE:step=3600${datastart+:start=$datastart}${dataend+:end=$dataend} \
|
||||||
DEF:fail=$rrdfile:$graph:FAILURES \
|
DEF:fail=$rrdfile:$graph:FAILURES \
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
send_headers() {
|
send_headers() {
|
||||||
local timestamp do_exit header thisdate expiredate
|
local timestamp do_exit header thisdate expiredate
|
||||||
read timestamp < <(stat -c %Y $0 "$rrdfile" lib/* |sort -r)
|
read timestamp < <(stat -c %Y $0 settings "$rrdfile" lib/* |sort -r)
|
||||||
thisdate=$(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z' -d @$timestamp)
|
thisdate=$(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z' -d @$timestamp)
|
||||||
expiredate=$(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z' -d '+1 minute')
|
expiredate=$(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z' -d '+1 minute')
|
||||||
if [[ $thisdate == $HTTP_IF_MODIFIED_SINCE ]]
|
if [[ $thisdate == $HTTP_IF_MODIFIED_SINCE ]]
|
||||||
|
|||||||
59
settings
59
settings
@ -39,36 +39,35 @@ start=$default_start
|
|||||||
end=$default_end
|
end=$default_end
|
||||||
prevperiod=$default_prevperiod
|
prevperiod=$default_prevperiod
|
||||||
|
|
||||||
uinames=(
|
declare -A uinames=(
|
||||||
AP
|
[AP]=AP
|
||||||
"Unique Portals Visited"
|
[Explorer]="Unique Portals Visited"
|
||||||
"Portals Discovered"
|
[Seer]="Portals Discovered"
|
||||||
"XM Collected"
|
[XM]="XM Collected"
|
||||||
"Distance Walked"
|
[Walked]="Distance Walked"
|
||||||
"Resonators Deployed"
|
[Builder]="Resonators Deployed"
|
||||||
"Links Created"
|
[Connector]="Links Created"
|
||||||
"Control Fields Created"
|
[Mind_Controller]="Control Fields Created"
|
||||||
"Mind Units Captured"
|
[MU]="Mind Units Captured"
|
||||||
"Longest Link Ever Created"
|
[Longest_Link]="Longest Link Ever Created"
|
||||||
"Largest Control Field"
|
[Largest_Field]="Largest Control Field"
|
||||||
"XM Recharged"
|
[Recharger]="XM Recharged"
|
||||||
"Portals Captured"
|
[Liberator]="Portals Captured"
|
||||||
"Unique Portals Captured"
|
[Pioneer]="Unique Portals Captured"
|
||||||
"Mods Deployed"
|
[Engineer]="Mods Deployed"
|
||||||
"Resonators Destroyed"
|
[Purifier]="Resonators Destroyed"
|
||||||
"Portals Neutralized"
|
[Neutralized]="Portals Neutralized"
|
||||||
"Enemy Links Destroyed"
|
[Links_Destroyed]="Enemy Links Destroyed"
|
||||||
"Enemy Control Fields Destroyed"
|
[Fields_Destroyed]="Enemy Control Fields Destroyed"
|
||||||
"Max Time Portal Held"
|
[Guardian]="Max Time Portal Held"
|
||||||
"Max Time Link Maintained"
|
[Link_Maintained]="Max Time Link Maintained"
|
||||||
"Max Link Length x Days"
|
[Link_Length_x_Days]="Max Link Length x Days"
|
||||||
"Max Time Field Held"
|
[Field_Held]="Max Time Field Held"
|
||||||
"Largest Field MUs x Days"
|
[Field_x_Days]="Largest Field MUs x Days"
|
||||||
"Unique missions completed"
|
[Mercenary]="Unique missions completed"
|
||||||
Hacks
|
[Hacker]=Hacks
|
||||||
"Glyph Hack Points"
|
[Translator]="Glyph Hack Points"
|
||||||
"Agents Recruited"
|
[Recruiter]="Agents Recruited"
|
||||||
"Consecutive Days Hacking"
|
|
||||||
)
|
)
|
||||||
dsnames=(
|
dsnames=(
|
||||||
AP
|
AP
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user