Skip to content

Commit 8071fb0

Browse files
committed
Added vizarr viewer link to dataset page
1 parent 919dc34 commit 8071fb0

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

docs/environment-variables.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ The following environment variables can be used to configure fractal-web.
1616
* `LOG_FILE`: the path of the file where logs will be written; by default is unset and no file will be created;
1717
* `LOG_LEVEL_FILE`: the log level of logs that will be written to the file; the default value is `info`;
1818
* `LOG_LEVEL_CONSOLE`: the log level of logs that will be written to the console; the default value is `warn`;
19-
* `FRACTAL_API_V1_MODE`: include/exclude V1 pages and version switcher; the default value is `include`.
19+
* `FRACTAL_API_V1_MODE`: include/exclude V1 pages and version switcher; the default value is `include`;
20+
* `PUBLIC_FRACTAL_VIZARR_VIEWER_URL`: URL to [fractal-vizarr-viewer](https://github.com/fractal-analytics-platform/fractal-vizarr-viewer) service (e.g. http://localhost:3000/vizarr for testing).
2021

2122
When running directly using `node` command these extra variables can also be configured:
2223

src/routes/v2/projects/[projectId]/datasets/[datasetId]/+page.svelte

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
import SlimSelect from 'slim-select';
1212
import { onMount, tick } from 'svelte';
1313
import { objectChanged } from '$lib/common/component_utilities';
14+
import { env } from '$env/dynamic/public';
15+
16+
const vizarrViewerUrl = env.PUBLIC_FRACTAL_VIZARR_VIEWER_URL
17+
? env.PUBLIC_FRACTAL_VIZARR_VIEWER_URL.replace(/\/$|$/, '/')
18+
: null;
1419
1520
let projectId = $page.params.projectId;
1621
@@ -532,6 +537,16 @@
532537
<td><BooleanIcon value={image.types[typeKey]} /></td>
533538
{/each}
534539
<td class="col-2">
540+
{#if vizarrViewerUrl}
541+
<a
542+
class="btn btn-info"
543+
href="{vizarrViewerUrl}?source={vizarrViewerUrl}data{image.zarr_url}"
544+
target="_blank"
545+
>
546+
<i class="bi bi-eye" />
547+
View
548+
</a>
549+
{/if}
535550
<button class="btn btn-primary" on:click={() => imageModal?.openForEditing(image)}>
536551
<i class="bi bi-pencil" />
537552
Edit

0 commit comments

Comments
 (0)