diff --git a/pyfarm/agent/http/resource.py b/pyfarm/agent/http/resource.py index 07757006..aa58be0c 100644 --- a/pyfarm/agent/http/resource.py +++ b/pyfarm/agent/http/resource.py @@ -83,7 +83,8 @@ def __init__(self): loader.environment.globals.update( hostname=lambda: config["hostname"], agent_id=lambda: config["agent-id"], - state=lambda: config["state"]) + state=lambda: config["state"], + repr=repr) # Template is only required for subclasses. This class can serve # http requests but when we build the http server that's not how diff --git a/pyfarm/agent/http/system.py b/pyfarm/agent/http/system.py index 43f1351e..2ace633b 100644 --- a/pyfarm/agent/http/system.py +++ b/pyfarm/agent/http/system.py @@ -131,6 +131,7 @@ def cb(content): return NOT_DONE_YET +# TODO: add form to edit values class Configuration(Resource): TEMPLATE = "configuration.html" diff --git a/pyfarm/agent/http/templates/configuration.html b/pyfarm/agent/http/templates/configuration.html new file mode 100644 index 00000000..6bbb65a1 --- /dev/null +++ b/pyfarm/agent/http/templates/configuration.html @@ -0,0 +1,34 @@ +{% extends "layout.html" %} +{% block title %}Information{% endblock %} +{% block head %} + {{ super() }} + +{% endblock %} +{% block content %} +

Current Configuration Table

+ + + + + + + + + {% for key, value, css_class in configuration %} + + {% if css_class %} + + + {% else %} + + + {% endif %} + + {% endfor %} + +
KeyValue
{{key}}{{ repr(value) }}{{key}}{{value}}
+{% endblock %} \ No newline at end of file diff --git a/pyfarm/agent/http/templates/layout.html b/pyfarm/agent/http/templates/layout.html index 9292e862..d087bf0e 100644 --- a/pyfarm/agent/http/templates/layout.html +++ b/pyfarm/agent/http/templates/layout.html @@ -22,7 +22,6 @@ {% endblock %} -