1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Fixed WebUI issue displaying main index home page

This commit is contained in:
echel0n 2014-12-10 05:47:35 -08:00
parent 4cb4d1496e
commit 5fa67936aa
2 changed files with 21 additions and 19 deletions

View File

@ -235,8 +235,11 @@ class WebHandler(BaseHandler):
def get(self, route, *args, **kwargs): def get(self, route, *args, **kwargs):
try: try:
route = route.strip('/') or 'index' route = route.strip('/') or 'index'
# get route
method = getattr(self, route) method = getattr(self, route)
# process request async
self.async_worker(method, self.async_done) self.async_worker(method, self.async_done)
except: except:
raise HTTPError(404) raise HTTPError(404)
@ -616,7 +619,7 @@ class WebRoot(WebHandler):
return ical return ical
@route('/ui/(.*)(/?)') @route('/ui(.*)(/?)')
class UI(WebRoot): class UI(WebRoot):
def add_message(self, *args, **kwargs): def add_message(self, *args, **kwargs):
ui.notifications.message('Test 1', 'This is test number 1') ui.notifications.message('Test 1', 'This is test number 1')
@ -636,7 +639,7 @@ class UI(WebRoot):
return json.dumps(messages) return json.dumps(messages)
@route('/browser/(.*)(/?)') @route('/browser(.*)(/?)')
class WebFileBrowser(WebRoot): class WebFileBrowser(WebRoot):
def index(self, path='', includeFiles=False, *args, **kwargs): def index(self, path='', includeFiles=False, *args, **kwargs):
self.set_header("Content-Type", "application/json") self.set_header("Content-Type", "application/json")
@ -650,7 +653,7 @@ class WebFileBrowser(WebRoot):
return json.dumps(paths) return json.dumps(paths)
@route('/home/(.*)(/?)') @route('/home(.*)(/?)')
class Home(WebRoot): class Home(WebRoot):
def HomeMenu(self, *args, **kwargs): def HomeMenu(self, *args, **kwargs):
menu = [ menu = [
@ -1961,7 +1964,7 @@ class Home(WebRoot):
return json.dumps({'result': 'failure'}) return json.dumps({'result': 'failure'})
@route('/home/postprocess/(.*)(/?)') @route('/home/postprocess(.*)(/?)')
class HomePostProcess(Home): class HomePostProcess(Home):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
@ -1999,7 +2002,7 @@ class HomePostProcess(Home):
return self._genericMessage("Postprocessing results", result) return self._genericMessage("Postprocessing results", result)
@route('/home/addShows/(.*)(/?)') @route('/home/addShows(.*)(/?)')
class NewHomeAddShows(Home): class NewHomeAddShows(Home):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
@ -2500,7 +2503,7 @@ class NewHomeAddShows(Home):
return self.newShow(dirs_only[0], dirs_only[1:]) return self.newShow(dirs_only[0], dirs_only[1:])
@route('/manage/(.*)(/?)') @route('/manage(.*)(/?)')
class Manage(WebRoot): class Manage(WebRoot):
def ManageMenu(self, *args, **kwargs): def ManageMenu(self, *args, **kwargs):
menu = [ menu = [
@ -3196,7 +3199,7 @@ class Manage(WebRoot):
return t return t
@route('/manage/manageSearches/(.*)(/?)') @route('/manage/manageSearches(.*)(/?)')
class ManageSearches(Manage): class ManageSearches(Manage):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
t = PageTemplate(rh=self, file="manage_manageSearches.tmpl") t = PageTemplate(rh=self, file="manage_manageSearches.tmpl")
@ -3259,7 +3262,7 @@ class ManageSearches(Manage):
self.redirect("/manage/manageSearches/") self.redirect("/manage/manageSearches/")
@route('/history/(.*)(/?)') @route('/history(.*)(/?)')
class History(WebRoot): class History(WebRoot):
def index(self, limit=100): def index(self, limit=100):
@ -3351,7 +3354,7 @@ class History(WebRoot):
self.redirect("/history/") self.redirect("/history/")
@route('/config/(.*)(/?)') @route('/config(.*)(/?)')
class Config(WebRoot): class Config(WebRoot):
def ConfigMenu(self, *args, **kwargs): def ConfigMenu(self, *args, **kwargs):
menu = [ menu = [
@ -3374,7 +3377,7 @@ class Config(WebRoot):
return t return t
@route('/config/general/(.*)(/?)') @route('/config/general(.*)(/?)')
class ConfigGeneral(Config): class ConfigGeneral(Config):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
t = PageTemplate(rh=self, file="config_general.tmpl") t = PageTemplate(rh=self, file="config_general.tmpl")
@ -3508,7 +3511,7 @@ class ConfigGeneral(Config):
self.redirect("/config/general/") self.redirect("/config/general/")
@route('/config/backuprestore/(.*)(/?)') @route('/config/backuprestore(.*)(/?)')
class ConfigBackupRestore(Config): class ConfigBackupRestore(Config):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
t = PageTemplate(rh=self, file="config_backuprestore.tmpl") t = PageTemplate(rh=self, file="config_backuprestore.tmpl")
@ -3556,7 +3559,7 @@ class ConfigBackupRestore(Config):
return finalResult return finalResult
@route('/config/search/(.*)(/?)') @route('/config/search(.*)(/?)')
class ConfigSearch(Config): class ConfigSearch(Config):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
@ -3649,7 +3652,7 @@ class ConfigSearch(Config):
self.redirect("/config/search/") self.redirect("/config/search/")
@route('/config/postProcessing/(.*)(/?)') @route('/config/postProcessing(.*)(/?)')
class ConfigPostProcessing(Config): class ConfigPostProcessing(Config):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
@ -3849,7 +3852,7 @@ class ConfigPostProcessing(Config):
return 'not supported' return 'not supported'
@route('/config/providers/(.*)(/?)') @route('/config/providers(.*)(/?)')
class ConfigProviders(Config): class ConfigProviders(Config):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
t = PageTemplate(rh=self, file="config_providers.tmpl") t = PageTemplate(rh=self, file="config_providers.tmpl")
@ -4288,7 +4291,7 @@ class ConfigProviders(Config):
self.redirect("/config/providers/") self.redirect("/config/providers/")
@route('/config/notifications/(.*)(/?)') @route('/config/notifications(.*)(/?)')
class ConfigNotifications(Config): class ConfigNotifications(Config):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
t = PageTemplate(rh=self, file="config_notifications.tmpl") t = PageTemplate(rh=self, file="config_notifications.tmpl")
@ -4498,7 +4501,7 @@ class ConfigNotifications(Config):
self.redirect("/config/notifications/") self.redirect("/config/notifications/")
@route('/config/subtitles/(.*)(/?)') @route('/config/subtitles(.*)(/?)')
class ConfigSubtitles(Config): class ConfigSubtitles(Config):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
t = PageTemplate(rh=self, file="config_subtitles.tmpl") t = PageTemplate(rh=self, file="config_subtitles.tmpl")
@ -4562,7 +4565,7 @@ class ConfigSubtitles(Config):
self.redirect("/config/subtitles/") self.redirect("/config/subtitles/")
@route('/config/anime/(.*)(/?)') @route('/config/anime(.*)(/?)')
class ConfigAnime(Config): class ConfigAnime(Config):
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
@ -4595,7 +4598,7 @@ class ConfigAnime(Config):
self.redirect("/config/anime/") self.redirect("/config/anime/")
@route('/errorlogs/(.*)(/?)') @route('/errorlogs(.*)(/?)')
class ErrorLogs(WebRoot): class ErrorLogs(WebRoot):
def ErrorLogsMenu(self, *args, **kwargs): def ErrorLogsMenu(self, *args, **kwargs):
menu = [ menu = [

View File

@ -102,7 +102,6 @@ class SRWebServer(threading.Thread):
{"url": self.options['web_root'] + '/apibuilder/'}), {"url": self.options['web_root'] + '/apibuilder/'}),
(r'%s/login(/?)' % self.options['web_root'], LoginHandler), (r'%s/login(/?)' % self.options['web_root'], LoginHandler),
(r'%s/logout(/?)' % self.options['web_root'], LogoutHandler), (r'%s/logout(/?)' % self.options['web_root'], LogoutHandler),
(r'/', RedirectHandler, {"url": self.options['web_root'] + '/home/'}),
] + route.get_routes(self.options['web_root'])) ] + route.get_routes(self.options['web_root']))
# Static Path Handlers # Static Path Handlers