-
Notifications
You must be signed in to change notification settings - Fork 194
Expand file tree
/
Copy pathJarvis.py
More file actions
37 lines (29 loc) · 1.07 KB
/
Jarvis.py
File metadata and controls
37 lines (29 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import streamlit as st
from src.helpers.getFolders import getFolders
from src.helpers.structPages import structPages
def application():
pages = {
"": [
st.Page("src/apps/public/home.py", title="Home", icon=":material/home:"),
st.Page("src/apps/public/youtubePlaylist.py", title="Jarvis Videos", icon=":material/ondemand_video:"),
],
"Account": [
st.Page("src/apps/auth/auth.py", title="Authentication", icon=":material/lock_open:"),
],
}
if st.user and st.user.is_logged_in:
MAIN_DIR = "src/apps/pages"
folders = getFolders(MAIN_DIR)
if folders:
for folder_name, folder_dir in folders.items():
pages[folder_name.title()] = structPages(f"{MAIN_DIR}/{folder_dir}")
if st.user.email == st.secrets["general"]["ADMIN_EMAIL"] and st.user.given_name == st.secrets["general"]["ADMIN_NAME"]:
pages.update(
{
"Admin": [
st.Page("src/apps/auth/env.py", title="Environment Variables", icon=":material/security:"),
]
}
)
return st.navigation(pages)
application().run()