Skip to content

Commit fe3ce51

Browse files
committed
Added links to sandbox pages
1 parent 4899b3c commit fe3ce51

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

src/routes/+layout.svelte

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
if (pathname === '/') {
7676
return 'home';
7777
}
78-
for (const section of ['projects', 'tasks', 'jobs', 'admin', 'auth']) {
78+
for (const section of ['projects', 'tasks', 'jobs', 'admin', 'auth', 'sandbox']) {
7979
if (pathname.startsWith(`/${section}`) || pathname.startsWith(`/${apiVersion}/${section}`)) {
8080
return section;
8181
}
@@ -118,6 +118,13 @@
118118
<li class="nav-item">
119119
<a href="/" class="nav-link" class:active={selectedSection === 'home'}> Home </a>
120120
</li>
121+
{#if import.meta.env.MODE === 'development' && selectedSection === 'sandbox'}
122+
<li class="nav-item">
123+
<a href="/sandbox" class="nav-link" class:active={selectedSection === 'sandbox'}>
124+
Sandbox pages
125+
</a>
126+
</li>
127+
{/if}
121128
{#if userLoggedIn}
122129
<li class="nav-item">
123130
<a
@@ -215,7 +222,7 @@
215222
<div class="admin-border" />
216223
{/if}
217224
<div class="container p-4">
218-
{#if !server.alive}
225+
{#if !server.alive && selectedSection !== 'sandbox'}
219226
<div class="alert alert-danger">
220227
Sorry, we are performing some maintenance on fractal-server. It will be back online soon.
221228
</div>

src/routes/+page.svelte

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
<a href="/v2/projects" class="btn btn-primary">Projects</a>
2828
<a href="/v2/tasks" class="btn btn-primary">Tasks</a>
2929
<a href="/v2/jobs" class="btn btn-primary">Jobs</a>
30+
{#if import.meta.env.MODE === 'development'}
31+
<a href="/sandbox" class="btn btn-primary">Sandbox</a>
32+
{/if}
3033
</div>
3134

3235
<p>

src/routes/sandbox/+page.svelte

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<h1 class="fw-light">Sandbox pages</h1>
2+
3+
<p>
4+
These pages are visible only in development mode and can be used to simplify the development of
5+
your custom task forms.
6+
</p>
7+
8+
<ul>
9+
<li>
10+
<a href="/sandbox/jsonschema">Sandbox page for JSON Schema</a>
11+
</li>
12+
<li>
13+
<a href="/sandbox/version">Sandbox page for task version update</a>
14+
</li>
15+
</ul>

0 commit comments

Comments
 (0)