Spaces:
Sleeping
Sleeping
Initial Commit
Browse filesCopy of AI-GOV-Platform
- README.md +12 -13
- app.py +39 -0
- apphome.py +63 -0
- config.yaml +15 -0
- requirements.txt +6 -0
- styles.py +72 -0
README.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
| 1 |
-
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk: streamlit
|
| 7 |
-
sdk_version: 1.
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: AI GOV PLATFORM
|
| 3 |
+
emoji: 🌖
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: blue
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.37.1
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
app.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import streamlit.components.v1 as components
|
| 3 |
+
import asyncio
|
| 4 |
+
import streamlit_authenticator as stauth
|
| 5 |
+
|
| 6 |
+
if "logged_in" not in st.session_state:
|
| 7 |
+
st.session_state.logged_in = False
|
| 8 |
+
|
| 9 |
+
if "previlage" not in st.session_state:
|
| 10 |
+
st.session_state.previlage = 0
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
#other Session state Variables:
|
| 14 |
+
if "firsttime" not in st.session_state:
|
| 15 |
+
st.session_state.firsttime = 0
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
#Landing Page
|
| 20 |
+
home_page = st.Page("apphome.py", title="Home", icon=":material/add_circle:")
|
| 21 |
+
#user_page = st.Page("Usermain.py", title="User", icon=":material/add_circle:")
|
| 22 |
+
|
| 23 |
+
#User
|
| 24 |
+
dashboard = st.Page("Usermainpages/Dashboard.py", title="Dashboard", icon=":material/add_circle:")
|
| 25 |
+
AIpolicy = st.Page("Usermainpages/AIPolicy.py", title="AI Policy", icon=":material/add_circle:")
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
if st.session_state.logged_in == True and st.session_state.previlage == 0:
|
| 29 |
+
pg = st.navigation([dashboard,AIpolicy])
|
| 30 |
+
else:
|
| 31 |
+
pg = st.navigation([home_page])
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
if __name__ == "__main__":
|
| 36 |
+
st.logo("Logo/LOGO2.svg")
|
| 37 |
+
|
| 38 |
+
pg.run()
|
| 39 |
+
|
apphome.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import streamlit.components.v1 as components
|
| 3 |
+
from streamlit_navigation_bar import st_navbar
|
| 4 |
+
from streamlit_option_menu import option_menu
|
| 5 |
+
import time
|
| 6 |
+
import asyncio
|
| 7 |
+
from styles import *
|
| 8 |
+
|
| 9 |
+
########################################################
|
| 10 |
+
from NoNavPages.Home import home
|
| 11 |
+
|
| 12 |
+
from IntroBars.Style7IntroBar import introBar7
|
| 13 |
+
########################################################
|
| 14 |
+
#App goes here...S
|
| 15 |
+
|
| 16 |
+
def apphome():
|
| 17 |
+
########################## Do not Alter this Code
|
| 18 |
+
st.set_page_config(layout = "wide",initial_sidebar_state="collapsed",page_title = "AI Compliance Platform" ,page_icon = "Logo/LOGO1.svg")
|
| 19 |
+
st.markdown(wholepage ,unsafe_allow_html=True)
|
| 20 |
+
st.markdown(reduceTop_style ,unsafe_allow_html=True)
|
| 21 |
+
##########################
|
| 22 |
+
|
| 23 |
+
#Style 1
|
| 24 |
+
#selected = option_menu(None, ["Home", "GRCT", "Docs", 'About','Contact Us'],styles={"container":{"background-color":"transparent"}},icons=['house', 'cloud-upload', "list-task", 'gear'], menu_icon=None, default_index=0, orientation="horizontal")
|
| 25 |
+
|
| 26 |
+
#Style 2
|
| 27 |
+
#selected = option_menu(None, ["Home", "GRCT", "Docs", 'About','Contact Us'],icons=['house', 'cloud-upload', "list-task", 'gear'], menu_icon=None, default_index=0, orientation="horizontal")
|
| 28 |
+
|
| 29 |
+
#Style 3: when using style 3 reduceTop_style padding 2rem for top
|
| 30 |
+
#selected = option_menu(None, ["Home", "GRCT", "Docs", 'About' ,'Contact Us'],styles={"container":{"background-color":"transparent"}},icons=['house', 'cloud-upload', "list-task"], menu_icon=None, default_index=0, orientation="horizontal")
|
| 31 |
+
#st.markdown(navstyle3_style ,unsafe_allow_html=True)
|
| 32 |
+
|
| 33 |
+
#style 4:
|
| 34 |
+
#introBar4() #reduceTop_style padding 0.15rem/0rem for top
|
| 35 |
+
|
| 36 |
+
#style 5:
|
| 37 |
+
#introBar5() #reduceTop_style padding 0.15rem/0rem for top
|
| 38 |
+
|
| 39 |
+
#style 6:
|
| 40 |
+
#introBar6() #reduceTop_style padding 0.15rem/0rem for top
|
| 41 |
+
|
| 42 |
+
#style 7:
|
| 43 |
+
introBar7() #reduceTop_style padding 0.15rem/0rem for top
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
#await home()
|
| 48 |
+
home()
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
# Marginleft, AppCol, Marginright= st.columns([0.05,0.9,0.05])
|
| 52 |
+
# #bordered page content
|
| 53 |
+
# with AppCol:
|
| 54 |
+
# st.write("<h1>HTML Headings</h1>",unsafe_allow_html=True)
|
| 55 |
+
# st.markdown("# Markdown Heading")
|
| 56 |
+
# st.popover(label="This is some label")
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
# if __name__ == "__main__":
|
| 60 |
+
# asyncio.run(main())
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
apphome()
|
config.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
credentials:
|
| 2 |
+
usernames:
|
| 3 |
+
sameer:
|
| 4 |
+
email: sameer@grct.net
|
| 5 |
+
failed_login_attempts: 0 # Will be managed automatically
|
| 6 |
+
logged_in: False # Will be managed automatically
|
| 7 |
+
name: Sameer Jaipal
|
| 8 |
+
password: SammyJoe123 # Will be hashed automatically
|
| 9 |
+
cookie:
|
| 10 |
+
expiry_days: 2
|
| 11 |
+
key: "govTAIPLT" # Must be string
|
| 12 |
+
name: AIGOVGRCT
|
| 13 |
+
pre-authorized:
|
| 14 |
+
emails:
|
| 15 |
+
- melsby@gmail.com
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit==1.37.1
|
| 2 |
+
streamlit-autorefresh==1.0.1
|
| 3 |
+
streamlit-navigation-bar==3.3.0
|
| 4 |
+
streamlit-option-menu==0.3.13
|
| 5 |
+
streamlit-authenticator
|
| 6 |
+
streamlit-quill
|
styles.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#style for the main container to contain image
|
| 2 |
+
wholepage = """
|
| 3 |
+
<style>
|
| 4 |
+
*, ::before, ::after {
|
| 5 |
+
box-sizing: revert-layer;
|
| 6 |
+
}
|
| 7 |
+
</style>
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
borderpage = """
|
| 11 |
+
<style>
|
| 12 |
+
*, ::before, ::after {
|
| 13 |
+
box-sizing: border-box;
|
| 14 |
+
}
|
| 15 |
+
</style>
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
mainCont_style = """
|
| 19 |
+
<style>
|
| 20 |
+
.st-emotion-cache-1xuzhe1 {
|
| 21 |
+
height: 700px;
|
| 22 |
+
overflow: auto;
|
| 23 |
+
display: flex;
|
| 24 |
+
justify-content: center;
|
| 25 |
+
align-items: center;
|
| 26 |
+
background: url('https://wallpaperaccess.com/full/3228833.jpg'), #6DB3F2;
|
| 27 |
+
background-size: cover; /* Scale the background image to cover the entire container */
|
| 28 |
+
background-repeat: no-repeat; /* Prevent the background image from repeating */
|
| 29 |
+
background-position: center; /* Center the background image within the container */
|
| 30 |
+
}
|
| 31 |
+
.stream-text {
|
| 32 |
+
text-align: center;
|
| 33 |
+
}
|
| 34 |
+
</style>
|
| 35 |
+
"""
|
| 36 |
+
|
| 37 |
+
reduceTop_style = """
|
| 38 |
+
<style>
|
| 39 |
+
.st-emotion-cache-1jicfl2, .st-emotion-cache-1a46zap, [data-testid="stAppViewBlockContainer"] {
|
| 40 |
+
width: 100%;
|
| 41 |
+
padding: 0rem 0rem 10rem;
|
| 42 |
+
min-width: auto;
|
| 43 |
+
max-width: initial;
|
| 44 |
+
}
|
| 45 |
+
</style>
|
| 46 |
+
"""
|
| 47 |
+
|
| 48 |
+
navstyle3_style = """
|
| 49 |
+
<style>
|
| 50 |
+
/* Targeting the iframe by its src attribute */
|
| 51 |
+
iframe[src*="streamlit_option_menu.option_menu"] {
|
| 52 |
+
position: fixed;
|
| 53 |
+
top: 2pt;
|
| 54 |
+
/*bottom:0pt;*/
|
| 55 |
+
z-index: 999990;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.st-emotion-cache-12fmjuu, .st-emotion-cache-h4xjwg {
|
| 59 |
+
position: unset;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.st-emotion-cache-15ecox0 {
|
| 63 |
+
top: 0.8rem;
|
| 64 |
+
right: 0.7rem;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
.st-emotion-cache-czk5ss {
|
| 68 |
+
z-index: 999999;
|
| 69 |
+
}
|
| 70 |
+
</style>
|
| 71 |
+
"""
|
| 72 |
+
|