added image cheksum

This commit is contained in:
2025-03-18 14:41:31 +10:30
parent 5eeaa90e1d
commit 827e9b4455
3 changed files with 12 additions and 4 deletions
+8 -3
View File
@@ -15,6 +15,7 @@ def render_list():
location_type = st.selectbox("Location Type", ["url", "local"])
os_family = st.text_input("OS Family")
os_version = st.text_input("OS Version")
checksum = st.text_input("Checksum")
submit = st.form_submit_button("Create Image")
if submit and location and size:
@@ -23,7 +24,8 @@ def render_list():
"size": size,
"location_type": location_type,
"os_family": os_family,
"os_version": os_version
"os_version": os_version,
"checksum": checksum
})
if result:
st.success(f"Image created successfully!")
@@ -69,7 +71,7 @@ def render_detail():
st.session_state.view_type = 'list'
st.rerun()
st.header("Image Details")
col1, col2 = st.columns(2)
with col1:
@@ -82,6 +84,7 @@ def render_detail():
st.markdown(f"**Last Updated:** {format_timestamp(image['updated_at'])}")
st.markdown(f"**OS Family:** {image.get('os_family', 'N/A')}")
st.markdown(f"**OS Version:** {image.get('os_version', 'N/A')}")
st.markdown(f"**Checksum:** {image.get('checksum', 'N/A')}")
# Edit Image Form
with st.expander("Edit Image"):
@@ -91,6 +94,7 @@ def render_detail():
new_location_type = st.selectbox("Location Type", ["url", "local"], index=0 if image.get('location_type') == "url" else 1)
new_os_family = st.text_input("OS Family", value=image.get('os_family', ''))
new_os_version = st.text_input("OS Version", value=image.get('os_version', ''))
new_checksum = st.text_input("Checksum", value=image.get('checksum', ''))
submit = st.form_submit_button("Update Image")
if submit:
@@ -99,7 +103,8 @@ def render_detail():
"size": new_size,
"location_type": new_location_type,
"os_family": new_os_family,
"os_version": new_os_version
"os_version": new_os_version,
"checksum": new_checksum
})
if result:
st.success("Image updated successfully!")