UI: Fix UiSchema manipulators to use payloads section

This commit is contained in:
Ilija Lazoroski 2022-07-04 15:04:30 +02:00
parent a37157b086
commit 3bbbca783d
3 changed files with 13 additions and 5 deletions

View File

@ -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']};
}

View File

@ -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: {

View File

@ -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