MCSM:WebConsole: отправка комманд
This commit is contained in:
@@ -93,6 +93,13 @@ var WebConsole = React.createClass({
|
||||
focusInput: function() {
|
||||
this.refs.input.focus();
|
||||
},
|
||||
handleKeyInput: function(event) {
|
||||
if (event.key === 'Enter') {
|
||||
console.debug("send command '" + this.refs.input.value + "'");
|
||||
this.ws.send(':'+this.refs.input.value);
|
||||
this.refs.input.value = '';
|
||||
}
|
||||
},
|
||||
/*--------------------*/
|
||||
getInitialState: function(){return{
|
||||
lines: []
|
||||
@@ -107,7 +114,7 @@ var WebConsole = React.createClass({
|
||||
return ce('p', {dangerouslySetInnerHTML: {__html: ansi_up.ansi_to_html(line)}});
|
||||
})
|
||||
),
|
||||
ce('input', {ref: 'input'})
|
||||
ce('input', {ref: 'input', 'onKeyPress': this.handleKeyInput})
|
||||
)
|
||||
)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user