mirror of
https://github.com/rembo10/headphones.git
synced 2026-04-05 04:29:25 +01:00
Merge pull request #1787 from multikatt/cleanup
Creating method of shutdown actions
This commit is contained in:
@@ -1393,25 +1393,22 @@ class WebInterface(object):
|
||||
|
||||
configUpdate.exposed = True
|
||||
|
||||
def shutdown(self):
|
||||
headphones.SIGNAL = 'shutdown'
|
||||
message = 'Shutting Down...'
|
||||
return serve_template(templatename="shutdown.html", title="Shutting Down", message=message, timer=15)
|
||||
return page
|
||||
def do_state_change(self, signal, title, timer):
|
||||
headphones.SIGNAL = signal
|
||||
message = title + '...'
|
||||
return serve_template(templatename="shutdown.html", title=title,
|
||||
message=message, timer=timer)
|
||||
|
||||
def shutdown(self):
|
||||
return self.do_state_change('shutdown', 'Shutting Down', 15)
|
||||
shutdown.exposed = True
|
||||
|
||||
def restart(self):
|
||||
headphones.SIGNAL = 'restart'
|
||||
message = 'Restarting...'
|
||||
return serve_template(templatename="shutdown.html", title="Restarting", message=message, timer=30)
|
||||
return self.do_state_change('restart', 'Restarting', 30)
|
||||
restart.exposed = True
|
||||
|
||||
def update(self):
|
||||
headphones.SIGNAL = 'update'
|
||||
message = 'Updating...'
|
||||
return serve_template(templatename="shutdown.html", title="Updating", message=message, timer=120)
|
||||
return page
|
||||
return self.do_state_change('update', 'Updating', 120)
|
||||
update.exposed = True
|
||||
|
||||
def extras(self):
|
||||
|
||||
Reference in New Issue
Block a user