forked from p15670423/monkey
Added the the ability to assing info/warnings to configuration fields/sections. Moved network warning under "Scope"
This commit is contained in:
parent
0be9b19186
commit
64a8d71439
|
@ -19,7 +19,9 @@ BASIC_NETWORK = {
|
||||||
},
|
},
|
||||||
"default": [
|
"default": [
|
||||||
],
|
],
|
||||||
"description": "List of IPs that the Monkey will not scan."
|
"description": "List of IPs that the Monkey will not scan.",
|
||||||
|
"info": "The Monkey scans its subnet if \"Local network scan\" is ticked. "
|
||||||
|
"Additionally the monkey scans machines according to \"Scan target list\"."
|
||||||
},
|
},
|
||||||
"local_network_scan": {
|
"local_network_scan": {
|
||||||
"title": "Local network scan",
|
"title": "Local network scan",
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
import ObjectField from 'react-jsonschema-form-bs4/lib/components/fields/ArrayField';
|
||||||
|
import * as React from 'react';
|
||||||
|
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||||
|
import {faInfoCircle} from '@fortawesome/free-solid-svg-icons/faInfoCircle';
|
||||||
|
|
||||||
|
class FieldWithInfo extends React.Component {
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className='alert alert-info'>
|
||||||
|
<FontAwesomeIcon icon={faInfoCircle} style={{'marginRight': '5px'}}/>
|
||||||
|
{this.props.schema.info}
|
||||||
|
</div>
|
||||||
|
<ObjectField {...this.props} />
|
||||||
|
</>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default FieldWithInfo;
|
|
@ -1,6 +1,7 @@
|
||||||
import AdvancedMultiSelect from '../ui-components/AdvancedMultiSelect';
|
import AdvancedMultiSelect from '../ui-components/AdvancedMultiSelect';
|
||||||
import PbaInput from './PbaInput';
|
import PbaInput from './PbaInput';
|
||||||
import {API_PBA_LINUX, API_PBA_WINDOWS} from '../pages/ConfigurePage';
|
import {API_PBA_LINUX, API_PBA_WINDOWS} from '../pages/ConfigurePage';
|
||||||
|
import FieldWithInfo from './FieldWithInfo';
|
||||||
|
|
||||||
export default function UiSchema(props) {
|
export default function UiSchema(props) {
|
||||||
const UiSchema = {
|
const UiSchema = {
|
||||||
|
@ -16,7 +17,10 @@ export default function UiSchema(props) {
|
||||||
basic_network: {
|
basic_network: {
|
||||||
'ui:order': ['scope', 'network_analysis'],
|
'ui:order': ['scope', 'network_analysis'],
|
||||||
scope: {
|
scope: {
|
||||||
subnet_scan_list:{
|
blocked_ips: {
|
||||||
|
'ui:field': FieldWithInfo
|
||||||
|
},
|
||||||
|
subnet_scan_list: {
|
||||||
format: 'ip-list'
|
format: 'ip-list'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import AuthComponent from '../AuthComponent';
|
||||||
import ConfigMatrixComponent from '../attack/ConfigMatrixComponent';
|
import ConfigMatrixComponent from '../attack/ConfigMatrixComponent';
|
||||||
import UiSchema from '../configuration-components/UiSchema';
|
import UiSchema from '../configuration-components/UiSchema';
|
||||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||||
import {faInfoCircle} from '@fortawesome/free-solid-svg-icons/faInfoCircle';
|
|
||||||
import {faCheck} from '@fortawesome/free-solid-svg-icons/faCheck';
|
import {faCheck} from '@fortawesome/free-solid-svg-icons/faCheck';
|
||||||
import {faExclamationCircle} from '@fortawesome/free-solid-svg-icons/faExclamationCircle';
|
import {faExclamationCircle} from '@fortawesome/free-solid-svg-icons/faExclamationCircle';
|
||||||
import {formValidationFormats} from '../configuration-components/ValidationFormats';
|
import {formValidationFormats} from '../configuration-components/ValidationFormats';
|
||||||
|
@ -352,7 +351,6 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{this.renderBasicNetworkWarning()}
|
|
||||||
<Form {...formProperties}>
|
<Form {...formProperties}>
|
||||||
<button type='submit' className={'hidden'}>Submit</button>
|
<button type='submit' className={'hidden'}>Submit</button>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -377,18 +375,6 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
renderBasicNetworkWarning = () => {
|
|
||||||
if (this.state.selectedSection === 'basic_network') {
|
|
||||||
return (<div className='alert alert-info'>
|
|
||||||
<FontAwesomeIcon icon={faInfoCircle} style={{'marginRight': '5px'}}/>
|
|
||||||
The Monkey scans its subnet if "Local network scan" is ticked. Additionally the monkey scans machines
|
|
||||||
according to "Scan target list".
|
|
||||||
</div>)
|
|
||||||
} else {
|
|
||||||
return (<div/>)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
renderNav = () => {
|
renderNav = () => {
|
||||||
return (<Nav variant='tabs'
|
return (<Nav variant='tabs'
|
||||||
fill
|
fill
|
||||||
|
|
Loading…
Reference in New Issue