Commit 3a8770bf authored by Duggan, John's avatar Duggan, John
Browse files

Adjust UI to work with template updates

parent 12adb64b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ class ConfigTab:
                InputField(v_model="config.time_id")

            code.Editor(
                ref="input_config",
                model_value=("config.file_contents",),
                classes="flex-1-0 h-0 mb-2 w-100",
                theme="vs-dark",
+1 −3
Original line number Diff line number Diff line
@@ -11,8 +11,6 @@ class ResourcesTab:
        self.create_ui()

    def create_ui(self) -> None:
        # InputField(v_model="resource_params.partition")
        with GridLayout(columns=3, classes="mb-2", gap="0.5em"):
            InputField(v_model="resource_params.compute_resource", type="select")
        with GridLayout(columns=2, gap="0.5em"):
            InputField(v_model="resource_params.number_of_nodes", type="number")
            InputField(v_model="resource_params.time_limit", type="number")
+20 −2
Original line number Diff line number Diff line
@@ -11,12 +11,30 @@ class TabsPanel:

    def __init__(self, view_model: MainViewModel):
        self.view_model = view_model
        self._on_mount = client.JSEval(
            exec=(
                "window._resize_monaco = (timeout) => {"
                "  window.setTimeout(() => {"
                "    window.trame.refs.input_config.editor.layout();"
                "    window.trame.refs.plot_config.editor.layout();"
                "  }, timeout);"
                "};"
                "window.addEventListener('resize', () => {"
                "  window._resize_monaco(250);"
                "});"
                "window._resize_monaco(0);"
            )
        ).exec
        self._resize_monaco = client.JSEval(exec="window._resize_monaco(250);").exec

        self.create_ui()

    def create_ui(self) -> None:
        client.ClientTriggers(mounted=self._on_mount)

        with client.DeepReactive("state"):
            with vuetify.VTabs(v_model="state.active_tab", classes="pl-5"):
                vuetify.VTab("IPS Fastran Configuration", value=0)
                vuetify.VTab("IPS Fastran Configuration", value=0, click=self._resize_monaco)
                vuetify.VTab("Run Configuration", value=1)
                vuetify.VTab("Job Execution", value=2)
                vuetify.VTab(
@@ -25,5 +43,5 @@ class TabsPanel:
                    disabled=("state.results_disabled",),
                    # Monaco requires this when the editor isn't in the initial view.
                    # plot_config corresponds to the ref passed to code.Editor
                    click="window.setTimeout(() => { window.trame.refs.plot_config.editor.layout(); }, 500);",
                    click=self._resize_monaco,
                )