Skip to content

Commit

Permalink
Merge pull request #46 from StardustSystems/gui-refresh-memo
Browse files Browse the repository at this point in the history
Gui refresh button
  • Loading branch information
ddutt authored Apr 6, 2022
2 parents 45394e8 + b0eef3d commit 998c472
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions suzieq/gui/stlit/guiutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ def display_help_icon(url: str):
unsafe_allow_html=True)


@st.cache(ttl=90, allow_output_mutation=True, show_spinner=False,
max_entries=20)
@st.experimental_memo(ttl=90, show_spinner=False, max_entries=20)
def gui_get_df(table: str,
config_file: str,
verb: str = 'get', **kwargs) -> pd.DataFrame:

"""Get the cached value of the table provided
The only verbs supported are get and find.
Expand Down
2 changes: 1 addition & 1 deletion suzieq/gui/stlit/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def _path_summarize(self, path_df: pd.DataFrame) -> pd.DataFrame:
.convert_dtypes()

# pylint: disable=too-many-statements
@st.cache(max_entries=10, allow_output_mutation=True)
@st.experimental_memo(max_entries=10)
def _build_graphviz_obj(self, show_ifnames: bool, df: pd.DataFrame):
'''Return a graphviz object'''

Expand Down
9 changes: 5 additions & 4 deletions suzieq/gui/stlit/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _create_sidebar(self) -> None:
on_change=self._sync_state)

if do_refresh:
st.caching.clear_memo_cache()
st.experimental_memo.clear()

st.sidebar.markdown(
'''This page provides an overview of the overall network status
Expand All @@ -66,9 +66,10 @@ def _create_sidebar(self) -> None:
you want to search. You can specify multiple addresses, space
separated. See the search page for more help.
* __Config__: View a device's configuration (show running-config equivalent.
Compare the config of 2 devices side-by-side, or the same device's
config at different times. Specify a string (like 'router ospf') or
regexp (^router ospf) to see specific sections of a config.
Compare the config of 2 devices side-by-side, or the same
device's config at different times. Specify a string (like
'router ospf') or regexp (^router ospf) to see specific sections
of a config.
__Caching is enabled by default for 90 secs on all pages__. You can clear the
cache by hitting the refresh button on this page or selecting "Clear Cache"
Expand Down

0 comments on commit 998c472

Please sign in to comment.