more working changes.... the handler is pretty much ready. Now we need to interface msfweb's console with the real console driver. And add any new javascript ninjitsu as necessary.
git-svn-id: file:///home/svn/framework3/trunk@4285 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
f178656cd4
commit
62c48a9ce9
|
@ -14,8 +14,10 @@
|
|||
|
||||
<body onload="console_init()">
|
||||
<div id="console_window">
|
||||
<a accesskey="C" href="javascript:go('console_clear()')" title="Accesskey: C">Clear console</a><br />
|
||||
<div id="console_output" class="output"></div>
|
||||
<div id="console_output" class="output">
|
||||
Metasploit <%=return_env_info()[:msfver]%> on <%=return_env_info()[:platform]%>
|
||||
(ruby <%=return_env_info()[:rubyver]%>).
|
||||
</div>
|
||||
<textarea id="console_input" class="input" wrap="off" onkeydown="console_keydown(event)" rows="1"></textarea></div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -9,12 +9,41 @@ var console_hindex = 0; // Index to current command history
|
|||
var console_input; // Object to console input
|
||||
var console_output; // Object to console output
|
||||
|
||||
function console_refocus() {}
|
||||
function console_tabcomplete() {
|
||||
// TODO:
|
||||
function console_refocus() {
|
||||
console_input.blur();
|
||||
console_input.focus();
|
||||
}
|
||||
|
||||
function console_execute() {}
|
||||
function console_printline(s, type) {
|
||||
if ((s=String(s))) {
|
||||
var n = document.createElement("div");
|
||||
n.appendChild(document.createTextNode(s));
|
||||
n.className = type;
|
||||
console_output.appendChild(n);
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
var console_commands = {
|
||||
print : function print(s) {
|
||||
console_printline(s, "info");
|
||||
},
|
||||
clear: function clear() {
|
||||
var child_preserve = 3;
|
||||
while (console_output.childNodes[child_preserve])
|
||||
console_output.removeChild(console_output.childNodes[child_preserve]);
|
||||
}
|
||||
}
|
||||
|
||||
function console_tabcomplete() {
|
||||
// TODO: get console_input.value, send to process_cmd with mode=tabcomplete
|
||||
// retrieve array of possible matches
|
||||
// put them to output container
|
||||
// done.
|
||||
}
|
||||
|
||||
function console_execute() {
|
||||
}
|
||||
|
||||
function console_keydown(e) {
|
||||
if (e.keyCode == 13) { // enter
|
||||
|
|
|
@ -11,7 +11,8 @@ html,body {
|
|||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #444;
|
||||
color: white;
|
||||
color: #fff;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
#output {
|
||||
|
@ -31,5 +32,6 @@ html,body {
|
|||
font: inherit;
|
||||
font-weight: bold;
|
||||
margin-top: .5em;
|
||||
background: #444;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue