S allius/issue401 (#402)

* add route for log file deletion

* add modal for senity check before file deletion

* add trash icon which unhide the modal

* add more translations

* increase test coverage

* cleanup
This commit is contained in:
Stefan Allius
2025-05-02 19:47:16 +02:00
committed by GitHub
parent aadbe6855e
commit 41515f4be3
5 changed files with 84 additions and 4 deletions

View File

@@ -50,3 +50,12 @@ async def send(file):
directory=Config.get_log_path(),
file_name=secure_filename(file),
as_attachment=True)
@web.route('/del-file/<file>', methods=['DELETE'])
async def delete(file):
try:
os.remove(Config.get_log_path() + secure_filename(file))
except OSError:
return 'File not found', 404
return '', 204