Skip to content

Commit a738e5e

Browse files
janfaraciktimja
andauthored
Add experimental Plugin Manager UI (#11332)
* Add experimental Plugin Manager UI * Update advanced.jelly * Update index.jelly * Update index.jelly * Update sidepanel.jelly * Update settings-subpage.jelly * I18n * Add translations * Fix search shortcut * Fix overflow cutoff --------- Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
1 parent f5a8ed8 commit a738e5e

26 files changed

+498
-121
lines changed

core/src/main/java/hudson/model/ManagementLink.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ public enum Category {
174174
* Configuration pages that don't fit into a more specific section.
175175
*/
176176
CONFIGURATION(Messages._ManagementLink_Category_CONFIGURATION()),
177+
/**
178+
* Configuration pages related to plugin management, including installation,
179+
* updates, and administrative actions for maintaining installed plugins.
180+
*/
181+
@Restricted(NoExternalUse.class)
182+
PLUGINS(Messages._ManagementLink_Category_PLUGINS()),
177183
/**
178184
* Security related options. Useful for plugins providing security related {@code ManagementLink}s (e.g. security realms).
179185
* Use {@link Category#STATUS} instead if the feature is informational.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright (c) 2025, Jan Faracik
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
package jenkins.management;
26+
27+
import edu.umd.cs.findbugs.annotations.NonNull;
28+
import hudson.Extension;
29+
import hudson.model.ManagementLink;
30+
import hudson.security.Permission;
31+
import jenkins.model.Jenkins;
32+
import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag;
33+
34+
@Extension(ordinal = Integer.MAX_VALUE - 1)
35+
public class PluginsAvailableLink extends ManagementLink {
36+
37+
@Override
38+
public String getIconFileName() {
39+
var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue();
40+
41+
if (!flagEnabled) {
42+
return null;
43+
}
44+
45+
return "symbol-shopping-bag";
46+
}
47+
48+
@Override
49+
public String getDisplayName() {
50+
return Messages.PluginsAvailableLink_DisplayName();
51+
}
52+
53+
@Override
54+
public String getUrlName() {
55+
return "pluginManager/available";
56+
}
57+
58+
@NonNull
59+
@Override
60+
public Permission getRequiredPermission() {
61+
return Jenkins.SYSTEM_READ;
62+
}
63+
64+
@NonNull
65+
@Override
66+
public Category getCategory() {
67+
return Category.PLUGINS;
68+
}
69+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright (c) 2025, Jan Faracik
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
package jenkins.management;
26+
27+
import edu.umd.cs.findbugs.annotations.NonNull;
28+
import hudson.Extension;
29+
import hudson.model.ManagementLink;
30+
import hudson.security.Permission;
31+
import jenkins.model.Jenkins;
32+
import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag;
33+
34+
@Extension(ordinal = Integer.MAX_VALUE - 3)
35+
public class PluginsDownloadProgressLink extends ManagementLink {
36+
37+
@Override
38+
public String getIconFileName() {
39+
var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue();
40+
41+
if (!flagEnabled) {
42+
return null;
43+
}
44+
45+
// Hide the 'Download progress' link if there are
46+
// no active downloads or restarts pending
47+
if (Jenkins.get().getUpdateCenter().getJobs().isEmpty()) {
48+
return null;
49+
}
50+
51+
return "symbol-list";
52+
}
53+
54+
@Override
55+
public String getDisplayName() {
56+
return Messages.PluginsDownloadProgressLink_DisplayName();
57+
}
58+
59+
@Override
60+
public String getUrlName() {
61+
return "pluginManager/updates/";
62+
}
63+
64+
@NonNull
65+
@Override
66+
public Permission getRequiredPermission() {
67+
return Jenkins.SYSTEM_READ;
68+
}
69+
70+
@NonNull
71+
@Override
72+
public Category getCategory() {
73+
return Category.PLUGINS;
74+
}
75+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright (c) 2025, Jan Faracik
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
package jenkins.management;
26+
27+
import edu.umd.cs.findbugs.annotations.NonNull;
28+
import hudson.Extension;
29+
import hudson.model.ManagementLink;
30+
import hudson.security.Permission;
31+
import jenkins.model.Jenkins;
32+
import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag;
33+
34+
@Extension(ordinal = Integer.MAX_VALUE - 2)
35+
public class PluginsInstalledLink extends ManagementLink {
36+
37+
@Override
38+
public String getIconFileName() {
39+
var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue();
40+
41+
if (!flagEnabled) {
42+
return null;
43+
}
44+
45+
return "symbol-plugins";
46+
}
47+
48+
@Override
49+
public String getDisplayName() {
50+
return Messages.PluginsInstalledLink_DisplayName();
51+
}
52+
53+
@Override
54+
public String getUrlName() {
55+
return "pluginManager/installed";
56+
}
57+
58+
@NonNull
59+
@Override
60+
public Permission getRequiredPermission() {
61+
return Jenkins.SYSTEM_READ;
62+
}
63+
64+
@NonNull
65+
@Override
66+
public Category getCategory() {
67+
return Category.PLUGINS;
68+
}
69+
}

core/src/main/java/jenkins/management/PluginsLink.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import hudson.model.UpdateCenter;
3131
import hudson.security.Permission;
3232
import jenkins.model.Jenkins;
33+
import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag;
3334
import org.jenkinsci.Symbol;
3435

3536
/**
@@ -40,6 +41,12 @@ public class PluginsLink extends ManagementLink {
4041

4142
@Override
4243
public String getIconFileName() {
44+
var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue();
45+
46+
if (flagEnabled) {
47+
return null;
48+
}
49+
4350
return "plugin.svg";
4451
}
4552

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright (c) 2025, Jan Faracik
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
package jenkins.management;
26+
27+
import edu.umd.cs.findbugs.annotations.NonNull;
28+
import hudson.Extension;
29+
import hudson.model.ManagementLink;
30+
import hudson.model.UpdateCenter;
31+
import hudson.security.Permission;
32+
import jenkins.model.Jenkins;
33+
import jenkins.model.experimentalflags.NewManageJenkinsUserExperimentalFlag;
34+
35+
@Extension(ordinal = Integer.MAX_VALUE)
36+
public class PluginsUpdatesLink extends ManagementLink {
37+
38+
@Override
39+
public String getIconFileName() {
40+
var flagEnabled = new NewManageJenkinsUserExperimentalFlag().getFlagValue();
41+
42+
if (!flagEnabled) {
43+
return null;
44+
}
45+
46+
return "symbol-download";
47+
}
48+
49+
@Override
50+
public String getDisplayName() {
51+
return Messages.PluginsUpdatesLink_DisplayName();
52+
}
53+
54+
@Override
55+
public String getUrlName() {
56+
return "pluginManager";
57+
}
58+
59+
@NonNull
60+
@Override
61+
public Permission getRequiredPermission() {
62+
return Jenkins.SYSTEM_READ;
63+
}
64+
65+
@NonNull
66+
@Override
67+
public Category getCategory() {
68+
return Category.PLUGINS;
69+
}
70+
71+
@Override
72+
public Badge getBadge() {
73+
final UpdateCenter updateCenter = Jenkins.get().getUpdateCenter();
74+
return updateCenter.getBadge();
75+
}
76+
}

0 commit comments

Comments
 (0)