This commit is contained in:
2026-08-10 04:48:07 +02:00
parent 6545b035e3
commit 38a6415ad3
3 changed files with 39 additions and 38 deletions
+32 -38
View File
@@ -1,44 +1,38 @@
import streamlit as st import streamlit as st
st.set_page_config(page_title="Sidebar Örneği", page_icon="🎛️", layout="wide") st.set_page_config(
page_title="Web Test Portal",
page_icon="🚀",
layout="wide"
)
# ==================== SOL MENÜ (SIDEBAR) ==================== # ---------------------------------------------------------
# 1. SAYFALARIN TANIMLANMASI
# ---------------------------------------------------------
home_page = st.Page("views/home.py", title="Ana Sayfa", icon="🏠", default=True)
settings_page = st.Page("views/settings.py", title="Ayarlar", icon="⚙️")
# ---------------------------------------------------------
# 2. NAVİGASYON HİYERARŞİSİ VEYA GRUPLAMA
# ---------------------------------------------------------
# İsterseniz sayfaları gruplayabilirsiniz de:
pg = st.navigation(
{
"Genel": [home_page],
"Yönetim": [settings_page]
}
)
# ---------------------------------------------------------
# 3. TÜM SAYFALARDA ORTAK ÇALIŞACAK ALANLAR (Header/Sidebar)
# ---------------------------------------------------------
with st.sidebar: with st.sidebar:
st.title("🎛️ Kontrol Paneli") st.caption("🚀 **Web-Test v1.0**")
st.write("Buradan site ayarlarını yapabilirsiniz.") st.write("Gitea & Coolify Otomatik Yayın Sistemi")
st.divider() # İnce çizgi
# Sidebar içine girdi elemanları ekleme
kullanici_adi = st.text_input("Kullanıcı Adı", value="iontalp")
sayfa_secimi = st.selectbox(
"Gidilecek Sayfa",
["Ana Sayfa", "İstatistikler", "Ayarlar"]
)
tema_koyu = st.toggle("Karanlık Mod", value=True)
st.divider() st.divider()
if st.button("Çıkış Yap"): # ---------------------------------------------------------
st.toast("Oturum kapatıldı!", icon="🚪") # 4. SEÇİLİ SAYFAYI ÇALIŞTIRMA
# ---------------------------------------------------------
pg.run()
# ==================== ANA SAYFA İÇERİĞİ ====================
st.title(f"Hoş Geldin, {kullanici_adi}! 👋")
if sayfa_secimi == "Ana Sayfa":
st.header("🏠 Ana Sayfa")
st.write("Şu anda ana sayfadasınız. Sol taraftaki menüden seçim yapabilirsiniz.")
st.info(f"Seçili Tema: {'Karanlık' if tema_koyu else 'Aydınlık'}")
elif sayfa_secimi == "İstatistikler":
st.header("📊 İstatistikler")
col1, col2 = st.columns(2)
col1.metric("Toplam Ziyaretçi", "1,245", "+12%")
col2.metric("Aktif Kullanıcı", "42", "-2%")
elif sayfa_secimi == "Ayarlar":
st.header("⚙️ Ayarlar")
st.write("Sistem ve profil ayarlarınızı buradan değiştirebilirsiniz.")
+3
View File
@@ -0,0 +1,3 @@
import streamlit as st
st.title("🏠 Ana Sayfa")
+4
View File
@@ -0,0 +1,4 @@
import streamlit as st
st.title("⚙️ Ayarlar")
st.checkbox("E-posta Bildirimleri")