diff --git a/core/src/main/java/hudson/model/ManagementLink.java b/core/src/main/java/hudson/model/ManagementLink.java index cf7c901e7207..e827ce74f3f9 100644 --- a/core/src/main/java/hudson/model/ManagementLink.java +++ b/core/src/main/java/hudson/model/ManagementLink.java @@ -174,6 +174,12 @@ public enum Category { * Configuration pages that don't fit into a more specific section. */ CONFIGURATION(Messages._ManagementLink_Category_CONFIGURATION()), + /** + * Configuration pages related to plugin management, including installation, + * updates, and administrative actions for maintaining installed plugins. + */ + @Restricted(NoExternalUse.class) + PLUGINS(Messages._ManagementLink_Category_PLUGINS()), /** * Security related options. Useful for plugins providing security related {@code ManagementLink}s (e.g. security realms). * Use {@link Category#STATUS} instead if the feature is informational. diff --git a/core/src/main/java/jenkins/management/PluginsAvailableLink.java b/core/src/main/java/jenkins/management/PluginsAvailableLink.java new file mode 100644 index 000000000000..2b54a096dc21 --- /dev/null +++ b/core/src/main/java/jenkins/management/PluginsAvailableLink.java @@ -0,0 +1,69 @@ +/* + * 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.management; + +import edu.umd.cs.findbugs.annotations.NonNull; +import hudson.Extension; +import hudson.model.ManagementLink; +import hudson.security.Permission; +import jenkins.model.Jenkins; +import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag; + +@Extension(ordinal = Integer.MAX_VALUE - 1) +public class PluginsAvailableLink extends ManagementLink { + + @Override + public String getIconFileName() { + var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue(); + + if (!flagEnabled) { + return null; + } + + return "symbol-shopping-bag"; + } + + @Override + public String getDisplayName() { + return Messages.PluginsAvailableLink_DisplayName(); + } + + @Override + public String getUrlName() { + return "pluginManager/available"; + } + + @NonNull + @Override + public Permission getRequiredPermission() { + return Jenkins.SYSTEM_READ; + } + + @NonNull + @Override + public Category getCategory() { + return Category.PLUGINS; + } +} diff --git a/core/src/main/java/jenkins/management/PluginsDownloadProgressLink.java b/core/src/main/java/jenkins/management/PluginsDownloadProgressLink.java new file mode 100644 index 000000000000..7450f054a0bd --- /dev/null +++ b/core/src/main/java/jenkins/management/PluginsDownloadProgressLink.java @@ -0,0 +1,75 @@ +/* + * 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.management; + +import edu.umd.cs.findbugs.annotations.NonNull; +import hudson.Extension; +import hudson.model.ManagementLink; +import hudson.security.Permission; +import jenkins.model.Jenkins; +import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag; + +@Extension(ordinal = Integer.MAX_VALUE - 3) +public class PluginsDownloadProgressLink extends ManagementLink { + + @Override + public String getIconFileName() { + var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue(); + + if (!flagEnabled) { + return null; + } + + // Hide the 'Download progress' link if there are + // no active downloads or restarts pending + if (Jenkins.get().getUpdateCenter().getJobs().isEmpty()) { + return null; + } + + return "symbol-list"; + } + + @Override + public String getDisplayName() { + return Messages.PluginsDownloadProgressLink_DisplayName(); + } + + @Override + public String getUrlName() { + return "pluginManager/updates/"; + } + + @NonNull + @Override + public Permission getRequiredPermission() { + return Jenkins.SYSTEM_READ; + } + + @NonNull + @Override + public Category getCategory() { + return Category.PLUGINS; + } +} diff --git a/core/src/main/java/jenkins/management/PluginsInstalledLink.java b/core/src/main/java/jenkins/management/PluginsInstalledLink.java new file mode 100644 index 000000000000..64c211276fd5 --- /dev/null +++ b/core/src/main/java/jenkins/management/PluginsInstalledLink.java @@ -0,0 +1,69 @@ +/* + * 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.management; + +import edu.umd.cs.findbugs.annotations.NonNull; +import hudson.Extension; +import hudson.model.ManagementLink; +import hudson.security.Permission; +import jenkins.model.Jenkins; +import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag; + +@Extension(ordinal = Integer.MAX_VALUE - 2) +public class PluginsInstalledLink extends ManagementLink { + + @Override + public String getIconFileName() { + var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue(); + + if (!flagEnabled) { + return null; + } + + return "symbol-plugins"; + } + + @Override + public String getDisplayName() { + return Messages.PluginsInstalledLink_DisplayName(); + } + + @Override + public String getUrlName() { + return "pluginManager/installed"; + } + + @NonNull + @Override + public Permission getRequiredPermission() { + return Jenkins.SYSTEM_READ; + } + + @NonNull + @Override + public Category getCategory() { + return Category.PLUGINS; + } +} diff --git a/core/src/main/java/jenkins/management/PluginsLink.java b/core/src/main/java/jenkins/management/PluginsLink.java index 0db05bfc8d43..d83024acab13 100644 --- a/core/src/main/java/jenkins/management/PluginsLink.java +++ b/core/src/main/java/jenkins/management/PluginsLink.java @@ -30,6 +30,7 @@ import hudson.model.UpdateCenter; import hudson.security.Permission; import jenkins.model.Jenkins; +import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag; import org.jenkinsci.Symbol; /** @@ -40,6 +41,12 @@ public class PluginsLink extends ManagementLink { @Override public String getIconFileName() { + var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue(); + + if (flagEnabled) { + return null; + } + return "plugin.svg"; } diff --git a/core/src/main/java/jenkins/management/PluginsUpdatesLink.java b/core/src/main/java/jenkins/management/PluginsUpdatesLink.java new file mode 100644 index 000000000000..1704035c2957 --- /dev/null +++ b/core/src/main/java/jenkins/management/PluginsUpdatesLink.java @@ -0,0 +1,76 @@ +/* + * 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.management; + +import edu.umd.cs.findbugs.annotations.NonNull; +import hudson.Extension; +import hudson.model.ManagementLink; +import hudson.model.UpdateCenter; +import hudson.security.Permission; +import jenkins.model.Jenkins; +import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag; + +@Extension(ordinal = Integer.MAX_VALUE) +public class PluginsUpdatesLink extends ManagementLink { + + @Override + public String getIconFileName() { + var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue(); + + if (!flagEnabled) { + return null; + } + + return "symbol-download"; + } + + @Override + public String getDisplayName() { + return Messages.PluginsUpdatesLink_DisplayName(); + } + + @Override + public String getUrlName() { + return "pluginManager"; + } + + @NonNull + @Override + public Permission getRequiredPermission() { + return Jenkins.SYSTEM_READ; + } + + @NonNull + @Override + public Category getCategory() { + return Category.PLUGINS; + } + + @Override + public Badge getBadge() { + final UpdateCenter updateCenter = Jenkins.get().getUpdateCenter(); + return updateCenter.getBadge(); + } +} diff --git a/core/src/main/resources/hudson/PluginManager/advanced.jelly b/core/src/main/resources/hudson/PluginManager/advanced.jelly index 81948afa6e80..dbee7b09a090 100644 --- a/core/src/main/resources/hudson/PluginManager/advanced.jelly +++ b/core/src/main/resources/hudson/PluginManager/advanced.jelly @@ -28,83 +28,73 @@ THE SOFTWARE. - + - - + +
- - + +
+

${%Deploy Plugin}

+ +
+ ${%deploytext} +
+ + + +

${%Or}

+ + + + +
+
+
-
- ${%proxyMovedBlurb(rootURL+"/manage/configure")} -
+
+

${%Update Site}

+ + + + + ${%Reset to default} + + + + + + + + + + + + + + + + + +
-
- - -
-

${%Deploy Plugin}

- -
- ${%deploytext} -
- - - -

${%Or}

- - - - -
-
-
- -
-

${%Update Site}

- - - - - ${%Reset to default} - - - - - - - - - - - - - - - - - -
- - -
-

${%Other Sites}

-
    - - -
  • ${site.url}
  • -
    -
    -
-
-
-
-
- + +
+

${%Other Sites}

+
    + + +
  • ${site.url}
  • +
    +
    +
+
+
+
+
diff --git a/core/src/main/resources/hudson/PluginManager/available.jelly b/core/src/main/resources/hudson/PluginManager/available.jelly index ef71ceb256eb..3ae30ea2a162 100644 --- a/core/src/main/resources/hudson/PluginManager/available.jelly +++ b/core/src/main/resources/hudson/PluginManager/available.jelly @@ -27,17 +27,14 @@ THE SOFTWARE. --> - - - - - +
@@ -65,6 +62,7 @@ THE SOFTWARE.
+
@@ -96,7 +94,5 @@ THE SOFTWARE. -
-
- +
diff --git a/core/src/main/resources/hudson/PluginManager/installed.jelly b/core/src/main/resources/hudson/PluginManager/installed.jelly index 3c9e356fce6b..4205ddabfb4d 100644 --- a/core/src/main/resources/hudson/PluginManager/installed.jelly +++ b/core/src/main/resources/hudson/PluginManager/installed.jelly @@ -27,13 +27,9 @@ THE SOFTWARE. --> - + - - - - @@ -43,9 +39,13 @@ THE SOFTWARE. placeholder="${%Search installed plugins}" id="filter-box" autofocus="true" + hasKeyboardShortcut="false" value="${request2.getParameter('filter')}" enabled="${!noPlugins}" /> +
+ +
@@ -310,6 +310,5 @@ THE SOFTWARE. -
-
+
diff --git a/core/src/main/resources/hudson/PluginManager/overflow.jelly b/core/src/main/resources/hudson/PluginManager/overflow.jelly new file mode 100644 index 000000000000..4200d5362313 --- /dev/null +++ b/core/src/main/resources/hudson/PluginManager/overflow.jelly @@ -0,0 +1,35 @@ + + + + + + + + + + + diff --git a/core/src/main/resources/hudson/PluginManager/updates.jelly b/core/src/main/resources/hudson/PluginManager/updates.jelly index 454ab8e383ff..9b7e7d8ac148 100644 --- a/core/src/main/resources/hudson/PluginManager/updates.jelly +++ b/core/src/main/resources/hudson/PluginManager/updates.jelly @@ -24,23 +24,17 @@ THE SOFTWARE. - + - - - - -