Skip to content

Commit

Permalink
Version check dsiabled for SL community.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot committed Dec 21, 2024
1 parent 4c0b8e1 commit f6aa973
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions webui/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,25 +116,27 @@ def add_left_widgets(self) -> None:
self.logger.debug("Adding widgets to the left column...")

st.title(Messages.TITLE)
versions = config.get_versions(self.logger)
try:
if versions:
latest_version, current_version = versions
if current_version != latest_version and len(current_version) > 0:
st.warning(
f"🆕 New version is available! \n"
f"Your current version: `{current_version}`, "
f"latest version: `{latest_version}`. \n"
"Use the following commands to upgrade: \n"
"```bash \n"
"docker stop maps4fs \n"
"docker rm maps4fs \n"
"docker run -d -p 8501:8501 --name maps4fs "
f"iwatkot/maps4fs:{latest_version} \n"
"```"
)
except Exception as e:
self.logger.error("An error occurred while checking the package version: %s", e)

if not self.community:
versions = config.get_versions(self.logger)
try:
if versions:
latest_version, current_version = versions
if current_version != latest_version and len(current_version) > 0:
st.warning(
f"🆕 New version is available! \n"
f"Your current version: `{current_version}`, "
f"latest version: `{latest_version}`. \n"
"Use the following commands to upgrade: \n"
"```bash \n"
"docker stop maps4fs \n"
"docker rm maps4fs \n"
"docker run -d -p 8501:8501 --name maps4fs "
f"iwatkot/maps4fs:{latest_version} \n"
"```"
)
except Exception as e:
self.logger.error("An error occurred while checking the package version: %s", e)

st.write(Messages.MAIN_PAGE_DESCRIPTION)
if self.community:
Expand Down

0 comments on commit f6aa973

Please sign in to comment.