fix(eda): name a source's delivery header in the dashboard instead of a built-in sender list
This commit is contained in:
1 parent
a355f13a03
commit
0fc8535d87
24 files changed
+942
-667
No files matched your search
@@ -342,6 +342,8 @@ export const api = {
|
||||
}),
|
||||
sourceName: <T = unknown>(path: string, name: string) =>
|
||||
request<T>(`/api/sources/${encodeURIComponent(path)}/name`, { method: "PUT", body: { name } }),
|
||||
sourceDeliveryHeader: <T = unknown>(path: string, header: string) =>
|
||||
request<T>(`/api/sources/${encodeURIComponent(path)}/delivery-header`, { method: "PUT", body: { header } }),
|
||||
sourceDelete: (path: string) =>
|
||||
request<void>(`/api/sources/${encodeURIComponent(path)}`, { method: "DELETE", parse: false }),
|
||||
sourceSecret: <T = unknown>(path: string) =>
|
||||
|
||||
@@ -47,6 +47,7 @@ const {
|
||||
requireSigning,
|
||||
approveUnsigned,
|
||||
rename,
|
||||
setDeliveryHeader,
|
||||
remove,
|
||||
refusals,
|
||||
} = useSources();
|
||||
@@ -121,6 +122,15 @@ function url(source: Source): string {
|
||||
:disabled="busy"
|
||||
@change="rename(source, ($event.target as HTMLInputElement).value)"
|
||||
/>{{ source.path }}
|
||||
<input
|
||||
class="block w-full bg-transparent font-mono text-xs text-fg-muted outline-none placeholder:text-fg-subtle focus:underline"
|
||||
:value="source.delivery_header ?? ''"
|
||||
placeholder="Delivery ID header"
|
||||
title="The header the sender repeats on every retry of one delivery; a retry then starts no second run"
|
||||
:aria-label="`Delivery ID header of source ${source.path}`"
|
||||
:disabled="busy"
|
||||
@change="setDeliveryHeader(source, ($event.target as HTMLInputElement).value)"
|
||||
/>
|
||||
<div
|
||||
v-if="refusals[source.path]"
|
||||
class="text-xs font-sans text-destructive"
|
||||
|
||||
@@ -8,6 +8,8 @@ export interface Source {
|
||||
path: string;
|
||||
/** The operator's label; the path stays the source's identity. */
|
||||
name?: string;
|
||||
/** The header the sender repeats on every retry of one delivery. */
|
||||
delivery_header?: string;
|
||||
signing?: string;
|
||||
/** Present only on create and on a new secret. */
|
||||
secret?: string;
|
||||
|
||||
@@ -66,6 +66,8 @@ export function useSources() {
|
||||
run(() => api.sourceApproveUnsigned<Source>(source.path)),
|
||||
rename: (source: Source, name: string) =>
|
||||
run(() => api.sourceName<Source>(source.path, name.trim())),
|
||||
setDeliveryHeader: (source: Source, header: string) =>
|
||||
run(() => api.sourceDeliveryHeader<Source>(source.path, header.trim())),
|
||||
// An armed binding on the source refuses the delete; the refusal shows
|
||||
// as the panel's failure.
|
||||
remove: (source: Source) => run(() => api.sourceDelete(source.path)),
|
||||
|
||||
Reference in new issue
Block a user