-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-69113] renovate progressBar (#8821)
* [JENKINS-69113] renovate progressBar The progressbar used at various places is replaced by a div/span compbination and gets a new styling that is in sync with other ui elements. Mainly it has rounded corners. The bar is always animated opposed to old behaviour where it was only animated when the estimated remaining time was unknown. Animation is now based on css and no longer a gif. All colors are defined via variables so they can be adjusted by themes. The build progress bar shown on run and console views is now updated dynamically. The progress bar used in progressive rendering is doubled in size to make it more prominent that it is still running (See [JENKINS-72138], this doesn't solve the problem but might lower the chance that people reload the mentioned page because they think nothing happens). * apply prettier * scss style * set status url the parameters page also includes the buildCaption.jelly. But the js is using a relative url thus accessing `statusIcon` fails. Store status url in the div and read from there. * apply behaviour so tooltip is shown after icon update fix url * incorporate feedback use existing colors only animate when unknown or with flag animate via build caption and progressive rendering * adjust class name * adjust bg color * fix style * sRGB * avoid j:out --------- Co-authored-by: Alexander Brandes <[email protected]>
- Loading branch information
1 parent
f91d1ec
commit 5304da1
Showing
44 changed files
with
229 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,51 @@ | ||
(function () { | ||
function updateBuildCaptionIcon() { | ||
fetch("statusIcon").then((rsp) => { | ||
var isBuilding = rsp.headers.get("X-Building"); | ||
if (isBuilding === "true") { | ||
setTimeout(updateBuildCaptionIcon, 5000); | ||
} else { | ||
var progressBar = document.querySelector( | ||
".build-caption-progress-container", | ||
); | ||
if (progressBar) { | ||
progressBar.style.display = "none"; | ||
const buildCaption = document.querySelector(".jenkins-build-caption"); | ||
const url = buildCaption.dataset.statusUrl; | ||
fetch(url).then((rsp) => { | ||
if (rsp.ok) { | ||
let isBuilding = rsp.headers.get("X-Building"); | ||
if (isBuilding === "true") { | ||
setTimeout(updateBuildCaptionIcon, 5000); | ||
let progress = rsp.headers.get("X-Progress"); | ||
let runtime = rsp.headers.get("X-Executor-Runtime"); | ||
let remaining = rsp.headers.get("X-Executor-Remaining"); | ||
let stuck = rsp.headers.get("X-Executor-Stuck"); | ||
let progressBar = document.querySelector(".app-progress-bar"); | ||
let progressBarDone = document.querySelector( | ||
".app-progress-bar span", | ||
); | ||
if (progressBar) { | ||
let tooltip = progressBar.dataset.tooltipTemplate; | ||
tooltip = tooltip.replace("%0", runtime).replace("%1", remaining); | ||
progressBar.setAttribute("tooltip", tooltip); | ||
progressBar.setAttribute("title", tooltip); | ||
Behaviour.applySubtree(progressBar, true); | ||
if (stuck === "true") { | ||
progressBar.classList.add("app-progress-bar--error"); | ||
} else { | ||
progressBar.classList.remove("app-progress-bar--error"); | ||
} | ||
} | ||
if (progressBarDone) { | ||
progressBarDone.style.width = `${progress}%`; | ||
} | ||
} else { | ||
let progressBar = document.querySelector( | ||
".build-caption-progress-container", | ||
); | ||
if (progressBar) { | ||
progressBar.style.display = "none"; | ||
} | ||
} | ||
rsp.text().then((responseText) => { | ||
document.querySelector(".jenkins-build-caption svg").outerHTML = | ||
responseText; | ||
Behaviour.applySubtree(buildCaption, false); | ||
}); | ||
} | ||
rsp.text().then((responseText) => { | ||
document.querySelector(".jenkins-build-caption .icon-xlg").outerHTML = | ||
responseText; | ||
}); | ||
}); | ||
} | ||
|
||
window.addEventListener("load", function () { | ||
window.addEventListener("jenkins:consoleFinished", updateBuildCaptionIcon); | ||
}); | ||
setTimeout(updateBuildCaptionIcon, 5000); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
core/src/main/resources/lib/hudson/buildProgressBar_es_AR.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# This file is under the MIT License by authors | ||
|
||
text=Inicio hace {0}<br/> Tiempo estimado restante: {1} | ||
text=Inicio hace {0}\n Tiempo estimado restante: {1} |
3 changes: 1 addition & 2 deletions
3
core/src/main/resources/lib/hudson/buildProgressBar_et.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# This file is under the MIT License by authors | ||
|
||
text=Alustas {0} tagasi<br> Arvatavasti lõpetab kell {1} | ||
text=Alustas {0} tagasi\n Arvatavasti lõpetab kell {1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
core/src/main/resources/lib/hudson/buildProgressBar_sl.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# This file is under the MIT License by authors | ||
|
||
text=Startan pred {0}<br> Predviden preostali čas: {1} | ||
text=Startan pred {0}\n Predviden preostali čas: {1} |
3 changes: 1 addition & 2 deletions
3
core/src/main/resources/lib/hudson/buildProgressBar_sr.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# This file is under the MIT License by authors | ||
|
||
text=Започето пре {0} <br> Очекивано преостало време: {1} | ||
text=Започето пре {0} \n Очекивано преостало време: {1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.