bug background
This commit is contained in:
+15
@@ -72,6 +72,11 @@ REMOTE_SHUTDOWN_RUNTIME_SECONDS = 5 * 60
|
|||||||
LOCAL_SHUTDOWN_RUNTIME_SECONDS = 200
|
LOCAL_SHUTDOWN_RUNTIME_SECONDS = 200
|
||||||
BATTERY_CHARGE_MEAN_SAMPLES = 10
|
BATTERY_CHARGE_MEAN_SAMPLES = 10
|
||||||
|
|
||||||
|
GRAPH_COLOR_ARGS = [
|
||||||
|
"--color", "BACK#F7F5EFFF",
|
||||||
|
"--color", "CANVAS#FFFFFFFF",
|
||||||
|
]
|
||||||
|
|
||||||
GRAPH_DIR = "/var/www/html/ups"
|
GRAPH_DIR = "/var/www/html/ups"
|
||||||
HTML_FILE = os.path.join(GRAPH_DIR, "index.html")
|
HTML_FILE = os.path.join(GRAPH_DIR, "index.html")
|
||||||
WEEKLY_HTML_FILE = os.path.join(GRAPH_DIR, "week.html")
|
WEEKLY_HTML_FILE = os.path.join(GRAPH_DIR, "week.html")
|
||||||
@@ -695,6 +700,7 @@ def graph_status():
|
|||||||
[
|
[
|
||||||
"graph",
|
"graph",
|
||||||
GRAPH_STATUS,
|
GRAPH_STATUS,
|
||||||
|
*GRAPH_COLOR_ARGS,
|
||||||
|
|
||||||
"--start",
|
"--start",
|
||||||
str(now - 90 * 86400),
|
str(now - 90 * 86400),
|
||||||
@@ -762,6 +768,7 @@ def graph_battery_1y():
|
|||||||
[
|
[
|
||||||
"graph",
|
"graph",
|
||||||
GRAPH_BATTERY_1Y,
|
GRAPH_BATTERY_1Y,
|
||||||
|
*GRAPH_COLOR_ARGS,
|
||||||
|
|
||||||
"--start",
|
"--start",
|
||||||
str(now - 365 * 86400),
|
str(now - 365 * 86400),
|
||||||
@@ -813,6 +820,7 @@ def graph_battery_5y():
|
|||||||
[
|
[
|
||||||
"graph",
|
"graph",
|
||||||
GRAPH_BATTERY_5Y,
|
GRAPH_BATTERY_5Y,
|
||||||
|
*GRAPH_COLOR_ARGS,
|
||||||
|
|
||||||
"--start",
|
"--start",
|
||||||
str(now - 5 * 365 * 86400),
|
str(now - 5 * 365 * 86400),
|
||||||
@@ -868,6 +876,7 @@ def graph_runtime_1y():
|
|||||||
[
|
[
|
||||||
"graph",
|
"graph",
|
||||||
GRAPH_RUNTIME_1Y,
|
GRAPH_RUNTIME_1Y,
|
||||||
|
*GRAPH_COLOR_ARGS,
|
||||||
|
|
||||||
"--start",
|
"--start",
|
||||||
str(now - 365 * 86400),
|
str(now - 365 * 86400),
|
||||||
@@ -919,6 +928,7 @@ def graph_runtime_5y():
|
|||||||
[
|
[
|
||||||
"graph",
|
"graph",
|
||||||
GRAPH_RUNTIME_5Y,
|
GRAPH_RUNTIME_5Y,
|
||||||
|
*GRAPH_COLOR_ARGS,
|
||||||
|
|
||||||
"--start",
|
"--start",
|
||||||
str(now - 5 * 365 * 86400),
|
str(now - 5 * 365 * 86400),
|
||||||
@@ -970,6 +980,7 @@ def graph_load():
|
|||||||
[
|
[
|
||||||
"graph",
|
"graph",
|
||||||
GRAPH_LOAD,
|
GRAPH_LOAD,
|
||||||
|
*GRAPH_COLOR_ARGS,
|
||||||
|
|
||||||
"--start",
|
"--start",
|
||||||
str(now - 90 * 86400),
|
str(now - 90 * 86400),
|
||||||
@@ -1024,6 +1035,7 @@ def graph_power_1y():
|
|||||||
[
|
[
|
||||||
"graph",
|
"graph",
|
||||||
GRAPH_POWER_1Y,
|
GRAPH_POWER_1Y,
|
||||||
|
*GRAPH_COLOR_ARGS,
|
||||||
|
|
||||||
"--start",
|
"--start",
|
||||||
str(now - 365 * 86400),
|
str(now - 365 * 86400),
|
||||||
@@ -1069,6 +1081,7 @@ def graph_power_5y():
|
|||||||
[
|
[
|
||||||
"graph",
|
"graph",
|
||||||
GRAPH_POWER_5Y,
|
GRAPH_POWER_5Y,
|
||||||
|
*GRAPH_COLOR_ARGS,
|
||||||
|
|
||||||
"--start",
|
"--start",
|
||||||
str(now - 5 * 365 * 86400),
|
str(now - 5 * 365 * 86400),
|
||||||
@@ -1116,6 +1129,7 @@ def graph_weekly_status():
|
|||||||
run_rrdtool(
|
run_rrdtool(
|
||||||
[
|
[
|
||||||
"graph", GRAPH_STATUS_1W,
|
"graph", GRAPH_STATUS_1W,
|
||||||
|
*GRAPH_COLOR_ARGS,
|
||||||
"--start", str(now - 7 * 86400),
|
"--start", str(now - 7 * 86400),
|
||||||
"--end", str(now),
|
"--end", str(now),
|
||||||
"--width", "1000",
|
"--width", "1000",
|
||||||
@@ -1153,6 +1167,7 @@ def graph_weekly_metric(
|
|||||||
now = int(time.time())
|
now = int(time.time())
|
||||||
command = [
|
command = [
|
||||||
"graph", output_file,
|
"graph", output_file,
|
||||||
|
*GRAPH_COLOR_ARGS,
|
||||||
"--start", str(now - 7 * 86400),
|
"--start", str(now - 7 * 86400),
|
||||||
"--end", str(now),
|
"--end", str(now),
|
||||||
"--width", "1000",
|
"--width", "1000",
|
||||||
|
|||||||
Reference in New Issue
Block a user