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 %} +
Key | +Value | +||
---|---|---|---|
{{key}} | +{{ repr(value) }} | + {% else %} +{{key}} | +{{value}} | + {% endif %} +