From 38a6415ad361ea86e644b341ccbe1298172ac63b Mon Sep 17 00:00:00 2001 From: iontalp Date: Mon, 10 Aug 2026 04:48:07 +0200 Subject: [PATCH] test --- app.py | 70 ++++++++++++++++++++++------------------------- pages/home.py | 3 ++ pages/settings.py | 4 +++ 3 files changed, 39 insertions(+), 38 deletions(-) create mode 100644 pages/home.py create mode 100644 pages/settings.py diff --git a/app.py b/app.py index 8652b09..5321519 100644 --- a/app.py +++ b/app.py @@ -1,44 +1,38 @@ 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: - st.title("🎛️ Kontrol Paneli") - st.write("Buradan site ayarlarını yapabilirsiniz.") - - 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.caption("🚀 **Web-Test v1.0**") + st.write("Gitea & Coolify Otomatik Yayın Sistemi") st.divider() - - if st.button("Çıkış Yap"): - st.toast("Oturum kapatıldı!", icon="🚪") - -# ==================== 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.") \ No newline at end of file +# --------------------------------------------------------- +# 4. SEÇİLİ SAYFAYI ÇALIŞTIRMA +# --------------------------------------------------------- +pg.run() \ No newline at end of file diff --git a/pages/home.py b/pages/home.py new file mode 100644 index 0000000..7e18fc9 --- /dev/null +++ b/pages/home.py @@ -0,0 +1,3 @@ +import streamlit as st + +st.title("🏠 Ana Sayfa") \ No newline at end of file diff --git a/pages/settings.py b/pages/settings.py new file mode 100644 index 0000000..6c7e8ee --- /dev/null +++ b/pages/settings.py @@ -0,0 +1,4 @@ +import streamlit as st + +st.title("⚙️ Ayarlar") +st.checkbox("E-posta Bildirimleri") \ No newline at end of file