Nice exit template
This commit is contained in:
41
rc/exit.tpl
Normal file
41
rc/exit.tpl
Normal file
@@ -0,0 +1,41 @@
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
|
||||
|
||||
p.left {
|
||||
text-align: left;
|
||||
}
|
||||
p.center {
|
||||
text-align: center;
|
||||
}
|
||||
img {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
#content {
|
||||
font: 1em/1.5em 'Lato', sans-serif;
|
||||
margin: 0px auto;
|
||||
width: 275px;
|
||||
text-align: center;
|
||||
}
|
||||
#dialog {
|
||||
width: auto; height: auto;
|
||||
background: #009933;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
font-family: 'Lato', sans-serif; font-size: 17px;
|
||||
padding-right: 0.5em;
|
||||
padding-left: 0.5em;
|
||||
padding-top: 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
border:none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<title>Little Backup Box</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<div id="content">
|
||||
<div id="dialog">Command sent. You can close this page.</div>
|
||||
</div>
|
||||
8
rc/rc.py
8
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')
|
||||
|
||||
Reference in New Issue
Block a user