diff options
Diffstat (limited to 'ogcp')
-rw-r--r-- | ogcp/templates/dashboard.html | 65 | ||||
-rw-r--r-- | ogcp/views.py | 3 |
2 files changed, 17 insertions, 51 deletions
diff --git a/ogcp/templates/dashboard.html b/ogcp/templates/dashboard.html index 38dbafd..257cfe3 100644 --- a/ogcp/templates/dashboard.html +++ b/ogcp/templates/dashboard.html @@ -4,6 +4,7 @@ {% block content %} +<p class="text-left">Last update: {{ now }}</p> <div class="row"> <div class="card col-12"> <table class="table"> @@ -82,48 +83,6 @@ <div class="tab-pane {% if loop.first %}show active{% endif %}" id="{{ id }}" role="tabpanel"> <div class="row"> - <div class="col-{{ colsize }}"> - <ul class="list-group list-group-horizontal"> - <li class="list-group-item w-50"> - {{ _('Date') }} - </li> - <li class="list-group-item w-50"> - <p class="card-text">{{ time_dict['now'] }}</p> - </li> - </ul> - <ul class="list-group list-group-horizontal"> - <li class="list-group-item w-50"> - {{ _('Uptime') }} - </li> - <li class="list-group-item w-50"> - <p class="card-text">{{ time_dict['boot'] }}</p> - </li> - </ul> - <ul class="list-group list-group-horizontal"> - <li class="list-group-item w-50"> - {{ _('ogServer uptime') }} - </li> - <li class="list-group-item w-50"> - <p class="card-text">{{ time_dict['start'] }}</p> - </li> - </ul> - <ul class="list-group list-group-horizontal"> - <li class="list-group-item w-50"> - {{ _('Connected clients (ogClient)') }} - </li> - <li class="list-group-item w-50"> - <p class="card-text">{{ server.clients | length }}</p> - </li> - </ul> - <ul class="list-group list-group-horizontal"> - <li class="list-group-item w-50"> - {{ _('Number of images') }} - </li> - <li class="list-group-item w-50"> - <p class="card-text">{{ images | length }}</p> - </li> - </ul> - </div> <!-- disk stats --> <div class="col-{{ colsize }}"> @@ -263,14 +222,20 @@ {{ _('ogLive images') }} </div> <ul class="list-group"> - {% for oglive in oglive_list['oglive'] %} - <li class="list-group-item"> - {{ oglive['directory'] }} - {% if loop.index0 == oglive_list['default'] %} - ({{ _('default') }}) - {% endif %} - </li> - {% endfor %} + {% if oglive_list %} + {% for oglive in oglive_list['oglive'] %} + <li class="list-group-item"> + {{ oglive['directory'] }} + {% if loop.index0 == oglive_list['default'] %} + ({{ _('default') }}) + {% endif %} + </li> + {% endfor %} + {% else %} + <li class="list-group-item"> + No ogLive images available + </li> + {% endif %} </ul> </div> </div> diff --git a/ogcp/views.py b/ogcp/views.py index ba9f1a3..db56169 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -380,7 +380,8 @@ def index(): server_id = i['server'].id dashboard_servers[server_id]['clients'] = i['json']['clients'] - return render_template('dashboard.html', servers=dashboard_servers, colsize="6") + now = timestamp.strftime('%Y-%m-%d %H:%M:%S') + return render_template('dashboard.html', servers=dashboard_servers, now=now, colsize="6") @app.route('/login', methods=['GET', 'POST']) def login(): |