-__-
This commit is contained in:
@@ -47,6 +47,8 @@ export const secondaryNavTree = [
|
||||
},
|
||||
] as AppSidebarItem[];
|
||||
|
||||
export const FRONTEND_URL =
|
||||
env.PUBLIC_FRONTEND_URL ?? "https://iotam-frontend.snapyra.com";
|
||||
export const WS_SCRCPY_URL =
|
||||
env.PUBLIC_WS_SCRCPY_SVC_URL ?? "https://iotam-ws-scrcpy.snapyra.com";
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
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 { Badge } from "$lib/components/ui/badge";
|
||||
import { Button, buttonVariants } from "$lib/components/ui/button";
|
||||
@@ -8,17 +9,15 @@
|
||||
import { Input } from "$lib/components/ui/input";
|
||||
import { Label } from "$lib/components/ui/label";
|
||||
import * as Table from "$lib/components/ui/table";
|
||||
import { PUBLIC_FRONTEND_URL } from "$env/static/public";
|
||||
import MaxWidthWrapper from "$lib/components/molecules/max-width-wrapper.svelte";
|
||||
import { mainNavTree } from "$lib/core/constants";
|
||||
import { FRONTEND_URL, mainNavTree } from "$lib/core/constants";
|
||||
import { linkVM } from "$lib/domains/link/link.vm.svelte";
|
||||
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 Plus from "@lucide/svelte/icons/plus";
|
||||
import RefreshCw from "@lucide/svelte/icons/refresh-cw";
|
||||
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 { toast } from "svelte-sonner";
|
||||
|
||||
@@ -51,8 +50,11 @@
|
||||
}
|
||||
|
||||
function buildPublicLink(token: string): string {
|
||||
const base = PUBLIC_FRONTEND_URL?.trim() || "/";
|
||||
const origin = typeof window !== "undefined" ? window.location.origin : "http://localhost";
|
||||
const base = FRONTEND_URL.trim() || "/";
|
||||
const origin =
|
||||
typeof window !== "undefined"
|
||||
? window.location.origin
|
||||
: "http://localhost";
|
||||
const url = new URL(base, origin);
|
||||
url.searchParams.set("token", token);
|
||||
return url.toString();
|
||||
@@ -141,9 +143,7 @@
|
||||
<div class="space-y-3 md:hidden">
|
||||
{#each linkVM.links as link (link.id)}
|
||||
<div class="rounded-lg border bg-background p-3">
|
||||
<div
|
||||
class="flex items-start justify-between gap-3"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<div class="min-w-0">
|
||||
<div class="flex items-center gap-2">
|
||||
<code
|
||||
@@ -153,8 +153,7 @@
|
||||
</code>
|
||||
<button
|
||||
class="text-muted-foreground hover:text-foreground shrink-0"
|
||||
onclick={() =>
|
||||
copyLink(link.token)}
|
||||
onclick={() => copyLink(link.token)}
|
||||
>
|
||||
<Copy class="h-3.5 w-3.5" />
|
||||
</button>
|
||||
@@ -270,9 +269,7 @@
|
||||
{#each linkVM.links as link (link.id)}
|
||||
<Table.Row>
|
||||
<Table.Cell>
|
||||
<div
|
||||
class="flex items-center gap-1.5"
|
||||
>
|
||||
<div class="flex items-center gap-1.5">
|
||||
<code class="text-sm">
|
||||
{link.token}
|
||||
</code>
|
||||
@@ -287,9 +284,7 @@
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
<Badge
|
||||
variant={statusVariant(
|
||||
link.status,
|
||||
)}
|
||||
variant={statusVariant(link.status)}
|
||||
>
|
||||
{link.status}
|
||||
</Badge>
|
||||
@@ -358,7 +353,8 @@
|
||||
<AlertDialog.Title>
|
||||
Delete link?
|
||||
</AlertDialog.Title>
|
||||
<AlertDialog.Description>
|
||||
<AlertDialog.Description
|
||||
>
|
||||
This will
|
||||
permanently remove
|
||||
this link. Anyone
|
||||
@@ -441,7 +437,8 @@
|
||||
{/each}
|
||||
</select>
|
||||
<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>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user