mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Better error message for un-auth access
This commit is contained in:
parent
5c2441fe0d
commit
58365b94fe
@ -6,6 +6,7 @@ from elementmaker import E
|
||||
from session import UserSessionData, SessionData
|
||||
from book_list.boss import Boss
|
||||
from book_list.globals import set_boss, set_session_data
|
||||
from gettext import gettext as _
|
||||
|
||||
def on_library_loaded(end_type, xhr, ev):
|
||||
p = document.getElementById('page_load_progress')
|
||||
@ -17,7 +18,12 @@ def on_library_loaded(end_type, xhr, ev):
|
||||
boss = Boss(interface_data)
|
||||
set_boss(boss)
|
||||
else:
|
||||
document.body.appendChild(E.p(style='color:red', xhr.error_string))
|
||||
p = E.p(style='color:red; font-weight: bold; font-size:1.5em')
|
||||
if xhr.status == 401:
|
||||
p.innerHTML = _('You are not authorized to view this site')
|
||||
else:
|
||||
p.innerHTML = xhr.error_string
|
||||
document.body.appendChild(p)
|
||||
|
||||
def on_library_load_progress(loaded, total):
|
||||
p = document.querySelector('#page_load_progress > progress')
|
||||
|
Loading…
x
Reference in New Issue
Block a user