Skip to content

Commit 1de7c11

Browse files
committed
Supported FRACTAL_API_V1_MODE=include_read_only
1 parent 31a5c06 commit 1de7c11

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

docs/environment-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ 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; supported values are: `include`, `include_read_only`, `exclude`; the default value is `include`;
2020
* `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);
2121
* `WARNING_BANNER_PATH`: specifies the path to a text file containing the warning banner message displayed on the site; the banner is used to inform users about important issues, such as external resources downtime or maintenance alerts; if the variable is empty or unset no banner is displayed.
2222

src/routes/+layout.server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export async function load({ locals, request, url }) {
2222
return {
2323
...pageInfo,
2424
warningBanner,
25-
v1Enabled: env.FRACTAL_API_V1_MODE !== 'exclude'
25+
apiV1Mode: env.FRACTAL_API_V1_MODE
2626
};
2727
}
2828

src/routes/+layout.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
let clientVersion = __APP_VERSION__;
1818
1919
$: displayVersionSelector =
20-
$page.data.v1Enabled &&
20+
$page.data.apiV1Mode !== 'exclude' &&
2121
(!isSubPage($page.url.pathname, apiVersion) ||
2222
$page.url.pathname === '/v2/admin/jobs' ||
2323
$page.url.pathname === '/v1/admin/jobs') &&
@@ -221,6 +221,9 @@
221221
Sorry, we are performing some maintenance on fractal-server. It will be back online soon.
222222
</div>
223223
{/if}
224+
{#if apiVersion === 'v1' && $page.data.apiV1Mode === 'include_read_only'}
225+
<div class="alert alert-warning">Warning: legacy API is in read-only mode.</div>
226+
{/if}
224227
{#if warningBanner}
225228
<div class="alert alert-warning">
226229
{#each warningBanner.split('\n') as line, index}

0 commit comments

Comments
 (0)