提交 59a6f8e7 编写于 作者: K kohsuke

adding the advanced tab for proxy configuration.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9914 71c3de6d-444a-0410-be80-ed276b4c234a
上级 9ceeb556
......@@ -858,5 +858,9 @@ public class Functions {
return projectName;
}
public String getSystemProperty(String key) {
return System.getProperty(key);
}
private static final Pattern SCHEME = Pattern.compile("[a-z]+://.+");
}
......@@ -26,6 +26,7 @@ import java.util.logging.Logger;
import org.apache.commons.logging.LogFactory;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.QueryParameter;
/**
* Manages {@link PluginWrapper}s.
......@@ -171,6 +172,12 @@ public final class PluginManager extends AbstractModelObject {
rsp.sendRedirect("../updateCenter/");
}
public void doProxyConfigure(@QueryParameter("proxy.server") String server, @QueryParameter("proxy.port") String port, StaplerResponse rsp) throws IOException {
System.setProperty("http.proxyHost",Util.fixEmptyAndTrim(server));
System.setProperty("http.proxyPort",Util.fixEmptyAndTrim(port));
rsp.sendRedirect("./advanced");
}
private final class UberClassLoader extends ClassLoader {
public UberClassLoader() {
super(PluginManager.class.getClassLoader());
......
......@@ -11,7 +11,37 @@
</tr>
<tr>
<td>
Big table
<h1>${%HTTP Proxy Configuration}</h1>
<f:form method="post" action="proxyConfigure">
<f:block>
<f:entry title="HTTP proxy server" help="/help/update-center/proxy-server.html">
<f:textbox name="proxy.server" value="${h.getSystemProperty('http.proxyHost')}" />
</f:entry>
<f:entry title="HTTP proxy port" help="/help/update-center/proxy-port.html">
<f:textbox name="proxy.port" value="${h.getSystemProperty('http.proxyPort')}" />
</f:entry>
</f:block>
<f:block>
<f:submit value="${%Submit}" />
</f:block>
</f:form>
<h1>${%Upload Plugin}</h1>
<f:form method="post" action="uploadPlugin" enctype="multipart/form-data">
<f:block>
<div style="margin-bottom: 1em;">
${%uploadtext}
</div>
</f:block>
<f:block>
<!-- @size is for other browsers, @style is for IE -->
${%File}: <input type="file" name="name" class="setting-input" style="width:80%" size='40' />
</f:block>
<f:block>
<f:submit value="${%Upload}" />
</f:block>
</f:form>
</td>
</tr>
</local:tabBar>
......
......@@ -96,22 +96,6 @@
updateMsg(); // set the initial state
</script>
<s:form method="post" action="uploadPlugin" enctype="multipart/form-data">
<s:block>
<h1>${%Upload Plugin}</h1>
<div style="margin-bottom: 1em;">
${%uploadtext}
</div>
</s:block>
<s:block>
<!-- @size is for other browsers, @style is for IE -->
${%File}: <input type="file" name="name" class="setting-input" style="width:80%" size='40' />
</s:block>
<s:block><div>
<s:submit value="${%Upload}" />
</div></s:block>
</s:form>
</l:main-panel>
</l:layout>
</j:jelly>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册