From 6e8eceee37ce5d5bec2c4f314b648c7491aca736 Mon Sep 17 00:00:00 2001 From: antisnatchor Date: Fri, 11 Mar 2011 13:44:46 +0000 Subject: [PATCH] issue 249: added loading masks for both module tree and module config panel renderings. User interaction on the UI is also prevented. Useful while working with MSF git-svn-id: https://beef.googlecode.com/svn/trunk@784 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- public/javascript/ui/panel/common.js | 2 ++ .../ui/panel/tabs/ZombieTabCommands.js | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/public/javascript/ui/panel/common.js b/public/javascript/ui/panel/common.js index 907d1f084..bc4afdff5 100644 --- a/public/javascript/ui/panel/common.js +++ b/public/javascript/ui/panel/common.js @@ -386,6 +386,8 @@ function genNewExploitPanel(panel, command_module_id, command_module_name, zombi panel.add(form); panel.doLayout(); + // hide the load mask after rendering of the config panel is done + panel.configLoadMask.hide(); } }); } diff --git a/public/javascript/ui/panel/tabs/ZombieTabCommands.js b/public/javascript/ui/panel/tabs/ZombieTabCommands.js index 877728e6a..64e172ccc 100644 --- a/public/javascript/ui/panel/tabs/ZombieTabCommands.js +++ b/public/javascript/ui/panel/tabs/ZombieTabCommands.js @@ -10,9 +10,7 @@ ZombieTab_Commands = function(zombie) { border: false, layout: 'fit', autoScroll: true - // commenting it for now: it's causing troubles (don't disappear) when enabling the autoScroll and anchor of form inputs - //html: "
Please select a command module from the command module tree on the left

Most command modules are javascript commands that are executed against the selected Hooked Browser. Command modules are able to perform any actions that can be achieved with javascript, for example they may gather information about the Hooked Browser, or perform other activities such as exploiting vulnerabilities within the local network of the Hooked Browser.

To learn more about writing your own modules review the wiki:
http://code.google.com/p/beef/wiki/DevDocs

The traffic lights indicate the following:
" - }); + }); var command_module_grid = new Ext.grid.GridPanel({ store: new Ext.data.JsonStore({ @@ -75,16 +73,30 @@ ZombieTab_Commands = function(zombie) { root: {nodeType: 'async'}, loader: new Ext.tree.TreeLoader({ dataUrl: '/ui/modules/select/commandmodules/tree.json', - baseParams: {zombie_session: zombie.session} + baseParams: {zombie_session: zombie.session}, + listeners:{ + beforeload: function(treeloader, node, callback) { + // Show loading mask on body, to prevent the user interacting with the UI + treeloader.treeLoadingMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait, command tree is loading..."}); + treeloader.treeLoadingMask.show(); + return true; + }, + load: function(treeloader, node, response) { + // Hide loading mask after tree is fully loaded + treeloader.treeLoadingMask.hide(); + return true; + } + } }), listeners: { 'click': function(node) { if(!node.leaf) { node.toggle(); } else { - commands_statusbar.showBusy('Loading ' + node.text); - - command_module_grid.i = 0; + command_module_config.configLoadMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait, module config is loading..."}); + command_module_config.configLoadMask.show(); + + command_module_grid.i = 0; command_module_grid.store.baseParams = {command_module_id: node.attributes.id, zombie_session: zombie.session}; command_module_grid.store.reload({ //reload the command module grid params: { // insert the nonce with the request to reload the grid