Created form component for each ARE rule.
This commit is contained in:
@@ -91,6 +91,7 @@ module BeEF
|
||||
ui/panel/Logout.js
|
||||
ui/panel/WelcomeTab.js
|
||||
ui/panel/AutoRunTab.js
|
||||
ui/panel/AutoRunRuleForm.js
|
||||
ui/panel/ModuleSearching.js
|
||||
]
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
/**
|
||||
* Form for the user to read, update and delete a specific Auto Run rule.
|
||||
*
|
||||
* rule: The object definition of this rule from the Auto Run Engine.
|
||||
* deleteFn: callback function to delete this rule.
|
||||
* updateFn: callback function to update this rule.
|
||||
*/
|
||||
AutoRunRuleForm = function(rule, deleteFn, updateFn) {
|
||||
|
||||
AutoRunRuleForm.superclass.constructor.call(this, {
|
||||
padding:'10 10 10 10',
|
||||
items: [{
|
||||
xtype: 'textfield',
|
||||
value: rule.name ? rule.name : '',
|
||||
fieldLabel: 'Name',
|
||||
}],
|
||||
buttons: [{
|
||||
text: 'Delete',
|
||||
handler: deleteFn
|
||||
}, {
|
||||
text: 'Save',
|
||||
handler: updateFn
|
||||
}],
|
||||
border: false,
|
||||
closable: false
|
||||
});
|
||||
};
|
||||
|
||||
Ext.extend(AutoRunRuleForm, Ext.FormPanel, {});
|
||||
@@ -55,10 +55,10 @@ AutoRunTab = function() {
|
||||
container.update(`<p>Number of Auto Run rules enabled: ${rules.length}.</p>`);
|
||||
|
||||
for (let i = 0; i < rules.length; i++) {
|
||||
ruleTitle = document.createElement('h4');
|
||||
ruleTitle.innerHTML = rules[i].name ? rules[i].name : `Rule ${i + 1}`;
|
||||
container.getEl().appendChild(ruleTitle);
|
||||
ruleForm = new AutoRunRuleForm(rules[i], function() {console.log('delete')}, function() {console.log('update')});
|
||||
container.add(ruleForm);
|
||||
}
|
||||
container.doLayout();
|
||||
} else {
|
||||
container.update("<p>Failed to load Auto Run rules.</p>");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user