From 05e9c2af626ec89226885b0c809a2aca80d69b9b Mon Sep 17 00:00:00 2001 From: Kekoa Kaaikala Date: Wed, 28 Sep 2022 17:40:56 +0000 Subject: [PATCH] UI: Add WarningBox --- .../configuration-components/UiSchema.js | 6 ++---- .../configuration-components/WarningBox.js | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 monkey/monkey_island/cc/ui/src/components/configuration-components/WarningBox.js diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js index 3256feeaa..5b96cdae6 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js @@ -1,6 +1,7 @@ import AdvancedMultiSelect from '../ui-components/AdvancedMultiSelect'; import InfoBox from './InfoBox'; import TextBox from './TextBox.js'; +import WarningBox from './WarningBox'; import PbaInput from './PbaInput'; import { API_PBA_LINUX, API_PBA_WINDOWS } from '../pages/ConfigurePage'; import SensitiveTextInput from '../ui-components/SensitiveTextInput'; @@ -60,9 +61,6 @@ export default function UiSchema(props) { }, network_scan: { targets: { - info_box_general: { - 'ui:field': InfoBox - }, blocked_ips: { items: { classNames: 'config-template-no-header' @@ -74,7 +72,7 @@ export default function UiSchema(props) { } }, info_box_scan_my_networks: { - 'ui:field': InfoBox + 'ui:field': WarningBox }, subnets: { items: { diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/WarningBox.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/WarningBox.js new file mode 100644 index 000000000..89b1c4534 --- /dev/null +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/WarningBox.js @@ -0,0 +1,17 @@ +import * as React from 'react'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons/faExclamationTriangle'; + +class WarningBox extends React.Component { + + render() { + return ( +
+ + {this.props.schema.info} +
+ ); + } +} + +export default WarningBox;