diff --git a/ohmg/frontend/svelte_components/src/components/base/Link.svelte b/ohmg/frontend/svelte_components/src/components/base/Link.svelte index 95b98ae0..9b80e315 100644 --- a/ohmg/frontend/svelte_components/src/components/base/Link.svelte +++ b/ohmg/frontend/svelte_components/src/components/base/Link.svelte @@ -9,18 +9,19 @@ export let download = false; export let title = ''; export let classes = []; + export let style = ''; const classStr = classes.join(' '); {#if external || rightArrow || download} {#if download } - + {:else} - + {#if external} @@ -30,7 +31,7 @@ {/if} {:else} - + {/if} diff --git a/ohmg/frontend/svelte_components/src/components/map/MosaicDerivatives.svelte b/ohmg/frontend/svelte_components/src/components/map/MosaicDerivatives.svelte index 811a5965..866006fa 100644 --- a/ohmg/frontend/svelte_components/src/components/map/MosaicDerivatives.svelte +++ b/ohmg/frontend/svelte_components/src/components/map/MosaicDerivatives.svelte @@ -8,6 +8,8 @@ import ModalInfo from '../base/ModalInfo.svelte'; import LoadingEllipsis from '../shared/LoadingEllipsis.svelte'; import DerivativeDD from '../shared/DerivativeDD.svelte'; + import MosaicStatus from '../shared/tags/MosaicStatus.svelte'; + import ArrowsClockwise from 'phosphor-svelte/lib/ArrowsClockwise'; export let CONTEXT; export let mapId; @@ -49,52 +51,29 @@ i.masksDateDisplay = i.multimask_date ? new Date(i.multimask_date*1000).toLocaleString() : null; i.xyzStaticArchiveURL = i.xyz_tiles_url ? `${i.xyz_tiles_url}/archive.tar.gz` : null; i.xyzStaticTilesURL = i.xyz_tiles_url ? `${i.xyz_tiles_url}/{z}/{x}/{y}.png` : null; + + i.enableCogQueueBtn = CONTEXT.user.perms.includes("core.queue_mosaic_cog") + i.cogQueueBtnTitle = CONTEXT.user.perms.includes("core.queue_mosaic_cog") ? + "Click to queue COG build" : "You do not have permission for this action" + i.cogStale = false; - i.cogDateDisplay = "---"; - i.showCogQueueBtn = false; - if (i.latest_cog_job) { - if (i.latest_cog_job.stage == "completed") { - i.cogDate = new Date(i.latest_cog_job.date_started * 1000).toLocaleString(); - i.cogDateDisplay = `last updated: ${i.cogDate}`; - i.cogStale = i.multimask_date ? i.latest_cog_job.date_started < i.multimask_date : false - i.showCogQueueBtn = i.cogStale; - } else { - i.cogDateDisplay = i.latest_cog_job.stage; - if (i.latest_cog_job.stage != "queued" && i.latest_cog_job.stage != "running") { - i.showCogQueueBtn = true; - } - } - } else { - i.showCogQueueBtn = true; - i.cogDateDisplay = "not generated"; + if (i.latest_cog_job && i.latest_cog_job.stage == "completed") { + i.cogStale = i.multimask_date ? i.latest_cog_job.date_started < i.multimask_date : false } // same thing now but for the XYZ tileset build - i.showXyzQueueBtn = false; - i.enableXyzQueue = false; - if (i.mosaic_cog_url && !i.cogStale) { - i.enableXyzQueue = true + i.xyzQueueBtnTitle = "Click to queue XYZ tileset build"; + i.enableXyzQueue = true; + if (!i.latest_cog_job || i.cogStale) { + i.enableXyzQueue = false; + i.xyzQueueBtnTitle = "COG must be up-to-date before tileset can be built"; } - - i.xyzStale = false; - i.xyzDateDisplay = "---" - if (i.latest_xyz_job) { - if (i.latest_xyz_job.stage == "completed") { - i.xyzDate = new Date(i.latest_xyz_job.date_started * 1000).toLocaleString(); - i.xyzDateDisplay = `last updated: ${i.xyzDate}`; - i.xyzStale = i.multimask_date ? i.latest_xyz_job.date_started < i.multimask_date : false; - i.showXyzQueueBtn = i.xyzStale; - } else { - i.xyzDateDisplay = i.latest_xyz_job.stage; - if (i.latest_xyz_job.stage != "queued" && i.latest_xyz_job.stage != "running") { - i.showXyzQueueBtn = true; - i.enableXyzQueue = true; - } - } - } else { - i.showXyzQueueBtn = true; - i.xyzDateDisplay = "not generated" + if (!CONTEXT.user.perms.includes("core.queue_mosaic_xyz")) { + i.enableXyzQueue = false; + i.xyzQueueBtnTitle = "You do not have permission for this action"; } + + return i }); loading = false; @@ -128,20 +107,21 @@ {submitQueueRequest('queue-cog-creation')}} > -

Submit mosaic COG generation to queue?

+

Submit mosaic COG generation to queue? If the current COG is up-to-date, there is no need to rebuild it.

{submitQueueRequest('queue-tileset-creation')}} > -

Submit XYZ tileset generation to queue?

+

Submit XYZ tileset generation to queue? If the current XYZ tileset is up-to-date, there is no need to rebuild it.

-

Once layers have been trimmed in the MultiMask they can be combined into a single - mosaic. We provide access to this mosaic in the form of file downloads, web service endpoints, and direct integrations - into other platforms. Read more in the docs

-

If the MultiMask has been updated after one of these artifacts was generated, dates will be shown in - red and you can queue that mosaic to be rebuilt.

+

Once layers have been trimmed in the MultiMask they are combined into a single + mosaic output, or "derivative". You can access these derivatives here in the form of file downloads, web service endpoints, and direct integrations + into other platforms.

+

To queue the creation (or recreation) of mosaics for each layerset, use the summary table below. If a derivative has been created, but + the MultiMask has since been edited, it will be marked as stale it should be queued for a rebuild. + Read more in the docs

{#if loading} @@ -152,24 +132,31 @@ {`${ls.name} (${ls.layers_masked_ct}/${ls.layers.length} layers masked)`} - {#if ls.multimask_date} - - masks last updated: {ls.masksDateDisplay} - - {/if} +
+ {#if ls.multimask_date} + + masks last edit: {ls.masksDateDisplay} + + {/if} + +
Cloud Optimized GeoTIFF - - {ls.cogDateDisplay} - {#if ls.showCogQueueBtn} - - {/if} - + }}>build COG +
Direct download (.tif)
-
XYZ tile endpoint (dynamic)
+
Dynamic XYZ endpoint
- Static XYZ Tileset - - {ls.xyzDateDisplay} - {#if ls.showXyzQueueBtn} - - {/if} - + }}>build XYZ tileset +
Direct download (gzipped tarfile)
-
Tiles endpoint
+
Static XYZ endpoint
- Extensions... - - always current, unless noted - + Extensions
-
Open in OpenHistoricalMap editor (uses XYZ tile endpoint)
+
Open in OpenHistoricalMap editor (uses dynamic XYZ endpoint)
\ No newline at end of file diff --git a/ohmg/frontend/svelte_components/src/components/shared/tags/MosaicStatus.svelte b/ohmg/frontend/svelte_components/src/components/shared/tags/MosaicStatus.svelte new file mode 100644 index 00000000..cd78e4c3 --- /dev/null +++ b/ohmg/frontend/svelte_components/src/components/shared/tags/MosaicStatus.svelte @@ -0,0 +1,26 @@ + + +{#if job.stage == "completed"} + {#if stale} +
+ stale +
+ {:else} +
+ up-to-date +
+ {/if} +{:else} +
+ {job.stage} +
+{/if} \ No newline at end of file