fix(webui): show real source endpoints and New source on the Inspector tab instead of a placeholder

This commit is contained in:
sam committed 2026-10-06 03:25:12 +11:00
1 parent 95ca1cd303
commit 93bd7f50fb
5 files changed
+76 -98

No files matched your search

-3
View File
@@ -4,7 +4,6 @@ import { onMounted, ref } from "vue";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import SourcesPanel from "@/sources/SourcesPanel.vue";
import { useLiveResource } from "@/stores/live-updates";
import BindingEditor from "./BindingEditor.vue";
import BindingsTable from "./BindingsTable.vue";
@@ -73,8 +72,6 @@ async function handleDelete(binding: Binding): Promise<void> {
<template>
<div>
<SourcesPanel />
<!-- The tab owns the actions that belong to it. The page's header names the
page, not this panel, so nothing here repeats "Events". -->
<div class="mb-4 flex flex-wrap items-center justify-end gap-2">
+1 -17
View File
@@ -1,9 +1,7 @@
<script setup lang="ts">
import { Inbox, TriangleAlert } from "@lucide/vue";
import { ref } from "vue";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import {
Empty,
EmptyDescription,
@@ -28,16 +26,6 @@ import { captures, enabled, error, loading } from "./state";
* window with nothing in it yet.
*/
// The receiver's path, held as a string rather than typed into the template:
// its source segment is angle-bracketed, which a template parser reads as a
// tag.
const endpoint = "/webhooks/capture/<source>";
const copied = ref(false);
async function copyEndpoint() {
await navigator.clipboard.writeText(`${location.origin}${endpoint}`);
copied.value = true;
setTimeout(() => (copied.value = false), 1500);
}
</script>
<template>
@@ -64,12 +52,8 @@ async function copyEndpoint() {
<EmptyHeader>
<EmptyMedia variant="icon"><Inbox /></EmptyMedia>
<EmptyTitle>No captures yet</EmptyTitle>
<EmptyDescription>Webhooks sent here appear below.</EmptyDescription>
<EmptyDescription>Create a source above and point a sender at its URL.</EmptyDescription>
</EmptyHeader>
<div class="flex items-center gap-2 rounded-md border border-border bg-background py-1 pr-1 pl-3">
<code class="font-mono text-xs">{{ endpoint }}</code>
<Button variant="ghost" size="sm" @click="copyEndpoint">{{ copied ? "Copied" : "Copy" }}</Button>
</div>
</Empty>
<Table v-else>
+2
View File
@@ -3,6 +3,7 @@ import { breakpointsTailwind, useBreakpoints } from "@vueuse/core";
import { onBeforeUnmount, onMounted, ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import SourcesPanel from "@/sources/SourcesPanel.vue";
import CaptureDetail from "./CaptureDetail.vue";
import CapturesCard from "./CapturesCard.vue";
import EventTypesCard from "./EventTypesCard.vue";
@@ -90,6 +91,7 @@ watch(selected, (capture) => {
</script>
<template>
<SourcesPanel />
<!-- Split only when there is a capture to show beside the list. -->
<div
class="grid min-w-0 items-start gap-4"