Added ability to set IP's of workload hosts and added a filter to ensure the IP addresses are set

This commit is contained in:
2025-06-29 09:27:30 +09:30
parent 7a6083f308
commit d5126aafcf
4 changed files with 101 additions and 11 deletions
+21 -1
View File
@@ -142,6 +142,27 @@ def render_detail():
st.markdown(f"**Available for Scheduling:** `{workload_host['available_for_scheduling']}`")
st.markdown(f"**Placement Priority:** `{workload_host['placement_priority']}`")
st.markdown(f"**Status:** `{workload_host['status']}`")
# Network configuration section
st.subheader("Network Configuration")
# Input fields for editing East-West and North-South IPs
current_ew_ip = workload_host.get('ip_address_eastwest') or ""
current_ns_ip = workload_host.get('ip_address_northsouth') or ""
new_ew_ip = st.text_input("East-West IP Address", value=current_ew_ip)
new_ns_ip = st.text_input("North-South IP Address", value=current_ns_ip)
if st.button("Save Network Configuration"):
update_payload = {
"ip_address_eastwest": new_ew_ip,
"ip_address_northsouth": new_ns_ip
}
update_result = st.session_state.client.update_workload_host(host_id, update_payload)
if update_result and update_result.get('success'):
st.success("Network configuration updated.")
st.rerun()
else:
st.error("Failed to update network configuration.")
# Display OVS Bridges
st.subheader("Attached OVS Bridges")
@@ -152,7 +173,6 @@ def render_detail():
else:
st.info("No OVS bridges attached to this host.")
# ... (rest of the existing detail view code remains the same)
if st.session_state.view_type == 'detail' and st.session_state.selected_resource_type == 'workload_host':
render_detail()