http routes static assets nits (#4676)

This commit is contained in:
HugoCasa
2024-11-08 20:25:03 +01:00
committed by GitHub
parent 2b8b95ac33
commit de75b806ec
2 changed files with 10 additions and 3 deletions
@@ -283,7 +283,9 @@
<ToggleButtonGroup
class="w-auto"
bind:selected={http_method}
disabled={!($userStore?.is_admin || $userStore?.is_super_admin) || !can_write}
disabled={!($userStore?.is_admin || $userStore?.is_super_admin) ||
!can_write ||
!!static_asset_config}
>
<ToggleButton label="GET" value="get" />
<ToggleButton label="POST" value="post" />
@@ -328,6 +330,7 @@
script_path = ''
initialScriptPath = ''
is_flow = false
http_method = 'get'
} else {
static_asset_config = undefined
}
@@ -200,7 +200,7 @@
<div class="text-center text-sm text-tertiary mt-2"> No routes </div>
{:else if items?.length}
<div class="border rounded-md divide-y">
{#each items.slice(0, nbDisplayed) as { path, edited_by, edited_at, script_path, route_path, is_flow, extra_perms, canWrite, marked, http_method } (path)}
{#each items.slice(0, nbDisplayed) as { path, edited_by, edited_at, script_path, route_path, is_flow, extra_perms, canWrite, marked, http_method, static_asset_config } (path)}
{@const href = `${is_flow ? '/flows/get' : '/scripts/get'}/${script_path}`}
<div
@@ -228,7 +228,11 @@
{path}
</div>
<div class="text-secondary text-xs truncate text-left font-light">
runnable: {script_path}
{#if static_asset_config}
file: {static_asset_config.s3}
{:else}
runnable: {script_path}
{/if}
</div>
</a>