semoga final
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
[mysql]
|
[mysql]
|
||||||
host = "sql12.freesqldatabase.com"
|
host = "sql12.freesqldatabase.com"
|
||||||
port = 3306
|
port = 3306
|
||||||
user = "sql12761095"
|
user = "sql12762365"
|
||||||
password = "mvUNuQW8DX"
|
password = "NmrnGnWwkP"
|
||||||
dbname = "sql12761095"
|
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": {
|
"metadata": {
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": ".venv",
|
"display_name": "Python 3",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
},
|
},
|
||||||
@ -4588,7 +4588,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.10.3"
|
"version": "3.10.16"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
@ -2150,7 +2150,7 @@
|
|||||||
"provenance": []
|
"provenance": []
|
||||||
},
|
},
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": ".venv",
|
"display_name": "Python 3",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
},
|
},
|
||||||
@ -2164,7 +2164,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.10.3"
|
"version": "3.10.16"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
@ -20,56 +20,84 @@ def navbar():
|
|||||||
st.markdown(
|
st.markdown(
|
||||||
f"""
|
f"""
|
||||||
<style>
|
<style>
|
||||||
.navbar {{
|
.navbar-container {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: space-between;
|
||||||
|
background-color: #D0EEFF;
|
||||||
|
border-radius: 15px;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
font-family: 'Inter', sans-serif;
|
width: 100%;
|
||||||
margin-top: 20px;
|
|
||||||
background-color: #D0EEFF; /* Background navbar */
|
|
||||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
|
||||||
}}
|
}}
|
||||||
.navbar .logo {{
|
.navbar-left {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 15px;
|
gap: 10px;
|
||||||
}}
|
}}
|
||||||
.navbar .logo img {{
|
.navbar-left img {{
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}}
|
}}
|
||||||
.navbar .text {{
|
.navbar-center {{
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
color: #1D567E;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
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>
|
</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">
|
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||||
<div class="text">Halaman Dashboard</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="navbar-center">
|
||||||
|
Halaman Dashboard
|
||||||
</div>
|
</div>
|
||||||
""",
|
<div class="navbar-right">
|
||||||
unsafe_allow_html=True,
|
""", 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():
|
def menu():
|
||||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
|
||||||
if "page" not in st.session_state:
|
if "page" not in st.session_state:
|
||||||
st.session_state["page"] = "Home"
|
st.session_state["page"] = "Home"
|
||||||
|
|
||||||
current_page = st.session_state["page"]
|
# **Gunakan Streamlit Columns agar Navbar Sejajar (3 Kolom)**
|
||||||
logo_path = os.path.join(os.path.dirname(__file__), "../asset/logo.png")
|
col2, col3, col4 = st.columns([1.5, 1.5, 1.5]) # 3 Kolom (Tanpa col5)
|
||||||
|
|
||||||
# **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)
|
|
||||||
|
|
||||||
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||||
st.markdown(
|
st.markdown(
|
||||||
@ -116,26 +144,6 @@ def menu():
|
|||||||
div[data-testid="column"]:nth-child(3) button:hover {
|
div[data-testid="column"]:nth-child(3) button:hover {
|
||||||
background-color: #2C3E50 !important; /* Warna biru lebih gelap saat 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>
|
</style>
|
||||||
""",
|
""",
|
||||||
unsafe_allow_html=True
|
unsafe_allow_html=True
|
||||||
@ -154,12 +162,6 @@ def menu():
|
|||||||
if st.button("Laporan", key="nav_laporan"):
|
if st.button("Laporan", key="nav_laporan"):
|
||||||
st.switch_page("pages/Laporan.py") # Pindah ke halaman 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():
|
def connect_to_db():
|
||||||
try:
|
try:
|
||||||
|
@ -15,39 +15,76 @@ def navbar():
|
|||||||
st.markdown(
|
st.markdown(
|
||||||
f"""
|
f"""
|
||||||
<style>
|
<style>
|
||||||
.navbar {{
|
.navbar-container {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: space-between;
|
||||||
|
background-color: #D0EEFF;
|
||||||
|
border-radius: 15px;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
font-family: 'Inter', sans-serif;
|
width: 100%;
|
||||||
margin-top: 20px;
|
|
||||||
background-color: #D0EEFF; /* Background navbar */
|
|
||||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
|
||||||
}}
|
}}
|
||||||
.navbar .logo {{
|
.navbar-left {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 15px;
|
gap: 10px;
|
||||||
}}
|
}}
|
||||||
.navbar .logo img {{
|
.navbar-left img {{
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}}
|
}}
|
||||||
.navbar .text {{
|
.navbar-center {{
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
color: #1D567E;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
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>
|
</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">
|
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||||
<div class="text">Halaman Dashboard</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="navbar-center">
|
||||||
|
Halaman Dashboard
|
||||||
</div>
|
</div>
|
||||||
""",
|
<div class="navbar-right">
|
||||||
unsafe_allow_html=True,
|
""", 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():
|
def menu():
|
||||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
||||||
@ -64,7 +101,7 @@ def menu():
|
|||||||
login_button_text = "Login"
|
login_button_text = "Login"
|
||||||
|
|
||||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (4 Kolom)**
|
# **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**
|
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||||
st.markdown(
|
st.markdown(
|
||||||
@ -144,13 +181,6 @@ def menu():
|
|||||||
if st.button("Dashboard", key="nav_dashboard"):
|
if st.button("Dashboard", key="nav_dashboard"):
|
||||||
st.switch_page("pages/Dashboard_Pimpinan.py") # Pindah ke halaman yang sesuai
|
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():
|
def connect_to_db():
|
||||||
try:
|
try:
|
||||||
conn = mysql.connector.connect(
|
conn = mysql.connector.connect(
|
||||||
|
@ -74,39 +74,76 @@ def navbar():
|
|||||||
st.markdown(
|
st.markdown(
|
||||||
f"""
|
f"""
|
||||||
<style>
|
<style>
|
||||||
.navbar {{
|
.navbar-container {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: space-between;
|
||||||
|
background-color: #D0EEFF;
|
||||||
|
border-radius: 15px;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
font-family: 'Inter', sans-serif;
|
width: 100%;
|
||||||
margin-top: 20px;
|
|
||||||
background-color: #D0EEFF; /* Background navbar */
|
|
||||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
|
||||||
}}
|
}}
|
||||||
.navbar .logo {{
|
.navbar-left {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 15px;
|
gap: 10px;
|
||||||
}}
|
}}
|
||||||
.navbar .logo img {{
|
.navbar-left img {{
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}}
|
}}
|
||||||
.navbar .text {{
|
.navbar-center {{
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
color: #1D567E;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
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>
|
</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">
|
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||||
<div class="text">Form Komplain</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="navbar-center">
|
||||||
|
Form Keluhan
|
||||||
</div>
|
</div>
|
||||||
""",
|
<div class="navbar-right">
|
||||||
unsafe_allow_html=True,
|
""", 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():
|
def menu():
|
||||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
# **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']:
|
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||||
login_button_text = "Logout"
|
login_button_text = "Logout"
|
||||||
else:
|
else:
|
||||||
login_button_text = "Login"
|
login_button_text = "Logout"
|
||||||
|
|
||||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (4 Kolom)**
|
# **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**
|
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||||
st.markdown(
|
st.markdown(
|
||||||
@ -203,13 +240,6 @@ def menu():
|
|||||||
if st.button("Form Keluhan", key="nav_dashboard"):
|
if st.button("Form Keluhan", key="nav_dashboard"):
|
||||||
st.switch_page("pages/Form_Keluhan.py") # Pindah ke halaman yang sesuai
|
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():
|
def show_karyawan_komen():
|
||||||
# Navbar
|
# Navbar
|
||||||
navbar()
|
navbar()
|
||||||
|
@ -15,39 +15,76 @@ def navbar():
|
|||||||
st.markdown(
|
st.markdown(
|
||||||
f"""
|
f"""
|
||||||
<style>
|
<style>
|
||||||
.navbar {{
|
.navbar-container {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: space-between;
|
||||||
|
background-color: #D0EEFF;
|
||||||
|
border-radius: 15px;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
font-family: 'Inter', sans-serif;
|
width: 100%;
|
||||||
margin-top: 20px;
|
|
||||||
background-color: #D0EEFF; /* Background navbar */
|
|
||||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
|
||||||
}}
|
}}
|
||||||
.navbar .logo {{
|
.navbar-left {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 15px;
|
gap: 10px;
|
||||||
}}
|
}}
|
||||||
.navbar .logo img {{
|
.navbar-left img {{
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}}
|
}}
|
||||||
.navbar .text {{
|
.navbar-center {{
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
color: #1D567E;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
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>
|
</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">
|
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||||
<div class="text">Form Kepuasan Kerja</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="navbar-center">
|
||||||
|
Form Kepuasan Kerja
|
||||||
</div>
|
</div>
|
||||||
""",
|
<div class="navbar-right">
|
||||||
unsafe_allow_html=True,
|
""", 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():
|
def menu():
|
||||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
# **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']:
|
if 'logged_in' in st.session_state and st.session_state['logged_in']:
|
||||||
login_button_text = "Logout"
|
login_button_text = "Logout"
|
||||||
else:
|
else:
|
||||||
login_button_text = "Login"
|
login_button_text = "Logout"
|
||||||
|
|
||||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (4 Kolom)**
|
# **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**
|
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||||
st.markdown(
|
st.markdown(
|
||||||
@ -144,12 +181,6 @@ def menu():
|
|||||||
if st.button("Form Keluhan", key="nav_dashboard"):
|
if st.button("Form Keluhan", key="nav_dashboard"):
|
||||||
st.switch_page("pages/Form_Keluhan.py") # Pindah ke halaman yang sesuai
|
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():
|
def connect_to_db():
|
||||||
try:
|
try:
|
||||||
|
@ -17,39 +17,76 @@ def navbar():
|
|||||||
st.markdown(
|
st.markdown(
|
||||||
f"""
|
f"""
|
||||||
<style>
|
<style>
|
||||||
.navbar {{
|
.navbar-container {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: space-between;
|
||||||
|
background-color: #D0EEFF;
|
||||||
|
border-radius: 15px;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
font-family: 'Inter', sans-serif;
|
width: 100%;
|
||||||
margin-top: 20px;
|
|
||||||
background-color: #D0EEFF; /* Background navbar */
|
|
||||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
|
||||||
}}
|
}}
|
||||||
.navbar .logo {{
|
.navbar-left {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 15px;
|
gap: 10px;
|
||||||
}}
|
}}
|
||||||
.navbar .logo img {{
|
.navbar-left img {{
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}}
|
}}
|
||||||
.navbar .text {{
|
.navbar-center {{
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
color: #1D567E;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
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>
|
</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">
|
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||||
<div class="text">Form Penilaian Kinerja Karyawan</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="navbar-center">
|
||||||
|
Form Penilaian Kinerja Karyawan
|
||||||
</div>
|
</div>
|
||||||
""",
|
<div class="navbar-right">
|
||||||
unsafe_allow_html=True,
|
""", 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():
|
def menu():
|
||||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
||||||
@ -66,7 +103,7 @@ def menu():
|
|||||||
login_button_text = "Login"
|
login_button_text = "Login"
|
||||||
|
|
||||||
# **Gunakan Streamlit Columns agar Navbar Sejajar (4 Kolom)**
|
# **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**
|
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||||
st.markdown(
|
st.markdown(
|
||||||
@ -146,13 +183,6 @@ def menu():
|
|||||||
if st.button("Dashboard", key="nav_dashboard"):
|
if st.button("Dashboard", key="nav_dashboard"):
|
||||||
st.switch_page("pages/Dashboard_Pimpinan.py") # Pindah ke halaman yang sesuai
|
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
|
# Fungsi untuk koneksi ke database
|
||||||
def connect_to_db():
|
def connect_to_db():
|
||||||
try:
|
try:
|
||||||
|
117
pages/Laporan.py
117
pages/Laporan.py
@ -97,56 +97,84 @@ def navbar():
|
|||||||
st.markdown(
|
st.markdown(
|
||||||
f"""
|
f"""
|
||||||
<style>
|
<style>
|
||||||
.navbar {{
|
.navbar-container {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: space-between;
|
||||||
|
background-color: #D0EEFF;
|
||||||
|
border-radius: 15px;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
font-family: 'Inter', sans-serif;
|
width: 100%;
|
||||||
margin-top: 20px;
|
|
||||||
background-color: #D0EEFF; /* Background navbar */
|
|
||||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
|
||||||
}}
|
}}
|
||||||
.navbar .logo {{
|
.navbar-left {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 15px;
|
gap: 10px;
|
||||||
}}
|
}}
|
||||||
.navbar .logo img {{
|
.navbar-left img {{
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}}
|
}}
|
||||||
.navbar .text {{
|
.navbar-center {{
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
color: #1D567E;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
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>
|
</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">
|
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||||
<div class="text">Halaman Laporan</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="navbar-center">
|
||||||
|
Halaman Laporan
|
||||||
</div>
|
</div>
|
||||||
""",
|
<div class="navbar-right">
|
||||||
unsafe_allow_html=True,
|
""", 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():
|
def menu():
|
||||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
|
||||||
if "page" not in st.session_state:
|
if "page" not in st.session_state:
|
||||||
st.session_state["page"] = "Home"
|
st.session_state["page"] = "Home"
|
||||||
|
|
||||||
current_page = st.session_state["page"]
|
# **Gunakan Streamlit Columns agar Navbar Sejajar (3 Kolom)**
|
||||||
logo_path = os.path.join(os.path.dirname(__file__), "../asset/logo.png")
|
col2, col3, col4 = st.columns([1.5, 1.5, 1.5]) # 3 Kolom (Tanpa col5)
|
||||||
|
|
||||||
# **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)
|
|
||||||
|
|
||||||
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||||
st.markdown(
|
st.markdown(
|
||||||
@ -193,25 +221,6 @@ def menu():
|
|||||||
div[data-testid="column"]:nth-child(3) button:hover {
|
div[data-testid="column"]:nth-child(3) button:hover {
|
||||||
background-color: #2C3E50 !important; /* Warna biru lebih gelap saat 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>
|
</style>
|
||||||
""",
|
""",
|
||||||
unsafe_allow_html=True
|
unsafe_allow_html=True
|
||||||
@ -230,13 +239,6 @@ def menu():
|
|||||||
if st.button("Laporan", key="nav_laporan"):
|
if st.button("Laporan", key="nav_laporan"):
|
||||||
st.switch_page("pages/Laporan.py") # Pindah ke halaman 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():
|
def show_report():
|
||||||
# Tampilkan navbar
|
# Tampilkan navbar
|
||||||
navbar()
|
navbar()
|
||||||
@ -352,6 +354,11 @@ def show_report():
|
|||||||
# Ambil data dari tabel shap_pred_result
|
# Ambil data dari tabel shap_pred_result
|
||||||
df = get_shap_top_features()
|
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:
|
if not df.empty:
|
||||||
# Tambahkan kolom deskripsi fitur berdasarkan JSON
|
# Tambahkan kolom deskripsi fitur berdasarkan JSON
|
||||||
for i in range(1, 6): # Karena ada 5 fitur top SHAP
|
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 time
|
||||||
import json
|
import json
|
||||||
|
|
||||||
reg_model = pickle.load(open('regression_model.sav', 'rb'))
|
reg_model = pickle.load(open('regression_model_final.sav', 'rb'))
|
||||||
class_model = pickle.load(open('clasification_model.sav', 'rb'))
|
class_model = pickle.load(open('clasification_final_model.sav', 'rb'))
|
||||||
train_file_path = 'X_train.csv'
|
train_file_path = 'X_train.csv'
|
||||||
|
|
||||||
with open("feature_explanation.json", "r") as f:
|
with open("feature_explanation.json", "r") as f:
|
||||||
@ -153,56 +153,84 @@ def navbar():
|
|||||||
st.markdown(
|
st.markdown(
|
||||||
f"""
|
f"""
|
||||||
<style>
|
<style>
|
||||||
.navbar {{
|
.navbar-container {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: space-between;
|
||||||
|
background-color: #D0EEFF;
|
||||||
|
border-radius: 15px;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
font-family: 'Inter', sans-serif;
|
width: 100%;
|
||||||
margin-top: 20px;
|
|
||||||
background-color: #D0EEFF; /* Background navbar */
|
|
||||||
border-radius: 15px; /* Membulatkan sudut navbar */
|
|
||||||
}}
|
}}
|
||||||
.navbar .logo {{
|
.navbar-left {{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 15px;
|
gap: 10px;
|
||||||
}}
|
}}
|
||||||
.navbar .logo img {{
|
.navbar-left img {{
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}}
|
}}
|
||||||
.navbar .text {{
|
.navbar-center {{
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
color: #1D567E;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
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>
|
</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">
|
<img src="data:image/png;base64,{get_image_as_base64(logo_path)}" alt="Logo">
|
||||||
<div class="text">Halaman Prediksi Karyawan</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="navbar-center">
|
||||||
|
Halaman Prediksi
|
||||||
</div>
|
</div>
|
||||||
""",
|
<div class="navbar-right">
|
||||||
unsafe_allow_html=True,
|
""", 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():
|
def menu():
|
||||||
# **Pastikan Streamlit Session State Sudah Punya `page`**
|
|
||||||
if "page" not in st.session_state:
|
if "page" not in st.session_state:
|
||||||
st.session_state["page"] = "Home"
|
st.session_state["page"] = "Home"
|
||||||
|
|
||||||
current_page = st.session_state["page"]
|
# **Gunakan Streamlit Columns agar Navbar Sejajar (3 Kolom)**
|
||||||
logo_path = os.path.join(os.path.dirname(__file__), "../asset/logo.png")
|
col2, col3, col4 = st.columns([1.5, 1.5, 1.5]) # 3 Kolom (Tanpa col5)
|
||||||
|
|
||||||
# **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)
|
|
||||||
|
|
||||||
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
# **Custom CSS untuk Tombol Navbar yang Spesifik**
|
||||||
st.markdown(
|
st.markdown(
|
||||||
@ -267,13 +295,6 @@ def menu():
|
|||||||
if st.button("Laporan", key="nav_laporan"):
|
if st.button("Laporan", key="nav_laporan"):
|
||||||
st.switch_page("pages/Laporan.py") # Pindah ke halaman 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):
|
def save_prediction_to_db(employee_id, hasil_prediksi_klasifikasi, probabilitas_pred_klasifikasi, hasil_prediksi_regresi):
|
||||||
conn = connect_to_db()
|
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;
|
font-size: 14px;
|
||||||
color: #333333;
|
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>
|
</style>
|
||||||
""",
|
""",
|
||||||
unsafe_allow_html=True
|
unsafe_allow_html=True
|
||||||
@ -209,6 +218,7 @@ def show_home():
|
|||||||
</div>
|
</div>
|
||||||
<div class="image-content">
|
<div class="image-content">
|
||||||
<img src="data:image/png;base64,{get_image_as_base64(image_path)}" alt="Gambar Retensi Karyawan">
|
<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>
|
||||||
</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