Hi,
I am starting with Streamlit and I have a question about LinkColumn feature.
I am trying to create a link using data coming from a MySQL database.
My code is able to make the link appear but I don’t know how to go to a specific target.
# streamlit_app.py
import streamlit as st
import pandas as pd
# Initialize connection.
conn = st.connection('mysql', type='sql')
# Perform query.
# df = conn.query('SELECT * FROM block;', ttl=600)
dfp = pd.DataFrame(conn.query('SELECT * FROM block;', ttl=600))
dfb = pd.DataFrame(conn.query('SELECT name,totalcapacity FROM backup;', ttl=600))
add_sidebar = st.sidebar.selectbox('Select Technology', ('Block', 'Backup'))
if add_sidebar == 'Block':
st.data_editor(
dfp,
width=None,
height=int((len(dfp.reset_index(drop=True))+1) * 35.5),
use_container_width=True,
column_config={
"array": st.column_config.LinkColumn("Array")
}
)
if add_sidebar == 'Backup':
st.write(dfb)
here is an app screenshot.
If I click on any link a new page opens but with this error:
WebSocket connection to ‘ws://localhost:8501/CW3PAR01/_stcore/stream’ failed:
My goal is to have all links landing on the same page (eg. details.html) and that page will query the database again but using the “array name” as parameter.