refactor(ui): colocate Events files and split Extensions into nested routes
This commit is contained in:
80 files changed
+725
-560
No files matched your search
@@ -34,6 +34,20 @@ state; the UI presents them and submits operator choices.
|
||||
layouts must collapse cleanly: dropdowns instead of side lists, stacked panes,
|
||||
and nothing overlapping the canvas.
|
||||
|
||||
## Routing and layout
|
||||
|
||||
- Routes are files. `src/pages/` mirrors the URL: a list is `index.vue`, its
|
||||
detail is `[id].vue`, and a section's shared frame is `<name>.vue` beside the
|
||||
`<name>/` folder. Nav label, description, `section` and `navPath` go in the
|
||||
page's `definePage` meta; `pages.json` is generated from it.
|
||||
- A page's own code lives beside it: `components/` for `.vue` files (excluded
|
||||
from routing) and `lib/` for modules. Code used by several pages goes in
|
||||
`src/components`, `src/lib` or `src/stores`, never in another page's folder.
|
||||
- Layouts are `src/layouts`, chosen by `meta.layout`. Change shared chrome there,
|
||||
not in a page.
|
||||
- State that picks a view (a tab, a step) is a route, not `?tab=`. Query strings
|
||||
carry filters and selections only.
|
||||
|
||||
## Product scope
|
||||
|
||||
- Respect the existing feature set. New features honour instructions, policies,
|
||||
|
||||
@@ -80,6 +80,7 @@ const collected: Page[] = [];
|
||||
const opts = resolveOptions({
|
||||
root: uiRoot,
|
||||
routesFolder: "src/pages",
|
||||
exclude: ["**/components/**"],
|
||||
dts: false,
|
||||
extendRoute(route) {
|
||||
const file = route.components.get("default");
|
||||
|
||||
@@ -9,7 +9,7 @@ definePage({
|
||||
});
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { enabled as captureEnabled, loading as captureLoading } from "@/captures/state";
|
||||
import { enabled as captureEnabled, loading as captureLoading } from "@/pages/events/inspector/lib/state";
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import { RouterLink, useRoute, useRouter } from "vue-router";
|
||||
|
||||
@@ -19,8 +19,8 @@ import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { api } from "@/lib/api";
|
||||
import { useLiveResource, useSessionStore } from "@/stores/session";
|
||||
import { activeTab, availableTabs, stepsFor, tabPath } from "@/events/tab-selection";
|
||||
import { loadEventCounts, type EventsCounts } from "@/events/counts";
|
||||
import { activeTab, availableTabs, stepsFor, tabPath } from "@/pages/events/lib/tab-selection";
|
||||
import { loadEventCounts, type EventsCounts } from "@/pages/events/lib/counts";
|
||||
|
||||
/**
|
||||
* The Events surfaces: what arrived, how its fields are read, and which workflow
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import BindingsPage from "@/bindings/BindingsPage.vue";
|
||||
|
||||
definePage({
|
||||
name: "events-bindings",
|
||||
meta: {
|
||||
label: "Bindings",
|
||||
description: "Bindings that decide which workflow an event starts.",
|
||||
navPath: "/events",
|
||||
section: "bindings",
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BindingsPage />
|
||||
</template>
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { errors } from "@/copy/errors";
|
||||
import TriggerRuns from "./TriggerRuns.vue";
|
||||
import TriggerRuns from "@/pages/events/bindings/components/TriggerRuns.vue";
|
||||
import { computed, ref, watch } from "vue";
|
||||
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
} from "@/components/ui/dialog";
|
||||
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { eventTypeLabel, type EventType } from "@/captures/event-types";
|
||||
import { eventTypeLabel, type EventType } from "@/pages/events/inspector/lib/event-types";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
type BindingDraft,
|
||||
type MappingOption,
|
||||
type WorkflowOption,
|
||||
} from "./binding-trigger";
|
||||
} from "@/pages/events/bindings/lib/binding-trigger";
|
||||
|
||||
/**
|
||||
* The binding editor: name, the event type it applies to, an optional mapping
|
||||
+3
-3
@@ -6,9 +6,9 @@ import { Button } from "@/components/ui/button";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import { MoreMenu } from "@/components/ui/more-menu";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import BindingStatusBadge from "./BindingStatusBadge.vue";
|
||||
import { eventTypeLabel, type EventType } from "@/captures/event-types";
|
||||
import type { Binding } from "./binding-trigger";
|
||||
import BindingStatusBadge from "@/pages/events/bindings/components/BindingStatusBadge.vue";
|
||||
import { eventTypeLabel, type EventType } from "@/pages/events/inspector/lib/event-types";
|
||||
import type { Binding } from "@/pages/events/bindings/lib/binding-trigger";
|
||||
|
||||
/** One saved binding's summary row. */
|
||||
const props = defineProps<{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { statusKind, statusLabel } from "./binding-draft";
|
||||
import { statusKind, statusLabel } from "@/pages/events/bindings/lib/binding-draft";
|
||||
|
||||
/** A binding's lifecycle state: pending approval, armed or paused. The
|
||||
* colour ramp is shared with every other status in the dashboard, so the
|
||||
+4
-4
@@ -17,10 +17,10 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import BindingRow from "./BindingRow.vue";
|
||||
import type { EventType } from "@/captures/event-types";
|
||||
import type { Binding } from "./binding-trigger";
|
||||
import type { LoadFailure } from "./use-bindings";
|
||||
import BindingRow from "@/pages/events/bindings/components/BindingRow.vue";
|
||||
import type { EventType } from "@/pages/events/inspector/lib/event-types";
|
||||
import type { Binding } from "@/pages/events/bindings/lib/binding-trigger";
|
||||
import type { LoadFailure } from "@/pages/events/bindings/lib/use-bindings";
|
||||
|
||||
const props = defineProps<{
|
||||
/** null means loading, [] means loaded and empty. */
|
||||
+1
-1
@@ -9,7 +9,7 @@ import {
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import type { Binding } from "./binding-trigger";
|
||||
import type { Binding } from "@/pages/events/bindings/lib/binding-trigger";
|
||||
|
||||
/** Confirming a delete, and nothing else. A binding cannot be recovered, so
|
||||
* the action is behind a dialog rather than a click. */
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
definePage({
|
||||
name: "events-bindings",
|
||||
meta: {
|
||||
label: "Bindings",
|
||||
description: "Bindings that decide which workflow an event starts.",
|
||||
navPath: "/events",
|
||||
section: "bindings",
|
||||
},
|
||||
});
|
||||
|
||||
import { errors } from "@/copy/errors";
|
||||
import { Plus } from "@lucide/vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
@@ -7,11 +17,11 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { useLiveResource } from "@/stores/session";
|
||||
import BindingEditor from "./BindingEditor.vue";
|
||||
import BindingsTable from "./BindingsTable.vue";
|
||||
import DeleteBindingDialog from "./DeleteBindingDialog.vue";
|
||||
import type { Binding, BindingDraft } from "./binding-trigger";
|
||||
import { useBindings } from "./use-bindings";
|
||||
import BindingEditor from "@/pages/events/bindings/components/BindingEditor.vue";
|
||||
import BindingsTable from "@/pages/events/bindings/components/BindingsTable.vue";
|
||||
import DeleteBindingDialog from "@/pages/events/bindings/components/DeleteBindingDialog.vue";
|
||||
import type { Binding, BindingDraft } from "@/pages/events/bindings/lib/binding-trigger";
|
||||
import { useBindings } from "@/pages/events/bindings/lib/use-bindings";
|
||||
|
||||
/**
|
||||
* Playbook bindings: tie an event type's mapping, an optional filter and a
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
* binding-editor.jsx had from bindings.jsx in the Preact build.
|
||||
*/
|
||||
|
||||
import type { EventType } from "../captures/event-types";
|
||||
import type { EventType } from "@/pages/events/inspector/lib/event-types";
|
||||
|
||||
/**
|
||||
* A binding as GET /api/bindings returns it. Signing belongs to the source the
|
||||
+2
-2
@@ -4,8 +4,8 @@
|
||||
* binding-draft.ts's.
|
||||
*/
|
||||
|
||||
import type { EventType } from "../captures/event-types";
|
||||
import type { Trigger, TriggerInput } from "../lib/api";
|
||||
import type { EventType } from "@/pages/events/inspector/lib/event-types";
|
||||
import type { Trigger, TriggerInput } from "@/lib/api";
|
||||
|
||||
/** A trigger bound to an event type. id is the trigger's id. */
|
||||
export interface Binding {
|
||||
@@ -2,7 +2,7 @@ import { ref } from "vue";
|
||||
|
||||
import { api, ApiError, describeError } from "@/lib/api";
|
||||
import { errors } from "@/copy/errors";
|
||||
import type { EventType } from "@/captures/event-types";
|
||||
import type { EventType } from "@/pages/events/inspector/lib/event-types";
|
||||
import {
|
||||
bindingOfTrigger,
|
||||
bindingPayload,
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
type BindingDraft,
|
||||
type MappingOption,
|
||||
type WorkflowOption,
|
||||
} from "./binding-trigger";
|
||||
} from "@/pages/events/bindings/lib/binding-trigger";
|
||||
|
||||
/**
|
||||
* Why the page has nothing to show. "unconfigured" is a server that doesn't
|
||||
File renamed without changes.
@@ -14,7 +14,7 @@ import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { api, type EventRecord } from "@/lib/api";
|
||||
import { usePoll, useRead } from "@/lib/use-read";
|
||||
import { useLiveResource } from "@/stores/session";
|
||||
import EventDetail from "./EventDetail.vue";
|
||||
import EventDetail from "@/pages/events/components/EventDetail.vue";
|
||||
|
||||
const route = useRoute();
|
||||
const ALL = "__all__";
|
||||
@@ -216,7 +216,7 @@ const connectorPlaceholder = computed(() => {
|
||||
</Select>
|
||||
</Field>
|
||||
<p v-if="!connectorNames.length && !connectors.loading.value && !connectors.error.value" class="col-span-2 text-caption text-fg-muted">
|
||||
<RouterLink class="underline" :to="{ path: '/settings/extensions', query: { tab: 'marketplace', kind: 'connectors' } }">Install a connector</RouterLink> first, then return here to add your source.
|
||||
<RouterLink class="underline" :to="{ path: '/settings/extensions/marketplace', query: { kind: 'connectors' } }">Install a connector</RouterLink> first, then return here to add your source.
|
||||
</p>
|
||||
<Field>
|
||||
<FieldLabel for="source-verification">Verification</FieldLabel>
|
||||
@@ -21,7 +21,7 @@ import { api, describeError, type Trigger, type TriggerInput } from "@/lib/api";
|
||||
import { fromLines, toLines } from "@/lib/lines";
|
||||
import { useRead } from "@/lib/use-read";
|
||||
import { interval } from "@/workflows/use-workflow-list";
|
||||
import { triggerInput } from "./trigger";
|
||||
import { triggerInput } from "@/pages/events/lib/trigger";
|
||||
|
||||
/** With `workflow`, a workflow's id, only the triggers that run it, and new
|
||||
* ones run it. */
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import EventList from "@/events/EventList.vue";
|
||||
import EventList from "@/pages/events/components/EventList.vue";
|
||||
|
||||
definePage({
|
||||
name: "events",
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import CapturesPage from "@/captures/CapturesPage.vue";
|
||||
|
||||
definePage({
|
||||
name: "events-inspector",
|
||||
meta: {
|
||||
label: "Inspector",
|
||||
description: "Captured webhooks and the event types they match.",
|
||||
navPath: "/events",
|
||||
section: "captures",
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<CapturesPage />
|
||||
</template>
|
||||
+4
-4
@@ -11,10 +11,10 @@ import {
|
||||
} from "@/components/ui/card";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { captureSignature } from "./capture-signature";
|
||||
import CapturePayload from "./CapturePayload.vue";
|
||||
import TriggerRuns from "@/bindings/TriggerRuns.vue";
|
||||
import { selected } from "./state";
|
||||
import { captureSignature } from "@/pages/events/inspector/lib/capture-signature";
|
||||
import CapturePayload from "@/pages/events/inspector/components/CapturePayload.vue";
|
||||
import TriggerRuns from "@/pages/events/bindings/components/TriggerRuns.vue";
|
||||
import { selected } from "@/pages/events/inspector/lib/state";
|
||||
|
||||
/**
|
||||
* The selected capture's payload and headers, beside the list.
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
import { computed } from "vue";
|
||||
|
||||
import CodeView from "@/base/CodeView.vue";
|
||||
import { prettyPrint } from "./capture-payload";
|
||||
import { prettyPrint } from "@/pages/events/inspector/lib/capture-payload";
|
||||
|
||||
/**
|
||||
* One labelled block of a capture: its body or its headers, as text. Both are
|
||||
+4
-4
@@ -5,10 +5,10 @@ import { computed } from "vue";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { eventTypes } from "./event-type-state";
|
||||
import { captureIdentity } from "./event-types";
|
||||
import { captureSignature } from "./capture-signature";
|
||||
import { selected, type Capture } from "./state";
|
||||
import { eventTypes } from "@/pages/events/inspector/lib/event-type-state";
|
||||
import { captureIdentity } from "@/pages/events/inspector/lib/event-types";
|
||||
import { captureSignature } from "@/pages/events/inspector/lib/capture-signature";
|
||||
import { selected, type Capture } from "@/pages/events/inspector/lib/state";
|
||||
|
||||
/**
|
||||
* One captured event. The row is the control, not a button sitting in one
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Section } from "@/components/ui/section";
|
||||
import CapturesList from "./CapturesList.vue";
|
||||
import CapturesList from "@/pages/events/inspector/components/CapturesList.vue";
|
||||
|
||||
/** The captured events panel, with the note that qualifies everything inside
|
||||
* it: what an operator reads here has already been through redaction.
|
||||
+2
-2
@@ -18,8 +18,8 @@ import {
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import { errors } from "@/copy/errors";
|
||||
import CaptureRow from "./CaptureRow.vue";
|
||||
import { captures, enabled, error, loading } from "./state";
|
||||
import CaptureRow from "@/pages/events/inspector/components/CaptureRow.vue";
|
||||
import { captures, enabled, error, loading } from "@/pages/events/inspector/lib/state";
|
||||
|
||||
/**
|
||||
* The captures, or the one thing that stands in for them: a read that failed,
|
||||
+2
-2
@@ -16,7 +16,7 @@ import { Label } from "@/components/ui/label";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import RuleEditor from "./RuleEditor.vue";
|
||||
import RuleEditor from "@/pages/events/inspector/components/RuleEditor.vue";
|
||||
import {
|
||||
closeDraft,
|
||||
draft,
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
saveError,
|
||||
saving,
|
||||
sourceLabel,
|
||||
} from "./event-type-state";
|
||||
} from "@/pages/events/inspector/lib/event-type-state";
|
||||
|
||||
/**
|
||||
* One event-type editing session: naming a proposed group, creating a type
|
||||
+3
-3
@@ -35,7 +35,7 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import EventTypeDialog from "./EventTypeDialog.vue";
|
||||
import EventTypeDialog from "@/pages/events/inspector/components/EventTypeDialog.vue";
|
||||
import {
|
||||
confirmDelete,
|
||||
editEventType,
|
||||
@@ -48,8 +48,8 @@ import {
|
||||
sourceLabel,
|
||||
pendingDelete,
|
||||
proposals,
|
||||
} from "./event-type-state";
|
||||
import { ruleSummary } from "./event-types";
|
||||
} from "@/pages/events/inspector/lib/event-type-state";
|
||||
import { ruleSummary } from "@/pages/events/inspector/lib/event-types";
|
||||
|
||||
/**
|
||||
* Proposed event types (groups of unidentified captures sharing a structure)
|
||||
+1
-1
@@ -12,7 +12,7 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import type { PayloadCondition, Rule } from "./event-types";
|
||||
import type { PayloadCondition, Rule } from "@/pages/events/inspector/lib/event-types";
|
||||
|
||||
/**
|
||||
* A match rule's conditions, edited in place: header equalities, then payload
|
||||
@@ -1,13 +1,23 @@
|
||||
<script setup lang="ts">
|
||||
definePage({
|
||||
name: "events-inspector",
|
||||
meta: {
|
||||
label: "Inspector",
|
||||
description: "Captured webhooks and the event types they match.",
|
||||
navPath: "/events",
|
||||
section: "captures",
|
||||
},
|
||||
});
|
||||
|
||||
import { breakpointsTailwind, useBreakpoints } from "@vueuse/core";
|
||||
import { onBeforeUnmount, onMounted, ref, watch } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import CaptureDetail from "./CaptureDetail.vue";
|
||||
import CapturesCard from "./CapturesCard.vue";
|
||||
import EventTypesCard from "./EventTypesCard.vue";
|
||||
import { loadEventTypes } from "./event-type-state";
|
||||
import { captures, load, selectById, selectNewest, selected, useCaptures } from "./state";
|
||||
import CaptureDetail from "@/pages/events/inspector/components/CaptureDetail.vue";
|
||||
import CapturesCard from "@/pages/events/inspector/components/CapturesCard.vue";
|
||||
import EventTypesCard from "@/pages/events/inspector/components/EventTypesCard.vue";
|
||||
import { loadEventTypes } from "@/pages/events/inspector/lib/event-type-state";
|
||||
import { captures, load, selectById, selectNewest, selected, useCaptures } from "@/pages/events/inspector/lib/state";
|
||||
|
||||
/**
|
||||
* Event inspector: recent inbound events, newest first, with the selected
|
||||
File renamed without changes.
File renamed without changes.
+2
-2
@@ -2,14 +2,14 @@ import { ref } from "vue";
|
||||
|
||||
import { errors } from "@/copy/errors";
|
||||
import { api, describeError, type EventSource_ } from "@/lib/api";
|
||||
import { captures } from "./state";
|
||||
import { captures } from "@/pages/events/inspector/lib/state";
|
||||
import {
|
||||
cleanRule,
|
||||
parseHeaderLines,
|
||||
type EventType,
|
||||
type Proposal,
|
||||
type Rule,
|
||||
} from "./event-types";
|
||||
} from "@/pages/events/inspector/lib/event-types";
|
||||
|
||||
/**
|
||||
* The inspector's event types: the named ones, and the groups of unidentified
|
||||
File renamed without changes.
@@ -4,7 +4,7 @@ import { errors } from "@/copy/errors";
|
||||
import { api, describeError } from "@/lib/api";
|
||||
import { keepRows } from "@/lib/keep-unchanged";
|
||||
import { useLiveResource } from "@/stores/session";
|
||||
import { loadEventTypes } from "./event-type-state";
|
||||
import { loadEventTypes } from "@/pages/events/inspector/lib/event-type-state";
|
||||
|
||||
/**
|
||||
* The event inspector's shared state.
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,17 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import MappingsPage from "@/mappings/MappingsPage.vue";
|
||||
|
||||
definePage({
|
||||
name: "events-mappings",
|
||||
meta: {
|
||||
label: "Mappings",
|
||||
description: "Field mappings that name an event's fields.",
|
||||
navPath: "/events",
|
||||
section: "mappings",
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<MappingsPage />
|
||||
</template>
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { actionErrorTitle, type ActionFailure } from "./state";
|
||||
import { actionErrorTitle, type ActionFailure } from "@/pages/events/mappings/lib/state";
|
||||
|
||||
/**
|
||||
* One failed operator action. The title comes from the classified kind, so an
|
||||
+1
-1
@@ -12,7 +12,7 @@ import {
|
||||
AlertDialogMedia,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { cancelDelete, confirmDelete, pendingDelete } from "./state";
|
||||
import { cancelDelete, confirmDelete, pendingDelete } from "@/pages/events/mappings/lib/state";
|
||||
|
||||
/**
|
||||
* The destructive confirmation for one mapping. Deleting unprompted is not
|
||||
+5
-5
@@ -10,10 +10,10 @@ import {
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import MappingActionError from "./MappingActionError.vue";
|
||||
import MappingFieldsTable from "./MappingFieldsTable.vue";
|
||||
import MappingForm from "./MappingForm.vue";
|
||||
import PayloadTree from "./PayloadTree.vue";
|
||||
import MappingActionError from "@/pages/events/mappings/components/MappingActionError.vue";
|
||||
import MappingFieldsTable from "@/pages/events/mappings/components/MappingFieldsTable.vue";
|
||||
import MappingForm from "@/pages/events/mappings/components/MappingForm.vue";
|
||||
import PayloadTree from "@/pages/events/mappings/components/PayloadTree.vue";
|
||||
import {
|
||||
actionError,
|
||||
addField,
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
runPreview,
|
||||
saveMapping,
|
||||
saving,
|
||||
} from "./state";
|
||||
} from "@/pages/events/mappings/lib/state";
|
||||
|
||||
/**
|
||||
* One editing session, in an overlay: the mapping's own fields, the fields
|
||||
+3
-3
@@ -14,9 +14,9 @@ import {
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { FIELD_TYPES, asFieldType } from "./mapping-fields";
|
||||
import MappingPreviewStatus from "./MappingPreviewStatus.vue";
|
||||
import type { MappingField, Preview, PreviewFailure } from "./state";
|
||||
import { FIELD_TYPES, asFieldType } from "@/pages/events/mappings/lib/mapping-fields";
|
||||
import MappingPreviewStatus from "@/pages/events/mappings/components/MappingPreviewStatus.vue";
|
||||
import type { MappingField, Preview, PreviewFailure } from "@/pages/events/mappings/lib/state";
|
||||
|
||||
/**
|
||||
* One bound field: the name the workflow receives, the path it resolves from,
|
||||
+2
-2
@@ -9,8 +9,8 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import MappingFieldRow from "./MappingFieldRow.vue";
|
||||
import { draft, removeField, updateField, type PreviewFailure } from "./state";
|
||||
import MappingFieldRow from "@/pages/events/mappings/components/MappingFieldRow.vue";
|
||||
import { draft, removeField, updateField, type PreviewFailure } from "@/pages/events/mappings/lib/state";
|
||||
|
||||
/**
|
||||
* The fields bound so far, each with what the last preview said about it.
|
||||
+2
-2
@@ -16,7 +16,7 @@ import {
|
||||
import { api } from "@/lib/api";
|
||||
import { ago } from "@/lib/format";
|
||||
import { useRead } from "@/lib/use-read";
|
||||
import { eventTypeLabel } from "@/captures/event-types";
|
||||
import { eventTypeLabel } from "@/pages/events/inspector/lib/event-types";
|
||||
import {
|
||||
captures,
|
||||
capturesEnabled,
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
loadMappings,
|
||||
selectCapture,
|
||||
type Capture,
|
||||
} from "./state";
|
||||
} from "@/pages/events/mappings/lib/state";
|
||||
|
||||
/**
|
||||
* The mapping's own fields: the name it is saved under, the organisational
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import type { MappingField, Preview, PreviewFailure } from "./state";
|
||||
import type { MappingField, Preview, PreviewFailure } from "@/pages/events/mappings/lib/state";
|
||||
|
||||
/**
|
||||
* What the last preview said about one field: the value it resolved to, the
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { eventTypeLabel } from "@/captures/event-types";
|
||||
import { eventTypeLabel } from "@/pages/events/inspector/lib/event-types";
|
||||
import { Timestamp } from "@/components/ui/timestamp";
|
||||
import { matchCountLabel } from "./match-count";
|
||||
import { eventTypes, type Mapping } from "./state";
|
||||
import { matchCountLabel } from "@/pages/events/mappings/lib/match-count";
|
||||
import { eventTypes, type Mapping } from "@/pages/events/mappings/lib/state";
|
||||
|
||||
/** One saved mapping's summary row. Both of its actions are the page's, not the
|
||||
* row's: editing opens the editor overlay, deleting opens the confirmation. */
|
||||
+2
-2
@@ -14,14 +14,14 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import MappingRow from "./MappingRow.vue";
|
||||
import MappingRow from "@/pages/events/mappings/components/MappingRow.vue";
|
||||
import {
|
||||
listLoading,
|
||||
loadError,
|
||||
mappings,
|
||||
requestDelete,
|
||||
startEdit,
|
||||
} from "./state";
|
||||
} from "@/pages/events/mappings/lib/state";
|
||||
|
||||
/**
|
||||
* The saved mappings, in all four states: still loading, unreadable, none yet,
|
||||
+1
-1
@@ -6,7 +6,7 @@ import {
|
||||
pathAppendIndex,
|
||||
pathAppendKey,
|
||||
type FieldPick,
|
||||
} from "./mapping-fields";
|
||||
} from "@/pages/events/mappings/lib/mapping-fields";
|
||||
|
||||
/**
|
||||
* One level of a captured payload, with every key and every leaf clickable, so
|
||||
@@ -1,14 +1,24 @@
|
||||
<script setup lang="ts">
|
||||
definePage({
|
||||
name: "events-mappings",
|
||||
meta: {
|
||||
label: "Mappings",
|
||||
description: "Field mappings that name an event's fields.",
|
||||
navPath: "/events",
|
||||
section: "mappings",
|
||||
},
|
||||
});
|
||||
|
||||
import { Plus } from "@lucide/vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import MappingActionError from "./MappingActionError.vue";
|
||||
import MappingDeleteDialog from "./MappingDeleteDialog.vue";
|
||||
import MappingEditorDialog from "./MappingEditorDialog.vue";
|
||||
import MappingsTable from "./MappingsTable.vue";
|
||||
import { actionError, loadMappings, startCreate } from "./state";
|
||||
import MappingActionError from "@/pages/events/mappings/components/MappingActionError.vue";
|
||||
import MappingDeleteDialog from "@/pages/events/mappings/components/MappingDeleteDialog.vue";
|
||||
import MappingEditorDialog from "@/pages/events/mappings/components/MappingEditorDialog.vue";
|
||||
import MappingsTable from "@/pages/events/mappings/components/MappingsTable.vue";
|
||||
import { actionError, loadMappings, startCreate } from "@/pages/events/mappings/lib/state";
|
||||
|
||||
/**
|
||||
* Payload field mapping: bind named fields to JSON paths inside a real captured
|
||||
File renamed without changes.
File renamed without changes.
@@ -2,12 +2,12 @@ import { ref } from "vue";
|
||||
|
||||
import { api, classifyActionError, describeError, type ActionErrorKind } from "@/lib/api";
|
||||
import { errors } from "@/copy/errors";
|
||||
import type { EventType } from "@/captures/event-types";
|
||||
import type { EventType } from "@/pages/events/inspector/lib/event-types";
|
||||
import {
|
||||
uniqueFieldName,
|
||||
type FieldPick,
|
||||
type FieldType,
|
||||
} from "./mapping-fields";
|
||||
} from "@/pages/events/mappings/lib/mapping-fields";
|
||||
|
||||
/**
|
||||
* The mappings page's shared state: the saved mappings, the captured events a
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import SourceList from "@/events/SourceList.vue";
|
||||
import SourceList from "@/pages/events/components/SourceList.vue";
|
||||
|
||||
definePage({
|
||||
name: "events-sources",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import TriggerList from "@/events/TriggerList.vue";
|
||||
import TriggerList from "@/pages/events/components/TriggerList.vue";
|
||||
|
||||
definePage({
|
||||
name: "events-triggers",
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { useExtensionsStore } from "@/stores/extensions";
|
||||
|
||||
definePage({
|
||||
name: "settings-extensions",
|
||||
meta: {
|
||||
navPath: "/settings",
|
||||
settings: true,
|
||||
@@ -10,211 +17,28 @@ definePage({
|
||||
},
|
||||
});
|
||||
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { ReadError } from "@/components/ui/read-error";
|
||||
import { Item, ItemGroup } from "@/components/ui/item";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import { RouterLink, useRoute, useRouter } from "vue-router";
|
||||
import { ChevronRight, Pencil, Plus, Settings2, Trash2 } from "@lucide/vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";
|
||||
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { MoreMenu } from "@/components/ui/more-menu";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { grants, stage, useExtensionsStore, type CatalogueEntry } from "@/stores/extensions";
|
||||
import { useOrgStore } from "@/stores/org";
|
||||
import { api, type Extension, type ExtensionScope, type SettingField } from "@/lib/api";
|
||||
import { useRead } from "@/lib/use-read";
|
||||
import { fromLines, toLines } from "@/lib/lines";
|
||||
import { stateTone } from "@/runs/state";
|
||||
import InstallationDialog from "@/settings/InstallationDialog.vue";
|
||||
import PackageList from "@/settings/PackageList.vue";
|
||||
import ExtensionsMarketplace from "@/settings/ExtensionsMarketplace.vue";
|
||||
import CatalogueInstallDialog from "@/settings/CatalogueInstallDialog.vue";
|
||||
import CataloguePreviewDialog from "@/settings/CataloguePreviewDialog.vue";
|
||||
import PackageVersionsDialog from "@/settings/PackageVersionsDialog.vue";
|
||||
const TABS = [
|
||||
{ id: "installations", path: "/settings/extensions", label: "Installations" },
|
||||
{ id: "packages", path: "/settings/extensions/packages", label: "Packages" },
|
||||
{ id: "marketplace", path: "/settings/extensions/marketplace", label: "Marketplace" },
|
||||
] as const;
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const VALID_TABS = new Set(["installations", "packages", "marketplace"]);
|
||||
const activeTab = computed(() => {
|
||||
const t = String(route.query.tab ?? "");
|
||||
if (VALID_TABS.has(t)) return t;
|
||||
return route.query.kind ? "packages" : "installations";
|
||||
});
|
||||
function selectTab(next: unknown): void {
|
||||
const value = String(next);
|
||||
if (!VALID_TABS.has(value)) return;
|
||||
void router.replace({ query: { ...route.query, tab: value === "installations" ? undefined : value } });
|
||||
}
|
||||
|
||||
const store = useExtensionsStore();
|
||||
const org = useOrgStore();
|
||||
const loading = ref(true);
|
||||
onMounted(async () => {
|
||||
await Promise.all([store.load(), org.loadOrg()]);
|
||||
loading.value = false;
|
||||
const configureId = String(route.query.configure ?? "");
|
||||
if (configureId) {
|
||||
const target = store.extensions.find((ext) => ext.id === configureId);
|
||||
if (target?.editable) openSettings(target);
|
||||
}
|
||||
|
||||
const activeTab = computed(() => {
|
||||
if (route.path.startsWith("/settings/extensions/packages")) return "packages";
|
||||
if (route.path.startsWith("/settings/extensions/marketplace")) return "marketplace";
|
||||
return "installations";
|
||||
});
|
||||
|
||||
// A new installation may be owned by the instance when the caller administers
|
||||
// it, by their organisation when they own it, and always by themselves.
|
||||
const scopes = computed<ExtensionScope[]>(() => {
|
||||
const out: ExtensionScope[] = [];
|
||||
if (org.instanceAdmin) out.push("instance");
|
||||
if (org.org?.role === "owner") out.push("org");
|
||||
out.push("person");
|
||||
return out;
|
||||
});
|
||||
const scopeLabels: Record<ExtensionScope, string> = { instance: "Instance", org: "Organisation", person: "Person" };
|
||||
|
||||
const sourceLocation = ref("");
|
||||
const sourceKey = ref("");
|
||||
watch(
|
||||
() => store.source,
|
||||
(view) => {
|
||||
sourceLocation.value = view.source?.location ?? "";
|
||||
sourceKey.value = view.source?.public_key ?? "";
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
async function saveSource(): Promise<void> {
|
||||
if (await store.saveSource(sourceLocation.value.trim(), sourceKey.value.trim())) {
|
||||
sourceLocation.value = store.source.source?.location ?? "";
|
||||
sourceKey.value = store.source.source?.public_key ?? "";
|
||||
function selectTab(next: unknown): void {
|
||||
const target = TABS.find((t) => t.id === next);
|
||||
if (target && route.path !== target.path) {
|
||||
void router.push(target.path);
|
||||
}
|
||||
}
|
||||
|
||||
const installing = ref<CatalogueEntry | null>(null);
|
||||
const installOpen = ref(false);
|
||||
function openInstall(entry: CatalogueEntry): void {
|
||||
installing.value = entry;
|
||||
installOpen.value = true;
|
||||
}
|
||||
|
||||
const previewing = ref<CatalogueEntry | null>(null);
|
||||
const previewOpen = ref(false);
|
||||
function openPreview(entry: CatalogueEntry): void {
|
||||
previewing.value = entry;
|
||||
previewOpen.value = true;
|
||||
}
|
||||
|
||||
const versionsOf = ref("");
|
||||
const versionsOpen = ref(false);
|
||||
function openVersions(name: string): void {
|
||||
versionsOf.value = name;
|
||||
versionsOpen.value = true;
|
||||
}
|
||||
// Versions belong to the package, which only an instance administrator
|
||||
// changes.
|
||||
const managesVersions = (extension: Extension) => org.instanceAdmin && extension.managed === true;
|
||||
|
||||
const installation = ref<Extension | null>(null);
|
||||
const installationOpen = ref(false);
|
||||
function openInstallation(extension: Extension | null = null): void {
|
||||
installation.value = extension;
|
||||
installationOpen.value = true;
|
||||
}
|
||||
async function reload(): Promise<void> {
|
||||
await store.load();
|
||||
}
|
||||
|
||||
async function overrideInstallation(extension: Extension, scope: "org" | "person", off: boolean): Promise<void> {
|
||||
await store.overrideInstallation(extension.id, scope, off);
|
||||
}
|
||||
|
||||
function overrideScope(extension: Extension, scope: ExtensionScope, off: boolean): Promise<void> {
|
||||
return scope === "org" || scope === "person" ? overrideInstallation(extension, scope, off) : Promise.resolve();
|
||||
}
|
||||
|
||||
const editing = ref<Extension | null>(null);
|
||||
const settingsOpen = ref(false);
|
||||
const schema = ref<SettingField[]>([]);
|
||||
const values = ref<Record<string, string>>({});
|
||||
const other = ref("");
|
||||
function openSettings(extension: Extension): void {
|
||||
editing.value = extension;
|
||||
schema.value = extension.settings_schema ?? [];
|
||||
const known = new Set(schema.value.map((field) => field.key));
|
||||
values.value = Object.fromEntries(Object.entries(extension.settings ?? {}).filter(([key]) => known.has(key)));
|
||||
other.value = toLines(Object.fromEntries(Object.entries(extension.settings ?? {}).filter(([key]) => !known.has(key))));
|
||||
settingsOpen.value = true;
|
||||
}
|
||||
async function saveSettings(): Promise<void> {
|
||||
if (!editing.value) return;
|
||||
const settings = {
|
||||
...fromLines(other.value),
|
||||
...Object.fromEntries(Object.entries(values.value).filter(([, value]) => value !== "")),
|
||||
};
|
||||
if (await store.saveSettings(editing.value, settings)) settingsOpen.value = false;
|
||||
}
|
||||
|
||||
const removing = ref<Extension | null>(null);
|
||||
const removePackage = ref(false);
|
||||
function askRemove(extension: Extension): void {
|
||||
removing.value = extension;
|
||||
// An instance installation is what makes the package usable, so removing it
|
||||
// removes the package too. A narrower installation is its own configuration.
|
||||
removePackage.value = extension.scope === "instance";
|
||||
}
|
||||
async function remove(): Promise<void> {
|
||||
if (!removing.value) return;
|
||||
if (removePackage.value) await store.remove(removing.value.name);
|
||||
else await store.removeInstallation(removing.value.id);
|
||||
}
|
||||
|
||||
const tones = {
|
||||
accept: { tone: "warn", label: "Authority not accepted" },
|
||||
disabled: { tone: "idle", label: "Disabled" },
|
||||
enabled: { tone: undefined, label: "" },
|
||||
} as const;
|
||||
|
||||
// Packages are accepted per kind; the tab lists one kind at a time.
|
||||
const kinds = useRead(() => api.extensionKinds());
|
||||
onMounted(kinds.reload);
|
||||
const pathGroups = computed(() => {
|
||||
const byGroup = new Map<string, { id: string; label: string; kinds: { kind: string; label: string; singular: string; contract: string }[] }>();
|
||||
for (const kind of kinds.data.value ?? []) {
|
||||
const group = byGroup.get(kind.group) ?? { id: kind.group, label: kind.group[0]!.toUpperCase() + kind.group.slice(1), kinds: [] };
|
||||
group.kinds.push(kind);
|
||||
byGroup.set(kind.group, group);
|
||||
}
|
||||
return [...byGroup.values()];
|
||||
});
|
||||
const activeKind = ref(String(route.query.kind ?? ""));
|
||||
watch(
|
||||
() => route.query.kind,
|
||||
(kind) => {
|
||||
if (typeof kind === "string") activeKind.value = kind;
|
||||
},
|
||||
);
|
||||
const active = computed(() => (kinds.data.value ?? []).find((kind) => kind.kind === activeKind.value) ?? kinds.data.value?.[0]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -223,207 +47,12 @@ const active = computed(() => (kinds.data.value ?? []).find((kind) => kind.kind
|
||||
|
||||
<Alert v-if="store.error" variant="destructive" class="mb-4"><AlertDescription>{{ store.error }}</AlertDescription></Alert>
|
||||
|
||||
<Tabs :model-value="activeTab" class="space-y-4" @update:model-value="selectTab">
|
||||
<Tabs :model-value="activeTab" class="mb-4" @update:model-value="selectTab">
|
||||
<TabsList>
|
||||
<TabsTrigger value="installations">Installations</TabsTrigger>
|
||||
<TabsTrigger value="packages">Packages</TabsTrigger>
|
||||
<TabsTrigger value="marketplace">Marketplace</TabsTrigger>
|
||||
<TabsTrigger v-for="t in TABS" :key="t.id" :value="t.id">{{ t.label }}</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="installations">
|
||||
<Section>
|
||||
<div class="mb-2 flex justify-end">
|
||||
<Button size="icon-sm" variant="ghost" aria-label="New installation" title="New installation" @click="openInstallation()"><Plus /></Button>
|
||||
</div>
|
||||
<ItemGroup aria-label="Installations">
|
||||
<Item v-for="extension in store.extensions" :key="extension.id" as="li" variant="outline">
|
||||
<div class="min-w-0 w-full @3xl:w-auto @3xl:flex-1">
|
||||
<p class="truncate text-label font-medium">
|
||||
{{ extension.display_name || extension.name }}
|
||||
<span class="font-mono text-caption text-fg-subtle">{{ extension.version }}</span>
|
||||
<Badge v-if="extension.version_pinned" variant="outline" class="ml-1">Pinned</Badge>
|
||||
</p>
|
||||
<p v-if="extension.package !== extension.name" class="truncate font-mono text-caption text-fg-subtle">{{ extension.package }}</p>
|
||||
<p v-if="extension.description" class="text-caption text-fg-subtle">{{ extension.description }}</p>
|
||||
<p class="truncate font-mono text-caption text-fg-subtle">{{ extension.digest }}</p>
|
||||
<Collapsible v-if="extension.declared">
|
||||
<CollapsibleTrigger as-child>
|
||||
<Button variant="ghost" size="sm" class="-ml-2 h-6 px-2 text-caption font-normal text-fg-subtle">
|
||||
<ChevronRight class="transition-transform group-data-[state=open]/button:rotate-90" />
|
||||
Declared authority
|
||||
</Button>
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent>
|
||||
<ul class="font-mono text-caption text-fg-subtle">
|
||||
<li v-for="line in grants(extension.declared)" :key="line">{{ line }}</li>
|
||||
</ul>
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
<Collapsible v-if="extension.accepted">
|
||||
<CollapsibleTrigger as-child>
|
||||
<Button variant="ghost" size="sm" class="-ml-2 h-6 px-2 text-caption font-normal text-fg-subtle">
|
||||
<ChevronRight class="transition-transform group-data-[state=open]/button:rotate-90" />
|
||||
Accepted authority
|
||||
</Button>
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent>
|
||||
<ul class="font-mono text-caption text-fg-subtle">
|
||||
<li v-for="line in grants(extension.accepted)" :key="line">{{ line }}</li>
|
||||
</ul>
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
</div>
|
||||
<Badge variant="outline">{{ scopeLabels[extension.scope] }}</Badge>
|
||||
<Badge v-if="extension.overridden" variant="idle">Switched off</Badge>
|
||||
<Badge v-if="tones[stage(extension)].tone" :variant="tones[stage(extension)].tone">{{ tones[stage(extension)].label }}</Badge>
|
||||
<Badge :variant="stateTone(extension.state === 'running' ? 'succeeded' : extension.state)" :title="extension.error || undefined">{{ extension.state }}</Badge>
|
||||
<Switch
|
||||
v-if="extension.editable"
|
||||
:model-value="!!extension.enabled"
|
||||
:disabled="!!store.busy || stage(extension) === 'accept'"
|
||||
:aria-label="`Enable ${extension.name}`"
|
||||
@update:model-value="(value: boolean) => store.setEnabled(extension, value)"
|
||||
/>
|
||||
<Tooltip v-if="extension.editable && extension.settings_schema.length">
|
||||
<TooltipTrigger as-child>
|
||||
<Button variant="ghost" size="icon" :aria-label="`Settings for ${extension.name}`" :disabled="!!store.busy" @click="openSettings(extension)">
|
||||
<Settings2 />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Settings</TooltipContent>
|
||||
</Tooltip>
|
||||
<Tooltip v-if="extension.editable">
|
||||
<TooltipTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
:aria-label="`Edit ${extension.name}`"
|
||||
:disabled="!!store.busy"
|
||||
@click="openInstallation(extension)"
|
||||
>
|
||||
<Pencil />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Edit</TooltipContent>
|
||||
</Tooltip>
|
||||
<MoreMenu
|
||||
v-if="managesVersions(extension) || (!extension.editable && ((extension.overridden_by?.length ?? 0) > 0 || (extension.can_override?.length ?? 0) > 0))"
|
||||
:label="`${extension.name} use`"
|
||||
>
|
||||
<DropdownMenuItem v-if="managesVersions(extension)" @select="openVersions(extension.package)">Versions</DropdownMenuItem>
|
||||
<template v-for="scope in extension.editable ? [] : (extension.overridden_by ?? [])" :key="`restore-${scope}`">
|
||||
<DropdownMenuItem @select="overrideScope(extension, scope, false)"
|
||||
>Use again {{ scope === 'org' ? 'for the organisation' : 'for me' }}</DropdownMenuItem
|
||||
>
|
||||
</template>
|
||||
<template v-for="scope in extension.editable ? [] : (extension.can_override ?? [])" :key="`off-${scope}`">
|
||||
<DropdownMenuItem v-if="!(extension.overridden_by?.length)" @select="overrideScope(extension, scope, true)"
|
||||
>Switch off {{ scope === 'org' ? 'for the organisation' : 'for me' }}</DropdownMenuItem
|
||||
>
|
||||
</template>
|
||||
</MoreMenu>
|
||||
<Tooltip v-if="extension.editable">
|
||||
<TooltipTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
:aria-label="`Remove ${extension.name}`"
|
||||
:disabled="!!store.busy"
|
||||
@click="askRemove(extension)"
|
||||
><Trash2
|
||||
/></Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Remove</TooltipContent>
|
||||
</Tooltip>
|
||||
</Item>
|
||||
<li v-if="loading" class="py-3 text-label text-fg-muted" role="status">Loading installations…</li>
|
||||
<li v-else-if="!store.extensions.length && !store.error">
|
||||
<Empty class="py-6">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Nothing installed</EmptyTitle>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</li>
|
||||
</ItemGroup>
|
||||
</Section>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="packages">
|
||||
<ReadError v-if="kinds.error.value" :message="kinds.error.value" retry-label="Retry" @retry="kinds.reload" />
|
||||
<template v-else-if="active">
|
||||
<Tabs :model-value="active.kind" class="mb-4" @update:model-value="(value) => (activeKind = String(value))">
|
||||
<div class="flex flex-wrap gap-x-6 gap-y-3">
|
||||
<div v-for="group in pathGroups" :key="group.id">
|
||||
<h2 class="mb-1 text-caption text-fg-subtle">{{ group.label }}</h2>
|
||||
<TabsList variant="line" class="justify-start">
|
||||
<TabsTrigger v-for="kind in group.kinds" :key="kind.kind" :value="kind.kind" class="flex-none px-3">{{ kind.label }}</TabsTrigger>
|
||||
</TabsList>
|
||||
</div>
|
||||
</div>
|
||||
</Tabs>
|
||||
<PackageList :kind="active.kind" :contract="active.contract" :noun="active.singular" />
|
||||
</template>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="marketplace">
|
||||
<Collapsible v-if="org.instanceAdmin" class="mb-3" :default-open="!store.source.configured && !!store.catalogueError">
|
||||
<CollapsibleTrigger class="cursor-pointer text-caption text-fg-muted">
|
||||
Catalogue source<span v-if="store.source.default" class="ml-1.5">(Archipelago)</span><span v-else-if="store.source.source?.location" class="ml-1.5 font-mono text-fg-subtle">({{ store.source.source.location }})</span>
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent>
|
||||
<form class="mt-2 flex flex-wrap items-end gap-2" @submit.prevent="saveSource">
|
||||
<Input v-model="sourceLocation" class="max-w-96 font-mono" placeholder="https://… or /path/to/catalogue.json" aria-label="Catalogue location" />
|
||||
<Input v-model="sourceKey" class="max-w-96 font-mono" placeholder="base64 Ed25519 public key" aria-label="Catalogue public key" />
|
||||
<Button type="submit" size="sm" :disabled="!!store.busy"><Plus data-icon="inline-start" />Save</Button>
|
||||
<Button v-if="store.source.default === false" type="button" variant="outline" size="sm" :disabled="!!store.busy" @click="store.resetSource()">Reset to Archipelago</Button>
|
||||
</form>
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
<ReadError v-if="store.catalogueError" :message="store.catalogueError" retry-label="Retry" @retry="store.load()" />
|
||||
<ExtensionsMarketplace v-else @install="openInstall" @versions="openVersions" @preview="openPreview" />
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
|
||||
<InstallationDialog v-model:open="installationOpen" :extension="installation" :packages="store.packages" :scopes="scopes" @saved="reload" />
|
||||
|
||||
<CataloguePreviewDialog v-model:open="previewOpen" :entry="previewing" />
|
||||
<CatalogueInstallDialog v-model:open="installOpen" :entry="installing" :scopes="scopes" />
|
||||
<PackageVersionsDialog v-model:open="versionsOpen" :name="versionsOf" />
|
||||
|
||||
<Dialog v-model:open="settingsOpen">
|
||||
<DialogContent class="max-h-[90dvh] overflow-y-auto sm:max-w-2xl">
|
||||
<DialogHeader><DialogTitle>Settings for {{ editing?.name }}</DialogTitle></DialogHeader>
|
||||
<form id="extension-settings" @submit.prevent="saveSettings">
|
||||
<SettingRow v-for="field in schema" :key="field.key" :label="field.label || field.key" :for="`ext-set-${field.key}`" :hint="field.description">
|
||||
<Select v-if="field.options?.length" v-model="values[field.key]">
|
||||
<SelectTrigger :id="`ext-set-${field.key}`" class="w-full"><SelectValue /></SelectTrigger>
|
||||
<SelectContent><SelectItem v-for="option in field.options" :key="option" :value="option">{{ option }}</SelectItem></SelectContent>
|
||||
</Select>
|
||||
<Input v-else :id="`ext-set-${field.key}`" v-model="values[field.key]" :required="field.required" :placeholder="field.secret ? 'engine:key' : undefined" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Other settings" for="ext-settings" hint="key=value, one per line. A key ending in _ref takes engine:key.">
|
||||
<Textarea id="ext-settings" v-model="other" class="font-mono" rows="3" />
|
||||
<p class="mt-1 text-caption text-fg-muted">
|
||||
Manage <RouterLink to="/settings/secret-engines" class="underline">secret engines</RouterLink> or <RouterLink to="/settings/credentials" class="underline">credentials</RouterLink>.
|
||||
</p>
|
||||
</SettingRow>
|
||||
</form>
|
||||
<DialogFooter><Button type="submit" form="extension-settings" :disabled="!!store.busy">Save and restart</Button></DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<AlertDialog :open="!!removing" @update:open="(value) => { if (!value) removing = null; }">
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Remove {{ removing?.name }}?</AlertDialogTitle>
|
||||
<AlertDialogDescription v-if="removePackage">Its process stops and the package is no longer accepted.</AlertDialogDescription>
|
||||
<AlertDialogDescription v-else>Its process stops and its configuration is deleted. The package stays accepted.</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction @click="remove">Remove</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
<RouterView />
|
||||
</div>
|
||||
</template>
|
||||
+1
-1
@@ -10,7 +10,7 @@ import { Switch } from "@/components/ui/switch";
|
||||
import { api, type ExtensionScope } from "@/lib/api";
|
||||
import { useRead } from "@/lib/use-read";
|
||||
import { grants, useExtensionsStore, type CatalogueEntry } from "@/stores/extensions";
|
||||
import ExtensionSettingField from "./ExtensionSettingField.vue";
|
||||
import ExtensionSettingField from "@/settings/ExtensionSettingField.vue";
|
||||
|
||||
/** Installs a catalogue extension in one step: the version, what it may use,
|
||||
* its settings and credentials, and who owns the installation. */
|
||||
+1
-1
@@ -7,7 +7,7 @@ import { MetadataList } from "@/components/ui/metadata-list";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { grants, type CatalogueEntry } from "@/stores/extensions";
|
||||
import { previewVersion } from "./catalogue-preview";
|
||||
import { previewVersion } from "@/pages/settings/extensions/lib/catalogue-preview";
|
||||
|
||||
const props = defineProps<{ entry: CatalogueEntry | null }>();
|
||||
const open = defineModel<boolean>("open", { required: true });
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,314 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { RouterLink, useRoute } from "vue-router";
|
||||
import { ChevronRight, Pencil, Plus, Settings2, Trash2 } from "@lucide/vue";
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";
|
||||
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Item, ItemGroup } from "@/components/ui/item";
|
||||
import { MoreMenu } from "@/components/ui/more-menu";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import type { Extension, ExtensionScope, SettingField } from "@/lib/api";
|
||||
import { fromLines, toLines } from "@/lib/lines";
|
||||
import { stateTone } from "@/runs/state";
|
||||
import { grants, stage, useExtensionsStore } from "@/stores/extensions";
|
||||
import { useOrgStore } from "@/stores/org";
|
||||
import InstallationDialog from "./components/InstallationDialog.vue";
|
||||
import PackageVersionsDialog from "./components/PackageVersionsDialog.vue";
|
||||
|
||||
definePage({
|
||||
name: "settings-extensions",
|
||||
beforeEnter: (to) => {
|
||||
const { tab, ...query } = to.query;
|
||||
if (tab === "packages") return { path: "/settings/extensions/packages", query, replace: true };
|
||||
if (tab === "marketplace") return { path: "/settings/extensions/marketplace", query, replace: true };
|
||||
if (tab === "installations") return { path: "/settings/extensions", query, replace: true };
|
||||
if (!tab && typeof to.query.kind === "string" && to.query.kind) {
|
||||
return { path: "/settings/extensions/packages", query, replace: true };
|
||||
}
|
||||
return true;
|
||||
},
|
||||
meta: {
|
||||
navPath: "/settings",
|
||||
settings: true,
|
||||
label: "Extensions",
|
||||
description: "Installed extensions, grants and the marketplace.",
|
||||
section: "extension_catalogue",
|
||||
},
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
const store = useExtensionsStore();
|
||||
const org = useOrgStore();
|
||||
const loading = ref(true);
|
||||
|
||||
onMounted(async () => {
|
||||
await Promise.all([store.load(), org.loadOrg()]);
|
||||
loading.value = false;
|
||||
const configureId = String(route.query.configure ?? "");
|
||||
if (configureId) {
|
||||
const target = store.extensions.find((ext) => ext.id === configureId);
|
||||
if (target?.editable) openSettings(target);
|
||||
}
|
||||
});
|
||||
|
||||
// A new installation may be owned by the instance when the caller administers
|
||||
// it, by their organisation when they own it, and always by themselves.
|
||||
const scopes = computed<ExtensionScope[]>(() => {
|
||||
const out: ExtensionScope[] = [];
|
||||
if (org.instanceAdmin) out.push("instance");
|
||||
if (org.org?.role === "owner") out.push("org");
|
||||
out.push("person");
|
||||
return out;
|
||||
});
|
||||
const scopeLabels: Record<ExtensionScope, string> = { instance: "Instance", org: "Organisation", person: "Person" };
|
||||
|
||||
const versionsOf = ref("");
|
||||
const versionsOpen = ref(false);
|
||||
function openVersions(name: string): void {
|
||||
versionsOf.value = name;
|
||||
versionsOpen.value = true;
|
||||
}
|
||||
// Versions belong to the package, which only an instance administrator
|
||||
// changes.
|
||||
const managesVersions = (extension: Extension) => org.instanceAdmin && extension.managed === true;
|
||||
|
||||
const installation = ref<Extension | null>(null);
|
||||
const installationOpen = ref(false);
|
||||
function openInstallation(extension: Extension | null = null): void {
|
||||
installation.value = extension;
|
||||
installationOpen.value = true;
|
||||
}
|
||||
async function reload(): Promise<void> {
|
||||
await store.load();
|
||||
}
|
||||
|
||||
async function overrideInstallation(extension: Extension, scope: "org" | "person", off: boolean): Promise<void> {
|
||||
await store.overrideInstallation(extension.id, scope, off);
|
||||
}
|
||||
|
||||
function overrideScope(extension: Extension, scope: ExtensionScope, off: boolean): Promise<void> {
|
||||
return scope === "org" || scope === "person" ? overrideInstallation(extension, scope, off) : Promise.resolve();
|
||||
}
|
||||
|
||||
const editing = ref<Extension | null>(null);
|
||||
const settingsOpen = ref(false);
|
||||
const schema = ref<SettingField[]>([]);
|
||||
const values = ref<Record<string, string>>({});
|
||||
const other = ref("");
|
||||
function openSettings(extension: Extension): void {
|
||||
editing.value = extension;
|
||||
schema.value = extension.settings_schema ?? [];
|
||||
const known = new Set(schema.value.map((field) => field.key));
|
||||
values.value = Object.fromEntries(Object.entries(extension.settings ?? {}).filter(([key]) => known.has(key)));
|
||||
other.value = toLines(Object.fromEntries(Object.entries(extension.settings ?? {}).filter(([key]) => !known.has(key))));
|
||||
settingsOpen.value = true;
|
||||
}
|
||||
async function saveSettings(): Promise<void> {
|
||||
if (!editing.value) return;
|
||||
const settings = {
|
||||
...fromLines(other.value),
|
||||
...Object.fromEntries(Object.entries(values.value).filter(([, value]) => value !== "")),
|
||||
};
|
||||
if (await store.saveSettings(editing.value, settings)) settingsOpen.value = false;
|
||||
}
|
||||
|
||||
const removing = ref<Extension | null>(null);
|
||||
const removePackage = ref(false);
|
||||
function askRemove(extension: Extension): void {
|
||||
removing.value = extension;
|
||||
// An instance installation is what makes the package usable, so removing it
|
||||
// removes the package too. A narrower installation is its own configuration.
|
||||
removePackage.value = extension.scope === "instance";
|
||||
}
|
||||
async function remove(): Promise<void> {
|
||||
if (!removing.value) return;
|
||||
if (removePackage.value) await store.remove(removing.value.name);
|
||||
else await store.removeInstallation(removing.value.id);
|
||||
}
|
||||
|
||||
const tones = {
|
||||
accept: { tone: "warn", label: "Authority not accepted" },
|
||||
disabled: { tone: "idle", label: "Disabled" },
|
||||
enabled: { tone: undefined, label: "" },
|
||||
} as const;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Section>
|
||||
<div class="mb-2 flex justify-end">
|
||||
<Button size="icon-sm" variant="ghost" aria-label="New installation" title="New installation" @click="openInstallation()"><Plus /></Button>
|
||||
</div>
|
||||
<ItemGroup aria-label="Installations">
|
||||
<Item v-for="extension in store.extensions" :key="extension.id" as="li" variant="outline">
|
||||
<div class="min-w-0 w-full @3xl:w-auto @3xl:flex-1">
|
||||
<p class="truncate text-label font-medium">
|
||||
{{ extension.display_name || extension.name }}
|
||||
<span class="font-mono text-caption text-fg-subtle">{{ extension.version }}</span>
|
||||
<Badge v-if="extension.version_pinned" variant="outline" class="ml-1">Pinned</Badge>
|
||||
</p>
|
||||
<p v-if="extension.package !== extension.name" class="truncate font-mono text-caption text-fg-subtle">{{ extension.package }}</p>
|
||||
<p v-if="extension.description" class="text-caption text-fg-subtle">{{ extension.description }}</p>
|
||||
<p class="truncate font-mono text-caption text-fg-subtle">{{ extension.digest }}</p>
|
||||
<Collapsible v-if="extension.declared">
|
||||
<CollapsibleTrigger as-child>
|
||||
<Button variant="ghost" size="sm" class="-ml-2 h-6 px-2 text-caption font-normal text-fg-subtle">
|
||||
<ChevronRight class="transition-transform group-data-[state=open]/button:rotate-90" />
|
||||
Declared authority
|
||||
</Button>
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent>
|
||||
<ul class="font-mono text-caption text-fg-subtle">
|
||||
<li v-for="line in grants(extension.declared)" :key="line">{{ line }}</li>
|
||||
</ul>
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
<Collapsible v-if="extension.accepted">
|
||||
<CollapsibleTrigger as-child>
|
||||
<Button variant="ghost" size="sm" class="-ml-2 h-6 px-2 text-caption font-normal text-fg-subtle">
|
||||
<ChevronRight class="transition-transform group-data-[state=open]/button:rotate-90" />
|
||||
Accepted authority
|
||||
</Button>
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent>
|
||||
<ul class="font-mono text-caption text-fg-subtle">
|
||||
<li v-for="line in grants(extension.accepted)" :key="line">{{ line }}</li>
|
||||
</ul>
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
</div>
|
||||
<Badge variant="outline">{{ scopeLabels[extension.scope] }}</Badge>
|
||||
<Badge v-if="extension.overridden" variant="idle">Switched off</Badge>
|
||||
<Badge v-if="tones[stage(extension)].tone" :variant="tones[stage(extension)].tone">{{ tones[stage(extension)].label }}</Badge>
|
||||
<Badge :variant="stateTone(extension.state === 'running' ? 'succeeded' : extension.state)" :title="extension.error || undefined">{{ extension.state }}</Badge>
|
||||
<Switch
|
||||
v-if="extension.editable"
|
||||
:model-value="!!extension.enabled"
|
||||
:disabled="!!store.busy || stage(extension) === 'accept'"
|
||||
:aria-label="`Enable ${extension.name}`"
|
||||
@update:model-value="(value: boolean) => store.setEnabled(extension, value)"
|
||||
/>
|
||||
<Tooltip v-if="extension.editable && extension.settings_schema.length">
|
||||
<TooltipTrigger as-child>
|
||||
<Button variant="ghost" size="icon" :aria-label="`Settings for ${extension.name}`" :disabled="!!store.busy" @click="openSettings(extension)">
|
||||
<Settings2 />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Settings</TooltipContent>
|
||||
</Tooltip>
|
||||
<Tooltip v-if="extension.editable">
|
||||
<TooltipTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
:aria-label="`Edit ${extension.name}`"
|
||||
:disabled="!!store.busy"
|
||||
@click="openInstallation(extension)"
|
||||
>
|
||||
<Pencil />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Edit</TooltipContent>
|
||||
</Tooltip>
|
||||
<MoreMenu
|
||||
v-if="managesVersions(extension) || (!extension.editable && ((extension.overridden_by?.length ?? 0) > 0 || (extension.can_override?.length ?? 0) > 0))"
|
||||
:label="`${extension.name} use`"
|
||||
>
|
||||
<DropdownMenuItem v-if="managesVersions(extension)" @select="openVersions(extension.package)">Versions</DropdownMenuItem>
|
||||
<template v-for="scope in extension.editable ? [] : (extension.overridden_by ?? [])" :key="`restore-${scope}`">
|
||||
<DropdownMenuItem @select="overrideScope(extension, scope, false)"
|
||||
>Use again {{ scope === 'org' ? 'for the organisation' : 'for me' }}</DropdownMenuItem
|
||||
>
|
||||
</template>
|
||||
<template v-for="scope in extension.editable ? [] : (extension.can_override ?? [])" :key="`off-${scope}`">
|
||||
<DropdownMenuItem v-if="!(extension.overridden_by?.length)" @select="overrideScope(extension, scope, true)"
|
||||
>Switch off {{ scope === 'org' ? 'for the organisation' : 'for me' }}</DropdownMenuItem
|
||||
>
|
||||
</template>
|
||||
</MoreMenu>
|
||||
<Tooltip v-if="extension.editable">
|
||||
<TooltipTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
:aria-label="`Remove ${extension.name}`"
|
||||
:disabled="!!store.busy"
|
||||
@click="askRemove(extension)"
|
||||
><Trash2
|
||||
/></Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Remove</TooltipContent>
|
||||
</Tooltip>
|
||||
</Item>
|
||||
<li v-if="loading" class="py-3 text-label text-fg-muted" role="status">Loading installations…</li>
|
||||
<li v-else-if="!store.extensions.length && !store.error">
|
||||
<Empty class="py-6">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Nothing installed</EmptyTitle>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</li>
|
||||
</ItemGroup>
|
||||
</Section>
|
||||
|
||||
<InstallationDialog v-model:open="installationOpen" :extension="installation" :packages="store.packages" :scopes="scopes" @saved="reload" />
|
||||
<PackageVersionsDialog v-model:open="versionsOpen" :name="versionsOf" />
|
||||
|
||||
<Dialog v-model:open="settingsOpen">
|
||||
<DialogContent class="max-h-[90dvh] overflow-y-auto sm:max-w-2xl">
|
||||
<DialogHeader><DialogTitle>Settings for {{ editing?.name }}</DialogTitle></DialogHeader>
|
||||
<form id="extension-settings" @submit.prevent="saveSettings">
|
||||
<SettingRow v-for="field in schema" :key="field.key" :label="field.label || field.key" :for="`ext-set-${field.key}`" :hint="field.description">
|
||||
<Select v-if="field.options?.length" v-model="values[field.key]">
|
||||
<SelectTrigger :id="`ext-set-${field.key}`" class="w-full"><SelectValue /></SelectTrigger>
|
||||
<SelectContent><SelectItem v-for="option in field.options" :key="option" :value="option">{{ option }}</SelectItem></SelectContent>
|
||||
</Select>
|
||||
<Input v-else :id="`ext-set-${field.key}`" v-model="values[field.key]" :required="field.required" :placeholder="field.secret ? 'engine:key' : undefined" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Other settings" for="ext-settings" hint="key=value, one per line. A key ending in _ref takes engine:key.">
|
||||
<Textarea id="ext-settings" v-model="other" class="font-mono" rows="3" />
|
||||
<p class="mt-1 text-caption text-fg-muted">
|
||||
Manage <RouterLink to="/settings/secret-engines" class="underline">secret engines</RouterLink> or <RouterLink to="/settings/credentials" class="underline">credentials</RouterLink>.
|
||||
</p>
|
||||
</SettingRow>
|
||||
</form>
|
||||
<DialogFooter><Button type="submit" form="extension-settings" :disabled="!!store.busy">Save and restart</Button></DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<AlertDialog :open="!!removing" @update:open="(value) => { if (!value) removing = null; }">
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Remove {{ removing?.name }}?</AlertDialogTitle>
|
||||
<AlertDialogDescription v-if="removePackage">Its process stops and the package is no longer accepted.</AlertDialogDescription>
|
||||
<AlertDialogDescription v-else>Its process stops and its configuration is deleted. The package stays accepted.</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction @click="remove">Remove</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
</div>
|
||||
</template>
|
||||
File renamed without changes.
@@ -0,0 +1,103 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import { Plus } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { ReadError } from "@/components/ui/read-error";
|
||||
import type { ExtensionScope } from "@/lib/api";
|
||||
import { useExtensionsStore, type CatalogueEntry } from "@/stores/extensions";
|
||||
import { useOrgStore } from "@/stores/org";
|
||||
import CatalogueInstallDialog from "./components/CatalogueInstallDialog.vue";
|
||||
import CataloguePreviewDialog from "./components/CataloguePreviewDialog.vue";
|
||||
import ExtensionsMarketplace from "./components/ExtensionsMarketplace.vue";
|
||||
import PackageVersionsDialog from "./components/PackageVersionsDialog.vue";
|
||||
|
||||
definePage({
|
||||
name: "settings-extensions-marketplace",
|
||||
meta: {
|
||||
navPath: "/settings",
|
||||
settings: true,
|
||||
label: "Extension marketplace",
|
||||
description: "Available extensions from the configured catalogue.",
|
||||
section: "extension_catalogue",
|
||||
},
|
||||
});
|
||||
|
||||
const store = useExtensionsStore();
|
||||
const org = useOrgStore();
|
||||
onMounted(() => void Promise.all([store.load(), org.loadOrg()]));
|
||||
|
||||
// A new installation may be owned by the instance when the caller administers
|
||||
// it, by their organisation when they own it, and always by themselves.
|
||||
const scopes = computed<ExtensionScope[]>(() => {
|
||||
const out: ExtensionScope[] = [];
|
||||
if (org.instanceAdmin) out.push("instance");
|
||||
if (org.org?.role === "owner") out.push("org");
|
||||
out.push("person");
|
||||
return out;
|
||||
});
|
||||
|
||||
const sourceLocation = ref("");
|
||||
const sourceKey = ref("");
|
||||
watch(
|
||||
() => store.source,
|
||||
(view) => {
|
||||
sourceLocation.value = view.source?.location ?? "";
|
||||
sourceKey.value = view.source?.public_key ?? "";
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
async function saveSource(): Promise<void> {
|
||||
if (await store.saveSource(sourceLocation.value.trim(), sourceKey.value.trim())) {
|
||||
sourceLocation.value = store.source.source?.location ?? "";
|
||||
sourceKey.value = store.source.source?.public_key ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
const installing = ref<CatalogueEntry | null>(null);
|
||||
const installOpen = ref(false);
|
||||
function openInstall(entry: CatalogueEntry): void {
|
||||
installing.value = entry;
|
||||
installOpen.value = true;
|
||||
}
|
||||
|
||||
const previewing = ref<CatalogueEntry | null>(null);
|
||||
const previewOpen = ref(false);
|
||||
function openPreview(entry: CatalogueEntry): void {
|
||||
previewing.value = entry;
|
||||
previewOpen.value = true;
|
||||
}
|
||||
|
||||
const versionsOf = ref("");
|
||||
const versionsOpen = ref(false);
|
||||
function openVersions(name: string): void {
|
||||
versionsOf.value = name;
|
||||
versionsOpen.value = true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Collapsible v-if="org.instanceAdmin" class="mb-3" :default-open="!store.source.configured && !!store.catalogueError">
|
||||
<CollapsibleTrigger class="cursor-pointer text-caption text-fg-muted">
|
||||
Catalogue source<span v-if="store.source.default" class="ml-1.5">(Archipelago)</span><span v-else-if="store.source.source?.location" class="ml-1.5 font-mono text-fg-subtle">({{ store.source.source.location }})</span>
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent>
|
||||
<form class="mt-2 flex flex-wrap items-end gap-2" @submit.prevent="saveSource">
|
||||
<Input v-model="sourceLocation" class="max-w-96 font-mono" placeholder="https://… or /path/to/catalogue.json" aria-label="Catalogue location" />
|
||||
<Input v-model="sourceKey" class="max-w-96 font-mono" placeholder="base64 Ed25519 public key" aria-label="Catalogue public key" />
|
||||
<Button type="submit" size="sm" :disabled="!!store.busy"><Plus data-icon="inline-start" />Save</Button>
|
||||
<Button v-if="store.source.default === false" type="button" variant="outline" size="sm" :disabled="!!store.busy" @click="store.resetSource()">Reset to Archipelago</Button>
|
||||
</form>
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
<ReadError v-if="store.catalogueError" :message="store.catalogueError" retry-label="Retry" @retry="store.load()" />
|
||||
<ExtensionsMarketplace v-else @install="openInstall" @versions="openVersions" @preview="openPreview" />
|
||||
|
||||
<CataloguePreviewDialog v-model:open="previewOpen" :entry="previewing" />
|
||||
<CatalogueInstallDialog v-model:open="installOpen" :entry="installing" :scopes="scopes" />
|
||||
<PackageVersionsDialog v-model:open="versionsOpen" :name="versionsOf" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,73 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { ReadError } from "@/components/ui/read-error";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { api } from "@/lib/api";
|
||||
import { useRead } from "@/lib/use-read";
|
||||
import PackageList from "./components/PackageList.vue";
|
||||
|
||||
definePage({
|
||||
name: "settings-extensions-packages",
|
||||
meta: {
|
||||
navPath: "/settings",
|
||||
settings: true,
|
||||
label: "Extension packages",
|
||||
description: "Accepted extension packages by kind.",
|
||||
section: "extension_catalogue",
|
||||
},
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
// Packages are accepted per kind; the view lists one kind at a time.
|
||||
const kinds = useRead(() => api.extensionKinds());
|
||||
onMounted(kinds.reload);
|
||||
|
||||
const pathGroups = computed(() => {
|
||||
const byGroup = new Map<string, { id: string; label: string; kinds: { kind: string; label: string; singular: string; contract: string }[] }>();
|
||||
for (const kind of kinds.data.value ?? []) {
|
||||
const group = byGroup.get(kind.group) ?? { id: kind.group, label: kind.group[0]!.toUpperCase() + kind.group.slice(1), kinds: [] };
|
||||
group.kinds.push(kind);
|
||||
byGroup.set(kind.group, group);
|
||||
}
|
||||
return [...byGroup.values()];
|
||||
});
|
||||
|
||||
const activeKind = ref(String(route.query.kind ?? ""));
|
||||
watch(
|
||||
() => route.query.kind,
|
||||
(kind) => {
|
||||
activeKind.value = typeof kind === "string" ? kind : "";
|
||||
},
|
||||
);
|
||||
|
||||
const active = computed(() => (kinds.data.value ?? []).find((kind) => kind.kind === activeKind.value) ?? kinds.data.value?.[0]);
|
||||
|
||||
function selectKind(next: unknown): void {
|
||||
const kind = String(next);
|
||||
activeKind.value = kind;
|
||||
void router.replace({ query: { ...route.query, kind } });
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<ReadError v-if="kinds.error.value" :message="kinds.error.value" retry-label="Retry" @retry="kinds.reload" />
|
||||
<template v-else-if="active">
|
||||
<Tabs :model-value="active.kind" class="mb-4" @update:model-value="selectKind">
|
||||
<div class="flex flex-wrap gap-x-6 gap-y-3">
|
||||
<div v-for="group in pathGroups" :key="group.id">
|
||||
<h2 class="mb-1 text-caption text-fg-subtle">{{ group.label }}</h2>
|
||||
<TabsList variant="line" class="justify-start">
|
||||
<TabsTrigger v-for="kind in group.kinds" :key="kind.kind" :value="kind.kind" class="flex-none px-3">{{ kind.label }}</TabsTrigger>
|
||||
</TabsList>
|
||||
</div>
|
||||
</div>
|
||||
</Tabs>
|
||||
<PackageList :kind="active.kind" :contract="active.contract" :noun="active.singular" />
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -30,9 +30,9 @@ useIntervalFn(store.load, 15_000);
|
||||
<Button variant="outline" size="sm" @click="store.load">Refresh</Button>
|
||||
</PageHeader>
|
||||
<p class="mb-4 text-label text-fg-muted">
|
||||
<RouterLink :to="{ path: '/settings/extensions', query: { tab: 'packages', kind: 'secret-engines' } }" class="underline">Manage secret engines</RouterLink>
|
||||
<RouterLink :to="{ path: '/settings/extensions/packages', query: { kind: 'secret-engines' } }" class="underline">Manage secret engines</RouterLink>
|
||||
·
|
||||
<RouterLink :to="{ path: '/settings/extensions', query: { tab: 'marketplace', kind: 'secret-engines' } }" class="underline">Browse secret engines</RouterLink>
|
||||
<RouterLink :to="{ path: '/settings/extensions/marketplace', query: { kind: 'secret-engines' } }" class="underline">Browse secret engines</RouterLink>
|
||||
</p>
|
||||
<Alert v-if="store.error" variant="destructive"><AlertDescription>{{ store.error }}</AlertDescription></Alert>
|
||||
<Empty v-else-if="store.engines && !store.engines.length"><EmptyHeader><EmptyTitle>No secret engines installed</EmptyTitle></EmptyHeader></Empty>
|
||||
|
||||
@@ -21,7 +21,7 @@ import UserReference from "@/org/UserReference.vue";
|
||||
import { runQuery, type LogState } from "./task-run";
|
||||
import { firstLine } from "./first-line";
|
||||
import { approvalLabels, statusKind, statusLabel } from "@/lib/task-meta";
|
||||
import DispatchLinks from "@/bindings/DispatchLinks.vue";
|
||||
import DispatchLinks from "@/pages/events/bindings/components/DispatchLinks.vue";
|
||||
import { MetadataList } from "@/components/ui/metadata-list";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import TaskRowActions from "./TaskRowActions.vue";
|
||||
|
||||
@@ -143,8 +143,8 @@ export function describeTimelineEvent(ev: TaskEvent = {}): TimelineLine {
|
||||
const source = text(data.source);
|
||||
const capture = text(data.capture_id);
|
||||
const links = [
|
||||
{ label: `binding ${text(data.binding_name) || text(data.binding_id)}`, to: "/events?tab=bindings" },
|
||||
...(capture ? [{ label: "captured event", to: `/events?tab=inspector&capture=${encodeURIComponent(capture)}` }] : []),
|
||||
{ label: `binding ${text(data.binding_name) || text(data.binding_id)}`, to: "/events/bindings" },
|
||||
...(capture ? [{ label: "captured event", to: `/events/inspector?capture=${encodeURIComponent(capture)}` }] : []),
|
||||
];
|
||||
if (data.unsigned === true)
|
||||
return { title: "Started by an unsigned event", detail: source ? `source ${source}` : "", tone: "warn", links };
|
||||
|
||||
Vendored
+53
-3
@@ -361,6 +361,15 @@ declare module 'vue-router/auto-routes' {
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'/settings/extensions': RouteRecordInfo<
|
||||
'/settings/extensions',
|
||||
'/settings/extensions',
|
||||
Record<never, never>,
|
||||
Record<never, never>,
|
||||
| 'settings-extensions'
|
||||
| 'settings-extensions-marketplace'
|
||||
| 'settings-extensions-packages'
|
||||
>,
|
||||
'settings-extensions': RouteRecordInfo<
|
||||
'settings-extensions',
|
||||
'/settings/extensions',
|
||||
@@ -368,6 +377,20 @@ declare module 'vue-router/auto-routes' {
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'settings-extensions-marketplace': RouteRecordInfo<
|
||||
'settings-extensions-marketplace',
|
||||
'/settings/extensions/marketplace',
|
||||
Record<never, never>,
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'settings-extensions-packages': RouteRecordInfo<
|
||||
'settings-extensions-packages',
|
||||
'/settings/extensions/packages',
|
||||
Record<never, never>,
|
||||
Record<never, never>,
|
||||
| never
|
||||
>,
|
||||
'shared-memory': RouteRecordInfo<
|
||||
'shared-memory',
|
||||
'/settings/memory',
|
||||
@@ -579,7 +602,7 @@ declare module 'vue-router/auto-routes' {
|
||||
pathParamNames:
|
||||
| never
|
||||
}
|
||||
'src/pages/events/bindings.vue': {
|
||||
'src/pages/events/bindings/index.vue': {
|
||||
routes:
|
||||
| 'events-bindings'
|
||||
views:
|
||||
@@ -587,7 +610,7 @@ declare module 'vue-router/auto-routes' {
|
||||
pathParamNames:
|
||||
| never
|
||||
}
|
||||
'src/pages/events/inspector.vue': {
|
||||
'src/pages/events/inspector/index.vue': {
|
||||
routes:
|
||||
| 'events-inspector'
|
||||
views:
|
||||
@@ -595,7 +618,7 @@ declare module 'vue-router/auto-routes' {
|
||||
pathParamNames:
|
||||
| never
|
||||
}
|
||||
'src/pages/events/mappings.vue': {
|
||||
'src/pages/events/mappings/index.vue': {
|
||||
routes:
|
||||
| 'events-mappings'
|
||||
views:
|
||||
@@ -851,7 +874,34 @@ declare module 'vue-router/auto-routes' {
|
||||
}
|
||||
'src/pages/settings/extensions.vue': {
|
||||
routes:
|
||||
| '/settings/extensions'
|
||||
| 'settings-extensions'
|
||||
| 'settings-extensions-marketplace'
|
||||
| 'settings-extensions-packages'
|
||||
views:
|
||||
| 'default'
|
||||
pathParamNames:
|
||||
| never
|
||||
}
|
||||
'src/pages/settings/extensions/index.vue': {
|
||||
routes:
|
||||
| 'settings-extensions'
|
||||
views:
|
||||
| never
|
||||
pathParamNames:
|
||||
| never
|
||||
}
|
||||
'src/pages/settings/extensions/marketplace.vue': {
|
||||
routes:
|
||||
| 'settings-extensions-marketplace'
|
||||
views:
|
||||
| never
|
||||
pathParamNames:
|
||||
| never
|
||||
}
|
||||
'src/pages/settings/extensions/packages.vue': {
|
||||
routes:
|
||||
| 'settings-extensions-packages'
|
||||
views:
|
||||
| never
|
||||
pathParamNames:
|
||||
|
||||
@@ -30,7 +30,7 @@ import { useRead } from "@/lib/use-read";
|
||||
import { stateLabel } from "@/runs/state";
|
||||
import StepEditor from "./StepEditor.vue";
|
||||
import WorkflowSettings from "./WorkflowSettings.vue";
|
||||
import TriggerList from "@/events/TriggerList.vue";
|
||||
import TriggerList from "@/pages/events/components/TriggerList.vue";
|
||||
import WorkflowYaml from "./WorkflowYaml.vue";
|
||||
import OptionSelect from "@/components/OptionSelect.vue";
|
||||
import RunWorkflowButton from "./RunWorkflowButton.vue";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { constantValue, type Binding, type InputSource } from "../bindings/binding-draft.ts";
|
||||
import type { Capture } from "@/captures/state";
|
||||
import { constantValue, type Binding, type InputSource } from "../pages/events/bindings/lib/binding-draft.ts";
|
||||
import type { Capture } from "@/pages/events/inspector/lib/state";
|
||||
import { errors } from "../copy/errors/index.ts";
|
||||
import type { InputSpec } from "./workflow-edit.ts";
|
||||
import type { FieldType } from "@/mappings/mapping-fields";
|
||||
import type { MappingField, Preview } from "@/mappings/state";
|
||||
import type { FieldType } from "@/pages/events/mappings/lib/mapping-fields";
|
||||
import type { MappingField, Preview } from "@/pages/events/mappings/lib/state";
|
||||
|
||||
/**
|
||||
* Binding an event to one workflow from its Start node: each declared input
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
const { eventTypeLabel } = await import("../src/captures/event-types.ts");
|
||||
const { eventTypeLabel } = await import("../src/pages/events/inspector/lib/event-types.ts");
|
||||
const { bindingPayload, draftFromBinding, emptyDraft, mappingsForEventType } =
|
||||
await import("../src/bindings/binding-draft.ts");
|
||||
const { matchCountLabel } = await import("../src/mappings/match-count.ts");
|
||||
await import("../src/pages/events/bindings/lib/binding-draft.ts");
|
||||
const { matchCountLabel } = await import("../src/pages/events/mappings/lib/match-count.ts");
|
||||
|
||||
const types = [
|
||||
{ id: "et1", source: "gh", name: "push", rule: { headers: [], payload: [] } },
|
||||
@@ -76,7 +76,7 @@ test("a mapping's match count reads as a number of events or as never matched",
|
||||
|
||||
test("a binding's inputs go out typed, and a no-repository workflow names no repo", async () => {
|
||||
const { constantValue, paramsForType, takesRepository } =
|
||||
await import("../src/bindings/binding-draft.ts");
|
||||
await import("../src/pages/events/bindings/lib/binding-draft.ts");
|
||||
const workflow = {
|
||||
id: "investigate",
|
||||
name: "investigate",
|
||||
|
||||
@@ -2,7 +2,7 @@ import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
test("extension preview chooses an offered version when catalogue defaults are stale", async () => {
|
||||
const { previewVersion } = await import("../src/settings/catalogue-preview.ts");
|
||||
const { previewVersion } = await import("../src/pages/settings/extensions/lib/catalogue-preview.ts");
|
||||
const cases = [
|
||||
{
|
||||
name: "keeps an offered default ahead of latest",
|
||||
|
||||
@@ -2,7 +2,7 @@ import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
const { captureIdentity, cleanRule, parseHeaderLines, ruleSummary } =
|
||||
await import("../src/captures/event-types.ts");
|
||||
await import("../src/pages/events/inspector/lib/event-types.ts");
|
||||
|
||||
test("pasted header lines become a name-to-value map", () => {
|
||||
assert.deepEqual(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import type { EventsCountReaders } from "../src/events/counts.ts";
|
||||
import type { EventsCountReaders } from "../src/pages/events/lib/counts.ts";
|
||||
|
||||
const { loadEventCounts } = await import("../src/events/counts.ts");
|
||||
const { loadEventCounts } = await import("../src/pages/events/lib/counts.ts");
|
||||
|
||||
/** Readers standing in for api.captures / api.mappings / api.bindings. */
|
||||
function readers(overrides: Partial<EventsCountReaders> = {}): EventsCountReaders {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { activeTab, availableTabs } from "../src/events/tab-selection.ts";
|
||||
import { activeTab, availableTabs } from "../src/pages/events/lib/tab-selection.ts";
|
||||
|
||||
test("Events hides only capabilities explicitly disabled by the server", () => {
|
||||
const cases: Array<[Record<string, boolean> | null | undefined, string[]]> = [
|
||||
|
||||
@@ -16,7 +16,7 @@ const server = await createServer({
|
||||
after(async () => server.close());
|
||||
|
||||
test("catalogue extensions expose a preview action separately from install", async () => {
|
||||
const { default: Marketplace } = await server.ssrLoadModule("/src/settings/ExtensionsMarketplace.vue");
|
||||
const { default: Marketplace } = await server.ssrLoadModule("/src/pages/settings/extensions/components/ExtensionsMarketplace.vue");
|
||||
const pinia = createPinia();
|
||||
setActivePinia(pinia);
|
||||
const { useExtensionsStore } = await server.ssrLoadModule("/src/stores/extensions.ts");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { captureSignature } from "../src/captures/capture-signature.ts";
|
||||
import { captureSignature } from "../src/pages/events/inspector/lib/capture-signature.ts";
|
||||
import {
|
||||
signingKind,
|
||||
signingLabel,
|
||||
@@ -50,8 +50,8 @@ test("a task started by an unsigned event says so on its timeline", () => {
|
||||
detail: "source firewall",
|
||||
tone: "warn",
|
||||
links: [
|
||||
{ label: "binding fw", to: "/events?tab=bindings" },
|
||||
{ label: "captured event", to: "/events?tab=inspector&capture=c1" },
|
||||
{ label: "binding fw", to: "/events/bindings" },
|
||||
{ label: "captured event", to: "/events/inspector?capture=c1" },
|
||||
],
|
||||
});
|
||||
assert.equal(
|
||||
|
||||
@@ -9,6 +9,8 @@ export default defineConfig({
|
||||
plugins: [
|
||||
VueRouter({
|
||||
routesFolder: "src/pages",
|
||||
// A page's own components live beside it and are not routes.
|
||||
exclude: ["**/components/**"],
|
||||
dts: "src/typed-router.d.ts",
|
||||
}),
|
||||
vue(),
|
||||
|
||||
Reference in new issue
Block a user