forked from p15670423/monkey
Island: Allow HTML in config_schema descriptions to be renedered
This commit is contained in:
parent
f698c889e3
commit
938022fc52
|
@ -0,0 +1,8 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
function HtmlFieldDescription(props) {
|
||||||
|
var content_obj = {__html: props.description};
|
||||||
|
return <p id={props.id} className='field-description' dangerouslySetInnerHTML={content_obj} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HtmlFieldDescription;
|
|
@ -17,6 +17,7 @@ import isUnsafeOptionSelected from '../utils/SafeOptionValidator.js';
|
||||||
import ConfigExportModal from '../configuration-components/ExportConfigModal';
|
import ConfigExportModal from '../configuration-components/ExportConfigModal';
|
||||||
import ConfigImportModal from '../configuration-components/ImportConfigModal';
|
import ConfigImportModal from '../configuration-components/ImportConfigModal';
|
||||||
import applyUiSchemaManipulators from '../configuration-components/UISchemaManipulators.tsx';
|
import applyUiSchemaManipulators from '../configuration-components/UISchemaManipulators.tsx';
|
||||||
|
import HtmlFieldDescription from '../configuration-components/HtmlFieldDescription.js';
|
||||||
|
|
||||||
const ATTACK_URL = '/api/attack';
|
const ATTACK_URL = '/api/attack';
|
||||||
const CONFIG_URL = '/api/configuration/island';
|
const CONFIG_URL = '/api/configuration/island';
|
||||||
|
@ -411,6 +412,7 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
setPbaFilenameLinux: this.setPbaFilenameLinux,
|
setPbaFilenameLinux: this.setPbaFilenameLinux,
|
||||||
selectedSection: this.state.selectedSection
|
selectedSection: this.state.selectedSection
|
||||||
})
|
})
|
||||||
|
formProperties['fields'] = {DescriptionField: HtmlFieldDescription};
|
||||||
formProperties['formData'] = this.state.currentFormData;
|
formProperties['formData'] = this.state.currentFormData;
|
||||||
formProperties['onChange'] = this.onChange;
|
formProperties['onChange'] = this.onChange;
|
||||||
formProperties['customFormats'] = formValidationFormats;
|
formProperties['customFormats'] = formValidationFormats;
|
||||||
|
|
Loading…
Reference in New Issue