From d20d16c2068cfb77079554acf476934be51d1d14 Mon Sep 17 00:00:00 2001 From: Amal Shaji Date: Fri, 14 Jun 2024 13:20:34 +0530 Subject: [PATCH] Update client and admin ui (#68) * update portr client ui * update admin ui --- .../src/lib/components/team-selector.svelte | 2 +- .../src/lib/components/users/delete.svelte | 5 +- .../lib/components/users/invite-user.svelte | 8 +- admin/src/web/src/pages/app/myaccount.svelte | 4 +- admin/src/web/src/pages/app/settings.svelte | 4 +- admin/src/web/src/pages/home.svelte | 13 +- .../instance-settings/emailSettings.svelte | 12 +- .../pages/instance-settings/newteam.svelte | 6 +- .../internal/client/dashboard/ui/package.json | 2 + .../client/dashboard/ui/pnpm-lock.yaml | 17 +++ .../ui/src/lib/components/HttpBadge.svelte | 43 ++++++ .../src/lib/components/InspectorIcon.svelte | 46 +++---- .../src/lib/components/RenderContent.svelte | 7 +- .../components/RenderFormUrlEncoded.svelte | 2 +- .../components/RenderMultipartFormData.svelte | 6 +- .../client/dashboard/ui/src/lib/types.d.ts | 1 + .../client/dashboard/ui/src/lib/utils.ts | 127 +++++++++++------- .../client/dashboard/ui/src/pages/Home.svelte | 8 +- .../dashboard/ui/src/pages/Inspect.svelte | 17 +-- .../ui/src/pages/RequestDetails.svelte | 87 ++++++++---- 20 files changed, 277 insertions(+), 140 deletions(-) create mode 100644 tunnel/internal/client/dashboard/ui/src/lib/components/HttpBadge.svelte diff --git a/admin/src/web/src/lib/components/team-selector.svelte b/admin/src/web/src/lib/components/team-selector.svelte index 6afb633a..bee49840 100644 --- a/admin/src/web/src/lib/components/team-selector.svelte +++ b/admin/src/web/src/lib/components/team-selector.svelte @@ -44,7 +44,7 @@ - +
Cancel diff --git a/admin/src/web/src/lib/components/users/invite-user.svelte b/admin/src/web/src/lib/components/users/invite-user.svelte index c5d84e11..b7505b27 100644 --- a/admin/src/web/src/lib/components/users/invite-user.svelte +++ b/admin/src/web/src/lib/components/users/invite-user.svelte @@ -1,14 +1,14 @@ + + + {method} + diff --git a/tunnel/internal/client/dashboard/ui/src/lib/components/InspectorIcon.svelte b/tunnel/internal/client/dashboard/ui/src/lib/components/InspectorIcon.svelte index 73aa8bfd..24de31f9 100644 --- a/tunnel/internal/client/dashboard/ui/src/lib/components/InspectorIcon.svelte +++ b/tunnel/internal/client/dashboard/ui/src/lib/components/InspectorIcon.svelte @@ -1,24 +1,24 @@ -
- - - -
+ d="M3.66 7.300000000000001 l0 4.98 l3.86 0 c1.74 0 2.92 -0.64 2.92 -2.58 c0 -1.82 -1.24 -2.4 -2.84 -2.4 l-3.94 0 z M3.66 13.940000000000001 l0 6.06 l-1.94 0 l0 -14.36 l6.46 0 c2.66 0 4.26 1.72 4.26 4.04 c0 2 -1.14 4.26 -4.26 4.26 l-4.52 0 z M14.04 14.76 c0 -2.7 1.52 -5.52 4.86 -5.52 s4.86 2.82 4.86 5.52 s-1.52 5.52 -4.86 5.52 s-4.86 -2.82 -4.86 -5.52 z M15.86 14.76 c0 1.4 0.52 4 3.04 4 s3.04 -2.6 3.04 -4 s-0.52 -4 -3.04 -4 s-3.04 2.6 -3.04 4 z M27.76 13.92 l0 6.08 l-1.76 0 l0 -10.46 l1.66 0 l0 1.74 l0.04 0 c0.7 -1.22 1.62 -2.04 2.94 -2.04 c0.22 0 0.32 0.02 0.46 0.06 l0 1.82 l-0.66 0 c-1.64 0 -2.68 1.28 -2.68 2.8 z M36.26 11 l-1.68 0 l0 6.8 c0 0.82 0.7 0.82 1.06 0.82 l0.62 0 l0 1.38 c-0.64 0.06 -1.14 0.14 -1.32 0.14 c-1.74 0 -2.12 -0.98 -2.12 -2.24 l0 -6.9 l-1.42 0 l0 -1.46 l1.42 0 l0 -2.92 l1.76 0 l0 2.92 l1.68 0 l0 1.46 z M39.98 13.92 l0 6.08 l-1.76 0 l0 -10.46 l1.66 0 l0 1.74 l0.04 0 c0.7 -1.22 1.62 -2.04 2.94 -2.04 c0.22 0 0.32 0.02 0.46 0.06 l0 1.82 l-0.66 0 c-1.64 0 -2.68 1.28 -2.68 2.8 z M52.660000000000004 5.640000000000001 l0 14.36 l-1.94 0 l0 -14.36 l1.94 0 z M64.28 12.879999999999999 l0 7.12 l-1.76 0 l0 -6.44 c0 -1.82 -0.52 -2.74 -2.24 -2.74 c-1 0 -2.76 0.64 -2.76 3.48 l0 5.7 l-1.76 0 l0 -10.46 l1.66 0 l0 1.48 l0.04 0 c0.38 -0.56 1.36 -1.78 3.16 -1.78 c1.62 0 3.66 0.66 3.66 3.64 z M74.52000000000001 12.52 l-1.7 0 c-0.02 -0.66 -0.26 -1.76 -2.48 -1.76 c-0.54 0 -2.08 0.18 -2.08 1.48 c0 0.86 0.54 1.06 1.9 1.4 l1.76 0.44 c2.18 0.54 2.94 1.34 2.94 2.76 c0 2.16 -1.78 3.46 -4.14 3.46 c-4.14 0 -4.44 -2.4 -4.5 -3.66 l1.7 0 c0.06 0.82 0.3 2.14 2.78 2.14 c1.26 0 2.4 -0.5 2.4 -1.66 c0 -0.84 -0.58 -1.12 -2.08 -1.5 l-2.04 -0.5 c-1.46 -0.36 -2.42 -1.1 -2.42 -2.54 c0 -2.3 1.9 -3.34 3.96 -3.34 c3.74 0 4 2.76 4 3.28 z M78.42000000000002 15.26 c0 2.78 1.74 3.52 2.86 3.52 c1.92 0 2.82 -1.74 2.82 -4.04 c0 -1.34 -0.14 -3.92 -2.86 -3.92 c-2.54 0 -2.82 2.74 -2.82 4.44 z M76.74000000000001 24.14 l0 -14.6 l1.66 0 l0 1.48 l0.04 0 c0.42 -0.6 1.22 -1.78 3.12 -1.78 c2.78 0 4.36 2.28 4.36 5.22 c0 2.5 -1.04 5.84 -4.6 5.84 c-1.4 0 -2.32 -0.66 -2.78 -1.4 l-0.04 0 l0 5.24 l-1.76 0 z M95.12000000000002 16.72 l1.76 0 c-0.06 0.5 -0.54 1.98 -1.86 2.86 c-0.48 0.32 -1.16 0.72 -2.84 0.72 c-2.94 0 -4.68 -2.22 -4.68 -5.24 c0 -3.24 1.56 -5.82 5.02 -5.82 c3.02 0 4.5 2.4 4.5 6.1 l-7.64 0 c0 2.18 1.02 3.44 3.04 3.44 c1.66 0 2.64 -1.28 2.7 -2.06 z M89.38000000000002 13.940000000000001 l5.82 0 c-0.1 -1.62 -0.78 -3.12 -2.92 -3.12 c-1.62 0 -2.9 1.5 -2.9 3.12 z M107.36000000000001 13.059999999999999 l-1.7 0 c-0.22 -1.4 -1 -2.24 -2.48 -2.24 c-2.18 0 -2.88 2.08 -2.88 3.94 c0 1.8 0.44 4.02 2.86 4.02 c1.18 0 2.2 -0.88 2.5 -2.48 l1.7 0 c-0.18 1.66 -1.2 4 -4.26 4 c-2.94 0 -4.68 -2.22 -4.68 -5.24 c0 -3.24 1.56 -5.82 5.02 -5.82 c2.74 0 3.78 2 3.92 3.82 z M112.96000000000002 11 l-1.68 0 l0 6.8 c0 0.82 0.7 0.82 1.06 0.82 l0.62 0 l0 1.38 c-0.64 0.06 -1.14 0.14 -1.32 0.14 c-1.74 0 -2.12 -0.98 -2.12 -2.24 l0 -6.9 l-1.42 0 l0 -1.46 l1.42 0 l0 -2.92 l1.76 0 l0 2.92 l1.68 0 l0 1.46 z M114.08000000000003 14.76 c0 -2.7 1.52 -5.52 4.86 -5.52 s4.86 2.82 4.86 5.52 s-1.52 5.52 -4.86 5.52 s-4.86 -2.82 -4.86 -5.52 z M115.90000000000002 14.76 c0 1.4 0.52 4 3.04 4 s3.04 -2.6 3.04 -4 s-0.52 -4 -3.04 -4 s-3.04 2.6 -3.04 4 z M127.80000000000003 13.92 l0 6.08 l-1.76 0 l0 -10.46 l1.66 0 l0 1.74 l0.04 0 c0.7 -1.22 1.62 -2.04 2.94 -2.04 c0.22 0 0.32 0.02 0.46 0.06 l0 1.82 l-0.66 0 c-1.64 0 -2.68 1.28 -2.68 2.8 z" + > diff --git a/tunnel/internal/client/dashboard/ui/src/lib/components/RenderContent.svelte b/tunnel/internal/client/dashboard/ui/src/lib/components/RenderContent.svelte index 848321a5..981e9b6c 100644 --- a/tunnel/internal/client/dashboard/ui/src/lib/components/RenderContent.svelte +++ b/tunnel/internal/client/dashboard/ui/src/lib/components/RenderContent.svelte @@ -1,5 +1,7 @@ -
+
@@ -32,9 +34,9 @@ {#each tunnels as tunnel, i (i)} gotoTunnel(tunnel)} - class="hover:cursor-pointer" + class="hover:cursor-pointer hover:bg-gray-100" > - {tunnel.Subdomain} + {tunnel.Subdomain} {tunnel.Localport} {/each} diff --git a/tunnel/internal/client/dashboard/ui/src/pages/Inspect.svelte b/tunnel/internal/client/dashboard/ui/src/pages/Inspect.svelte index 6af36eab..98f1edf4 100644 --- a/tunnel/internal/client/dashboard/ui/src/pages/Inspect.svelte +++ b/tunnel/internal/client/dashboard/ui/src/pages/Inspect.svelte @@ -1,13 +1,14 @@ + + {@html atomonelight} + +

-
{$currentRequest?.Method}
-
{$currentRequest?.Url}
+ +
+

{$currentRequest?.Url}

+
- - + {/if} +

+
+ {#if $currentRequest?.LoggedAt} +

+ {convertDateToHumanReadable($currentRequest.LoggedAt)} +

+ {/if} +
-

+

Request Headers

-
-
{JSON.stringify(
+      
+ + )} + />
-

+

Request Body

-
+
-

+

Response Headers

-
-
{JSON.stringify(
+      
+ + )} + />
-

+

Response Body

-
+
+ +