diff --git a/src/openflexure_microscope_server/things/smart_scan.py b/src/openflexure_microscope_server/things/smart_scan.py index 59ff87dc..1483278b 100644 --- a/src/openflexure_microscope_server/things/smart_scan.py +++ b/src/openflexure_microscope_server/things/smart_scan.py @@ -17,6 +17,7 @@ from subprocess import SubprocessError from fastapi import HTTPException from fastapi.responses import FileResponse import numpy as np +from pydantic import BaseModel import labthings_fastapi as lt @@ -39,6 +40,16 @@ CSMDep = lt.deps.direct_thing_client_dependency( AutofocusDep = lt.deps.direct_thing_client_dependency(AutofocusThing, "/autofocus/") +class ScanListData(BaseModel): + """The data to be sent to the Scan List tab.""" + + scans: list[scan_directories.ScanInfo] + """The list of scans as ScanInfo objects""" + + ongoing: Optional[str] + """The name of the ongoing scan or None""" + + class JPEGBlob(lt.blob.Blob): """A class representing a JPEG image as a LabThings FastAPI Blob.""" @@ -557,7 +568,7 @@ class SmartScanThing(lt.Thing): """Whether to run a final stitch at the end of a successful scan.""" @lt.thing_property - def scans(self) -> list[scan_directories.ScanInfo]: + def scans(self) -> ScanListData: """All the available scans. Each scan has a name (which can be used to access it), along with @@ -566,7 +577,10 @@ class SmartScanThing(lt.Thing): uses a regular expression, and changes to the naming scheme will break it. """ - return self._scan_dir_manager.all_scans_info() + return ScanListData( + scans=self._scan_dir_manager.all_scans_info(), + ongoing=None if self._ongoing_scan is None else self._ongoing_scan.name, + ) @lt.fastapi_endpoint( "get", diff --git a/webapp/src/components/tabContentComponents/scanListComponents/scanCard.vue b/webapp/src/components/tabContentComponents/scanListComponents/scanCard.vue new file mode 100644 index 00000000..a44d5406 --- /dev/null +++ b/webapp/src/components/tabContentComponents/scanListComponents/scanCard.vue @@ -0,0 +1,196 @@ + + + + \ No newline at end of file diff --git a/webapp/src/components/tabContentComponents/scanListContent.vue b/webapp/src/components/tabContentComponents/scanListContent.vue index 65363c43..7cf1d4dc 100644 --- a/webapp/src/components/tabContentComponents/scanListContent.vue +++ b/webapp/src/components/tabContentComponents/scanListContent.vue @@ -60,12 +60,12 @@ fullscreen -
- +
+
@@ -84,101 +84,36 @@ There are no scans available to show.

-
-
-
-
-
- -
-
-

{{ item.name }}

-
-
- - -
- - - -
-
-
    -
  • {{ item.number_of_images }} images
  • -
  • created: {{ formatDate(item.created) }}
  • -
  • modified: {{ formatDate(item.modified) }}
  • -
-
  • Not enough images to stitch
  • -
  • Interactive preview not available
  • -
  • High quality stitch not available
  • -
    -
    +
    +
    - @@ -364,57 +253,5 @@ export default { .gallery-folder-heading { margin-bottom: 30px; } -/* -.gallery-grid { - display: grid; - grid-template-columns: repeat(auto-fill, 320px); - justify-content: center; - overflow-y: hidden; -} - -.gallery-grid > div { - display: inline-block; - margin-bottom: 20px; -} - -#openseadragon { - width: 100%; - height: 100%; -} -#info-panel { - position: absolute; - top: 10px; - left: 10px; - background-color: rgba(255, 255, 255, 0.7); - padding: 5px; - border-radius: 1px; - z-index: 1000; -} - -/deep/ .capture-card { - width: 300px; - height: 100%; // Used to have all cards in a row match their heights - margin-left: auto; - margin-right: auto; -}*/ - -ul { - display: inline-block; - text-align: center; - list-style-type:none; - margin: 5px 0px 10px 0px; -} - -.warning-msg { - color: red; - text-align: center; - font-weight: bold; -} - -.alert-msg{ - color: orange; - text-align: center; - font-weight: bold; -} \ No newline at end of file