From 561f5d613c76bc852551560959188858b09d8b02 Mon Sep 17 00:00:00 2001 From: Markus Winter Date: Tue, 9 Jan 2024 23:26:27 +0100 Subject: [PATCH] UI renovation - remove all style attributes and replace with classes - use only standard jenkins variables and color so everything looks good with dark theme as well - do all styling via an explicit css file - use jenkins-table where appropriate - use a grid layout instead of tables to arrange the portlets - wrap the portlet in a div instead of a table - use new weather icons for job statistics - sort jobs by full name for job grid --- README.md | 10 +- pom.xml | 8 +- .../view/dashboard/core/JobsPortlet.java | 7 +- .../view/dashboard/stats/StatJobs.java | 36 ++-- .../Dashboard/configure-entries.jelly | 180 +++++++++--------- .../view/dashboard/Dashboard/main.jelly | 108 ++++------- .../builds/LatestBuilds/latestbuilds.jelly | 48 +++-- .../builds/LatestBuilds/portlet.jelly | 64 +++---- .../core/HudsonStdJobsPortlet/portlet.jelly | 72 ++++--- .../core/IframePortlet/portlet.jelly | 48 +++-- .../dashboard/core/ImagePortlet/portlet.jelly | 24 +-- .../dashboard/core/JobsPortlet/config.jelly | 75 ++++---- .../dashboard/core/JobsPortlet/portlet.jelly | 45 ++--- .../core/UnstableJobsPortlet/config.jelly | 8 +- .../core/UnstableJobsPortlet/portlet.jelly | 61 ++---- .../view/dashboard/decorate-plain.jelly | 49 +++++ .../plugins/view/dashboard/decorate.jelly | 32 +--- .../plugins/view/dashboard/jobCell.jelly | 33 ++++ .../hudson/plugins/view/dashboard/portlet.css | 80 ++++++++ .../dashboard/stats/StatBuilds/main.jelly | 64 +++---- .../dashboard/stats/StatBuilds/portlet.jelly | 64 +++---- .../stats/StatBuilds/statbuilds.jelly | 56 +++--- .../view/dashboard/stats/StatJobs/main.jelly | 64 +++---- .../dashboard/stats/StatJobs/portlet.jelly | 64 +++---- .../dashboard/stats/StatJobs/statjobs.jelly | 38 ++-- .../dashboard/stats/StatSlaves/main.jelly | 12 +- .../view/dashboard/stats/StatSlaves/poller.js | 31 +++ .../dashboard/stats/StatSlaves/portlet.jelly | 12 +- .../stats/StatSlaves/statagents.jelly | 80 +++----- .../test/TestStatisticsChart/main.jelly | 64 +++---- .../test/TestStatisticsChart/portlet.jelly | 64 +++---- .../test/TestStatisticsPortlet/portlet.jelly | 64 +++---- .../teststatistics.jelly | 131 ++++++------- .../dashboard/test/TestTrendChart/main.jelly | 64 +++---- .../test/TestTrendChart/portlet.jelly | 64 +++---- .../hudson/plugins/view/dashboard/title.jelly | 59 ++++++ src/main/webapp/images/go-bottom.png | Bin 663 -> 0 bytes src/main/webapp/images/go-top.png | Bin 636 -> 0 bytes src/main/webapp/images/view-fullscreen.png | Bin 650 -> 0 bytes src/main/webapp/js/dashboard-view.js | 92 +++------ .../dashboard/core/IFramePortletTest.java | 2 +- .../view/dashboard/core/ImagePortletTest.java | 2 +- 42 files changed, 1066 insertions(+), 1013 deletions(-) create mode 100644 src/main/resources/hudson/plugins/view/dashboard/decorate-plain.jelly create mode 100644 src/main/resources/hudson/plugins/view/dashboard/jobCell.jelly create mode 100644 src/main/resources/hudson/plugins/view/dashboard/portlet.css create mode 100644 src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/poller.js create mode 100644 src/main/resources/hudson/plugins/view/dashboard/title.jelly delete mode 100644 src/main/webapp/images/go-bottom.png delete mode 100644 src/main/webapp/images/go-top.png delete mode 100644 src/main/webapp/images/view-fullscreen.png diff --git a/README.md b/README.md index f4c91dcd..8b8a4d8f 100644 --- a/README.md +++ b/README.md @@ -210,16 +210,10 @@ class MyPortlet extends DashboardPortlet { xmlns:dp="/hudson/plugins/view/dashboard" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"> - - - + -
-
- - -
+ ``` diff --git a/pom.xml b/pom.xml index 4fdea43a..de2bc395 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ 2 999999-SNAPSHOT jenkinsci/${project.artifactId}-plugin - 2.401.3 + 2.426.2 false @@ -53,7 +53,7 @@ io.jenkins.tools.bom - bom-2.401.x + bom-2.426.x 2675.v1515e14da_7a_6 pom import @@ -62,6 +62,10 @@ + + io.jenkins.plugins + ionicons-api + org.jenkins-ci.plugins junit diff --git a/src/main/java/hudson/plugins/view/dashboard/core/JobsPortlet.java b/src/main/java/hudson/plugins/view/dashboard/core/JobsPortlet.java index e666528c..7e723f54 100644 --- a/src/main/java/hudson/plugins/view/dashboard/core/JobsPortlet.java +++ b/src/main/java/hudson/plugins/view/dashboard/core/JobsPortlet.java @@ -21,6 +21,7 @@ public class JobsPortlet extends DashboardPortlet { private static final int MIN_COLUMN_COUNT = 3; private final int columnCount; + private boolean fillColumnFirst = false; @DataBoundConstructor @@ -30,13 +31,17 @@ public JobsPortlet(String name, int columnCount, boolean fillColumnFirst) { this.fillColumnFirst = fillColumnFirst; } + public boolean isFillColumnFirst() { + return fillColumnFirst; + } + public int getColumnCount() { return columnCount <= 0 ? MIN_COLUMN_COUNT : columnCount; } public List> getJobs() { List jobs = this.getDashboard().getJobs(); - Collections.sort(jobs, (p1, p2) -> p1.getDisplayName().compareToIgnoreCase(p2.getDisplayName())); + Collections.sort(jobs, (p1, p2) -> p1.getFullDisplayName().compareToIgnoreCase(p2.getFullDisplayName())); if (this.fillColumnFirst) { return transposed(jobs); diff --git a/src/main/java/hudson/plugins/view/dashboard/stats/StatJobs.java b/src/main/java/hudson/plugins/view/dashboard/stats/StatJobs.java index 3b3f8ee3..ccb2c1d9 100644 --- a/src/main/java/hudson/plugins/view/dashboard/stats/StatJobs.java +++ b/src/main/java/hudson/plugins/view/dashboard/stats/StatJobs.java @@ -2,7 +2,6 @@ import hudson.Extension; import hudson.model.Descriptor; -import hudson.model.Hudson; import hudson.model.Job; import hudson.model.TopLevelItem; import hudson.plugins.view.dashboard.DashboardPortlet; @@ -34,19 +33,22 @@ public StatJobs(String name) { */ @Deprecated public enum HealthStatus { - HEALTH_OVER_80("health-80plus.gif", Messages.Dashboard_NoRecentBuildsFailed()), - HEALTH_60_TO_79("health-60to79.gif", Messages.Dashboard_RecentBuildsFailed("20", "40")), - HEALTH_40_TO_59("health-40to59.gif", Messages.Dashboard_RecentBuildsFailed("40", "60")), - HEALTH_20_TO_39("health-20to39.gif", Messages.Dashboard_RecentBuildsFailed("60", "80")), - HEALTH_0_TO_19("health-00to19.gif", Messages.Dashboard_AllRecentBuildsFailed()), - HEALTH_UNKNOWN("empty.gif", Messages.Dashboard_UnknownStatus()); + HEALTH_OVER_80("symbol-weather-icon-health-80plus", Messages.Dashboard_NoRecentBuildsFailed(), 100), + HEALTH_60_TO_79("symbol-weather-icon-health-60to79", Messages.Dashboard_RecentBuildsFailed("20", "40"), 80), + HEALTH_40_TO_59("symbol-weather-icon-health-40to59", Messages.Dashboard_RecentBuildsFailed("40", "60"), 60), + HEALTH_20_TO_39("symbol-weather-icon-health-20to39", Messages.Dashboard_RecentBuildsFailed("60", "80"), 40), + HEALTH_0_TO_19("symbol-weather-icon-health-00to19", Messages.Dashboard_AllRecentBuildsFailed(), 20), + HEALTH_UNKNOWN("symbol-indeterminate", Messages.Dashboard_UnknownStatus(), 0); // private HealthReport healthReport; - private final String iconUrl; + private final String iconClassName; private final String description; - HealthStatus(String iconUrl, String description) { - this.iconUrl = iconUrl; + private int score; + + HealthStatus(String iconClassName, String description, int score) { + this.iconClassName = iconClassName; this.description = description; + this.score = score; } public static HealthStatus getHealthStatus(Job job) { @@ -67,18 +69,12 @@ public static HealthStatus getHealthStatus(Job job) { return job.getFirstBuild() != null ? HEALTH_OVER_80 : HEALTH_UNKNOWN; } - public String getIconUrl() { - return Hudson.RESOURCE_PATH + "/images/32x32/" + iconUrl; + public String getIconClassName() { + return iconClassName; } - public String getIconUrl(String size) { - if (iconUrl == null) { - return Hudson.RESOURCE_PATH + "/images/" + size + "/" + HEALTH_UNKNOWN.getIconUrl(); - } - if (iconUrl.startsWith("/")) { - return iconUrl.replace("/32x32/", "/" + size + "/"); - } - return Hudson.RESOURCE_PATH + "/images/" + size + "/" + iconUrl; + public int getScore() { + return score; } public String getDescription() { diff --git a/src/main/resources/hudson/plugins/view/dashboard/Dashboard/configure-entries.jelly b/src/main/resources/hudson/plugins/view/dashboard/Dashboard/configure-entries.jelly index aa0f8c1a..13199217 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/Dashboard/configure-entries.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/Dashboard/configure-entries.jelly @@ -1,89 +1,91 @@ - - - - - - - - - - - ${%Show standard Jenkins list at the top of the page} - - - - ${%Full screen view - hide standard Jenkins panels} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/Dashboard/main.jelly b/src/main/resources/hudson/plugins/view/dashboard/Dashboard/main.jelly index 2d5a8d4d..714636e3 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/Dashboard/main.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/Dashboard/main.jelly @@ -49,81 +49,43 @@ itemGroup="${it.owner.itemGroup}"/> +

+
+ + + + + +
+ +
+ + + + + + +
+ +
+ + + + + + +
- - - - - - - - - -
- - - - -

- - -

-

- - - - - - - - - - - - - - - - -
- - - - -

- - -

- - - -

- - -

- - - - - - - - - - - - -
- - - - -

- - -

-

+

+ + + + + + +
+
diff --git a/src/main/resources/hudson/plugins/view/dashboard/builds/LatestBuilds/latestbuilds.jelly b/src/main/resources/hudson/plugins/view/dashboard/builds/LatestBuilds/latestbuilds.jelly index d0f25f89..566450bb 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/builds/LatestBuilds/latestbuilds.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/builds/LatestBuilds/latestbuilds.jelly @@ -1,27 +1,35 @@ - - - - - - - +
${%Build name}${%Build status}${%Build time}
+ - - - + + + - + + + + + + + + + +
- - - - ${build.displayName} - - ${it.getTimestampString(build)}${%Build name}${%Build status}${%Build time}
+
+ +
+
+ + ${it.getTimestampString(build)}
diff --git a/src/main/resources/hudson/plugins/view/dashboard/builds/LatestBuilds/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/builds/LatestBuilds/portlet.jelly index e61dce16..8fdeb27c 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/builds/LatestBuilds/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/builds/LatestBuilds/portlet.jelly @@ -1,34 +1,30 @@ - - - - - - -
- -
- -
-
\ No newline at end of file + + + + + + + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/HudsonStdJobsPortlet/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/core/HudsonStdJobsPortlet/portlet.jelly index 88e27c7f..58c2c51e 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/core/HudsonStdJobsPortlet/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/core/HudsonStdJobsPortlet/portlet.jelly @@ -1,38 +1,34 @@ - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/IframePortlet/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/core/IframePortlet/portlet.jelly index 6484e6dc..49a11cb6 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/core/IframePortlet/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/core/IframePortlet/portlet.jelly @@ -24,29 +24,27 @@ THE SOFTWARE. - - - - -
- - - - - - - - -
-
- -
${%Display error: URL is invalid}
-
-
- -
+ + + +
+ + + + + + + + +
+
+ +
${%Display error: URL is invalid}
+
+
+
diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/ImagePortlet/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/core/ImagePortlet/portlet.jelly index 6243b23d..8131d688 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/core/ImagePortlet/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/core/ImagePortlet/portlet.jelly @@ -24,18 +24,14 @@ THE SOFTWARE. - - - - - - - - -
${%Display error: Image URL is invalid}
-
-
- - -
+ + + + + + +
${%Display error: Image URL is invalid}
+
+
+
diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/config.jelly b/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/config.jelly index 252f117f..7d2027a7 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/config.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/config.jelly @@ -1,38 +1,37 @@ - - - - - - - - - - - - - ${%Fill column first} - - + + + + + + + + + + + + + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.jelly index a5e87a19..32ada8e0 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/core/JobsPortlet/portlet.jelly @@ -7,38 +7,15 @@ SPDX-License-Identifier: MIT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + +
+
diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/config.jelly b/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/config.jelly index f398ac88..c3188570 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/config.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/config.jelly @@ -27,10 +27,10 @@ THE SOFTWARE. - + - ${%Show only Failed Jobs}
+
+ - ${%Recurse within folders}
-
\ No newline at end of file + diff --git a/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.jelly index e38cd006..77f28e55 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/core/UnstableJobsPortlet/portlet.jelly @@ -7,49 +7,26 @@ SPDX-License-Identifier: MIT - - - - - - - - ${%No unstable jobs} - - - - - + + + + + + - - - - - + + + + + + + + + +
- - - - - - - - - - - - - - - - - - - - - - + + ${%No unstable jobs}
+
diff --git a/src/main/resources/hudson/plugins/view/dashboard/decorate-plain.jelly b/src/main/resources/hudson/plugins/view/dashboard/decorate-plain.jelly new file mode 100644 index 00000000..da4d2e98 --- /dev/null +++ b/src/main/resources/hudson/plugins/view/dashboard/decorate-plain.jelly @@ -0,0 +1,49 @@ + + + + + + + Portlet border decoration without a table. Use this when the portlet itself renders a table. + + The portlet being rendered + + + Unused + + + classes to be added to the content div: + + +
+ +
+ +
+
+
diff --git a/src/main/resources/hudson/plugins/view/dashboard/decorate.jelly b/src/main/resources/hudson/plugins/view/dashboard/decorate.jelly index e8209c00..47ade4a7 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/decorate.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/decorate.jelly @@ -26,9 +26,11 @@ THE SOFTWARE. adds a table with header row and caller adds additional rows to body --> - + - Portlet border decoration + Deprecated. Instead use decorate-plain.
+ Portlet border decoration. The body is wrapper inside a table. The portlet being rendered @@ -36,26 +38,10 @@ THE SOFTWARE. Unused
-
-
- ${attrs.portlet.displayName} - - - - - -
- - -
+
+ + + +
diff --git a/src/main/resources/hudson/plugins/view/dashboard/jobCell.jelly b/src/main/resources/hudson/plugins/view/dashboard/jobCell.jelly new file mode 100644 index 00000000..ec284374 --- /dev/null +++ b/src/main/resources/hudson/plugins/view/dashboard/jobCell.jelly @@ -0,0 +1,33 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + +
diff --git a/src/main/resources/hudson/plugins/view/dashboard/portlet.css b/src/main/resources/hudson/plugins/view/dashboard/portlet.css new file mode 100644 index 00000000..10c8620b --- /dev/null +++ b/src/main/resources/hudson/plugins/view/dashboard/portlet.css @@ -0,0 +1,80 @@ +.dbv-container { + display: grid; + gap: 5px 10px; +} + +.dbv-container__first{ + grid-row: 1; + grid-column: 1 / 3; +} + +.dbv-container__left{ + grid-row: 2; + grid-column: 1; +} + +.dbv-container__right{ + grid-row: 2; + grid-column: 2; +} + +.dbv-container__last { + grid-row: 3; + grid-column: 1 / 3; +} + +.dbv-portlet { + margin-bottom: var(--section-padding); +} + +.dbv-portlet__content--center { + text-align: center; +} + +.dbv-portlet__title { + background-color: var(--medium-grey); + padding: 4px 10px; + font-weight: bold; + display: flex; + border-radius: calc(var(--table-border-radius) + 2px); + margin-bottom: 2px; +} + +.dbv-portlet__title--icons { + margin-left: auto; +} + +.dbv-portlet__table--gap { + border-spacing: 2px; +} + +.dbv-portlet__table--compact > tbody > tr > td { + height: auto; +} + +.dbv-portlet__title-button--maximize { + color: var(--text-color); +} + +.dbv-cell { + display: flex; + align-items: center; + width: fit-content; + gap: 3px; +} + +.dbv-cell > a.model-link { + text-align: left; +} + +.dbv-cell svg { + min-width: 16px; +} + +.dbv-table__bottom--left { + padding-left: 1.6rem; +} + +.dbv-table__bottom--right { + padding-right: .55rem; +} diff --git a/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/main.jelly b/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/main.jelly index 391eea30..e0df874b 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/main.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/main.jelly @@ -1,34 +1,30 @@ - - - - - - -
- -
- -
-
\ No newline at end of file + + + + + + + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/portlet.jelly index 391eea30..e0df874b 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/portlet.jelly @@ -1,34 +1,30 @@ - - - - - - -
- -
- -
-
\ No newline at end of file + + + + + + + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/statbuilds.jelly b/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/statbuilds.jelly index c0d5cbd6..539fec75 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/statbuilds.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/stats/StatBuilds/statbuilds.jelly @@ -23,34 +23,38 @@ THE SOFTWARE. --> - - + - - - - - - - - - - - - - - - - - - - - - - - +
${%Status of the build}${%Description}${%Number of builds with status}${%Percentage of total builds}
${col.key.description}${col.value}${it.roundFloatDecimal((col.value/nBuilds)*100)}
${%Total builds}${%All builds}${nBuilds}
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
${%S}${%Description}${%Number of builds with status}${%Percentage of total builds}
${col.key.description}${col.value}${it.roundFloatDecimal((col.value/nBuilds)*100)}
${%Total builds}${nBuilds}
diff --git a/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/main.jelly b/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/main.jelly index 483c0716..dbd52d78 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/main.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/main.jelly @@ -1,34 +1,30 @@ - - - - - - -
- -
- -
-
\ No newline at end of file + + + + + + + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/portlet.jelly index 483c0716..dbd52d78 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/portlet.jelly @@ -1,34 +1,30 @@ - - - - - - -
- -
- -
-
\ No newline at end of file + + + + + + + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/statjobs.jelly b/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/statjobs.jelly index 27b5f662..457b1a10 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/statjobs.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/stats/StatJobs/statjobs.jelly @@ -24,32 +24,38 @@ THE SOFTWARE. - - - - - +
${%Project health}
+ + + - + + + - - - + + + - - - + + - + +
${%W} ${%Description}${%Number of projects}${%Number of projects}
${col.key.description}${col.key.description}${col.value} +
+ +
+
${col.key.description}${col.value}
${%Total projects}${%All projects}
+ ${%Total projects} ${nProjects}${nProjects}
-
\ No newline at end of file + diff --git a/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/main.jelly b/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/main.jelly index 7d704017..e692f372 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/main.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/main.jelly @@ -2,13 +2,7 @@ - - - -
- -
- - -
+ + +
diff --git a/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/poller.js b/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/poller.js new file mode 100644 index 00000000..818532e2 --- /dev/null +++ b/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/poller.js @@ -0,0 +1,31 @@ +let err = 0; +function repeat() { + buildStat.getStats(function(t) { + let tables = document.querySelectorAll(".dbv-agents-table"); + for (let table of tables) { + let tableId = table.dataset.id; + if (t.status === 200) { + err = 0; + let stats = t.responseObject(); + document.getElementById('agents-' + tableId).innerText = stats.agents; + document.getElementById('onlineAgents-' + tableId).innerText = stats.onlineAgents; + document.getElementById('offlineAgents-' + tableId).innerText = stats.offlineAgents; + document.getElementById('disconnectedAgents-' + tableId).innerText = stats.disconnectedAgents; + document.getElementById('tasksInQueue-' + tableId).innerText = stats.tasksInQueue; + document.getElementById('runningJobs-' + tableId).innerText = stats.runningJobs; + } else if (t.status === 503 || t.status === 0) { + // Consider these recoverable and don't update error count + document.getElementById('runningJobs-' + tableId).innerText = 'ERR-' + + (t.status === 0)? 'OFFLINE' : 'PROXY'; + } else { + err++; + document.getElementById('runningJobs-' + tableId).innerText = 'ERR-' + err; + } + } + + if (err < 5) { + setTimeout('repeat()', 2500); + } + }); +} +repeat(); diff --git a/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/portlet.jelly index 7d704017..e5aef049 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/portlet.jelly @@ -2,13 +2,7 @@ - - - -
- -
- - -
+ + +
diff --git a/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/statagents.jelly b/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/statagents.jelly index 0bfb35f1..95be8a69 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/statagents.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/stats/StatSlaves/statagents.jelly @@ -1,38 +1,11 @@ - - - + + +
+ + @@ -40,25 +13,28 @@ - - - - - - - - + + + + + + + + + + +
${%Agents} ${%Online agents} ${%Offline agents}${%Tasks in queue} ${%Running jobs}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsChart/main.jelly b/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsChart/main.jelly index 6c5b75f5..983ffc34 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsChart/main.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsChart/main.jelly @@ -1,34 +1,30 @@ - - - - - - -
- [Test Summary graph] -
- -
-
\ No newline at end of file + + + + + + [Test Summary graph] + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsChart/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsChart/portlet.jelly index c48f5aae..283e0ea3 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsChart/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsChart/portlet.jelly @@ -1,34 +1,30 @@ - - - - - - -
- [Test Summary graph] -
- -
-
\ No newline at end of file + + + + + + [Test Summary graph] + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsPortlet/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsPortlet/portlet.jelly index 5d585ea1..1d00972f 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsPortlet/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsPortlet/portlet.jelly @@ -1,34 +1,30 @@ - - - - - - -
- -
- -
-
\ No newline at end of file + + + + + + + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsPortlet/teststatistics.jelly b/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsPortlet/teststatistics.jelly index 0a4afeca..698ec183 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsPortlet/teststatistics.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/test/TestStatisticsPortlet/teststatistics.jelly @@ -5,91 +5,94 @@ - - - - - - - - - - - +
${%Job}${%Success} #%${%Failed} #%${%Skipped} #%${%Total} #
+ + + + + + + + + + + + - - - - - - - - - - - - + @@ -102,14 +105,14 @@ - - - - - - - - + + + + + + + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/test/TestTrendChart/main.jelly b/src/main/resources/hudson/plugins/view/dashboard/test/TestTrendChart/main.jelly index 240f13d6..10b3e199 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/test/TestTrendChart/main.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/test/TestTrendChart/main.jelly @@ -1,34 +1,30 @@ - - - - - - - - \ No newline at end of file + + + + + + [${%Test Summary graph}] + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/test/TestTrendChart/portlet.jelly b/src/main/resources/hudson/plugins/view/dashboard/test/TestTrendChart/portlet.jelly index fb50ebe3..a7f77384 100644 --- a/src/main/resources/hudson/plugins/view/dashboard/test/TestTrendChart/portlet.jelly +++ b/src/main/resources/hudson/plugins/view/dashboard/test/TestTrendChart/portlet.jelly @@ -1,34 +1,30 @@ - - - - - - - - \ No newline at end of file + + + + + + [${%Test Summary graph}] + + diff --git a/src/main/resources/hudson/plugins/view/dashboard/title.jelly b/src/main/resources/hudson/plugins/view/dashboard/title.jelly new file mode 100644 index 00000000..12da245f --- /dev/null +++ b/src/main/resources/hudson/plugins/view/dashboard/title.jelly @@ -0,0 +1,59 @@ + + + + + + + Portlet border decoration without a table. Use this when the portlet itself renders a table + + The portlet being rendered + + + +
+
+ ${attrs.portlet.displayName} +
+
+ + + + + +
+
+
diff --git a/src/main/webapp/images/go-bottom.png b/src/main/webapp/images/go-bottom.png deleted file mode 100644 index 2c5a80385cca2f80f829819f25e943bee4fbb759..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 663 zcmV;I0%-k-P)^@R5*>5 zQafl0i$fhnu!z>dT@ZRl2cb)*4pLDG zZG=odu7yxbG&DksLWh*3HCi!E@4f%ybBM&$q+$>J%i-gE|2f}bM1)ohPMBp7qUZ#M ziZjW3S}CJ#h!C}JK7mjILiv!2Lnsa|Jv>a^ZWC@70Kk}r+-e%0*oG^%;PEY-Ju=$y zQ(8wB42=DLU;tx~itk0BkqZ%lKmgIM0>;oi(;G18uk)G8m+}(D!pA`x$GW$IlKT-XC=du~Fhe@}W5cL!R;jp>uMpvSGepPcH4u{1 zFCV)GvtXJgHvG>pEgb<%Lm;Fh9zKRhs1Mm!vo0wl9h=v7T*0wCML#^(K9-8dDwfOPh0opXQOv3a5686BHXl{Qv0xety%&@%$fU@!t2&O}F$dq3~5 zSJ&non@{aHV_O3h#uf_mOTDqf@uT4c(+v&P(of1QI%OprzW-Sy$L2MXNX}+oxQB2O x2h<5XpL^yi`NwxFSmKUBf0KK`E>-@2`~s>b4Ju;H8xa5i002ovPDHLkV1l6R8=C+C diff --git a/src/main/webapp/images/go-top.png b/src/main/webapp/images/go-top.png deleted file mode 100644 index 70f2c996cd72a79328be5bd0ef9b39cc86be7086..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 636 zcmV-?0)zdDP)L zlTS!gQ51)N=l*%UXM%2Q)F>(p+zgmdf)8?0hB*|-MC$(Y7uSP)<6hBvp%pb#VTA`mW=f8m3=A+VF$gz+5g|*fW9a=~fVCub#hVuLlKG!y<+UFWVr@ zx}I*`6F`LLL;b0)!-tO1O8E;`N}ti*)<%831DzmD?+S1|ojsB`IeM-?t-lsNLXv_Y zi4Wgq(ARs$>S*s8bv>PJ3UEE0w6rsoxp>?8Sy_bP08%N`;|ezT7d{op$Nz_$1Jr8{;^A=dpOl#Zx*NxBimVOIKWYqfyp}XTIm^nr{$U_L)(rG}9&-Pp{q+QMh53JODVWnpw>WFU8GbZ8({Xk{Qr zNlj3Y*^6%g00GuXL_t(I%bk-uXp>PC$AABu8#NVa(wI$T<{@WGkC&Rq}NCt4}x%j9e{w{GG08_2W z82w8IB#^|@_+o3% z62b*n^?G2CgpncfV1l`YKTLhjGCTK^?5{i{FQ&+~TjD@QIr1YpnEWG%pTp?h$I%#R%DFN>Tzx)VuA;$%;RRC=Co+23>x zBpc7cvJ1JtOWb!3dz~l(Brz86V` findIFrame(HtmlPage page) { - return page.getByXPath("//table[@id='portlet-bottomPortlets-0']//iframe"); + return page.getByXPath("//div[@id='portlet-bottomPortlets-0']//iframe"); } private List findError(HtmlPage page) { diff --git a/src/test/java/hudson/plugins/view/dashboard/core/ImagePortletTest.java b/src/test/java/hudson/plugins/view/dashboard/core/ImagePortletTest.java index f44c9ff2..900a4a4d 100644 --- a/src/test/java/hudson/plugins/view/dashboard/core/ImagePortletTest.java +++ b/src/test/java/hudson/plugins/view/dashboard/core/ImagePortletTest.java @@ -50,7 +50,7 @@ public void imagePortletValidation() throws Exception { } private List findImage(HtmlPage page) { - return page.getByXPath("//table[@id='portlet-bottomPortlets-0']//img"); + return page.getByXPath("//div[@id='portlet-bottomPortlets-0']//img"); } private List findError(HtmlPage page) {
${%Job}${%Success} #%${%Failed} #%${%Skipped} #%${%Total} #
+ - +
- +
- ${tr.success} + + ${tr.success} - ${it.format(format, tr.successPct)} + + ${it.format(format, tr.successPct)} - ${tr.failed} + + ${tr.failed} - ${it.format(format, tr.failedPct)} + + ${it.format(format, tr.failedPct)} - ${tr.skipped} + + ${tr.skipped} - ${it.format(format, tr.skippedPct)} + + ${it.format(format, tr.skippedPct)} - ${tr.tests} + + ${tr.tests}
- ${%Total} - + - ${summary.success} - - + - ${it.format(format, summary.successPct)} - - + - ${summary.failed} - - + - ${it.format(format, summary.failedPct)} - - + - ${summary.skipped} - - + - ${it.format(format, summary.skippedPct)} - - + - ${summary.tests} - + ${summary.tests} +
- +
+ +
${tr.success} ${it.format(format, tr.successPct)}
${%Total}${summary.success}${it.format(format, summary.successPct)}${summary.failed}${it.format(format, summary.failedPct)}${summary.skipped}${it.format(format, summary.skippedPct)}${summary.tests}${%Total}${summary.success}${it.format(format, summary.successPct)}${summary.failed}${it.format(format, summary.failedPct)}${summary.skipped}${it.format(format, summary.skippedPct)}${summary.tests}
-
- [${%Test Summary graph}] -
-
-
- [${%Test Summary graph}] -
-