diff --git a/admin/freeposte/__init__.py b/admin/freeposte/__init__.py index 96e6d564..64d8eade 100644 --- a/admin/freeposte/__init__.py +++ b/admin/freeposte/__init__.py @@ -4,6 +4,7 @@ from flask_bootstrap import Bootstrap from flask.ext import login as flask_login import os +import docker # Create application @@ -12,7 +13,8 @@ app = Flask(__name__) default_config = { 'SQLALCHEMY_DATABASE_URI': 'sqlite:////data/freeposte.db', 'SQLALCHEMY_TRACK_MODIFICATIONS': False, - 'SECRET_KEY': "changeMe", + 'SECRET_KEY': 'changeMe', + 'DOCKER_SOCKET': 'unix:///var/run/docker.sock', 'DEBUG': False } @@ -26,6 +28,9 @@ db = SQLAlchemy(app) login_manager = flask_login.LoginManager() login_manager.init_app(app) +# Connect to the Docker socket +dockercli = docker.Client(base_url=app.config['DOCKER_SOCKET']) + # Finally setup the blueprint from freeposte import admin app.register_blueprint(admin.app, url_prefix='/admin') diff --git a/admin/freeposte/admin/templates/admin/status.html b/admin/freeposte/admin/templates/admin/status.html index a500fb36..749898db 100644 --- a/admin/freeposte/admin/templates/admin/status.html +++ b/admin/freeposte/admin/templates/admin/status.html @@ -1 +1,30 @@ -{% extends "working.html" %} +{% extends "base.html" %} + +{% block title %} +Services status +{% endblock %} + +{% block box %} +
Service | +Status | +PID | +Image | +Started | +Last update | +
---|---|---|---|---|---|
{{ name }} | +{{ container['State']['Status'] }} | +{{ container['State']['Pid'] }} | +{{ container['Config']['Image'] }} | +{{ container['State']['StartedAt'] }} | +{{ container['Image']['Created'] }} + |