|
|
|
@ -4,6 +4,7 @@ import yaml |
|
|
|
from yaml.loader import SafeLoader |
|
|
|
from yaml.loader import SafeLoader |
|
|
|
import main |
|
|
|
import main |
|
|
|
import create_credentials |
|
|
|
import create_credentials |
|
|
|
|
|
|
|
import traceback |
|
|
|
|
|
|
|
|
|
|
|
with open('credentials.yaml') as file: |
|
|
|
with open('credentials.yaml') as file: |
|
|
|
config = yaml.load(file, Loader=SafeLoader) |
|
|
|
config = yaml.load(file, Loader=SafeLoader) |
|
|
|
@ -32,11 +33,11 @@ def add_user(): |
|
|
|
st.write('Användare finns redan.') |
|
|
|
st.write('Användare finns redan.') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
|
|
|
|
name, authentication_status, username = authenticator.login('Logga in', 'main') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if authentication_status: |
|
|
|
name, authentication_status, username = authenticator.login('Logga in', 'main') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if authentication_status: |
|
|
|
|
|
|
|
try: |
|
|
|
# Say hello |
|
|
|
# Say hello |
|
|
|
st.markdown(f':blue[**Hej {name}!**]') |
|
|
|
st.markdown(f':blue[**Hej {name}!**]') |
|
|
|
|
|
|
|
|
|
|
|
@ -44,7 +45,7 @@ def main(): |
|
|
|
add_user() |
|
|
|
add_user() |
|
|
|
|
|
|
|
|
|
|
|
# Ask for input |
|
|
|
# Ask for input |
|
|
|
help_text = '[Du kan hitta en profils Facebook-ID här](https://lookup-id.com/)' |
|
|
|
help_text = '[Du kan hitta en profils Facebook-ID här](https://findidfb.com/)' |
|
|
|
user_input = str(st.text_input('Skriv in telefonnummer eller Facebook-ID', help=help_text, placeholder='Skriv här...')).strip() |
|
|
|
user_input = str(st.text_input('Skriv in telefonnummer eller Facebook-ID', help=help_text, placeholder='Skriv här...')).strip() |
|
|
|
|
|
|
|
|
|
|
|
if user_input != '': |
|
|
|
if user_input != '': |
|
|
|
@ -70,16 +71,17 @@ def main(): |
|
|
|
with st.expander('Mer information'): |
|
|
|
with st.expander('Mer information'): |
|
|
|
st.dataframe(r['df'], use_container_width=True) |
|
|
|
st.dataframe(r['df'], use_container_width=True) |
|
|
|
else: |
|
|
|
else: |
|
|
|
st.text('Not found.') |
|
|
|
st.text('Hittade inga uppgifter.') |
|
|
|
|
|
|
|
|
|
|
|
authenticator.logout('Logout', 'main') |
|
|
|
authenticator.logout('Logout', 'main') |
|
|
|
|
|
|
|
except Exception as e: |
|
|
|
|
|
|
|
traceback.print_exc() |
|
|
|
|
|
|
|
st.write('Något gick fel :(') |
|
|
|
|
|
|
|
|
|
|
|
elif authentication_status is False: |
|
|
|
elif authentication_status is False: |
|
|
|
st.error('Fel användarnamn/lösenord') |
|
|
|
st.error('Fel användarnamn/lösenord') |
|
|
|
|
|
|
|
|
|
|
|
elif authentication_status is None: |
|
|
|
|
|
|
|
st.warning('Skriv in användarnamn och lösenord') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif authentication_status is None: |
|
|
|
|
|
|
|
st.warning('Skriv in användarnamn och lösenord') |
|
|
|
|
|
|
|
|
|
|
|
main() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|