%
# Note that this file is not a valid *.html file!
# It is intended to be a bottlepy - style template
# used for the scripting part of TheOnionBox!
VERSION_STATUS_COLORS = {"new": "blue", "new in series": "blue", "obsolete": "red", "recommended": "green",
"old": "red", "unrecommended": "red", "unknown": "cyan"}
tor = get('tor')
# This is Copy/Paste from ARM!
# see dir-spec.txt for description of FLAGS
FLAG_LABELS = {"Authority": "default", "BadExit": "danger", "BadDirectory": "danger", "Exit": "warning",
"Fast": "primary", "Guard": "primary", "HSDir": "info", "Named": "primary",
"Stable": "primary", "Running": "success", "Unnamed": "warning", "Valid": "success",
"V2Dir": "default", "V3Dir": "default"}
FLAG_COLORS = {"Authority": "black", "BadExit": "red", "BadDirectory": "red", "Exit": "orange",
"Fast": "blue", "Guard": "blue", "HSDir": "deepskyblue", "Named": "blue",
"Stable": "blue", "Running": "green", "Unnamed": "red", "Valid": "green",
"V2Dir": "black", "V3Dir": "black", "Tor Communication Error": "red", 'none': 'cyan',
"unknown": "black"}
def flags():
flags = []
try:
flags = tor.get_flags()
except:
pass
end
fs = ''
for flag in flags:
if fs is not '':
fs += ' '
end
fs += '' + flag + '
'
end
if (len(flags) == 1) and (flags[0] == 'none'):
a_o = get('accounting_on')
if a_o == True:
a_s = get('accounting_stats')
if a_s.status != 'awake':
fs += ' | could be due to '
fs += 'Hibernation Status'
fs += ' ' + a_s.status + '
'
end
end
end
return fs
end
%>
<%
tvs = tor.get_version_short()
%>
{{!header_row('Box', 'Control Center', 'control')}}
Search
{{node['name']}}