diff --git a/add.html b/add.html index 548955f..32871c6 100755 --- a/add.html +++ b/add.html @@ -18,33 +18,11 @@ . settings -if [ -n "$QUERY_STRING" ] -then - query_data="${QUERY_STRING//&/ -}" - exprtime='[[:alnum:]-]+' - exprgraph='[[:alpha:]_]+' - while read name value - do - case $name in - start) - [[ $value =~ $exprtime ]] && start=$value - ;; - end) - [[ $value =~ $exprtime ]] && end=$value - ;; - esac - done <<<"${query_data//=/ }" -fi - -readprevvalues() { - shift - for arg - do - prevvalues+=( "$arg" ) - done -} -readprevvalues $(rrdtool lastupdate ingress.rrd | tail -n1) +for lib in lib/* +do + source $lib +done +read_query_string cat <<-EOHTML content-type: text/xml @@ -91,7 +69,6 @@ Expires: $(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z')
| Platinum | Black | -||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - | $(printf "%'li" ${last["AP"]}) | -
- EOHTML
- for stat in ${silvers[@]}
- do
- img=${stat,,}
- cat <<-EOHTML
-
-
-
- EOHTML
- done
- cat <<-EOHTML
- |
-
- EOHTML
- for stat in ${golds[@]}
- do
- img=${stat,,}
- cat <<-EOHTML
-
-
-
- EOHTML
- done
- cat <<-EOHTML
- |
-
- EOHTML
- for stat in ${platinums[@]}
- do
- img=${stat,,}
- cat <<-EOHTML
-
-
-
- EOHTML
- done
- cat <<-EOHTML
- |
-
- EOHTML
- for stat in ${blacks[@]}
- do
- img=${stat,,}
- cat <<-EOHTML
-
-
-
- EOHTML
- done
- cat <<-EOHTML
- |
- ||||||||||||||||||||||||||||||||
| $level | " + if (( level <= curlevel )) + then + echo "|||||||||||||||||||||||||||||||||||||
| $level | " + else + echo "|||||||||||||||||||||||||||||||||||||
| $level | " + fi if (( last["AP"] >= lvl[level] )) then echo '' @@ -276,6 +140,7 @@ then echo ' | '${lvlsilver[level]}' | ' else echo "${lvlsilver[level]} ($(( silvercount - lvlsilver[level] ))) " + count=0 for id in {100..0} do [ -z "${upsilver[id]}" ] && continue @@ -296,6 +161,7 @@ then alt="$stat silver" /> EOHTML + (( count++ == lvlsilver[level] - silvercount )) && break 2 done done echo ' | '
@@ -305,6 +171,7 @@ then
echo ''${lvlgold[level]}' | ' else echo "${lvlgold[level]} ($(( goldcount - lvlgold[level] ))) " + count=0 for id in {100..0} do [ -z "${upgold[id]}" ] && continue @@ -325,6 +192,7 @@ then alt="$stat gold" /> EOHTML + (( count++ == lvlgold[level] - goldcount )) && break 2 done done echo ' | '
@@ -334,6 +202,7 @@ then
echo ''${lvlplatinum[level]}' | ' else echo "${lvlplatinum[level]} ($(( platinumcount - lvlplatinum[level] ))) " + count=0 for id in {100..0} do [ -z "${upplatinum[id]}" ] && continue @@ -354,6 +223,7 @@ then alt="$stat platinum" /> EOHTML + (( count++ == lvlplatinum[level] - platinumcount )) && break 2 done done echo ' | '
@@ -363,6 +233,7 @@ then
echo ''${lvlblack[level]}' | ' else echo "${lvlblack[level]} ($(( blackcount - lvlblack[level] ))) " + count=0 for id in {100..0} do [ -z "${upblack[id]}" ] && continue @@ -383,6 +254,7 @@ then alt="$stat black" /> EOHTML + (( count++ == lvlblack[level] - blackcount )) && break 2 done done echo ' | '
@@ -402,7 +274,7 @@ then
+
EOHTML
if (( show_all ))
diff --git a/ingrrd.css b/ingrrd.css
new file mode 100644
index 0000000..5b3d2d0
--- /dev/null
+++ b/ingrrd.css
@@ -0,0 +1,131 @@
+/*
+ * IngRRD (https://forge.riquer.fr/p/ingrrd/)
+ * Copyright (C) 2014 Vincent Riquer
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see
| |||||||||||||||||||||||||||