mirror of
https://github.com/vale981/dirkules
synced 2025-03-06 01:41:38 -05:00
some ui improvements
This commit is contained in:
parent
92d6fa244c
commit
91ca317924
4 changed files with 53 additions and 63 deletions
|
@ -83,7 +83,7 @@ dictConfig({
|
||||||
'formatter': 'telegram',
|
'formatter': 'telegram',
|
||||||
'token': TOKEN,
|
'token': TOKEN,
|
||||||
'chat_id': CHAT_ID,
|
'chat_id': CHAT_ID,
|
||||||
'level': 'WARNING',
|
'level': 'ERROR',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'root': {
|
'root': {
|
||||||
|
|
|
@ -19,9 +19,8 @@ def create_cleaning_obj(jobname, path, active):
|
||||||
|
|
||||||
def get_pool_health(drive_list):
|
def get_pool_health(drive_list):
|
||||||
drive_split = drive_list.split(",")
|
drive_split = drive_list.split(",")
|
||||||
health = True
|
|
||||||
for drive in drive_split:
|
for drive in drive_split:
|
||||||
db_drive = db.session.query(Drive).filter(Drive.name == drive).scalar()
|
db_drive = db.session.query(Drive).filter(Drive.name == drive).scalar()
|
||||||
if db_drive.smart is not True:
|
if db_drive.smart is not True:
|
||||||
health = False
|
return False
|
||||||
return health
|
return True
|
||||||
|
|
|
@ -6,15 +6,6 @@
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="topspacer"></div>
|
<div class="topspacer"></div>
|
||||||
<div class="ui container">
|
<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="infobox">
|
||||||
<div class="ui info message">
|
<div class="ui info message">
|
||||||
<i class="close icon"></i>
|
<i class="close icon"></i>
|
||||||
|
@ -27,8 +18,12 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui segment">
|
<a href="{{ url_for('add_pool') }}">
|
||||||
<table class="ui very basic celled table">
|
<div class="ui primary labeled icon button">
|
||||||
|
<i class="plus icon"></i> Neuen Pool erstellen
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
<table class="ui celled table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
|
@ -72,5 +67,4 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -10,12 +10,7 @@ from dirkules.config import staticDir
|
||||||
|
|
||||||
@app.errorhandler(404)
|
@app.errorhandler(404)
|
||||||
def page_not_found(e):
|
def page_not_found(e):
|
||||||
return render_template('404.html', error=str(e)), 404
|
return render_template('404.html', error=str(e))
|
||||||
|
|
||||||
|
|
||||||
@app.route('/404', methods=['GET'])
|
|
||||||
def test_404():
|
|
||||||
abort(404, description="Resource not found")
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/', methods=['GET'])
|
@app.route('/', methods=['GET'])
|
||||||
|
@ -38,6 +33,8 @@ def pools():
|
||||||
@app.route('/pool/<pool>', methods=['GET'])
|
@app.route('/pool/<pool>', methods=['GET'])
|
||||||
def pool(pool):
|
def pool(pool):
|
||||||
db_pool = Pool.query.get(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)
|
pool_health = viewManager.get_pool_health(db_pool.drives)
|
||||||
return render_template('pool.html', pool=db_pool, health=pool_health)
|
return render_template('pool.html', pool=db_pool, health=pool_health)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue