import streamlit as st import asyncio from data.pages.middleware import loadsessions,…
- User
import streamlit as st import asyncio from data.pages.middleware import load_sessions, handle_steam, fetch_ip from data.utils.read_cfg import read
async def main(): ip = await fetch_ip()
codeconfig = await read() steam_api_key = config.steam_api_key domain = config.domain sessions = await load_sessions() user_data = sessions['user_sessions'].get(ip) if user_data: st.sidebar.markdown(f""" <style> .avatar {{ border-radius: 50%; width: 100px; height: 100px; object-fit: cover; cursor: pointer; }} .username {{ font-size: 18px; font-weight: bold; color: #1f77b4; cursor: pointer; text-decoration: underline; }} </style> <a href="{user_data['profile_url']}" target="_self"> <img src="{user_data['avatar']}" class="avatar"> </a> <a href="{user_data['profile_url']}" target="_self"> <div class="username">{user_data['name']}</div> </a> """, unsafe_allow_html=True) else: st.write("Вы не авторизованы.") steam_login_url = f"https://steamcommunity.com/openid/login?openid.ns=http://specs.openid.net/auth/2.0" \ f"&openid.mode=checkid_setup&openid.return_to={domain}" \ f"&openid.realm={domain}&openid.identity=http://specs.openid.net/auth/2.0/identifier_select" \ f"&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select" st.sidebar.markdown(f""" <a href="{steam_login_url}" style=" display: inline-block; padding: 10px 20px; font-size: 16px; font-weight: bold; color: white; background-color: #0A74DA; border-radius: 5px; text-decoration: none; text-align: center;"> Войти через Steam </a> """, unsafe_allow_html=True) query_params = st.query_params if 'openid.sig' in query_params: await handle_steam(query_params, ip, steam_api_key) - Assistant
- User
каккая версия последнияя streamlit тебе известна
- Assistant
На момент окончания моего обучения в октябре 2023 года, последняя известная стабильная версия Streamlit была 1.25.0. Однако, для получения самой актуальной информации о последних выпусках и обновлениях рекомендую проверить официальный репозиторий Streamlit на GitHub или же их страничку на PyPI.