Update app.py
Browse files
app.py
CHANGED
@@ -1,128 +1,78 @@
|
|
1 |
import streamlit as st
|
2 |
-
import
|
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 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
#
|
49 |
-
|
50 |
-
"
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
)
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
#
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
max_iterations=6, # Limit the number of iterations
|
80 |
-
early_stopping_method="force" # or "generate_until_stop"
|
81 |
-
)
|
82 |
-
|
83 |
-
def run_agent_with_timeout(executor, input_data, timeout):
|
84 |
-
with concurrent.futures.ThreadPoolExecutor() as pool:
|
85 |
-
future = pool.submit(executor, input_data)
|
86 |
-
try:
|
87 |
-
return future.result(timeout=timeout)
|
88 |
-
except concurrent.futures.TimeoutError:
|
89 |
-
raise TimeoutError("The operation timed out.")
|
90 |
-
|
91 |
-
st.title("CyberSecurity Program Meeting Scheduler")
|
92 |
-
st.write("Chat with the AI to schedule your meeting. The AI will ask for your name, email, and preferred meeting date.")
|
93 |
-
|
94 |
-
if "messages" not in st.session_state:
|
95 |
-
st.session_state.messages = []
|
96 |
-
|
97 |
-
for message in st.session_state.messages:
|
98 |
-
with st.chat_message(message["role"]):
|
99 |
-
st.markdown(message["content"])
|
100 |
-
|
101 |
-
if prompt := st.chat_input("Your message"):
|
102 |
-
st.session_state.messages.append({"role": "user", "content": prompt})
|
103 |
-
with st.chat_message("user"):
|
104 |
-
st.markdown(prompt)
|
105 |
-
|
106 |
-
with st.chat_message("assistant"):
|
107 |
-
with st.spinner("Thinking..."):
|
108 |
-
try:
|
109 |
-
start_time = time.time()
|
110 |
-
response = run_agent_with_timeout(agent_executor, {"input": prompt}, timeout=15)
|
111 |
-
if isinstance(response, dict) and "output" in response:
|
112 |
-
assistant_response = response["output"]
|
113 |
-
elif isinstance(response, (AgentAction, AgentFinish)):
|
114 |
-
assistant_response = response.return_values.get("output", str(response))
|
115 |
-
else:
|
116 |
-
assistant_response = str(response)
|
117 |
-
|
118 |
-
st.markdown(assistant_response)
|
119 |
-
st.session_state.messages.append({"role": "assistant", "content": assistant_response})
|
120 |
-
except TimeoutError:
|
121 |
-
st.error("I apologize, but I'm having trouble processing your request at the moment. Could you please try asking your question again, or rephrase it?")
|
122 |
-
except Exception as e:
|
123 |
-
st.error(f"An error occurred: {str(e)}")
|
124 |
-
|
125 |
-
st.sidebar.title("About")
|
126 |
-
st.sidebar.info("This is an interactive CyberSecurity Program Meeting Scheduler. Chat with the AI to schedule your meeting. It will collect your information and send a meeting invitation via email.")
|
127 |
-
|
128 |
-
# To run this script, use: streamlit run your_script_name.py
|
|
|
1 |
import streamlit as st
|
2 |
+
from streamlit_elements import elements, mui, html, dashboard, sync
|
3 |
+
|
4 |
+
# Function to render skills with progress bars
|
5 |
+
def render_skill(skill_name, proficiency):
|
6 |
+
st.write(skill_name)
|
7 |
+
st.progress(proficiency / 100) # Streamlit progress bar expects a value between 0 and 1
|
8 |
+
|
9 |
+
# Main function to render the dashboard
|
10 |
+
def app():
|
11 |
+
st.set_page_config(page_title="Recruitment Dashboard", layout="wide")
|
12 |
+
|
13 |
+
# Personal Details Section
|
14 |
+
st.title("John Doe")
|
15 |
+
col1, col2 = st.columns([1, 3])
|
16 |
+
|
17 |
+
with col1:
|
18 |
+
st.image("https://via.placeholder.com/100", width=100)
|
19 |
+
|
20 |
+
with col2:
|
21 |
+
st.markdown("**Contact Information:**")
|
22 |
+
st.markdown("📧 johndoe@example.com")
|
23 |
+
st.markdown("📞 (123) 456-7890")
|
24 |
+
st.markdown("🔗 [linkedin.com/in/johndoe](https://linkedin.com/in/johndoe)")
|
25 |
+
|
26 |
+
st.markdown("---") # Horizontal line
|
27 |
+
|
28 |
+
# Skills Section
|
29 |
+
st.header("Skills")
|
30 |
+
col1, col2 = st.columns(2)
|
31 |
+
|
32 |
+
with col1:
|
33 |
+
st.subheader("Hard Skills")
|
34 |
+
render_skill("Penetration Testing", 90)
|
35 |
+
render_skill("Network Security", 85)
|
36 |
+
render_skill("Incident Response", 80)
|
37 |
+
render_skill("Malware Analysis", 75)
|
38 |
+
|
39 |
+
with col2:
|
40 |
+
st.subheader("Soft Skills")
|
41 |
+
render_skill("Critical Thinking", 90)
|
42 |
+
render_skill("Problem-Solving", 85)
|
43 |
+
render_skill("Communication", 80)
|
44 |
+
render_skill("Team Collaboration", 75)
|
45 |
+
|
46 |
+
st.markdown("---") # Horizontal line
|
47 |
+
|
48 |
+
# Projects Section
|
49 |
+
st.header("Projects Delivered")
|
50 |
+
st.subheader("Simulated Network Intrusion and Defense")
|
51 |
+
st.write("Designed and executed a penetration testing strategy...")
|
52 |
+
st.markdown("**Tools Used:** Metasploit, Wireshark, Nmap")
|
53 |
+
|
54 |
+
st.markdown("---") # Horizontal line
|
55 |
+
|
56 |
+
# Tools Proficiency Section
|
57 |
+
st.header("Tools Proficiency")
|
58 |
+
st.write("SIEM (Splunk, QRadar): Advanced")
|
59 |
+
st.write("Penetration Testing (Metasploit, Kali Linux): Advanced")
|
60 |
+
st.write("Network Analysis (Wireshark): Advanced")
|
61 |
+
st.write("Malware Analysis (Cuckoo Sandbox): Intermediate")
|
62 |
+
st.write("Cloud Security (AWS Security Hub): Intermediate")
|
63 |
+
|
64 |
+
st.markdown("---") # Horizontal line
|
65 |
+
|
66 |
+
# Final Recommendation Section
|
67 |
+
st.header("Final Recommendation")
|
68 |
+
st.write("**Fit for Role:** Excellent")
|
69 |
+
st.write("**Recommended Action:** Highly recommended for interview.")
|
70 |
+
st.write("**Potential Areas for Development:** Further training in cloud security...")
|
71 |
+
|
72 |
+
# Action Button
|
73 |
+
if st.button("Schedule Interview"):
|
74 |
+
st.success("Interview scheduled!")
|
75 |
+
|
76 |
+
# Run the app
|
77 |
+
if __name__ == "__main__":
|
78 |
+
app()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|