mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 20:12:14 +00:00
Add sidebar to plugin manager, increase search bar size (#6783)
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> Co-authored-by: Basil Crow <me@basilcrow.com> Co-authored-by: Alexander Brandes <mc.cache@web.de>
This commit is contained in:
66 files changed
+325
-1322
No files matched your search
@@ -154,6 +154,7 @@ import org.kohsuke.stapler.HttpRedirect;
|
||||
import org.kohsuke.stapler.HttpResponse;
|
||||
import org.kohsuke.stapler.HttpResponses;
|
||||
import org.kohsuke.stapler.QueryParameter;
|
||||
import org.kohsuke.stapler.StaplerFallback;
|
||||
import org.kohsuke.stapler.StaplerOverridable;
|
||||
import org.kohsuke.stapler.StaplerProxy;
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
@@ -1386,6 +1387,27 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
return !("adopt-this-plugin".equals(label) || "deprecated".equals(label));
|
||||
}
|
||||
|
||||
/**
|
||||
* This allows "Update Center" to live at the URL
|
||||
* {@code /pluginManager/updates/} in addition to its {@code /updateCenter/}
|
||||
* URL which is provided by {@link jenkins.model.Jenkins#getUpdateCenter()}.
|
||||
* For purposes of Stapler, this object is the current item serving the
|
||||
* view, and since this is not a {@link hudson.model.ModelObject}, it does
|
||||
* not appear as an additional breadcrumb and only the "Plugin Manager"
|
||||
* breadcrumb is shown.
|
||||
*/
|
||||
@Restricted(NoExternalUse.class)
|
||||
public static class UpdateCenterProxy implements StaplerFallback {
|
||||
@Override
|
||||
public Object getStaplerFallback() {
|
||||
return Jenkins.get().getUpdateCenter();
|
||||
}
|
||||
}
|
||||
|
||||
public UpdateCenterProxy getUpdates() {
|
||||
return new UpdateCenterProxy();
|
||||
}
|
||||
|
||||
@Restricted(NoExternalUse.class)
|
||||
public HttpResponse doPluginsSearch(@QueryParameter String query, @QueryParameter Integer limit) {
|
||||
List<JSONObject> plugins = new ArrayList<>();
|
||||
@@ -1593,7 +1615,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
boolean dynamicLoad = req.getParameter("dynamicLoad") != null;
|
||||
install(plugins, dynamicLoad);
|
||||
|
||||
rsp.sendRedirect("../updateCenter/");
|
||||
rsp.sendRedirect("updates/");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1898,7 +1920,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
element("url", t.toURI().toString()).
|
||||
element("dependencies", dependencies);
|
||||
new UpdateSite(UpdateCenter.ID_UPLOAD, null).new Plugin(UpdateCenter.ID_UPLOAD, cfg).deploy(true);
|
||||
return new HttpRedirect("../updateCenter");
|
||||
return new HttpRedirect("updates/");
|
||||
} catch (FileUploadException e) {
|
||||
throw new ServletException(e);
|
||||
}
|
||||
@@ -2124,7 +2146,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
@RequirePOST
|
||||
public HttpResponse doInstallNecessaryPlugins(StaplerRequest req) throws IOException {
|
||||
prevalidateConfig(req.getInputStream());
|
||||
return HttpResponses.redirectViaContextPath("updateCenter");
|
||||
return HttpResponses.redirectViaContextPath("updates/");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user