Manual Export Backup option in Report page
This commit is contained in:
parent
059e3915ed
commit
09a63f78ba
6
app.py
6
app.py
@ -1,4 +1,4 @@
|
|||||||
from flask import Flask, render_template, request, jsonify
|
from flask import Flask, render_template, request, jsonify, send_from_directory
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -46,6 +46,10 @@ def update_data():
|
|||||||
save_data(data)
|
save_data(data)
|
||||||
return jsonify({"status": "success"})
|
return jsonify({"status": "success"})
|
||||||
|
|
||||||
|
@app.route('/export-data')
|
||||||
|
def export_data():
|
||||||
|
return send_from_directory(directory='data', path='attendance_data.json', as_attachment=True)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import os
|
import os
|
||||||
port = int(os.environ.get('PORT', 5000))
|
port = int(os.environ.get('PORT', 5000))
|
||||||
|
|||||||
@ -39,7 +39,10 @@
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="/" style="margin-bottom: 2em; display: inline-block;">Back to Attendance</a>
|
<div style="display: flex; gap: 1em; align-items: center; margin-bottom: 2em;">
|
||||||
|
<a href="/" style="display: inline-block;">Back to Attendance</a>
|
||||||
|
<a href="/export-data" download style="display: inline-block;">Export data</a>
|
||||||
|
</div>
|
||||||
<div class="charts-flex">
|
<div class="charts-flex">
|
||||||
<div class="chart-container large-chart">
|
<div class="chart-container large-chart">
|
||||||
<h2>Attendance Count per Player</h2>
|
<h2>Attendance Count per Player</h2>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user