mirror of
https://github.com/garethgeorge/backrest.git
synced 2026-09-28 10:55:33 +00:00
add it to the ui
This commit is contained in:
@@ -185,6 +185,8 @@
|
||||
"repo_hooks_command_runs_condition_forget_success": "Triggered when a forget operation completes successfully",
|
||||
"repo_hooks_command_runs_condition_forget_error": "Triggered when a forget operation fails",
|
||||
"repo_hooks_command_runs_condition_any_error": "Triggered when any operation fails",
|
||||
"repo_hooks_command_runs_condition_any_start": "Triggered before any operation starts",
|
||||
"repo_hooks_command_runs_condition_any_end": "Triggered after any operation ends (success or fail)",
|
||||
"repo_hooks_command_runs_condition_unknown": "Triggered when unknown",
|
||||
"settings_modal_title": "Settings",
|
||||
"app_breadcrumb_repo": "Repo",
|
||||
|
||||
@@ -42,6 +42,7 @@ export interface HookFields {
|
||||
actionShoutrrr?: any;
|
||||
actionHealthchecks?: any;
|
||||
actionTelegram?: any;
|
||||
actionSyncLock?: any;
|
||||
}
|
||||
|
||||
export const hooksListTooltipText = (
|
||||
@@ -83,6 +84,8 @@ const hookConditionDescriptions: Record<string, string> = {
|
||||
CONDITION_FORGET_SUCCESS: m.repo_hooks_command_runs_condition_forget_success(),
|
||||
CONDITION_FORGET_ERROR: m.repo_hooks_command_runs_condition_forget_error(),
|
||||
CONDITION_ANY_ERROR: m.repo_hooks_command_runs_condition_any_error(),
|
||||
CONDITION_ANY_START: m.repo_hooks_command_runs_condition_any_start(),
|
||||
CONDITION_ANY_END: m.repo_hooks_command_runs_condition_any_end(),
|
||||
CONDITION_UNKNOWN: m.repo_hooks_command_runs_condition_unknown(),
|
||||
};
|
||||
|
||||
@@ -554,6 +557,44 @@ const hookTypes: {
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Sync Lock",
|
||||
template: {
|
||||
actionSyncLock: {
|
||||
targetInstanceId: "",
|
||||
lockKey: "",
|
||||
},
|
||||
conditions: ["CONDITION_ANY_START", "CONDITION_ANY_END"],
|
||||
},
|
||||
oneofKey: "actionSyncLock",
|
||||
component: ({ hook, onChange }) => {
|
||||
const updateSyncLock = (field: string, val: string) => {
|
||||
onChange({
|
||||
...hook,
|
||||
actionSyncLock: { ...hook.actionSyncLock, [field]: val },
|
||||
});
|
||||
};
|
||||
return (
|
||||
<Stack gap={2}>
|
||||
<Input
|
||||
placeholder="Target Instance ID"
|
||||
value={hook.actionSyncLock?.targetInstanceId || ""}
|
||||
onChange={(e) =>
|
||||
updateSyncLock("targetInstanceId", e.target.value)
|
||||
}
|
||||
size="sm"
|
||||
/>
|
||||
<Input
|
||||
placeholder="Lock Key (e.g. repo ID)"
|
||||
value={hook.actionSyncLock?.lockKey || ""}
|
||||
onChange={(e) => updateSyncLock("lockKey", e.target.value)}
|
||||
size="sm"
|
||||
/>
|
||||
<ItemOnErrorSelector hook={hook} onChange={onChange} />
|
||||
</Stack>
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const findHookTypeName = (field: HookFields): string => {
|
||||
|
||||
Reference in New Issue
Block a user