Merge pull request #3 from mcrowson/login_messaging

Error messaging for login failures and logo
This commit is contained in:
Nick Bisby 2019-04-27 22:23:16 -05:00 committed by GitHub
commit 78c1e33fde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 10 deletions

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="ConfigScene" extends="Scene">
<children>
<Overhang
id="overhang"
title="Configure"
/>
<label text="Enter Configuration"
id="prompt"
font="font:LargeBoldSystemFont"
@ -13,6 +17,10 @@
text="Submit"
showFocusFootprint="false"
translation="[150, 450]" />
<label text=""
id="alert"
font="font:MediumSystemFont"
translation="[150, 550]" />
</children>
<script type="text/brightscript" uri="pkg:/components/config/scene.brs"/>
</component>

View File

@ -7,6 +7,8 @@ BANNER_SOURCE=banner-dark.svg
OUTPUT_DIR=./images
[ ! -d $OUTPUT_DIR ] && mkdir -p OUTPUT_DIR
# Don't need to keep re-downloading things we already have
if [ ! -e $ICON_SOURCE ]; then
wget $BRANDING_ROOT/$ICON_SOURCE > /dev/null

View File

@ -27,15 +27,6 @@ sub LoginFlow()
ShowServerSelect()
end if
if ServerInfo() = invalid
' Maybe don't unset setting, but offer as a prompt
' Server not found, is it online? New values / Retry
print "Connection to server failed, restart flow"
SignOut()
unset_setting("server")
goto start_login
end if
if get_setting("active_user") = invalid then
print "Get user login"
ShowSigninSelect()

View File

@ -35,7 +35,15 @@ sub ShowServerSelect()
if node = "submit"
set_setting("server", server_hostname.value)
set_setting("port", server_port.value)
return
if ServerInfo() = invalid then
' Maybe don't unset setting, but offer as a prompt
' Server not found, is it online? New values / Retry
print "Server not found, is it online? New values / Retry"
scene.findNode("alert").text = "Server not found, is it online?"
SignOut()
else
return
endif
end if
end if
end while
@ -82,6 +90,7 @@ sub ShowSignInSelect()
get_token(username.value, password.value)
if get_setting("active_user") <> invalid then return
print "Login attempt failed..."
scene.findNode("alert").text = "Login attempt failed."
end if
end if
end while