Skip to content

Commit 7f31fbf

Browse files
authored
Merge pull request #23 from codeuh/improvements
Improvements!
2 parents b9d3c6a + 17809e7 commit 7f31fbf

File tree

10 files changed

+290
-153
lines changed

10 files changed

+290
-153
lines changed

.devcontainer/Containerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ RUN echo 'source /root/.ble.sh/out/ble.sh' >> /root/.bashrc && \
6767
echo 'export FZF_DEFAULT_OPTS="--layout=reverse --preview '\''bat --color=always {}'\''"' >> /root/.bashrc && \
6868
echo 'export FZF_CTRL_T_COMMAND="find . -type f -not -path '\''./.git/*'\''"' >> /root/.bashrc && \
6969
echo 'export FZF_CTRL_T_OPTS="--height 100% --preview '\''bat --color=always {}'\''"' >> /root/.bashrc && \
70-
echo 'export FZF_CTRL_R_OPTS="--height 100% --preview '\''echo {}'\'' --preview-window up:3:wrap"' >> /root/.bashrc
70+
echo 'export FZF_CTRL_R_OPTS="--height 100% --preview '\''echo {}'\'' --preview-window up:3:wrap"' >> /root/.bashrc && \
71+
echo 'clear' >> /root/.bashrc
7172

7273
RUN microdnf install -y python3.12 python3.12-pip \
7374
&& microdnf clean all \
@@ -84,7 +85,7 @@ ENV _ZO_DOCTOR=0 \
8485
PIP_DISABLE_PIP_VERSION_CHECK=on \
8586
PIP_NO_WARN_SCRIPT_LOCATION=on \
8687
PIP_DEFAULT_TIMEOUT=100 \
87-
POSH_THEME="/root/.posh-themes/powerlevel10k_lean.omp.json"
88+
POSH_THEME="/root/.posh-themes/aliens.omp.json"
8889

8990
COPY /app/requirements.txt /app/requirements.txt
9091
RUN pip install -r /app/requirements.txt

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"customizations": {
88
"vscode": {
99
"extensions": [
10-
"ms-python.vscode-pylance"
10+
"ms-python.python"
1111
],
1212
"settings": {
1313
"python.defaultInterpreterPath": "/venv/bin/python"

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python-envs.pythonProjects": []
3+
}

app/components/container_tab.py

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,36 @@ def show(client):
2424

2525
df_containers = pd.DataFrame(container_data)
2626

27-
containerCols = st.columns((1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1))
27+
action = st.selectbox(
28+
"Container Actions",
29+
[
30+
"Select action...",
31+
"🔍 Inspect",
32+
"🔗 Show Links",
33+
"📝 View Logs",
34+
"📄 Generate Quadlet",
35+
"▶️ Execute Command",
36+
"▶️ Start",
37+
"⏸️ Pause",
38+
"⏹️ Stop",
39+
"🗑️ Remove",
40+
"🧹 Prune",
41+
"🔄 Refresh"
42+
]
43+
)
2844

29-
inspect = container_buttons.show_inspect(containerCols[0])
30-
show_links = container_buttons.show_links(containerCols[1])
31-
logs = container_buttons.show_logs(containerCols[2])
32-
generate_quadlet = container_buttons.show_generate_quadlet(containerCols[3])
33-
container_exec = container_buttons.show_exec(containerCols[4])
34-
start = container_buttons.show_start(containerCols[5])
35-
pause = container_buttons.show_pause(containerCols[6])
36-
stop = container_buttons.show_stop(containerCols[7])
37-
remove = container_buttons.show_remove(containerCols[8])
38-
prune = container_buttons.show_prune(containerCols[9])
39-
refresh = container_buttons.show_refresh(containerCols[10])
45+
# Convert dropdown selection to button clicks
46+
inspect = action == "🔍 Inspect"
47+
show_links = action == "🔗 Show Links"
48+
logs = action == "📝 View Logs"
49+
generate_quadlet = action == "📄 Generate Quadlet"
50+
container_exec = action == "▶️ Execute Command"
51+
start = action == "▶️ Start"
52+
pause = action == "⏸️ Pause"
53+
stop = action == "⏹️ Stop"
54+
remove = action == "🗑️ Remove"
55+
prune = action == "🧹 Prune"
56+
refresh = action == "🔄 Refresh"
4057

4158
edited_containers_df = st.data_editor(
4259
df_containers,
@@ -49,7 +66,7 @@ def show(client):
4966
),
5067
},
5168
column_order=["Selected", "Name","ID", "Status", "Image", "Ports", "Created"],
52-
use_container_width=True
69+
width='stretch'
5370
)
5471

5572
selected_containers = edited_containers_df[edited_containers_df['Selected']]

app/components/image_tab.py

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,29 @@ def show(client):
6868

6969
df_images = pd.DataFrame(image_data)
7070

71-
imageCols = st.columns((1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1))
72-
73-
with imageCols[0]:
74-
inspect_all = st.button("🔍", help="Inspect Selected Images")
75-
76-
with imageCols[1]:
77-
pull_all = st.button("📥", help="Pull Selected Images")
78-
79-
with imageCols[2]:
80-
remove_all = st.button("🗑️", help="Remove Selected Images")
81-
82-
with imageCols[3]:
83-
if st.button("✂️", help="Prune All Images"):
84-
client.images.prune()
85-
client.images.prune_builds()
86-
st.rerun()
87-
with imageCols[4]:
88-
refresh_all = st.button("🔄", help="Refresh All Images")
71+
action = st.selectbox(
72+
"Image Actions",
73+
[
74+
"Select action...",
75+
"🔍 Inspect",
76+
"📥 Pull",
77+
"🗑️ Remove",
78+
"✂️ Prune",
79+
"🔄 Refresh"
80+
]
81+
)
82+
83+
# Convert dropdown selection to button clicks
84+
inspect_all = action == "🔍 Inspect"
85+
pull_all = action == "📥 Pull"
86+
remove_all = action == "🗑️ Remove"
87+
prune_all = action == "✂️ Prune"
88+
refresh_all = action == "🔄 Refresh"
89+
90+
if prune_all:
91+
client.images.prune()
92+
client.images.prune_builds()
93+
st.rerun()
8994

9095
edited_images_df = st.data_editor(df_images,
9196
hide_index=True,
@@ -96,7 +101,7 @@ def show(client):
96101
help="Select images for actions"
97102
)
98103
},
99-
use_container_width=True)
104+
width="stretch")
100105

101106
selected_images = edited_images_df[edited_images_df['Selected']]
102107

app/components/network_tab.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,20 @@ def show(client):
3434

3535
df_networks = pd.DataFrame(network_data)
3636

37-
networkCols = st.columns((1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1))
37+
action = st.selectbox(
38+
"Network Actions",
39+
[
40+
"Select action...",
41+
"🔍 Inspect",
42+
"🗑️ Remove",
43+
"🔄 Refresh"
44+
]
45+
)
3846

39-
with networkCols[0]:
40-
inspect_all = st.button("🔍", help="Inspect Selected Networks")
41-
42-
with networkCols[1]:
43-
remove_all = st.button("🗑️", help="Remove Selected Networks")
44-
45-
with networkCols[2]:
46-
refresh_all = st.button("🔄", help="Refresh All Networks")
47+
# Convert dropdown selection to button clicks
48+
inspect_all = action == "🔍 Inspect"
49+
remove_all = action == "🗑️ Remove"
50+
refresh_all = action == "🔄 Refresh"
4751

4852
edited_networks_df = st.data_editor(df_networks,
4953
hide_index=True,
@@ -54,7 +58,7 @@ def show(client):
5458
help="Select networks for actions"
5559
)
5660
},
57-
use_container_width=True)
61+
width="stretch")
5862

5963
selected_networks = edited_networks_df[edited_networks_df['Selected']]
6064

app/components/pod_tab.py

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,30 +40,32 @@ def show(client):
4040

4141
df_pods = pd.DataFrame(pod_data)
4242

43-
podCols = st.columns((1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1))
44-
45-
with podCols[0]:
46-
inspect_all = st.button("🔍", help="Inspect Selected Pods")
47-
48-
with podCols[1]:
49-
start_all = st.button("▶️", help="Start Selected Pods")
50-
51-
with podCols[2]:
52-
pause_all = st.button("⏸️", help="Pause Selected Pods")
53-
54-
with podCols[3]:
55-
stop_all = st.button("⏹️", help="Stop Selected Pods")
56-
57-
with podCols[4]:
58-
remove_all = st.button("🗑️", help="Remove Selected Pods")
59-
60-
with podCols[5]:
61-
if st.button("✂️", help="Prune All Pods"):
62-
client.pods.prune()
63-
st.rerun()
64-
65-
with podCols[6]:
66-
refresh_all = st.button("🔄", help="Refresh All Pods")
43+
action = st.selectbox(
44+
"Pod Actions",
45+
[
46+
"Select action...",
47+
"🔍 Inspect",
48+
"▶️ Start",
49+
"⏸️ Pause",
50+
"⏹️ Stop",
51+
"🗑️ Remove",
52+
"✂️ Prune",
53+
"🔄 Refresh"
54+
]
55+
)
56+
57+
# Convert dropdown selection to button clicks
58+
inspect_all = action == "🔍 Inspect"
59+
start_all = action == "▶️ Start"
60+
pause_all = action == "⏸️ Pause"
61+
stop_all = action == "⏹️ Stop"
62+
remove_all = action == "🗑️ Remove"
63+
prune_all = action == "✂️ Prune"
64+
refresh_all = action == "🔄 Refresh"
65+
66+
if prune_all:
67+
client.pods.prune()
68+
st.rerun()
6769

6870
edited_pods_df = st.data_editor(df_pods,
6971
hide_index=True,
@@ -74,7 +76,7 @@ def show(client):
7476
help="Select pods for actions"
7577
)
7678
},
77-
use_container_width=True)
79+
width="stretch")
7880

7981
selected_pods = edited_pods_df[edited_pods_df['Selected']]
8082

app/components/secret_tab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ def show(client):
4848
st.error(f"Error deleting secret: {str(e)}")
4949

5050
if secrets_list:
51-
st.dataframe(secrets_list, use_container_width=True)
51+
st.dataframe(secrets_list, width="stretch")
5252
else:
5353
st.info("No secrets found.")

app/components/volume_tab.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,22 @@ def show(client):
3434

3535
df_volumes = pd.DataFrame(volume_data)
3636

37-
volumeCols = st.columns((1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1))
37+
action = st.selectbox(
38+
"Volume Actions",
39+
[
40+
"Select action...",
41+
"🔍 Inspect",
42+
"🗑️ Remove",
43+
"✂️ Prune",
44+
"🔄 Refresh"
45+
]
46+
)
3847

39-
with volumeCols[0]:
40-
inspect_all = st.button("🔍", help="Inspect Selected Volumes")
41-
42-
with volumeCols[1]:
43-
remove_all = st.button("🗑️", help="Remove Selected Volumes")
44-
45-
with volumeCols[2]:
46-
prune_all = st.button("✂️", help="Prune All Volumes")
47-
48-
with volumeCols[3]:
49-
refresh_all = st.button("🔄", help="Refresh All Volumes")
48+
# Convert dropdown selection to button clicks
49+
inspect_all = action == "🔍 Inspect"
50+
remove_all = action == "🗑️ Remove"
51+
prune_all = action == "✂️ Prune"
52+
refresh_all = action == "🔄 Refresh"
5053

5154
edited_volumes_df = st.data_editor(df_volumes,
5255
hide_index=True,
@@ -57,7 +60,7 @@ def show(client):
5760
help="Select volumes for actions"
5861
)
5962
},
60-
use_container_width=True)
63+
width="stretch")
6164

6265
selected_volumes = edited_volumes_df[edited_volumes_df['Selected']]
6366

0 commit comments

Comments
 (0)