From 940b5cab0623fa43b855e7d615efb96ba4d07504 Mon Sep 17 00:00:00 2001 From: Dmitri Popov Date: Mon, 9 Apr 2018 15:48:36 +0200 Subject: [PATCH] Nice exit template --- rc/exit.tpl | 41 +++++++++++++++++++++++++++++++++++++++++ rc/rc.py | 8 ++++---- 2 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 rc/exit.tpl diff --git a/rc/exit.tpl b/rc/exit.tpl new file mode 100644 index 0000000..be182f5 --- /dev/null +++ b/rc/exit.tpl @@ -0,0 +1,41 @@ + + + + +Little Backup Box + +
+
Command sent. You can close this page.
+
diff --git a/rc/rc.py b/rc/rc.py index 5152b0f..5b5e99a 100755 --- a/rc/rc.py +++ b/rc/rc.py @@ -24,16 +24,16 @@ def remote_control(): if (request.POST.get("cardbackup")): process = subprocess.Popen("sudo /home/pi/little-backup-box/scripts/card-backup.sh", shell=True) - return ('Backup started. You can close this page.') + return template('exit.tpl') if (request.POST.get("camerabackup")): process = subprocess.Popen("sudo /home/pi/little-backup-box/scripts/camera-backup.sh", shell=True) - return ('Backup started. You can close this page.') + return template('exit.tpl') if (request.POST.get("devicebackup")): process = subprocess.Popen("sudo /home/pi/little-backup-box/scripts/device-backup.sh", shell=True) - return ('Transfer started. You can close this page.') + return template('exit.tpl') if (request.POST.get("shutdown")): process = subprocess.Popen("sudo shutdown -h now", shell=True) - return ('Shutdown request sent. You can close this page.') + return template('exit.tpl') return template('rc.tpl', freespace_home=free_home) @route('/static/:path#.+#', name='static')