UI: Fix UiSchema manipulators to use payloads section
This commit is contained in:
parent
a37157b086
commit
3bbbca783d
|
@ -12,7 +12,7 @@ function applyUiSchemaManipulators(selectedSection,
|
|||
function ransomwareDirManipulator(selectedSection,
|
||||
formData,
|
||||
uiSchema) {
|
||||
if (selectedSection === 'ransomware'){
|
||||
if (selectedSection === 'payloads'){
|
||||
uiSchema.encryption.directories =
|
||||
{'ui:disabled': !formData['encryption']['enabled']};
|
||||
}
|
||||
|
|
|
@ -74,9 +74,18 @@ export default function UiSchema(props) {
|
|||
info_box : {
|
||||
'ui:field': InfoBox
|
||||
},
|
||||
directories: {
|
||||
// Directory inputs are dynamically hidden
|
||||
},
|
||||
text_box: {
|
||||
'ui:field': TextBox
|
||||
},
|
||||
enabled: {
|
||||
'ui:widget': 'hidden'
|
||||
}
|
||||
},
|
||||
other_behaviors : {
|
||||
'ui:widget': 'hidden'
|
||||
}
|
||||
},
|
||||
custom_pbas: {
|
||||
|
|
|
@ -74,6 +74,9 @@ class ConfigurePageComponent extends AuthComponent {
|
|||
.then(data => {
|
||||
let sections = [];
|
||||
let monkeyConfig = data[0];
|
||||
// TODO: Fix when we add plugins
|
||||
monkeyConfig['payloads'] = monkeyConfig['payloads'][0]['options'];
|
||||
|
||||
this.setInitialConfig(monkeyConfig);
|
||||
for (let sectionKey of this.getSectionsOrder()) {
|
||||
sections.push({
|
||||
|
@ -269,10 +272,6 @@ class ConfigurePageComponent extends AuthComponent {
|
|||
this.currentSection = key;
|
||||
let selectedSectionData = this.state.configuration[key];
|
||||
|
||||
if(key == 'payloads') {
|
||||
selectedSectionData = this.state.configuration[key][0]['options'];
|
||||
}
|
||||
|
||||
this.setState({
|
||||
selectedSection: key,
|
||||
currentFormData: selectedSectionData
|
||||
|
|
Loading…
Reference in New Issue