Commit 03f09863 authored by Nicolas Wavrant's avatar Nicolas Wavrant

stack-monitor: pure css applied to cgi scripts

parent 8857c98b
......@@ -108,7 +108,7 @@ logfile = $${directory:log}/crond.log
recipe = hexagonit.recipe.download
url = https://github.com/Sebatyne/staticForMonitoring/blob/master/static-files.tar.gz?raw=true
download-only = true
#md5sum =
md5sum = e98585b85634de48240b2c215e946769
filename = static-files.tar.gz
mode = 0644
......
......@@ -8,7 +8,10 @@ import os
cgitb.enable()
form = cgi.FieldStorage()
print "<html><body>"
print "<html><head>"
print "<link rel=\"stylesheet\" href=\"pure-min.css\">"
print "<link rel=\"stylesheet\" href=\"/style.css\">"
print "</head><body>"
config_file = "{{ config_cfg }}"
......@@ -26,18 +29,25 @@ with open(config_file, 'w') as file:
parser.write(file)
print "<h1>Values that can be defined by the user :</h1>"
print "<form action=\"/index.cgi\" method=\"post\">"
print "<form action=\"/index.cgi\" method=\"post\" class=\"pure-form-aligned\">"
print "<input type=\"hidden\" name=\"posting-script\" value=\"{{ pwd }}/{{ this_file }}\">"
for option in parser.options("public"):
print "%s : <input type=\"text\" name=\"%s\" \
value=\"%s\"><br>"% (option, option, parser.get('public', option))
print "<input type=\"submit\" value=\"Save\"></form>"
print "<h1>Other values :</h1>"
print "<div class=\"pure-control-group\">"
print "<label for=\"=%s\">%s</label>"%(option, option)
print "<input type=\"text\" name=\"%s\" value=\"%s\" readonly>"%(option, parser.get('public', option))
print "</div>"
print "<div class=\"pure-controls\"><button type=\"submit\" class=\"pure-button \
pure-button-primary\">Save</button></div></form>"
print "<br><h1>Other values :</h1>"
print "<form class=\"pure-form-aligned\">"
for section in parser.sections():
if section != 'public':
for option in parser.options(section):
print "<b>%s</b> : value=\"%s\"<br>" % (option,
parser.get(section, option))
print "<div class=\"pure-control-group\">"
print "<label for=\"=%s\">%s</label>"%(option, option)
print "<input type=\"text\" name=\"%s\" value=\"%s\">"%(option, parser.get(section, option))
print "</div>"
print "</form>"
print "</body></html>"
......@@ -8,7 +8,10 @@ cgitb.enable(display=0, logdir="/tmp/cgi.log")
json_file = "{{ json_file }}"
result = json.load(open(json_file))
print "<html><body>"
print "<html><head>"
print "<link rel=\"stylesheet\" href=\"pure-min.css\">"
print "<link rel=\"stylesheet\" href=\"/style.css\">"
print "</head><body>"
print "<h1>Monitoring :</h1>"
print "<p><em>Last time of monitoring process : %s</em></p>" % (result['datetime'])
del result['datetime']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment