This commit is contained in:
user
2026-03-28 19:29:08 +02:00
parent ce13ad8124
commit c52612825c
2 changed files with 19 additions and 20 deletions

View File

@@ -47,6 +47,8 @@ export const secondaryNavTree = [
}, },
] as AppSidebarItem[]; ] as AppSidebarItem[];
export const FRONTEND_URL =
env.PUBLIC_FRONTEND_URL ?? "https://iotam-frontend.snapyra.com";
export const WS_SCRCPY_URL = export const WS_SCRCPY_URL =
env.PUBLIC_WS_SCRCPY_SVC_URL ?? "https://iotam-ws-scrcpy.snapyra.com"; env.PUBLIC_WS_SCRCPY_SVC_URL ?? "https://iotam-ws-scrcpy.snapyra.com";

View File

@@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import Icon from "$lib/components/atoms/icon.svelte"; import Icon from "$lib/components/atoms/icon.svelte";
import MaxWidthWrapper from "$lib/components/molecules/max-width-wrapper.svelte";
import * as AlertDialog from "$lib/components/ui/alert-dialog/index.js"; import * as AlertDialog from "$lib/components/ui/alert-dialog/index.js";
import { Badge } from "$lib/components/ui/badge"; import { Badge } from "$lib/components/ui/badge";
import { Button, buttonVariants } from "$lib/components/ui/button"; import { Button, buttonVariants } from "$lib/components/ui/button";
@@ -8,17 +9,15 @@
import { Input } from "$lib/components/ui/input"; import { Input } from "$lib/components/ui/input";
import { Label } from "$lib/components/ui/label"; import { Label } from "$lib/components/ui/label";
import * as Table from "$lib/components/ui/table"; import * as Table from "$lib/components/ui/table";
import { PUBLIC_FRONTEND_URL } from "$env/static/public"; import { FRONTEND_URL, mainNavTree } from "$lib/core/constants";
import MaxWidthWrapper from "$lib/components/molecules/max-width-wrapper.svelte";
import { mainNavTree } from "$lib/core/constants";
import { linkVM } from "$lib/domains/link/link.vm.svelte"; import { linkVM } from "$lib/domains/link/link.vm.svelte";
import { breadcrumbs } from "$lib/global.stores"; import { breadcrumbs } from "$lib/global.stores";
import Ban from "@lucide/svelte/icons/ban";
import Copy from "@lucide/svelte/icons/copy";
import LinkIcon from "@lucide/svelte/icons/link"; import LinkIcon from "@lucide/svelte/icons/link";
import Plus from "@lucide/svelte/icons/plus"; import Plus from "@lucide/svelte/icons/plus";
import RefreshCw from "@lucide/svelte/icons/refresh-cw"; import RefreshCw from "@lucide/svelte/icons/refresh-cw";
import Trash2 from "@lucide/svelte/icons/trash-2"; import Trash2 from "@lucide/svelte/icons/trash-2";
import Ban from "@lucide/svelte/icons/ban";
import Copy from "@lucide/svelte/icons/copy";
import { onMount } from "svelte"; import { onMount } from "svelte";
import { toast } from "svelte-sonner"; import { toast } from "svelte-sonner";
@@ -51,8 +50,11 @@
} }
function buildPublicLink(token: string): string { function buildPublicLink(token: string): string {
const base = PUBLIC_FRONTEND_URL?.trim() || "/"; const base = FRONTEND_URL.trim() || "/";
const origin = typeof window !== "undefined" ? window.location.origin : "http://localhost"; const origin =
typeof window !== "undefined"
? window.location.origin
: "http://localhost";
const url = new URL(base, origin); const url = new URL(base, origin);
url.searchParams.set("token", token); url.searchParams.set("token", token);
return url.toString(); return url.toString();
@@ -141,9 +143,7 @@
<div class="space-y-3 md:hidden"> <div class="space-y-3 md:hidden">
{#each linkVM.links as link (link.id)} {#each linkVM.links as link (link.id)}
<div class="rounded-lg border bg-background p-3"> <div class="rounded-lg border bg-background p-3">
<div <div class="flex items-start justify-between gap-3">
class="flex items-start justify-between gap-3"
>
<div class="min-w-0"> <div class="min-w-0">
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<code <code
@@ -153,8 +153,7 @@
</code> </code>
<button <button
class="text-muted-foreground hover:text-foreground shrink-0" class="text-muted-foreground hover:text-foreground shrink-0"
onclick={() => onclick={() => copyLink(link.token)}
copyLink(link.token)}
> >
<Copy class="h-3.5 w-3.5" /> <Copy class="h-3.5 w-3.5" />
</button> </button>
@@ -270,9 +269,7 @@
{#each linkVM.links as link (link.id)} {#each linkVM.links as link (link.id)}
<Table.Row> <Table.Row>
<Table.Cell> <Table.Cell>
<div <div class="flex items-center gap-1.5">
class="flex items-center gap-1.5"
>
<code class="text-sm"> <code class="text-sm">
{link.token} {link.token}
</code> </code>
@@ -287,9 +284,7 @@
</Table.Cell> </Table.Cell>
<Table.Cell> <Table.Cell>
<Badge <Badge
variant={statusVariant( variant={statusVariant(link.status)}
link.status,
)}
> >
{link.status} {link.status}
</Badge> </Badge>
@@ -358,7 +353,8 @@
<AlertDialog.Title> <AlertDialog.Title>
Delete link? Delete link?
</AlertDialog.Title> </AlertDialog.Title>
<AlertDialog.Description> <AlertDialog.Description
>
This will This will
permanently remove permanently remove
this link. Anyone this link. Anyone
@@ -441,7 +437,8 @@
{/each} {/each}
</select> </select>
<p class="text-muted-foreground text-xs"> <p class="text-muted-foreground text-xs">
Supported apps are managed from the dedicated catalogue page. Supported apps are managed from the dedicated catalogue
page.
</p> </p>
</div> </div>
<div class="space-y-2"> <div class="space-y-2">