diff --git a/.creevey/images/ContactList/invalid item/chrome.png b/.creevey/images/ContactList/invalid item/chrome.png index 2fd4fab57..bb1837986 100644 Binary files a/.creevey/images/ContactList/invalid item/chrome.png and b/.creevey/images/ContactList/invalid item/chrome.png differ diff --git a/src/Components/TriggerEditForm/MetricSourceSelect.tsx b/src/Components/TriggerEditForm/MetricSourceSelect.tsx new file mode 100644 index 000000000..eca18184f --- /dev/null +++ b/src/Components/TriggerEditForm/MetricSourceSelect.tsx @@ -0,0 +1,31 @@ +import React from "react"; +import { Gapped, Radio, RadioGroup } from "@skbkontur/react-ui"; +import TriggerSource from "../../Domain/Trigger"; +import { Link } from "@skbkontur/react-ui/components/Link"; + +interface Props { + triggerSource?: TriggerSource; + onSourceChange: (value: TriggerSource) => void; +} + +const remoteTriggerLink = + "http://moira.readthedocs.io/en/latest/user_guide/advanced.html#data-source"; + +export const MetricSourceSelect: React.FC = ({ triggerSource, onSourceChange }) => { + return ( + + name="data-source" + defaultValue={triggerSource} + onValueChange={onSourceChange} + > + + Local (default) + + Graphite Remote. Be careful, it may cause  + extra load + + Prometheus Remote + + + ); +}; diff --git a/src/Components/TriggerEditForm/TriggerEditForm.tsx b/src/Components/TriggerEditForm/TriggerEditForm.tsx index 8419718b9..0720612ed 100644 --- a/src/Components/TriggerEditForm/TriggerEditForm.tsx +++ b/src/Components/TriggerEditForm/TriggerEditForm.tsx @@ -4,17 +4,7 @@ import { Remarkable } from "remarkable"; import { sanitize } from "dompurify"; import RemoveIcon from "@skbkontur/react-icons/Remove"; import AddIcon from "@skbkontur/react-icons/Add"; -import { - RadioGroup, - Radio, - Checkbox, - Gapped, - Input, - Textarea, - Button, - Link, - Tabs, -} from "@skbkontur/react-ui"; +import { Checkbox, Input, Textarea, Button, Tabs } from "@skbkontur/react-ui"; import { RowStack, Fill, Fit } from "@skbkontur/react-stack-layout"; import { DEFAULT_TRIGGER_TTL, @@ -36,6 +26,8 @@ import CodeRef from "../CodeRef/CodeRef"; import HighlightInput from "../HighlightInput/HighlightInput"; import HelpTooltip from "../HelpTooltip/HelpTooltip"; import EditDescriptionHelp from "./EditDescritionHelp"; +import { MetricSourceSelect } from "./MetricSourceSelect"; + import classNames from "classnames/bind"; import styles from "./TriggerEditForm.less"; @@ -183,6 +175,16 @@ export default class TriggerEditForm extends React.Component { /> )} + {remoteAllowed && ( + + + onChange({ trigger_source: value }) + } + /> + + )} {targets?.map((x, i) => (
@@ -311,31 +313,6 @@ export default class TriggerEditForm extends React.Component { /> - {remoteAllowed && ( - - - name="data-source" - defaultValue={triggerSource} - onValueChange={(value: TriggerSource) => - onChange({ trigger_source: value }) - } - > - - Local (default) - - Graphite Remote. Be careful, it may cause  - - extra load - - - - {" "} - Prometheus Remote{" "} - - - - - )} ); }