mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
[JENKINS-70912] Remove Ajax.Request from build-timeline-widget (#7731)
This commit is contained in:
1 parent
b0b2fd194e
commit
4e9cc522bb
1 file changed
+20
-12
@@ -11,19 +11,27 @@ function getData(eventSource1, current, min, max) {
|
||||
}
|
||||
if (!eventSource1.loaded[current]) {
|
||||
eventSource1.loaded[current] = true;
|
||||
new Ajax.Request("timeline/data/", {
|
||||
method: "POST",
|
||||
parameters: { min: current * interval, max: (current + 1) * interval },
|
||||
onSuccess: function (t) {
|
||||
if (t.status != 0) {
|
||||
try {
|
||||
eventSource1.loadJSON(JSON.parse(t.responseText), ".");
|
||||
fetch(
|
||||
"timeline/data/?" +
|
||||
new URLSearchParams({
|
||||
min: current * interval,
|
||||
max: (current + 1) * interval,
|
||||
}),
|
||||
{
|
||||
method: "POST",
|
||||
headers: crumb.wrap({}),
|
||||
}
|
||||
).then((t) => {
|
||||
if (t.ok) {
|
||||
t.json()
|
||||
.then((json) => {
|
||||
eventSource1.loadJSON(json, ".");
|
||||
getData(eventSource1, current - 1, min, max);
|
||||
} catch (e) {
|
||||
alert(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
.catch((err) => {
|
||||
alert(err);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user