updated CSS
This commit is contained in:
@@ -67,7 +67,7 @@ def get_logs():
|
|||||||
|
|
||||||
@app.route('/cleanup', methods=['DELETE'])
|
@app.route('/cleanup', methods=['DELETE'])
|
||||||
def cleanup_logs():
|
def cleanup_logs():
|
||||||
cutoff_date = datetime.utcnow() - timedelta(hours=24)
|
cutoff_date = datetime.utcnow() - timedelta(hours=app.config.get('CLEANUP_TIME', 24))
|
||||||
Log.query.filter(Log.timestamp < cutoff_date).delete()
|
Log.query.filter(Log.timestamp < cutoff_date).delete()
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return jsonify({'status': 'success', 'message': 'Old logs deleted'})
|
return jsonify({'status': 'success', 'message': 'Old logs deleted'})
|
||||||
@@ -138,7 +138,8 @@ def control_relay(hostname, relay, action):
|
|||||||
|
|
||||||
@app.route('/settings', methods=['GET'])
|
@app.route('/settings', methods=['GET'])
|
||||||
def settings():
|
def settings():
|
||||||
return render_template('settings.html')
|
cleanup_time = app.config.get('CLEANUP_TIME', 24)
|
||||||
|
return render_template('settings.html', cleanup_time=cleanup_time)
|
||||||
|
|
||||||
@app.route('/set_cleanup_time', methods=['POST'])
|
@app.route('/set_cleanup_time', methods=['POST'])
|
||||||
def set_cleanup_time():
|
def set_cleanup_time():
|
||||||
@@ -150,6 +151,15 @@ def set_cleanup_time():
|
|||||||
flash('Invalid cleanup time!', 'danger')
|
flash('Invalid cleanup time!', 'danger')
|
||||||
return redirect(url_for('settings'))
|
return redirect(url_for('settings'))
|
||||||
|
|
||||||
|
@app.route('/run_cleanup_now', methods=['POST'])
|
||||||
|
def run_cleanup_now():
|
||||||
|
with app.app_context():
|
||||||
|
cutoff_date = datetime.utcnow() - timedelta(hours=app.config.get('CLEANUP_TIME', 24))
|
||||||
|
Log.query.filter(Log.timestamp < cutoff_date).delete()
|
||||||
|
db.session.commit()
|
||||||
|
flash('Cleanup executed successfully!', 'success')
|
||||||
|
return redirect(url_for('settings'))
|
||||||
|
|
||||||
def post_action_to_server(hostname, action):
|
def post_action_to_server(hostname, action):
|
||||||
url = "http://your-server-url.com/action"
|
url = "http://your-server-url.com/action"
|
||||||
payload = {
|
payload = {
|
||||||
|
|||||||
Binary file not shown.
@@ -8,7 +8,7 @@
|
|||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: #343a40;
|
background-color: #343a40;
|
||||||
color: #050505;
|
color: #f8f9fa;
|
||||||
}
|
}
|
||||||
.card {
|
.card {
|
||||||
background-color: #495057;
|
background-color: #495057;
|
||||||
@@ -25,6 +25,13 @@
|
|||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
color: #ced4da;
|
color: #ced4da;
|
||||||
}
|
}
|
||||||
|
.list-group-item {
|
||||||
|
background-color: #495057;
|
||||||
|
color: #f8f9fa;
|
||||||
|
}
|
||||||
|
.list-group-item .badge {
|
||||||
|
color: #f8f9fa;
|
||||||
|
}
|
||||||
.status-online {
|
.status-online {
|
||||||
color: #28a745;
|
color: #28a745;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -41,6 +48,22 @@
|
|||||||
background-color: #0056b3;
|
background-color: #0056b3;
|
||||||
border-color: #004085;
|
border-color: #004085;
|
||||||
}
|
}
|
||||||
|
.btn-success {
|
||||||
|
background-color: #28a745;
|
||||||
|
border-color: #28a745;
|
||||||
|
}
|
||||||
|
.btn-success:hover {
|
||||||
|
background-color: #218838;
|
||||||
|
border-color: #1e7e34;
|
||||||
|
}
|
||||||
|
.btn-danger {
|
||||||
|
background-color: #dc3545;
|
||||||
|
border-color: #dc3545;
|
||||||
|
}
|
||||||
|
.btn-danger:hover {
|
||||||
|
background-color: #c82333;
|
||||||
|
border-color: #bd2130;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Reference in New Issue
Block a user