From 23ff4bcb63cf6e681e73380a9b1bf62239fd9cf6 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Mon, 17 Nov 2025 16:26:44 +0000 Subject: [PATCH] Add experimental Manage Jenkins layout (#11222) Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- .../java/hudson/diagnosis/OldDataMonitor.java | 2 +- .../hudson/model/ManageJenkinsAction.java | 18 ++ .../NewManageJenkinsUserExperimentalFlag.java | 49 ++++ .../resources/hudson/AboutJenkins/index.jelly | 188 +++++++-------- .../hudson/cli/CLIAction/index.jelly | 17 +- .../diagnosis/OldDataMonitor/manage.jelly | 15 +- .../logging/LogRecorderManager/index.jelly | 41 ++-- .../hudson/model/ComputerSet/index.jelly | 61 ++--- .../hudson/model/LoadStatistics/main.jelly | 9 +- .../GlobalSecurityConfiguration/index.groovy | 82 ++++--- .../HudsonPrivateSecurityRealm/index.jelly | 100 ++++---- .../jenkins/agents/CloudSet/index.jelly | 216 +++++++++--------- .../AppearanceGlobalConfiguration/index.jelly | 77 ++++--- .../management/ShutdownLink/index.groovy | 38 ++- .../jenkins/model/Jenkins/configure.jelly | 47 ++-- .../model/Jenkins/load-statistics.jelly | 15 +- .../jenkins/model/Jenkins/systemInfo.jelly | 142 ++++++------ .../GlobalToolConfiguration/index.groovy | 35 ++- .../main/resources/lib/layout/app-bar.jelly | 32 ++- .../resources/lib/layout/defer.children.jelly | 33 +++ .../src/main/resources/lib/layout/defer.jelly | 43 ++++ .../lib/layout/defer.placeholder.jelly | 33 +++ .../lib/layout/settings-subpage.jelly | 144 ++++++++++++ .../main/resources/lib/layout/skeleton.jelly | 24 ++ .../lib/layout/skeleton/skeleton.css | 3 +- src/main/js/app.js | 2 + src/main/js/components/defer/index.js | 18 ++ .../components/dropdowns/inpage-jumplist.js | 17 +- src/main/js/pages/manage-jenkins/index.js | 14 +- src/main/js/section-to-tabs.js | 3 +- .../scss/components/_side-panel-tasks.scss | 15 +- src/main/scss/form/_layout.scss | 6 +- src/main/scss/pages/_about.scss | 7 +- src/main/scss/pages/_build.scss | 31 ++- 34 files changed, 1001 insertions(+), 576 deletions(-) create mode 100644 core/src/main/java/jenkins/model/experimentalflags/NewManageJenkinsUserExperimentalFlag.java create mode 100644 core/src/main/resources/lib/layout/defer.children.jelly create mode 100644 core/src/main/resources/lib/layout/defer.jelly create mode 100644 core/src/main/resources/lib/layout/defer.placeholder.jelly create mode 100644 core/src/main/resources/lib/layout/settings-subpage.jelly create mode 100644 src/main/js/components/defer/index.js diff --git a/core/src/main/java/hudson/diagnosis/OldDataMonitor.java b/core/src/main/java/hudson/diagnosis/OldDataMonitor.java index 425c521509..e38555a2a4 100644 --- a/core/src/main/java/hudson/diagnosis/OldDataMonitor.java +++ b/core/src/main/java/hudson/diagnosis/OldDataMonitor.java @@ -460,7 +460,7 @@ public class OldDataMonitor extends AdministrativeMonitor { @Override public String getUrlName() { - return "administrativeMonitor/OldData/"; + return "administrativeMonitor/OldData/manage"; } @Override diff --git a/core/src/main/java/hudson/model/ManageJenkinsAction.java b/core/src/main/java/hudson/model/ManageJenkinsAction.java index c54926d197..2044856a12 100644 --- a/core/src/main/java/hudson/model/ManageJenkinsAction.java +++ b/core/src/main/java/hudson/model/ManageJenkinsAction.java @@ -28,16 +28,19 @@ import hudson.Extension; import hudson.Util; import hudson.util.HudsonIsLoading; import hudson.util.HudsonIsRestarting; +import jakarta.servlet.ServletException; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; import jenkins.management.Badge; import jenkins.model.Jenkins; import jenkins.model.ModelObjectWithContextMenu; +import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag; import org.apache.commons.jelly.JellyException; import org.jenkinsci.Symbol; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; +import org.kohsuke.stapler.HttpRedirect; import org.kohsuke.stapler.Stapler; import org.kohsuke.stapler.StaplerFallback; import org.kohsuke.stapler.StaplerRequest2; @@ -76,6 +79,21 @@ public class ManageJenkinsAction implements RootAction, StaplerFallback, ModelOb return true; } + public HttpRedirect doIndex(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException { + try { + var newUiEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue(); + + if (newUiEnabled) { + return new HttpRedirect("configure"); + } + + req.getView(this, "index.jelly").forward(req, rsp); + } catch (ServletException e) { + throw new RuntimeException(e); + } + return null; + } + @Override public Object getStaplerFallback() { return Jenkins.get(); diff --git a/core/src/main/java/jenkins/model/experimentalflags/NewManageJenkinsUserExperimentalFlag.java b/core/src/main/java/jenkins/model/experimentalflags/NewManageJenkinsUserExperimentalFlag.java new file mode 100644 index 0000000000..e04f7c6031 --- /dev/null +++ b/core/src/main/java/jenkins/model/experimentalflags/NewManageJenkinsUserExperimentalFlag.java @@ -0,0 +1,49 @@ +/* + * The MIT License + * + * Copyright (c) 2025, Jan Faracik + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package jenkins.model.experimentalflags; + +import edu.umd.cs.findbugs.annotations.Nullable; +import hudson.Extension; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; + +@Extension +@Restricted(NoExternalUse.class) +public class NewManageJenkinsUserExperimentalFlag extends BooleanUserExperimentalFlag { + public NewManageJenkinsUserExperimentalFlag() { + super("new-manage-jenkins.flag"); + } + + @Override + public String getDisplayName() { + return "New Manage Jenkins UI"; + } + + @Nullable + @Override + public String getShortDescription() { + return "Enables a sidebar for the Manage Jenkins pages for easier navigation."; + } +} diff --git a/core/src/main/resources/hudson/AboutJenkins/index.jelly b/core/src/main/resources/hudson/AboutJenkins/index.jelly index 6d589663f5..ba4c77a125 100644 --- a/core/src/main/resources/hudson/AboutJenkins/index.jelly +++ b/core/src/main/resources/hudson/AboutJenkins/index.jelly @@ -25,18 +25,9 @@ THE SOFTWARE. - - -