From 3ccc39f8ba150db3bd46019fb71b03fdba4a9d75 Mon Sep 17 00:00:00 2001 From: Yaroslav Afenkin <91559310+yaroslavafenkin@users.noreply.github.com> Date: Fri, 1 Nov 2024 17:24:37 +0200 Subject: [PATCH] [JENKINS-74036] Extract inline script from `ActiveDirectoryStatus/index.jelly` --- .../ActiveDirectoryStatus/ad-display.js | 22 ++++++++++++++++ .../ActiveDirectoryStatus/index.jelly | 25 +------------------ 2 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 src/main/resources/hudson/plugins/active_directory/ActiveDirectoryStatus/ad-display.js diff --git a/src/main/resources/hudson/plugins/active_directory/ActiveDirectoryStatus/ad-display.js b/src/main/resources/hudson/plugins/active_directory/ActiveDirectoryStatus/ad-display.js new file mode 100644 index 00000000..85335c85 --- /dev/null +++ b/src/main/resources/hudson/plugins/active_directory/ActiveDirectoryStatus/ad-display.js @@ -0,0 +1,22 @@ +function display(r) { + r.domainHealth.forEach(function(domainHealth) { + var tr = document.createElement('tr'); + var td1 = document.createElement('td'); + var td2 = document.createElement('td'); + var td3 = document.createElement('td'); + var td4 = document.createElement('td'); + var text1 = document.createTextNode(domainHealth.host + ' / ' + domainHealth.ipAddress); + var text2 = document.createTextNode(domainHealth.canLogin); + var text3 = document.createTextNode(domainHealth.pingExecutionTime + ' ms'); + var text4 = document.createTextNode(domainHealth.loginExecutionTime + ' ms'); + td1.appendChild(text1); + td2.appendChild(text2); + td3.appendChild(text3); + td4.appendChild(text4); + tr.appendChild(td1); + tr.appendChild(td2); + tr.appendChild(td3); + tr.appendChild(td4); + document.getElementById("demo").appendChild(tr); + }); +} diff --git a/src/main/resources/hudson/plugins/active_directory/ActiveDirectoryStatus/index.jelly b/src/main/resources/hudson/plugins/active_directory/ActiveDirectoryStatus/index.jelly index 2dcd96d3..4be6382f 100644 --- a/src/main/resources/hudson/plugins/active_directory/ActiveDirectoryStatus/index.jelly +++ b/src/main/resources/hudson/plugins/active_directory/ActiveDirectoryStatus/index.jelly @@ -71,30 +71,7 @@
             ${it.check}
             
- +