This field has full regex support (Golang flavour).
@@ -702,10 +708,10 @@ function WarningAlert({ text, alert, colors }: WarningAlertProps) {
}
interface CollapsableSectionProps {
- title: string;
- subtitle: string;
- children: ReactNode;
- defaultOpen?: boolean;
+ title: string;
+ subtitle: string;
+ children: ReactNode;
+ defaultOpen?: boolean;
}
export function CollapsableSection({ title, subtitle, children, defaultOpen }: CollapsableSectionProps) {
diff --git a/web/src/screens/filters/External.tsx b/web/src/screens/filters/External.tsx
index fec5d02..efc455c 100644
--- a/web/src/screens/filters/External.tsx
+++ b/web/src/screens/filters/External.tsx
@@ -6,11 +6,11 @@
import { Field, FieldArray, FieldArrayRenderProps, FieldProps, useFormikContext } from "formik";
import { NumberField, Select, TextField } from "@components/inputs";
import { TextArea } from "@components/inputs/input";
-import { Fragment, useEffect, useRef, useState } from "react";
+import { Fragment, useRef } from "react";
import { EmptyListState } from "@components/emptystates";
import { useToggle } from "@hooks/hooks";
import { classNames } from "@utils";
-import { Dialog, Switch as SwitchBasic, Transition } from "@headlessui/react";
+import { Switch as SwitchBasic } from "@headlessui/react";
import {
ExternalFilterTypeNameMap,
ExternalFilterTypeOptions,
@@ -21,20 +21,20 @@ import { DeleteModal } from "@components/modals";
import { ArrowDownIcon, ArrowUpIcon } from "@heroicons/react/24/outline";
export function External() {
- const {values} = useFormikContext
();
+ const { values } = useFormikContext();
const newItem: ExternalFilter = {
id: values.external.length + 1,
index: values.external.length,
name: `External ${values.external.length + 1}`,
enabled: false,
- type: "EXEC",
- }
+ type: "EXEC"
+ };
return (
- {({remove, push, move}: FieldArrayRenderProps) => (
+ {({ remove, push, move }: FieldArrayRenderProps) => (
@@ -58,10 +58,10 @@ export function External() {
{values.external.length > 0
?
{values.external.map((f, index: number) => (
-
+
))}
- :
+ :
}
@@ -80,7 +80,7 @@ interface FilterExternalItemProps {
}
function FilterExternalItem({ idx, external, initialEdit, remove, move }: FilterExternalItemProps) {
- const {values, setFieldValue} = useFormikContext
();
+ const { values, setFieldValue } = useFormikContext();
const cancelButtonRef = useRef(null);
const [deleteModalIsOpen, toggleDeleteModal] = useToggle(false);
@@ -91,13 +91,13 @@ function FilterExternalItem({ idx, external, initialEdit, remove, move }: Filter
};
const moveUp = () => {
- move(idx, idx - 1)
- setFieldValue(`external.${idx}.index`, idx - 1)
+ move(idx, idx - 1);
+ setFieldValue(`external.${idx}.index`, idx - 1);
};
const moveDown = () => {
- move(idx, idx + 1)
- setFieldValue(`external.${idx}.index`, idx + 1)
+ move(idx, idx + 1);
+ setFieldValue(`external.${idx}.index`, idx + 1);
};
return (
@@ -130,9 +130,9 @@ function FilterExternalItem({ idx, external, initialEdit, remove, move }: Filter
{({
- field,
- form: {setFieldValue}
- }: FieldProps) => (
+ field,
+ form: { setFieldValue }
+ }: FieldProps) => (
@@ -183,28 +183,17 @@ function FilterExternalItem({ idx, external, initialEdit, remove, move }: Filter
{edit && (
-
-
-
+
-
}
/>
-
+
-
+
-
)}
@@ -254,79 +244,87 @@ interface TypeFormProps {
idx: number;
}
-const TypeForm = ({external, idx}: TypeFormProps) => {
+const TypeForm = ({ external, idx }: TypeFormProps) => {
switch (external.type) {
- case "EXEC":
- return (
-
-
-
-
-
- );
- case "WEBHOOK":
- return (
+ case "EXEC":
+ return (
+
URL or IP to api. Pass params and set api tokens etc.}
- />
- }
+ placeholder="Absolute path to executable eg. /bin/test"
+ tooltip={
+
+ }
/>
-
-
-
- );
+
+
+
+
+ );
+ case "WEBHOOK":
+ return (
+