Skip to content

Commit 658beff

Browse files
committed
add repository name and app name in settings.json
1 parent 85aab47 commit 658beff

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"app-name": "NuXLApp",
33
"version": "0.0.1",
4+
"repository-name": "nuxl-app",
45
"analytics": {
56
"google-analytics": {
67
"enabled": false,

src/common.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
# Detect system platform
2525
OS_PLATFORM = sys.platform
2626

27-
# set these variables according to your project
28-
APP_NAME = "NuXL"
29-
REPOSITORY_NAME = "nuxl-app"
30-
3127
@st.fragment(run_every=5)
3228
def monitor_hardware():
3329
cpu_progress = psutil.cpu_percent(interval=None) / 100
@@ -122,7 +118,7 @@ def page_setup(page: str = "") -> dict[str, Any]:
122118

123119
# Set Streamlit page configurations
124120
st.set_page_config(
125-
page_title=APP_NAME,
121+
page_title=st.session_state.settings["app-name"],
126122
page_icon="assets/OpenMS.png",
127123
layout="wide",
128124
initial_sidebar_state="auto",
@@ -214,7 +210,7 @@ def page_setup(page: str = "") -> dict[str, Any]:
214210
if "windows" in sys.argv:
215211
os.chdir("../nuxl-app-main")
216212
# Define the directory where all workspaces will be stored
217-
workspaces_dir = Path("..", "workspaces-" + REPOSITORY_NAME)
213+
workspaces_dir = Path("..", "workspaces-" + st.session_state.settings["repository-name"])
218214
if "workspace" in st.query_params:
219215
st.session_state.workspace = Path(workspaces_dir, st.query_params.workspace)
220216
elif st.session_state.location == "online":
@@ -283,7 +279,7 @@ def render_sidebar(page: str = "") -> None:
283279
if page == "main":
284280
st.markdown("🖥️ **Workspaces**")
285281
# Define workspaces directory outside of repository
286-
workspaces_dir = Path("..", "workspaces-"+REPOSITORY_NAME)
282+
workspaces_dir = Path("..", "workspaces-"+st.session_state.settings["repository-name"])
287283
# Online: show current workspace name in info text and option to change to other existing workspace
288284
if st.session_state.location == "online":
289285
# Change workspace...
@@ -374,7 +370,7 @@ def change_workspace():
374370

375371
with st.expander("📊 **Resource Utilization**"):
376372
monitor_hardware()
377-
373+
378374
st.image("assets/OpenMS.png", "powered by")
379375
#st.logo()
380376

0 commit comments

Comments
 (0)