diff --git a/README.md b/README.md index 3863662..af03832 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ # docker_flask + +## Run + `set FLASK_APP=index.py + set FLASK_DEBUG=1 + set + flask run -p 5001` \ No newline at end of file diff --git a/index.py b/index.py index 01b7ced..c0f03d4 100644 --- a/index.py +++ b/index.py @@ -5,6 +5,7 @@ import re import unidecode import datetime import base64 +import json # # from flask_wtf import FlaskForm @@ -184,7 +185,12 @@ def containers_all_action(client_name): def container_action(client_name, short_id=None): if client_name in clients: container = clients[client_name].containers.get(short_id) - return render_template('container.html', container=container, client_name=client_name) + # parsed = json.loads(container.attrs) + + # print() + + return render_template('container.html', container=container, client_name=client_name, + container_attributes=json.dumps(container.attrs, indent=4)) else: flash('Client name \'%s\' not found' % client_name) return redirect(url_for('index')) @@ -380,5 +386,6 @@ def slugify(text): app.secret_key = b'\xd7:o\\\xaayFe\x1ey\x08m9\xe4\xbc!\xee\x0e>\xd1Z\x99-\xbb' +# http://flask.pocoo.org/snippets/133/ @TODO if __name__ == "__main__": - app.run(host="0.0.0.0", port=5002, debug=True, threaded=True) + app.run(host="0.0.0.0", port=5001, debug=True, threaded=True) diff --git a/static/style.css b/static/style.css index 58bc3e3..24267a8 100644 --- a/static/style.css +++ b/static/style.css @@ -110,4 +110,18 @@ padding: 5px 15px; .details__entrypoint { display: inline-block; width: 210px; } .details__image { display: inline-block; } -.details__more-info {display: none; } \ No newline at end of file +.details__more-info { margin: 5px 10px; } +.more-info__ports { } +.more-info__ports--line { +display: list-item; +list-style-position: inside; +margin: 8px 8px; +} + +.container_attribute { + +} +.container_attribute-details { + white-space: pre; + line-height: 1.1em; +} \ No newline at end of file diff --git a/templates/container.html b/templates/container.html index 69af4fa..b906315 100644 --- a/templates/container.html +++ b/templates/container.html @@ -1,17 +1,17 @@ {% extends "layout.html" %} {% block body %} -
-{{ container.attrs|pprint }}
-
-
+