AnnasBlackHat commited on
Commit
550fc9d
·
1 Parent(s): 94781fc

add history product name

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -112,7 +112,7 @@ def show_table():
112
  st.write("No data found. Make sure to stock opname the product!")
113
 
114
  if api_data and api_data["data"]:
115
- # st.json(api_data)
116
  timestamp = later_time.strftime("%H:%M:%S") #time.strftime("%H:%M:%S")
117
  st.session_state.cache[timestamp] = api_data['data']
118
  st.session_state.last_data = api_data['data']
@@ -183,8 +183,10 @@ tabs = st.tabs(tabs_title)
183
 
184
  for tab, key in zip(tabs, list(cache.keys())):
185
  with tab:
186
- if st.button('Show', key=key):
187
- tables = format_df(cache[key])
 
 
188
  for table in tables:
189
  col1, col2 = st.columns(2)
190
  col1.write(table['main'])
 
112
  st.write("No data found. Make sure to stock opname the product!")
113
 
114
  if api_data and api_data["data"]:
115
+ st.json(api_data)
116
  timestamp = later_time.strftime("%H:%M:%S") #time.strftime("%H:%M:%S")
117
  st.session_state.cache[timestamp] = api_data['data']
118
  st.session_state.last_data = api_data['data']
 
183
 
184
  for tab, key in zip(tabs, list(cache.keys())):
185
  with tab:
186
+ if st.button('Show', key=key):
187
+ data = cache[key]
188
+ tables = format_df(data)
189
+ st.write(f'History of **{data[0]["product_name"]}**, at **{data[0]["outlet_name"]}**')
190
  for table in tables:
191
  col1, col2 = st.columns(2)
192
  col1.write(table['main'])