From b28878088926f25287a08ebceca5d587b1b71bc1 Mon Sep 17 00:00:00 2001
From: Xing Wang
- Completed workflows can be viewed in the Job History section. + Completed workflows can be viewed in the Calculation history section.
diff --git a/src/aiidalab_qe/app/wrapper.py b/src/aiidalab_qe/app/wrapper.py
index 8ecedb45a..3c171bd6e 100644
--- a/src/aiidalab_qe/app/wrapper.py
+++ b/src/aiidalab_qe/app/wrapper.py
@@ -52,7 +52,6 @@ def enable_toggles(self) -> None:
"""Enable the toggle buttons."""
self._view.guide_toggle.disabled = False
self._view.about_toggle.disabled = False
- self._view.job_history_toggle.disabled = False
@without_triggering("about_toggle")
def _on_guide_toggle(self, change: dict):
@@ -69,7 +68,6 @@ def _on_guide_toggle(self, change: dict):
),
]
self._view.info_container.layout.display = "flex"
- self._view.job_history_toggle.value = False
else:
self._view.info_container.children = []
self._view.info_container.layout.display = "none"
@@ -80,26 +78,10 @@ def _on_about_toggle(self, change: dict):
if change["new"]:
self._view.info_container.children = [self._view.about]
self._view.info_container.layout.display = "flex"
- self._view.job_history_toggle.value = False
else:
self._view.info_container.children = []
self._view.info_container.layout.display = "none"
- def _on_job_history_toggle(self, change: dict):
- """Toggle the job list section."""
- if change["new"]:
- self._view.about_toggle.value = False
- self._view.guide_toggle.value = False
- self._old_view = self._view.main.children
- self._view.main.children = [LoadingWidget("Loading job history")]
- self._view.job_history.setup_table()
- self._view.main.children = [
- self._view.job_history.filters_layout,
- self._view.job_history.table,
- ]
- else:
- self._view.main.children = self._old_view
-
def _on_guide_category_select(self, change: dict):
self._view.guide_selection.options = guide_manager.get_guides(change["new"])
self._update_active_guide()
@@ -131,10 +113,6 @@ def _set_event_handlers(self) -> None:
self._on_about_toggle,
"value",
)
- self._view.job_history_toggle.observe(
- self._on_job_history_toggle,
- "value",
- )
self._view.guide_category_selection.observe(
self._on_guide_category_select,
"value",
@@ -168,9 +146,7 @@ def __init__(self) -> None:
from jinja2 import Environment
from aiidalab_qe.app.static import templates
- from aiidalab_qe.app.utils.search_jobs import QueryInterface
from aiidalab_qe.common.infobox import InfoBox
- from aiidalab_qe.common.widgets import LoadingWidget
from aiidalab_qe.version import __version__
#################################################
@@ -208,21 +184,21 @@ def __init__(self) -> None:
disabled=True,
)
- self.job_history_toggle = ipw.ToggleButton(
+ self.calculation_history_button = ipw.Button(
layout=ipw.Layout(width="auto"),
button_style="",
icon="list",
- value=False,
- description="Job History",
- tooltip="View all jobs run with this app",
- disabled=True,
+ description="Calculation history",
+ tooltip="View all calculations run with this app",
)
+ self.calculation_history_button.on_click(self._open_calculation_history)
+
info_toggles = ipw.HBox(
children=[
self.guide_toggle,
self.about_toggle,
- self.job_history_toggle,
+ self.calculation_history_button,
]
)
info_toggles.add_class("info-toggles")
@@ -242,8 +218,6 @@ def __init__(self) -> None:
)
self.guide_selection = ipw.RadioButtons(layout=ipw.Layout(margin="2px 20px"))
- self.job_history = QueryInterface()
-
self.info_container = InfoBox()
header = ipw.VBox(
@@ -275,3 +249,9 @@ def __init__(self) -> None:
footer,
],
)
+
+ def _open_calculation_history(self, _):
+ from IPython.display import Javascript
+
+ url = "./calculation_history.ipynb"
+ display(Javascript(f"window.open('{url}', '_blank')"))
diff --git a/start.py b/start.py
index bdf98f6a3..5462a95a3 100644
--- a/start.py
+++ b/start.py
@@ -23,7 +23,7 @@ def get_start_widget(appbase, jupbase, notebase): # noqa: ARG001