semoga final
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
[mysql]
|
||||
host = "sql12.freesqldatabase.com"
|
||||
port = 3306
|
||||
user = "sql12761095"
|
||||
password = "mvUNuQW8DX"
|
||||
dbname = "sql12761095"
|
||||
user = "sql12762365"
|
||||
password = "NmrnGnWwkP"
|
||||
dbname = "sql12762365"
|
21488
X_train.csv
21488
X_train.csv
File diff suppressed because it is too large
Load Diff
11330
X_train_rus.csv
Normal file
11330
X_train_rus.csv
Normal file
File diff suppressed because it is too large
Load Diff
BIN
asset/karyawan-betah.jpg
Normal file
BIN
asset/karyawan-betah.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 543 KiB |
BIN
clasification_final_model.sav
Normal file
BIN
clasification_final_model.sav
Normal file
Binary file not shown.
@ -4574,7 +4574,7 @@
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": ".venv",
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
@ -4588,7 +4588,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.3"
|
||||
"version": "3.10.16"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
@ -2150,7 +2150,7 @@
|
||||
"provenance": []
|
||||
},
|
||||
"kernelspec": {
|
||||
"display_name": ".venv",
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
@ -2164,7 +2164,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.3"
|
||||
"version": "3.10.16"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
@ -20,56 +20,84 @@ def navbar():
|
||||
st.markdown(
|
||||
f"""
|
||||
<style>
|
||||
.navbar {{
|
||||
.navbar-container {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
background-color: #D0EEFF;
|
||||
border-radius: 15px;
|
||||
padding: 10px 20px;
|
||||
font-family: 'Inter', sans-serif;
|
||||
margin-top: 20px;
|
||||
background-color: #D0EEFF; /* Background navbar */
|
||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
||||
width: 100%;
|
||||
}}
|
||||
.navbar .logo {{
|
||||
.navbar-left {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
gap: 10px;
|
||||
}}
|
||||
.navbar .logo img {{
|
||||
.navbar-left img {{
|
||||
height: 40px;
|
||||
}}
|
||||
.navbar .text {{
|
||||
.navbar-center {{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-family: 'Inter', sans-serif;
|
||||
color: #1D567E;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #264CBE;
|
||||
}}
|
||||
.navbar-right {{
|
||||
margin-left: auto;
|
||||
}}
|
||||
.stButton > button {{
|
||||
background-color: #264CBE !important;
|
||||
color: white !important;
|
||||
border-radius: 10px !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: bold !important;
|
||||
padding: 10px 15px !important;
|
||||
margin-top:6px !important;
|
||||
border: none !important;
|
||||
cursor: pointer !important;
|
||||
}}
|
||||
.stButton > button:hover {{
|
||||
background-color: #1D3A8A !important;
|
||||
}}
|
||||
</style>
|
||||
<div class="navbar">
|
||||
<div class="logo">
|
||||
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
col1, col2 = st.columns([10, 1])
|
||||
|
||||
with col1:
|
||||
st.markdown(f"""
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-left">
|
||||
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||
<div class="text">Halaman Dashboard</div>
|
||||
</div>
|
||||
</div>
|
||||
""",
|
||||
unsafe_allow_html=True,
|
||||
)
|
||||
<div class="navbar-center">
|
||||
Halaman Dashboard
|
||||
</div>
|
||||
<div class="navbar-right">
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
with col2:
|
||||
if st.button("Logout" if st.session_state.get('logged_in', False) else "Logout", key="login_button"):
|
||||
if st.session_state.get('logged_in', False):
|
||||
st.session_state['logged_in'] = False
|
||||
st.query_params["logged_out"] = "true" # Tandai bahwa logout baru saja terjadi
|
||||
st.rerun()
|
||||
else:
|
||||
st.switch_page("pages/login.py")
|
||||
|
||||
st.markdown("</div></div>", unsafe_allow_html=True)
|
||||
|
||||
|
||||
def menu():
|
||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
||||
if "page" not in st.session_state:
|
||||
st.session_state["page"] = "Home"
|
||||
|
||||
current_page = st.session_state["page"]
|
||||
logo_path = os.path.join(os.path.dirname(__file__), "../asset/logo.png")
|
||||
|
||||
# **Login Check**
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
login_button_text = "Logout"
|
||||
else:
|
||||
login_button_text = "Login"
|
||||
|
||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (4 Kolom)**
|
||||
col2, col3, col4, col5 = st.columns([1.5, 1.5, 1.5, 1]) # 4 Kolom tanpa col1 (logo)
|
||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (3 Kolom)**
|
||||
col2, col3, col4 = st.columns([1.5, 1.5, 1.5]) # 3 Kolom (Tanpa col5)
|
||||
|
||||
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||
st.markdown(
|
||||
@ -116,26 +144,6 @@ def menu():
|
||||
div[data-testid="column"]:nth-child(3) button:hover {
|
||||
background-color: #2C3E50 !important; /* Warna biru lebih gelap saat hover */
|
||||
}
|
||||
|
||||
.stButton > button {
|
||||
background-color: #264CBE;
|
||||
color: white;
|
||||
font-family: 'Inter', sans-serif;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.stButton > button:hover {
|
||||
background-color: #ffffff;
|
||||
color: #264CBE;
|
||||
}
|
||||
|
||||
</style>
|
||||
""",
|
||||
unsafe_allow_html=True
|
||||
@ -154,12 +162,6 @@ def menu():
|
||||
if st.button("Laporan", key="nav_laporan"):
|
||||
st.switch_page("pages/Laporan.py") # Pindah ke halaman laporan
|
||||
|
||||
with col5:
|
||||
if st.button(login_button_text, key="login_button"):
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
st.session_state['logged_in'] = False # Logout user
|
||||
else:
|
||||
st.switch_page("pages/login.py") # Pindah ke halaman login
|
||||
|
||||
def connect_to_db():
|
||||
try:
|
||||
|
@ -15,39 +15,76 @@ def navbar():
|
||||
st.markdown(
|
||||
f"""
|
||||
<style>
|
||||
.navbar {{
|
||||
.navbar-container {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
background-color: #D0EEFF;
|
||||
border-radius: 15px;
|
||||
padding: 10px 20px;
|
||||
font-family: 'Inter', sans-serif;
|
||||
margin-top: 20px;
|
||||
background-color: #D0EEFF; /* Background navbar */
|
||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
||||
width: 100%;
|
||||
}}
|
||||
.navbar .logo {{
|
||||
.navbar-left {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
gap: 10px;
|
||||
}}
|
||||
.navbar .logo img {{
|
||||
.navbar-left img {{
|
||||
height: 40px;
|
||||
}}
|
||||
.navbar .text {{
|
||||
.navbar-center {{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-family: 'Inter', sans-serif;
|
||||
color: #1D567E;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #264CBE;
|
||||
}}
|
||||
.navbar-right {{
|
||||
margin-left: auto;
|
||||
}}
|
||||
.stButton > button {{
|
||||
background-color: #264CBE !important;
|
||||
color: white !important;
|
||||
border-radius: 10px !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: bold !important;
|
||||
padding: 10px 15px !important;
|
||||
margin-top:6px !important;
|
||||
border: none !important;
|
||||
cursor: pointer !important;
|
||||
}}
|
||||
.stButton > button:hover {{
|
||||
background-color: #1D3A8A !important;
|
||||
}}
|
||||
</style>
|
||||
<div class="navbar">
|
||||
<div class="logo">
|
||||
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
col1, col2 = st.columns([10, 1])
|
||||
|
||||
with col1:
|
||||
st.markdown(f"""
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-left">
|
||||
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||
<div class="text">Halaman Dashboard</div>
|
||||
</div>
|
||||
</div>
|
||||
""",
|
||||
unsafe_allow_html=True,
|
||||
)
|
||||
<div class="navbar-center">
|
||||
Halaman Dashboard
|
||||
</div>
|
||||
<div class="navbar-right">
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
with col2:
|
||||
if st.button("Logout" if st.session_state.get('logged_in', False) else "Logout", key="login_button"):
|
||||
if st.session_state.get('logged_in', False):
|
||||
st.session_state['logged_in'] = False
|
||||
st.query_params["logged_out"] = "true" # Tandai bahwa logout baru saja terjadi
|
||||
st.rerun()
|
||||
else:
|
||||
st.switch_page("pages/login.py")
|
||||
|
||||
st.markdown("</div></div>", unsafe_allow_html=True)
|
||||
|
||||
def menu():
|
||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
||||
@ -64,7 +101,7 @@ def menu():
|
||||
login_button_text = "Login"
|
||||
|
||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (4 Kolom)**
|
||||
col2, col3, col4 = st.columns([1.5, 1.5, 1]) # 4 Kolom tanpa col1 (logo)
|
||||
col2, col3 = st.columns([1.5, 1.5]) # 4 Kolom tanpa col1 (logo)
|
||||
|
||||
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||
st.markdown(
|
||||
@ -144,13 +181,6 @@ def menu():
|
||||
if st.button("Dashboard", key="nav_dashboard"):
|
||||
st.switch_page("pages/Dashboard_Pimpinan.py") # Pindah ke halaman yang sesuai
|
||||
|
||||
with col4:
|
||||
if st.button(login_button_text, key="login_button"):
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
st.session_state['logged_in'] = False # Logout user
|
||||
else:
|
||||
st.switch_page("pages/login.py") # Pindah ke halaman login
|
||||
|
||||
def connect_to_db():
|
||||
try:
|
||||
conn = mysql.connector.connect(
|
||||
|
@ -74,39 +74,76 @@ def navbar():
|
||||
st.markdown(
|
||||
f"""
|
||||
<style>
|
||||
.navbar {{
|
||||
.navbar-container {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
background-color: #D0EEFF;
|
||||
border-radius: 15px;
|
||||
padding: 10px 20px;
|
||||
font-family: 'Inter', sans-serif;
|
||||
margin-top: 20px;
|
||||
background-color: #D0EEFF; /* Background navbar */
|
||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
||||
width: 100%;
|
||||
}}
|
||||
.navbar .logo {{
|
||||
.navbar-left {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
gap: 10px;
|
||||
}}
|
||||
.navbar .logo img {{
|
||||
.navbar-left img {{
|
||||
height: 40px;
|
||||
}}
|
||||
.navbar .text {{
|
||||
.navbar-center {{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-family: 'Inter', sans-serif;
|
||||
color: #1D567E;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #264CBE;
|
||||
}}
|
||||
.navbar-right {{
|
||||
margin-left: auto;
|
||||
}}
|
||||
.stButton > button {{
|
||||
background-color: #264CBE !important;
|
||||
color: white !important;
|
||||
border-radius: 10px !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: bold !important;
|
||||
padding: 10px 15px !important;
|
||||
margin-top:6px !important;
|
||||
border: none !important;
|
||||
cursor: pointer !important;
|
||||
}}
|
||||
.stButton > button:hover {{
|
||||
background-color: #1D3A8A !important;
|
||||
}}
|
||||
</style>
|
||||
<div class="navbar">
|
||||
<div class="logo">
|
||||
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
col1, col2 = st.columns([10, 1])
|
||||
|
||||
with col1:
|
||||
st.markdown(f"""
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-left">
|
||||
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||
<div class="text">Form Komplain</div>
|
||||
</div>
|
||||
</div>
|
||||
""",
|
||||
unsafe_allow_html=True,
|
||||
)
|
||||
<div class="navbar-center">
|
||||
Form Keluhan
|
||||
</div>
|
||||
<div class="navbar-right">
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
with col2:
|
||||
if st.button("Logout" if st.session_state.get('logged_in', False) else "Logout", key="login_button"):
|
||||
if st.session_state.get('logged_in', False):
|
||||
st.session_state['logged_in'] = False
|
||||
st.query_params["logged_out"] = "true" # Tandai bahwa logout baru saja terjadi
|
||||
st.rerun()
|
||||
else:
|
||||
st.switch_page("pages/login.py")
|
||||
|
||||
st.markdown("</div></div>", unsafe_allow_html=True)
|
||||
|
||||
def menu():
|
||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
||||
@ -120,10 +157,10 @@ def menu():
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
login_button_text = "Logout"
|
||||
else:
|
||||
login_button_text = "Login"
|
||||
login_button_text = "Logout"
|
||||
|
||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (4 Kolom)**
|
||||
col2, col3, col4 = st.columns([1.5, 1.5, 1]) # 4 Kolom tanpa col1 (logo)
|
||||
col2, col3 = st.columns([1.5, 1.5]) # 4 Kolom tanpa col1 (logo)
|
||||
|
||||
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||
st.markdown(
|
||||
@ -203,13 +240,6 @@ def menu():
|
||||
if st.button("Form Keluhan", key="nav_dashboard"):
|
||||
st.switch_page("pages/Form_Keluhan.py") # Pindah ke halaman yang sesuai
|
||||
|
||||
with col4:
|
||||
if st.button(login_button_text, key="login_button"):
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
st.session_state['logged_in'] = False # Logout user
|
||||
else:
|
||||
st.switch_page("pages/login.py") # Pindah ke halaman login
|
||||
|
||||
def show_karyawan_komen():
|
||||
# Navbar
|
||||
navbar()
|
||||
|
@ -15,39 +15,76 @@ def navbar():
|
||||
st.markdown(
|
||||
f"""
|
||||
<style>
|
||||
.navbar {{
|
||||
.navbar-container {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
background-color: #D0EEFF;
|
||||
border-radius: 15px;
|
||||
padding: 10px 20px;
|
||||
font-family: 'Inter', sans-serif;
|
||||
margin-top: 20px;
|
||||
background-color: #D0EEFF; /* Background navbar */
|
||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
||||
width: 100%;
|
||||
}}
|
||||
.navbar .logo {{
|
||||
.navbar-left {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
gap: 10px;
|
||||
}}
|
||||
.navbar .logo img {{
|
||||
.navbar-left img {{
|
||||
height: 40px;
|
||||
}}
|
||||
.navbar .text {{
|
||||
.navbar-center {{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-family: 'Inter', sans-serif;
|
||||
color: #1D567E;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #264CBE;
|
||||
}}
|
||||
.navbar-right {{
|
||||
margin-left: auto;
|
||||
}}
|
||||
.stButton > button {{
|
||||
background-color: #264CBE !important;
|
||||
color: white !important;
|
||||
border-radius: 10px !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: bold !important;
|
||||
padding: 10px 15px !important;
|
||||
margin-top:6px !important;
|
||||
border: none !important;
|
||||
cursor: pointer !important;
|
||||
}}
|
||||
.stButton > button:hover {{
|
||||
background-color: #1D3A8A !important;
|
||||
}}
|
||||
</style>
|
||||
<div class="navbar">
|
||||
<div class="logo">
|
||||
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
col1, col2 = st.columns([10, 1])
|
||||
|
||||
with col1:
|
||||
st.markdown(f"""
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-left">
|
||||
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||
<div class="text">Form Kepuasan Kerja</div>
|
||||
</div>
|
||||
</div>
|
||||
""",
|
||||
unsafe_allow_html=True,
|
||||
)
|
||||
<div class="navbar-center">
|
||||
Form Kepuasan Kerja
|
||||
</div>
|
||||
<div class="navbar-right">
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
with col2:
|
||||
if st.button("Logout" if st.session_state.get('logged_in', False) else "Logout", key="login_button"):
|
||||
if st.session_state.get('logged_in', False):
|
||||
st.session_state['logged_in'] = False
|
||||
st.query_params["logged_out"] = "true" # Tandai bahwa logout baru saja terjadi
|
||||
st.rerun()
|
||||
else:
|
||||
st.switch_page("pages/login.py")
|
||||
|
||||
st.markdown("</div></div>", unsafe_allow_html=True)
|
||||
|
||||
def menu():
|
||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
||||
@ -61,10 +98,10 @@ def menu():
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
login_button_text = "Logout"
|
||||
else:
|
||||
login_button_text = "Login"
|
||||
login_button_text = "Logout"
|
||||
|
||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (4 Kolom)**
|
||||
col2, col3, col4 = st.columns([1.5, 1.5, 1]) # 4 Kolom tanpa col1 (logo)
|
||||
col2, col3 = st.columns([1.5, 1.5]) # 4 Kolom tanpa col1 (logo)
|
||||
|
||||
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||
st.markdown(
|
||||
@ -144,12 +181,6 @@ def menu():
|
||||
if st.button("Form Keluhan", key="nav_dashboard"):
|
||||
st.switch_page("pages/Form_Keluhan.py") # Pindah ke halaman yang sesuai
|
||||
|
||||
with col4:
|
||||
if st.button(login_button_text, key="login_button"):
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
st.session_state['logged_in'] = False # Logout user
|
||||
else:
|
||||
st.switch_page("pages/login.py") # Pindah ke halaman login
|
||||
|
||||
def connect_to_db():
|
||||
try:
|
||||
|
@ -17,39 +17,76 @@ def navbar():
|
||||
st.markdown(
|
||||
f"""
|
||||
<style>
|
||||
.navbar {{
|
||||
.navbar-container {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
background-color: #D0EEFF;
|
||||
border-radius: 15px;
|
||||
padding: 10px 20px;
|
||||
font-family: 'Inter', sans-serif;
|
||||
margin-top: 20px;
|
||||
background-color: #D0EEFF; /* Background navbar */
|
||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
||||
width: 100%;
|
||||
}}
|
||||
.navbar .logo {{
|
||||
.navbar-left {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
gap: 10px;
|
||||
}}
|
||||
.navbar .logo img {{
|
||||
.navbar-left img {{
|
||||
height: 40px;
|
||||
}}
|
||||
.navbar .text {{
|
||||
.navbar-center {{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-family: 'Inter', sans-serif;
|
||||
color: #1D567E;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #264CBE;
|
||||
}}
|
||||
.navbar-right {{
|
||||
margin-left: auto;
|
||||
}}
|
||||
.stButton > button {{
|
||||
background-color: #264CBE !important;
|
||||
color: white !important;
|
||||
border-radius: 10px !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: bold !important;
|
||||
padding: 10px 15px !important;
|
||||
margin-top:6px !important;
|
||||
border: none !important;
|
||||
cursor: pointer !important;
|
||||
}}
|
||||
.stButton > button:hover {{
|
||||
background-color: #1D3A8A !important;
|
||||
}}
|
||||
</style>
|
||||
<div class="navbar">
|
||||
<div class="logo">
|
||||
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
col1, col2 = st.columns([10, 1])
|
||||
|
||||
with col1:
|
||||
st.markdown(f"""
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-left">
|
||||
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||
<div class="text">Form Penilaian Kinerja Karyawan</div>
|
||||
</div>
|
||||
</div>
|
||||
""",
|
||||
unsafe_allow_html=True,
|
||||
)
|
||||
<div class="navbar-center">
|
||||
Form Penilaian Kinerja Karyawan
|
||||
</div>
|
||||
<div class="navbar-right">
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
with col2:
|
||||
if st.button("Logout" if st.session_state.get('logged_in', False) else "Logout", key="login_button"):
|
||||
if st.session_state.get('logged_in', False):
|
||||
st.session_state['logged_in'] = False
|
||||
st.query_params["logged_out"] = "true" # Tandai bahwa logout baru saja terjadi
|
||||
st.rerun()
|
||||
else:
|
||||
st.switch_page("pages/login.py")
|
||||
|
||||
st.markdown("</div></div>", unsafe_allow_html=True)
|
||||
|
||||
def menu():
|
||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
||||
@ -66,7 +103,7 @@ def menu():
|
||||
login_button_text = "Login"
|
||||
|
||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (4 Kolom)**
|
||||
col2, col3, col4 = st.columns([1.5, 1.5, 1]) # 4 Kolom tanpa col1 (logo)
|
||||
col2, col3 = st.columns([1.5, 1.5]) # 4 Kolom tanpa col1 (logo)
|
||||
|
||||
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||
st.markdown(
|
||||
@ -146,13 +183,6 @@ def menu():
|
||||
if st.button("Dashboard", key="nav_dashboard"):
|
||||
st.switch_page("pages/Dashboard_Pimpinan.py") # Pindah ke halaman yang sesuai
|
||||
|
||||
with col4:
|
||||
if st.button(login_button_text, key="login_button"):
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
st.session_state['logged_in'] = False # Logout user
|
||||
else:
|
||||
st.switch_page("pages/login.py") # Pindah ke halaman login
|
||||
|
||||
# Fungsi untuk koneksi ke database
|
||||
def connect_to_db():
|
||||
try:
|
||||
|
119
pages/Laporan.py
119
pages/Laporan.py
@ -97,56 +97,84 @@ def navbar():
|
||||
st.markdown(
|
||||
f"""
|
||||
<style>
|
||||
.navbar {{
|
||||
.navbar-container {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
background-color: #D0EEFF;
|
||||
border-radius: 15px;
|
||||
padding: 10px 20px;
|
||||
font-family: 'Inter', sans-serif;
|
||||
margin-top: 20px;
|
||||
background-color: #D0EEFF; /* Background navbar */
|
||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
||||
width: 100%;
|
||||
}}
|
||||
.navbar .logo {{
|
||||
.navbar-left {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
gap: 10px;
|
||||
}}
|
||||
.navbar .logo img {{
|
||||
.navbar-left img {{
|
||||
height: 40px;
|
||||
}}
|
||||
.navbar .text {{
|
||||
.navbar-center {{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-family: 'Inter', sans-serif;
|
||||
color: #1D567E;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #264CBE;
|
||||
}}
|
||||
.navbar-right {{
|
||||
margin-left: auto;
|
||||
}}
|
||||
.stButton > button {{
|
||||
background-color: #264CBE !important;
|
||||
color: white !important;
|
||||
border-radius: 10px !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: bold !important;
|
||||
padding: 10px 15px !important;
|
||||
margin-top:6px !important;
|
||||
border: none !important;
|
||||
cursor: pointer !important;
|
||||
}}
|
||||
.stButton > button:hover {{
|
||||
background-color: #1D3A8A !important;
|
||||
}}
|
||||
</style>
|
||||
<div class="navbar">
|
||||
<div class="logo">
|
||||
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
col1, col2 = st.columns([10, 1])
|
||||
|
||||
with col1:
|
||||
st.markdown(f"""
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-left">
|
||||
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||
<div class="text">Halaman Laporan</div>
|
||||
</div>
|
||||
</div>
|
||||
""",
|
||||
unsafe_allow_html=True,
|
||||
)
|
||||
<div class="navbar-center">
|
||||
Halaman Laporan
|
||||
</div>
|
||||
<div class="navbar-right">
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
with col2:
|
||||
if st.button("Logout" if st.session_state.get('logged_in', False) else "Logout", key="login_button"):
|
||||
if st.session_state.get('logged_in', False):
|
||||
st.session_state['logged_in'] = False
|
||||
st.query_params["logged_out"] = "true" # Tandai bahwa logout baru saja terjadi
|
||||
st.rerun()
|
||||
else:
|
||||
st.switch_page("pages/login.py")
|
||||
|
||||
st.markdown("</div></div>", unsafe_allow_html=True)
|
||||
|
||||
|
||||
def menu():
|
||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
||||
if "page" not in st.session_state:
|
||||
st.session_state["page"] = "Home"
|
||||
|
||||
current_page = st.session_state["page"]
|
||||
logo_path = os.path.join(os.path.dirname(__file__), "../asset/logo.png")
|
||||
|
||||
# **Login Check**
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
login_button_text = "Logout"
|
||||
else:
|
||||
login_button_text = "Login"
|
||||
|
||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (4 Kolom)**
|
||||
col2, col3, col4, col5 = st.columns([1.5, 1.5, 1.5, 1]) # 4 Kolom tanpa col1 (logo)
|
||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (3 Kolom)**
|
||||
col2, col3, col4 = st.columns([1.5, 1.5, 1.5]) # 3 Kolom (Tanpa col5)
|
||||
|
||||
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||
st.markdown(
|
||||
@ -193,25 +221,6 @@ def menu():
|
||||
div[data-testid="column"]:nth-child(3) button:hover {
|
||||
background-color: #2C3E50 !important; /* Warna biru lebih gelap saat hover */
|
||||
}
|
||||
|
||||
.stButton > button {
|
||||
background-color: #264CBE;
|
||||
color: white;
|
||||
font-family: 'Inter', sans-serif;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.stButton > button:hover {
|
||||
background-color: #ffffff;
|
||||
color: #264CBE;
|
||||
}
|
||||
</style>
|
||||
""",
|
||||
unsafe_allow_html=True
|
||||
@ -230,13 +239,6 @@ def menu():
|
||||
if st.button("Laporan", key="nav_laporan"):
|
||||
st.switch_page("pages/Laporan.py") # Pindah ke halaman laporan
|
||||
|
||||
with col5:
|
||||
if st.button(login_button_text, key="login_button"):
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
st.session_state['logged_in'] = False # Logout user
|
||||
else:
|
||||
st.switch_page("pages/login.py") # Pindah ke halaman login
|
||||
|
||||
def show_report():
|
||||
# Tampilkan navbar
|
||||
navbar()
|
||||
@ -352,6 +354,11 @@ def show_report():
|
||||
# Ambil data dari tabel shap_pred_result
|
||||
df = get_shap_top_features()
|
||||
|
||||
filter_retensi = st.selectbox("Pilih Kategori Retensi/Tidak", ["Semua", "Retensi", "Tidak Retensi"])
|
||||
|
||||
if filter_retensi != "Semua":
|
||||
df = df[df["Hasil_Prediksi_Retensi"] == filter_retensi]
|
||||
|
||||
if not df.empty:
|
||||
# Tambahkan kolom deskripsi fitur berdasarkan JSON
|
||||
for i in range(1, 6): # Karena ada 5 fitur top SHAP
|
||||
|
@ -13,8 +13,8 @@ import streamlit.components.v1 as components
|
||||
import time
|
||||
import json
|
||||
|
||||
reg_model = pickle.load(open('regression_model.sav', 'rb'))
|
||||
class_model = pickle.load(open('clasification_model.sav', 'rb'))
|
||||
reg_model = pickle.load(open('regression_model_final.sav', 'rb'))
|
||||
class_model = pickle.load(open('clasification_final_model.sav', 'rb'))
|
||||
train_file_path = 'X_train.csv'
|
||||
|
||||
with open("feature_explanation.json", "r") as f:
|
||||
@ -153,56 +153,84 @@ def navbar():
|
||||
st.markdown(
|
||||
f"""
|
||||
<style>
|
||||
.navbar {{
|
||||
.navbar-container {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
background-color: #D0EEFF;
|
||||
border-radius: 15px;
|
||||
padding: 10px 20px;
|
||||
font-family: 'Inter', sans-serif;
|
||||
margin-top: 20px;
|
||||
background-color: #D0EEFF; /* Background navbar */
|
||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
||||
width: 100%;
|
||||
}}
|
||||
.navbar .logo {{
|
||||
.navbar-left {{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
gap: 10px;
|
||||
}}
|
||||
.navbar .logo img {{
|
||||
.navbar-left img {{
|
||||
height: 40px;
|
||||
}}
|
||||
.navbar .text {{
|
||||
.navbar-center {{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-family: 'Inter', sans-serif;
|
||||
color: #1D567E;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #264CBE;
|
||||
}}
|
||||
.navbar-right {{
|
||||
margin-left: auto;
|
||||
}}
|
||||
.stButton > button {{
|
||||
background-color: #264CBE !important;
|
||||
color: white !important;
|
||||
border-radius: 10px !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: bold !important;
|
||||
padding: 10px 15px !important;
|
||||
margin-top:6px !important;
|
||||
border: none !important;
|
||||
cursor: pointer !important;
|
||||
}}
|
||||
.stButton > button:hover {{
|
||||
background-color: #1D3A8A !important;
|
||||
}}
|
||||
</style>
|
||||
<div class="navbar">
|
||||
<div class="logo">
|
||||
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
col1, col2 = st.columns([10, 1])
|
||||
|
||||
with col1:
|
||||
st.markdown(f"""
|
||||
<div class="navbar-container">
|
||||
<div class="navbar-left">
|
||||
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||
<div class="text">Halaman Prediksi Karyawan</div>
|
||||
</div>
|
||||
</div>
|
||||
""",
|
||||
unsafe_allow_html=True,
|
||||
)
|
||||
<div class="navbar-center">
|
||||
Halaman Prediksi
|
||||
</div>
|
||||
<div class="navbar-right">
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
with col2:
|
||||
if st.button("Logout" if st.session_state.get('logged_in', False) else "Logout", key="login_button"):
|
||||
if st.session_state.get('logged_in', False):
|
||||
st.session_state['logged_in'] = False
|
||||
st.query_params["logged_out"] = "true" # Tandai bahwa logout baru saja terjadi
|
||||
st.rerun()
|
||||
else:
|
||||
st.switch_page("pages/login.py")
|
||||
|
||||
st.markdown("</div></div>", unsafe_allow_html=True)
|
||||
|
||||
|
||||
def menu():
|
||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
||||
if "page" not in st.session_state:
|
||||
st.session_state["page"] = "Home"
|
||||
|
||||
current_page = st.session_state["page"]
|
||||
logo_path = os.path.join(os.path.dirname(__file__), "../asset/logo.png")
|
||||
|
||||
# **Login Check**
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
login_button_text = "Logout"
|
||||
else:
|
||||
login_button_text = "Login"
|
||||
|
||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (4 Kolom)**
|
||||
col2, col3, col4, col5 = st.columns([1.5, 1.5, 1.5, 1]) # 4 Kolom tanpa col1 (logo)
|
||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (3 Kolom)**
|
||||
col2, col3, col4 = st.columns([1.5, 1.5, 1.5]) # 3 Kolom (Tanpa col5)
|
||||
|
||||
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||
st.markdown(
|
||||
@ -267,13 +295,6 @@ def menu():
|
||||
if st.button("Laporan", key="nav_laporan"):
|
||||
st.switch_page("pages/Laporan.py") # Pindah ke halaman laporan
|
||||
|
||||
with col5:
|
||||
if st.button(login_button_text, key="login_button"):
|
||||
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||
st.session_state['logged_in'] = False # Logout user
|
||||
else:
|
||||
st.switch_page("pages/login.py") # Pindah ke halaman login
|
||||
|
||||
|
||||
def save_prediction_to_db(employee_id, hasil_prediksi_klasifikasi, probabilitas_pred_klasifikasi, hasil_prediksi_regresi):
|
||||
conn = connect_to_db()
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -190,6 +190,15 @@ def show_home():
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.source {
|
||||
font-style: italic; /* Italic */
|
||||
font-weight: 300; /* Light font */
|
||||
font-size: 12px; /* Ukuran lebih kecil */
|
||||
color: #666; /* Warna abu-abu agar lebih soft */
|
||||
margin-top: 5px;
|
||||
text-align: center; /* Agar sejajar dengan gambar */
|
||||
}
|
||||
</style>
|
||||
""",
|
||||
unsafe_allow_html=True
|
||||
@ -209,6 +218,7 @@ def show_home():
|
||||
</div>
|
||||
<div class="image-content">
|
||||
<img src="data:image/png;base64,{get_image_as_base64(image_path)}" alt="Gambar Retensi Karyawan">
|
||||
<p class="source">Sumber: freepik.com</p>
|
||||
</div>
|
||||
</div>
|
||||
""",
|
||||
|
BIN
regression_model_final.sav
Normal file
BIN
regression_model_final.sav
Normal file
Binary file not shown.
Reference in New Issue
Block a user