File tree Expand file tree Collapse file tree
assets/components/Notification Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 <li >
2828 <a @click =" editDestination" >{{ $t("notifications.destination.edit") }}</a >
2929 </li >
30+ <li v-if =" destination.type !== 'cloud'" >
31+ <a @click =" duplicateDestination" >{{ $t("notifications.destination.duplicate") }}</a >
32+ </li >
3033 <li v-if =" destination.type !== 'cloud'" >
3134 <a class =" text-error" @click =" deleteDestination" >{{ $t("notifications.destination.delete") }}</a >
3235 </li >
@@ -61,6 +64,21 @@ function editDestination() {
6164 );
6265}
6366
67+ async function duplicateDestination() {
68+ await fetch (withBase (" /api/notifications/dispatchers" ), {
69+ method: " POST" ,
70+ headers: { " Content-Type" : " application/json" },
71+ body: JSON .stringify ({
72+ name: ` Copy of ${destination .name } ` ,
73+ type: destination .type ,
74+ url: destination .url ,
75+ template: destination .template ,
76+ headers: destination .headers ,
77+ }),
78+ });
79+ onUpdated ?.();
80+ }
81+
6482async function deleteDestination() {
6583 await fetch (withBase (` /api/notifications/dispatchers/${destination .id } ` ), { method: " DELETE" });
6684 onUpdated ?.();
Original file line number Diff line number Diff line change @@ -255,6 +255,7 @@ notifications:
255255 http-webhook : HTTP Webhook
256256 dozzle-cloud : Dozzle Cloud
257257 edit : Edit
258+ duplicate : Duplicate
258259 delete : Delete
259260 alert-form :
260261 create-title : Create Alert
You can’t perform that action at this time.
0 commit comments