mirror of
https://github.com/ziirish/burp-ui.git
synced 2026-05-21 06:45:24 -06:00
re-enable asynchronous ajax
This commit is contained in:
parent
c9fb4d7058
commit
787e5930ca
6 changed files with 16 additions and 19 deletions
|
|
@ -3,12 +3,12 @@ var NOTIF_WARNING = 1;
|
|||
var NOTIF_ERROR = 2;
|
||||
var NOTIF_INFO = 3;
|
||||
|
||||
var _async_ajax = function(b) {
|
||||
var _ajax_setup = function(b) {
|
||||
$.ajaxSetup({
|
||||
headers: { 'X-From-UI': true },
|
||||
async: b,
|
||||
});
|
||||
};
|
||||
_ajax_setup();
|
||||
|
||||
var pad = function(num, size) {
|
||||
var s = "0000000" + num;
|
||||
|
|
@ -269,7 +269,6 @@ $('#input-client').typeahead({
|
|||
{% endif -%}
|
||||
{% endif -%}
|
||||
|
||||
_async_ajax(false);
|
||||
|
||||
{% if servers and overview -%}
|
||||
{% include "js/servers.js" %}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ var _client = function() {
|
|||
}
|
||||
});
|
||||
});
|
||||
_redraw();
|
||||
})
|
||||
.fail(myFail)
|
||||
.fail(function() {
|
||||
|
|
@ -77,7 +78,6 @@ var _client = function() {
|
|||
$(this).parent().hide();
|
||||
});
|
||||
});
|
||||
_redraw();
|
||||
};
|
||||
|
||||
var _redraw = function() {
|
||||
|
|
|
|||
|
|
@ -55,19 +55,17 @@ $( document ).ready(function() {
|
|||
}
|
||||
},
|
||||
source: function() {
|
||||
r = [];
|
||||
{% if edit and edit.found -%}
|
||||
url = '{{ url_for("api.client_tree", name=cname, backup=nbackup, server=server, root=edit.roots, recursive=True, selected=True) }}';
|
||||
{% else -%}
|
||||
url = '{{ url_for("api.client_tree", name=cname, backup=nbackup, server=server) }}';
|
||||
{% endif -%}
|
||||
$.getJSON(url, function(data) {
|
||||
r = data;
|
||||
return $.getJSON(url, function(data) {
|
||||
$("#waiting-container").hide();
|
||||
$("#tree-container").show();
|
||||
return data;
|
||||
})
|
||||
.fail(myFail);
|
||||
$("#waiting-container").hide();
|
||||
$("#tree-container").show();
|
||||
return r;
|
||||
},
|
||||
lazyLoad: function(event, data) {
|
||||
fixNeeded = true;
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ var _client = function() {
|
|||
if (!initialized) {
|
||||
$.each(_charts, function(i, j) {
|
||||
tmp = nv.models.stackedAreaChart()
|
||||
.x(function(d) { return d[0] })
|
||||
.x(function(d) { return d3.time.format.iso.parse(d[0]) })
|
||||
.y(function(d) { return d[1] })
|
||||
.useInteractiveGuideline(true)
|
||||
.color(d3.scale.category20c().range())
|
||||
.margin({bottom: 115, left: 100})
|
||||
;
|
||||
|
||||
tmp.xAxis.showMaxMin(true).tickFormat(function(d) { return d3.time.format('%x %X')(new Date(d)) }).rotateLabels(-45);
|
||||
tmp.xAxis.showMaxMin(true).tickFormat(function(d) { console.log(d); return d3.time.format('%x %X')(new Date(d)) }).rotateLabels(-45);
|
||||
|
||||
tmp.yAxis.tickFormat(d3.format('f'));
|
||||
|
||||
|
|
@ -124,14 +124,14 @@ var _client = function() {
|
|||
$.each(d, function(a, j) {
|
||||
if (j[c] !== undefined) {
|
||||
val = parseFloat(j[c][l]);
|
||||
values.push([ parseInt(j.end)*1000, val ]);
|
||||
values.push([ j.end, val ]);
|
||||
push = true;
|
||||
} else {
|
||||
values.push([ parseInt(j.end)*1000, 0 ]);
|
||||
values.push([ j.end, 0 ]);
|
||||
}
|
||||
if (stats) {
|
||||
size.push([ parseInt(j.end)*1000, j.received ]);
|
||||
duration.push([ parseInt(j.end)*1000, j.duration ]);
|
||||
size.push([ j.end, j.received ]);
|
||||
duration.push([ j.end, j.duration ]);
|
||||
}
|
||||
});
|
||||
if (stats) {
|
||||
|
|
@ -157,6 +157,7 @@ var _client = function() {
|
|||
}
|
||||
});
|
||||
});
|
||||
_redraw();
|
||||
})
|
||||
.fail(myFail)
|
||||
.fail(function() {
|
||||
|
|
@ -164,7 +165,6 @@ var _client = function() {
|
|||
$(this).parent().hide();
|
||||
});
|
||||
});
|
||||
_redraw();
|
||||
};
|
||||
|
||||
var _redraw = function() {
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ var _clients = function() {
|
|||
break;
|
||||
}
|
||||
});
|
||||
_redraw();
|
||||
})
|
||||
.fail(myFail)
|
||||
.fail(function () {
|
||||
|
|
@ -78,7 +79,6 @@ var _clients = function() {
|
|||
$(this).parent().hide();
|
||||
});
|
||||
});
|
||||
_redraw();
|
||||
};
|
||||
|
||||
var _redraw = function() {
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ var _servers = function() {
|
|||
break;
|
||||
}
|
||||
});
|
||||
_redraw();
|
||||
})
|
||||
.fail(myFail)
|
||||
.fail(function () {
|
||||
|
|
@ -73,7 +74,6 @@ var _servers = function() {
|
|||
$(this).parent().hide();
|
||||
});
|
||||
});
|
||||
_redraw();
|
||||
};
|
||||
|
||||
var _redraw = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue