mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-06 13:37:07 +00:00
Fix r2.js webui with 'l'->'T'
This commit is contained in:
parent
60c7c33e3f
commit
14629fed36
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@ enyo.kind ({
|
||||
create: function() {
|
||||
this.inherited (arguments);
|
||||
var out = this.$.output;
|
||||
this.logger = r2.get_logger ().on ("message", function (msg) {
|
||||
this.logger = r2.getTextLogger ().on ("message", function (msg) {
|
||||
out.setContent (out.getContent() + msg.text + "\n");
|
||||
});
|
||||
this.logger.autorefresh (3);
|
||||
|
@ -15,7 +15,7 @@ r2ui.consoleExec = function () {
|
||||
|
||||
r2ui.logger = null;
|
||||
function init () {
|
||||
logger = r2.get_logger ().on ("message", function (msg) {
|
||||
logger = r2.getTextLogger ().on ("message", function (msg) {
|
||||
var out = document.getElementById ('logsBody');
|
||||
out.innerHTML += "<br />"+msg.text; // XXX XSS
|
||||
});
|
||||
|
@ -234,26 +234,26 @@ r2.alive = function (cb) {
|
||||
});
|
||||
}
|
||||
|
||||
r2.get_logger = function (obj) {
|
||||
r2.getTextLogger = function (obj) {
|
||||
if (typeof (obj) != "object")
|
||||
obj = {};
|
||||
obj.last = 0;
|
||||
obj.events = {};
|
||||
obj.interval = null;
|
||||
r2.cmd ("ll", function (x) {
|
||||
r2.cmd ("Tl", function (x) {
|
||||
obj.last = +x;
|
||||
});
|
||||
obj.load = function (cb) {
|
||||
r2.cmd ("lj "+(obj.last+1), function (ret) {
|
||||
r2.cmd ("Tj "+(obj.last+1), function (ret) {
|
||||
if (cb) cb (JSON.parse (ret));
|
||||
});
|
||||
}
|
||||
obj.clear = function (cb) {
|
||||
// XXX: fix l-N
|
||||
r2.cmd ("l-", cb); //+obj.last, cb);
|
||||
r2.cmd ("T-", cb); //+obj.last, cb);
|
||||
}
|
||||
obj.send = function (msg, cb) {
|
||||
r2.cmd ("l "+msg, cb);
|
||||
r2.cmd ("T "+msg, cb);
|
||||
}
|
||||
obj.refresh = function (cb) {
|
||||
obj.load (function (ret) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user