some ui improvements

This commit is contained in:
Daniel 2019-09-12 19:02:06 +02:00
parent 92d6fa244c
commit 91ca317924
4 changed files with 53 additions and 63 deletions

View file

@ -83,7 +83,7 @@ dictConfig({
'formatter': 'telegram',
'token': TOKEN,
'chat_id': CHAT_ID,
'level': 'WARNING',
'level': 'ERROR',
}
},
'root': {

View file

@ -19,9 +19,8 @@ def create_cleaning_obj(jobname, path, active):
def get_pool_health(drive_list):
drive_split = drive_list.split(",")
health = True
for drive in drive_split:
db_drive = db.session.query(Drive).filter(Drive.name == drive).scalar()
if db_drive.smart is not True:
health = False
return health
return False
return True

View file

@ -6,15 +6,6 @@
{% block body %}
<div class="topspacer"></div>
<div class="ui container">
<h1 class="ui dividing header">Aktionen</h1>
<div class="ui container">
<a href="{{ url_for('add_pool') }}">
<div class="ui primary labeled icon button">
<i class="plus icon"></i> Neuen Pool erstellen
</div>
</a>
</div>
<h1 class="ui dividing header">Übersicht</h1>
<div class="infobox">
<div class="ui info message">
<i class="close icon"></i>
@ -27,8 +18,12 @@
</p>
</div>
</div>
<div class="ui segment">
<table class="ui very basic celled table">
<a href="{{ url_for('add_pool') }}">
<div class="ui primary labeled icon button">
<i class="plus icon"></i> Neuen Pool erstellen
</div>
</a>
<table class="ui celled table">
<thead>
<tr>
<th>Name</th>
@ -72,5 +67,4 @@
</tbody>
</table>
</div>
</div>
{% endblock %}

View file

@ -10,12 +10,7 @@ from dirkules.config import staticDir
@app.errorhandler(404)
def page_not_found(e):
return render_template('404.html', error=str(e)), 404
@app.route('/404', methods=['GET'])
def test_404():
abort(404, description="Resource not found")
return render_template('404.html', error=str(e))
@app.route('/', methods=['GET'])
@ -38,6 +33,8 @@ def pools():
@app.route('/pool/<pool>', methods=['GET'])
def pool(pool):
db_pool = Pool.query.get(pool)
if db_pool is None:
abort(404, description="Pool with ID {} could not be found.".format(pool))
pool_health = viewManager.get_pool_health(db_pool.drives)
return render_template('pool.html', pool=db_pool, health=pool_health)