mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-10 13:49:32 +01:00
Changed the reload mechanism, moved the shutdown header to templates.py
This commit is contained in:
@@ -8,6 +8,18 @@ _header = '''
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">'''
|
||||
|
||||
_shutdownheader = '''
|
||||
<html>
|
||||
<head>
|
||||
<title>Headphones</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css" />
|
||||
<link rel="icon" type="image/x-icon" href="images/favicon.ico" />
|
||||
<link rel="apple-touch-icon" href="images/headphoneslogo.png" />
|
||||
<meta http-equiv="refresh" content="%s;url=home"></head>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">'''
|
||||
|
||||
_logobar = '''
|
||||
<div class="logo"><a href="home"><img src="images/headphoneslogo.png" border="0">headphones<a></div>
|
||||
|
||||
@@ -628,23 +628,26 @@ class WebInterface(object):
|
||||
def shutdown(self):
|
||||
logger.info(u"Headphones is shutting down...")
|
||||
threading.Timer(2, headphones.shutdown).start()
|
||||
return '''<head></head>
|
||||
Shutting Down Headphones....'''
|
||||
page = [templates._shutdownheader % 10]
|
||||
page.append('Shutting down Headphones...')
|
||||
return page
|
||||
|
||||
shutdown.exposed = True
|
||||
|
||||
def restart(self):
|
||||
logger.info(u"Headphones is restarting...")
|
||||
threading.Timer(2, headphones.shutdown, [True]).start()
|
||||
return '''<head><meta http-equiv="refresh" content="20;url=home"></head>
|
||||
Restarting Headphones....'''
|
||||
page = [templates._shutdownheader % 20]
|
||||
page.append('Restarting Headphones...')
|
||||
return page
|
||||
|
||||
restart.exposed = True
|
||||
|
||||
def update(self):
|
||||
logger.info('Headphones is updating...')
|
||||
threading.Timer(2, headphones.shutdown, [True, True]).start()
|
||||
return '''<head><meta http-equiv="refresh" content="60;url=home"></head>
|
||||
Updating Headphones....'''
|
||||
page = [templates._shutdownheader % 60]
|
||||
page.append('Updating Headphones...')
|
||||
return page
|
||||
|
||||
update.exposed = True
|
||||
Reference in New Issue
Block a user