diff --git a/webui/src/views/AddPlanModal.tsx b/webui/src/views/AddPlanModal.tsx index 369127e2..a64e0c21 100644 --- a/webui/src/views/AddPlanModal.tsx +++ b/webui/src/views/AddPlanModal.tsx @@ -152,60 +152,64 @@ export const AddPlanModal = ({ template }: { template: Plan | null }) => { disabled={confirmLoading} > {/* Plan.id */} - - hasFeedback - name="id" - label="Plan Name" - initialValue={template ? template.id : ""} - validateTrigger={["onChange", "onBlur"]} - rules={[ - { - required: true, - message: "Please input plan name", - }, - { - validator: async (_, value) => { - if (template) return; - if (config?.plans?.find((r) => r.id === value)) { - throw new Error("Plan with name already exists"); - } + + + hasFeedback + name="id" + label="Plan Name" + initialValue={template ? template.id : ""} + validateTrigger={["onChange", "onBlur"]} + rules={[ + { + required: true, + message: "Please input plan name", }, - message: "Plan with name already exists", - }, - { - pattern: namePattern, - message: - "Name must be alphanumeric with dashes or underscores as separators", - }, - ]} - > - - + { + validator: async (_, value) => { + if (template) return; + if (config?.plans?.find((r) => r.id === value)) { + throw new Error("Plan with name already exists"); + } + }, + message: "Plan with name already exists", + }, + { + pattern: namePattern, + message: + "Name must be alphanumeric with dashes or underscores as separators", + }, + ]} + > + + + {/* Plan.repo */} - - name="repo" - label="Repository" - validateTrigger={["onChange", "onBlur"]} - initialValue={template ? template.repo : ""} - rules={[ - { - required: true, - message: "Please select repository", - }, - ]} - > - 0 ? repos[0].id : undefined} + options={repos.map((repo) => ({ + value: repo.id, + }))} + disabled={!!template} + /> + + {/* Plan.paths */} @@ -258,106 +262,136 @@ export const AddPlanModal = ({ template }: { template: Plan | null }) => { {/* Plan.excludes */} - - - {(fields, { add, remove }, { errors }) => ( - <> - {fields.map((field, index) => ( - - - form.validateFields()} - globAllowed={true} + + Paths to exclude from your backups. See the{" "} + + restic docs + {" "} + for more info. + + } + > + + + {(fields, { add, remove }, { errors }) => ( + <> + {fields.map((field, index) => ( + + + form.validateFields()} + globAllowed={true} + /> + + remove(field.name)} + style={{ paddingLeft: "5px" }} /> - remove(field.name)} - style={{ paddingLeft: "5px" }} - /> + ))} + + + - ))} - - - - - - )} - - + + )} + + + - {/* Plan.excludes */} - - - {(fields, { add, remove }, { errors }) => ( - <> - {fields.map((field, index) => ( - - - form.validateFields()} - globAllowed={true} + {/* Plan.iexcludes */} + + Case insensitive paths to exclude from your backups. See the{" "} + + restic docs + {" "} + for more info. + + } + > + + + {(fields, { add, remove }, { errors }) => ( + <> + {fields.map((field, index) => ( + + + form.validateFields()} + globAllowed={true} + /> + + remove(field.name)} + style={{ paddingLeft: "5px" }} /> - remove(field.name)} - style={{ paddingLeft: "5px" }} - /> + ))} + + + - ))} - - - - - - )} - - + + )} + + + {/* Plan.cron */}