Update app.py
Browse files
app.py
CHANGED
@@ -194,12 +194,12 @@ def workspace_page():
|
|
194 |
def project_view_page():
|
195 |
# Sidebar with logout and return buttons
|
196 |
st.sidebar.title(f"Project: {st.session_state.current_project}")
|
197 |
-
|
198 |
-
st.session_state.page = "workspace"
|
199 |
-
if st.sidebar.button("Log Out"):
|
200 |
st.session_state.authenticated = False
|
201 |
st.session_state.username = None
|
202 |
st.session_state.page = "login"
|
|
|
|
|
203 |
|
204 |
# Display project file structure
|
205 |
st.subheader(f"Project: {st.session_state.current_project}")
|
@@ -207,13 +207,22 @@ def project_view_page():
|
|
207 |
project_folder = os.path.join(user_folder, st.session_state.current_project)
|
208 |
|
209 |
st.write("File structure:")
|
|
|
210 |
for root, dirs, files in os.walk(project_folder):
|
211 |
level = root.replace(project_folder, "").count(os.sep)
|
212 |
indent = " " * 4 * level
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
|
218 |
|
219 |
if __name__ == "__main__":
|
|
|
194 |
def project_view_page():
|
195 |
# Sidebar with logout and return buttons
|
196 |
st.sidebar.title(f"Project: {st.session_state.current_project}")
|
197 |
+
if st.sidebar.button("Log Out"):
|
|
|
|
|
198 |
st.session_state.authenticated = False
|
199 |
st.session_state.username = None
|
200 |
st.session_state.page = "login"
|
201 |
+
if st.sidebar.button("Back to Workspace"):
|
202 |
+
st.session_state.page = "workspace"
|
203 |
|
204 |
# Display project file structure
|
205 |
st.subheader(f"Project: {st.session_state.current_project}")
|
|
|
207 |
project_folder = os.path.join(user_folder, st.session_state.current_project)
|
208 |
|
209 |
st.write("File structure:")
|
210 |
+
|
211 |
for root, dirs, files in os.walk(project_folder):
|
212 |
level = root.replace(project_folder, "").count(os.sep)
|
213 |
indent = " " * 4 * level
|
214 |
+
|
215 |
+
# Display the folder name
|
216 |
+
if level == 0:
|
217 |
+
st.write(f"π {os.path.basename(root)}")
|
218 |
+
else:
|
219 |
+
with st.expander(f"{indent}π {os.path.basename(root)}"):
|
220 |
+
sub_indent = " " * 4 * (level + 1)
|
221 |
+
|
222 |
+
# List files in the folder
|
223 |
+
for file in files:
|
224 |
+
st.write(f"{sub_indent}π {file}")
|
225 |
+
|
226 |
|
227 |
|
228 |
if __name__ == "__main__":
|