Update app.py
Browse files
app.py
CHANGED
@@ -49,10 +49,17 @@ def run_command(command):
|
|
49 |
st.error(f"An error occurred: {e}")
|
50 |
|
51 |
# Layout with columns
|
52 |
-
col1, col2 = st.columns([
|
53 |
|
54 |
-
# Command
|
55 |
with col1:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
command = st.text_area("Enter terminal command", placeholder="e.g., ls, pwd, echo 'Hello World'", height=100)
|
57 |
if st.button("Run Command"):
|
58 |
if command:
|
@@ -63,13 +70,6 @@ with col1:
|
|
63 |
else:
|
64 |
st.warning("Please enter a command to run.")
|
65 |
|
66 |
-
# Command history display in the second column
|
67 |
-
with col2:
|
68 |
-
st.subheader("Command History")
|
69 |
-
for cmd in reversed(st.session_state.history):
|
70 |
-
if st.button(f"Run: {cmd}", key=cmd):
|
71 |
-
run_command(cmd)
|
72 |
-
|
73 |
# Optional file upload (if needed)
|
74 |
uploaded_file = st.file_uploader("Upload a file to process with command:", type=["txt", "csv"])
|
75 |
if uploaded_file:
|
|
|
49 |
st.error(f"An error occurred: {e}")
|
50 |
|
51 |
# Layout with columns
|
52 |
+
col1, col2 = st.columns([1, 2])
|
53 |
|
54 |
+
# Command history display in the first column
|
55 |
with col1:
|
56 |
+
st.subheader("Command History")
|
57 |
+
for cmd in reversed(st.session_state.history):
|
58 |
+
if st.button(f"Run: {cmd}", key=cmd):
|
59 |
+
run_command(cmd)
|
60 |
+
|
61 |
+
# Command input and button in the second column
|
62 |
+
with col2:
|
63 |
command = st.text_area("Enter terminal command", placeholder="e.g., ls, pwd, echo 'Hello World'", height=100)
|
64 |
if st.button("Run Command"):
|
65 |
if command:
|
|
|
70 |
else:
|
71 |
st.warning("Please enter a command to run.")
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
# Optional file upload (if needed)
|
74 |
uploaded_file = st.file_uploader("Upload a file to process with command:", type=["txt", "csv"])
|
75 |
if uploaded_file:
|