Skip to content

Commit

Permalink
WebUI stats
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot authored Feb 12, 2025
1 parent e65727c commit 4b9e706
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions webui/webui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

import streamlit as st
import streamlit.components.v1 as components
from config import DOCS_DIRECTORY, FAQ_MD, get_mds
from generator.generator import GeneratorUI
from templates import Messages
Expand All @@ -10,19 +11,30 @@
class WebUI:
def __init__(self):
st.set_page_config(page_title="maps4FS", page_icon="🚜", layout="wide")
generator_tab, step_by_step_tab, toolbox_tab, knowledge_tab, faq_tab = st.tabs(
[
"🗺️ Map Generator",
"🔢 Step by step",
"🧰 Modder Toolbox",
"📖 Knowledge base",
"📝 FAQ",
]
generator_tab, statistics_tab, step_by_step_tab, toolbox_tab, knowledge_tab, faq_tab = (
st.tabs(
[
"🗺️ Map Generator",
"📊 Statistics",
"🔢 Step by step",
"🧰 Modder Toolbox",
"📖 Knowledge base",
"📝 FAQ",
]
)
)

with generator_tab:
self.generator = GeneratorUI()

with statistics_tab:
components.iframe(
"https://stats.maps4fs.xyz/public/dashboard/"
"f8defe6a-09db-4db1-911f-b6b02075d4b2#refresh=60",
height=2500,
scrolling=False,
)

with step_by_step_tab:
step_by_step_tab_path = os.path.join(DOCS_DIRECTORY, "step_by_step.md")
st.write(open(step_by_step_tab_path, "r", encoding="utf-8").read())
Expand Down

0 comments on commit 4b9e706

Please sign in to comment.