Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/infra
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2008984eb951
Choose a base ref
...
head repository: NixOS/infra
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ae96158c4d5c
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jan 8, 2020

  1. status-page: fix race condition in initialization. (#94)

    Due to the fact that loading state text is inserted on window onload,
    this insertion can potentially happen **after** all other async
    actions are already finished and thus replace the actual data.
    This fix makes sure that requests are triggered after onload is done.
    turboMaCk authored and zimbatm committed Jan 8, 2020
    Copy the full SHA
    ae96158 View commit details
Showing with 11 additions and 5 deletions.
  1. +11 −5 delft/eris/status-page/status.js
16 changes: 11 additions & 5 deletions delft/eris/status-page/status.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
window.onload = (_) => {
var tbody = document.getElementById("channel-status");
tbody.innerHTML = "<tr><td class='jsfallback' colspan='5'>Loading data from Prometheus...</td></tr>";
};
function init() {
return new Promise(resolve => {
window.onload = () => {
var tbody = document.getElementById("channel-status");
tbody.innerHTML = "<tr><td class='jsfallback' colspan='5'>Loading data from Prometheus...</td></tr>";
resolve();
};
});
}

function aggregateByChannel(result) {
return result.reduce((acc, {
@@ -119,7 +124,8 @@ function cmp_channels(left, right) {
return normalize_channel(left) < normalize_channel(right)
}

Promise.all([revisionData, updateTimeData, jobsetData])
init()
.then(() => Promise.all([revisionData, updateTimeData, jobsetData]))
.then(([revisions, update_times, jobsets]) => {
var combined = [];