From 8bc7ee50bf72f745df530182a09ecb6bfc9aa328 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 20 Aug 2023 12:11:43 +0200 Subject: [PATCH] add copy to clipboard to display result --- frontend/src/lib/components/ArgInfo.svelte | 2 +- frontend/src/lib/components/DisplayResult.svelte | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/ArgInfo.svelte b/frontend/src/lib/components/ArgInfo.svelte index 9bc252684d..52138b045c 100644 --- a/frontend/src/lib/components/ArgInfo.svelte +++ b/frontend/src/lib/components/ArgInfo.svelte @@ -30,7 +30,7 @@ color="light" size="xs" > -
Copy to clipboard
+
Copy
{#if isString(jsonViewerContent)} diff --git a/frontend/src/lib/components/DisplayResult.svelte b/frontend/src/lib/components/DisplayResult.svelte index 986f131c67..ece57a43f0 100644 --- a/frontend/src/lib/components/DisplayResult.svelte +++ b/frontend/src/lib/components/DisplayResult.svelte @@ -137,7 +137,8 @@ class="mb-2 w-full text-sm relative" >The result keys are: {truncate(Object.keys(result).join(', '), 50)} {#if !disableExpand} -
+
+
{/if} @@ -280,6 +281,13 @@ {:else} + {#if typeof result == 'string'} +
+ +
+ {/if} {/if} {/if} {:else} @@ -313,7 +321,13 @@ JSON is too large to be displayed in full.
{:else} + FOO + {#if typeof result == 'string'} + + {/if} {/if}