Skip to content

Commit ca1a965

Browse files
committed
Add schema_json to server.state
1 parent 25b7e0a commit ca1a965

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/fourc_webviewer/fourc_webserver.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
)
2727
from fourc_webviewer.python_utils import convert_string2number, find_value_recursively
2828

29+
from fourcipp import ALL_SECTIONS, CONFIG, LEGACY_SECTIONS, SECTIONS
2930
# always set pyvista to plot off screen with Trame
3031
pv.OFF_SCREEN = True
3132

@@ -67,6 +68,8 @@ def __init__(
6768
# create temporary directory
6869
self._server_vars["temp_dir_object"] = tempfile.TemporaryDirectory()
6970

71+
self._server_vars["json_schema"] = CONFIG["json_schema"]
72+
7073
# initialize state variables for the different modes and
7174
# statuses of the client (e.g. view mode versus edit mode,
7275
# read-in and export status, ...)
@@ -295,6 +298,8 @@ def init_general_sections_state_and_server_vars(self):
295298
approach to add them up to the main section SOLVERS.
296299
"""
297300

301+
self.state.json_schema = self._server_vars["json_schema"]
302+
298303
# define substrings of section names to exclude
299304
substr_to_exclude = ["DESIGN", "TOPOLOGY", "ELEMENTS", "NODE", "FUNCT"]
300305
# define full section names to exclude

src/fourc_webviewer/gui_utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,13 @@ def _prop_value_table():
448448
),
449449
key="item_key",
450450
):
451-
with html.Td():
452-
html.P(v_text=("item_key",), classes="text-center")
451+
with html.Td(classes="text-center"):
452+
html.P(v_text=("item_key",))
453453
html.P(
454-
"This will be the description of the item. It can be very long and will be new lined if it exceeds the width of the table cell.",
455-
style="font-size: 0.8em; color: #aaa; padding-left: 20px; padding-right: 20px;",
456-
# Optionales v_if, falls manche Keys gar keine Beschreibung haben:
457-
# v_if=("descriptions[item_key] !== undefined",),
454+
v_text=("json_schema['properties']['IO']['properties']['STDOUTEVERY']['description']",),
455+
style="font-size: 0.8em; color: #aaa; padding-left: 20px; padding-right: 20px;",
456+
# Optionales v_if, falls manche Keys gar keine Beschreibung haben:
457+
# v_if=("descriptions[item_key] !== undefined",),
458458
)
459459
html.Td(
460460
v_if="edit_mode == all_edit_modes['view_mode']",

0 commit comments

Comments
 (0)