Recreate the app
To upload files, please first save the app
import streamlit as st
from st_aggrid import AgGrid, GridOptionsBuilder
import pandas as pd
import numpy as np
# Configure page
st.set_page_config(page_title="SbSuite", layout="wide", initial_sidebar_state="expanded")
# Sidebar
with st.sidebar:
st.image("https://via.placeholder.com/150x50/2C5F2D/FFFFFF?text=SbSuite", width=150)
st.markdown("### Quick Nav")
# Navigation menu
nav_items = [
"Dashboard",
"Activity",
"My Documents",
"Organization Templates"
]
selected_nav = st.selectbox("", nav_items, index=0, label_visibility="collapsed")
st.markdown("### Toolbox")
toolbox_items = [
"Analysis",
"Help Docs",
"FMECA",
"RCM",
"My Library",
"Inspection Templates",
"Documents",
"Event Database"
]
for item in toolbox_items:
if st.button(item, use_container_width=True):
st.write(f"Selected: {item}")
st.markdown("### Account")
account_items = [
"Checklist",
"Compliance",
"SbNet"
]
for item in account_items:
if st.button(item, use_container_width=True):
st.write(f"Selected: {item}")
# Main content area
st.markdown("## Dashboard")
# Header section with revision info
col1, col2, col3, col4 = st.columns([2, 2, 2, 2])
with col1:
st.text_input("Revision Number", value="R01", key="revision")
with col2:
st.text_input("Originator", value="Henry Stenfield (L)", key="originator")
with col3:
st.text_input("Checked By", key="checked_by")
with col4:
st.text_input("Approved By", key="approved_by")
# Description and Notes section
col1, col2 = st.columns([1, 1])
with col1:
st.text_area("Description", value="SIF Gas Depot", height=80, key="description")
with col2:
st.text_area("Notes", height=80, key="notes")
# Process data and Instrument data sections
col1, col2 = st.columns([1, 1])
with col1:
st.markdown("### Process data")
# Create sample process data
process_data = pd.DataFrame({
"Parameter": [
"Top Tag",
"Rated Name",
"Rated Pres",
"Post Tag increment",
"Process Noise Amplitude",
"Primary Loop",
"Average Approach Speed",
"Normalized Trip Setting",
"Process Safety Time"
],
"Value": [
"2",
"10 mm",
"5.96d @ 190.78 bar",
"0.109 %",
"10.69%",
"7.5 ms",
"4.096 %/s",
"0.908",
"145.7°"
]
})
st.dataframe(process_data, use_container_width=True, hide_index=True)
with col2:
st.markdown("### Instrument data")
# Create sample instrument data with status indicators
instrument_data = pd.DataFrame({
"Parameter": [
"Sensor Response Time",
"Logic Response Time",
"Final Element Response Time",
"SIF Response Time",
"Max Allowable SIF Response Time",
"Trip Point Tolerance",
"Max Allowable Trip Tolerance",
"Potential Trip Delay",
"Potential SIF Execution Time",
"Potential SIF Execution Time As A PCT"
],
"Expected Value": [
"2",
"1.5",
"1.5",
"5.03",
"420",
"3.71",
"6275.8",
"",
"5.03",
"5.03"
],
"Mission Time (MT) Years": [
"10",
"10",
"10",
"10",
"",
"620",
"",
"",
"10",
"10"
],
"Growth Factor": [
"1.0",
"1.0",
"1.0",
"",
"",
"",
"",
"",
"",
""
],
"Growth Characteristic": [
"LN",
"LN",
"LN",
"",
"",
"LN",
"",
"",
"LN",
"LN"
],
"Response Time (RT) Units": [
"",
"1.1 s",
"15.1 s",
"15.7 s",
"",
"",
"",
"23.5",
"15.9 s",
""
],
"Status": [
"✓",
"",
"",
"",
"",
"✓",
"",
"",
"✓",
"⚠️"
]
})
# Configure AgGrid for the instrument data table
gb = GridOptionsBuilder.from_dataframe(instrument_data)
gb.configure_default_column(
resizable=True,
filterable=False,
sortable=False,
editable=False,
minWidth=80
)
# Configure specific columns
gb.configure_column("Parameter", minWidth=200, pinned='left')
gb.configure_column("Status", maxWidth=60, cellStyle={'textAlign': 'center'})
grid_options = gb.build()
grid_options['suppressHorizontalScroll'] = False
grid_options['domLayout'] = 'normal'
AgGrid(
instrument_data,
gridOptions=grid_options,
height=300,
fit_columns_on_grid_load=False,
theme='streamlit'
)
# Footer
st.markdown("---")
col1, col2, col3 = st.columns([1, 1, 1])
with col1:
st.text("Help center")
with col2:
st.text("Instructions (Report)")
with col3:
st.text("Contact")
with st.container():
col1, col2 = st.columns([3, 1])
with col1:
st.text("Dynamic Grid (7)")
with col2:
st.text("© 2023 - SbSuite™ Limited - v2.9.4")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?