1
0
Fork 0
Browse Source

add tim e of request info. to home.

stable
Craig Oates 4 years ago
parent
commit
ba85b560ea
  1. 5
      app/app.py
  2. 9
      app/static/styles/main.css
  3. 2
      app/swagger.yml
  4. 3
      app/templates/home.html

5
app/app.py

@ -1,4 +1,5 @@
from flask import Flask, render_template from flask import Flask, render_template
from datetime import datetime
import connexion import connexion
import config import config
from services import get_services from services import get_services
@ -12,8 +13,8 @@ app.add_api("swagger.yml")
@app.route("/") @app.route("/")
def home (): def home ():
data = get_services.get_latest_status_for_all_devices() data = get_services.get_latest_status_for_all_devices()
print(data) time = datetime.now()
return render_template("home.html", data=data) return render_template("home.html", data=data, time=time)
@app.route("/robots.txt") @app.route("/robots.txt")
@app.route("/robots") @app.route("/robots")

9
app/static/styles/main.css

@ -40,6 +40,7 @@ main div .status-bar {
padding: 20px; padding: 20px;
border-top: 2px solid #424242; border-top: 2px solid #424242;
border-bottom: 2px solid #424242; border-bottom: 2px solid #424242;
margin: 5px 0;
} }
.meter { .meter {
@ -60,7 +61,11 @@ main div .status-bar .meter img {
} }
main div h2 { main div .server-header,
font-size: 16px; main div .server-time {
margin: 0;
} }
main div .server-time {
font-size: 12px;
}

2
app/swagger.yml

@ -2,7 +2,7 @@ swagger: "2.0"
info: info:
description: >- description: >-
The 'Return to Ritherdon' project, by Nicola Ellis, is a two year art residency at Ritherdon & Co Ltd, a manufacturer of metal enclosures based in Darwen, Lancashire U.K. This website is part of the many outcomes produced throughout the duration of project. The 'Return to Ritherdon' project, by Nicola Ellis, is a two year art residency at Ritherdon & Co Ltd, a manufacturer of metal enclosures based in Darwen, Lancashire U.K. This website is part of the many outcomes produced throughout the duration of project.
version: "1.0.0 - Alpha" version: "1.0.0 - Beta"
title: Return to Ritherdon Project A.P.I. title: Return to Ritherdon Project A.P.I.
consumes: consumes:
- application/json - application/json

3
app/templates/home.html

@ -9,7 +9,8 @@
<h1>Return to Ritherdon Project</h1> <h1>Return to Ritherdon Project</h1>
</div> </div>
<h2>Artwork Status</h2> <h2 class="server-header">Artwork Status</h2>
<p class="server-time">Time on Server: {{ time }}</p>
<div class="status-bar"> <div class="status-bar">