diff --git a/tests/test_db_tui.json b/tests/test_db_tui.json index 00937aa..0db1f82 100644 --- a/tests/test_db_tui.json +++ b/tests/test_db_tui.json @@ -4,10 +4,10 @@ "id": "test", "name": "test", "args": "", - "date_created": 0, + "date_created": 1675779332, "local_results_path": "", "local_snapshot_path": "the/snapshot/path", - "date_saved": null, + "date_saved": 1675779432, "metrics": [{"entry_id": "test", "name": "f1", "value": 0.87}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}, {"entry_id": "test", "name": "loss", "value": 0.003}], "other_runs": [], "results": [{"entry_id": "test", "name": "with_svm", "path": "/the/result/path"}, {"entry_id": "test", "name": "with_svm", "path": "/a/very/very/very/very/very/long/path"}, {"entry_id": "test", "name": "with_svm", "path": "/the/result/path"}, {"entry_id": "test", "name": "with_svm", "path": "/the/result/path"}, {"entry_id": "test", "name": "with_svm", "path": "/the/result/path"}, {"entry_id": "test", "name": "with_svm", "path": "/the/result/path"}, {"entry_id": "test", "name": "with_svm", "path": "/the/result/path"}], @@ -17,10 +17,10 @@ "id": "test1", "name": "test1", "args": "", - "date_created": 0, + "date_created": 1675779332, "local_results_path": "", "local_snapshot_path": "", - "date_saved": null, + "date_saved": 1675779432, "metrics": [], "other_runs": [], "results": [], @@ -30,10 +30,10 @@ "id": "test2", "name": "test2", "args": "", - "date_created": 0, + "date_created": 1675779332, "local_results_path": "", "local_snapshot_path": "", - "date_saved": null, + "date_saved": 1675779432, "metrics": [], "other_runs": [], "results": [], diff --git a/tmt/interface/tui/search.py b/tmt/interface/tui/search.py index 4587889..e5e0c9b 100644 --- a/tmt/interface/tui/search.py +++ b/tmt/interface/tui/search.py @@ -76,11 +76,13 @@ def _show_results(self, entries: Iterable[Entry]): ids = HSplit([Label(text='ID')]) names = HSplit([Label(text='Name')]) dates = HSplit([Label(text='Date created')]) - self.results_box.children.append(VSplit([ids, names, dates])) + dates_saved = HSplit([Label(text='Date saved')]) + self.results_box.children.append(VSplit([ids, names, dates, dates_saved])) for entry in entries: ids.children.append(to_container(FocusableText(entry.id, handler=partial(self.entry_select_handler, entry)))) names.children.append(to_container(Label(text=entry.name))) dates.children.append(to_container(Label(text=date_formatter(entry.date_created)))) + dates_saved.children.append(to_container(Label(text=date_formatter(float(entry.date_saved)) if entry.date_saved else "NA"))) def _bottom_toolbar(self): toolbar = super()._bottom_toolbar()