提交 d02c7563 编写于 作者: J Jesse Glick 提交者: Oleg Nenashev

[JENKINS-60750] Skip CONFIGURE_INSTANCE panel when root URL is set during skipFirstUser (#4430)

* [JENKINS-60750] Skip the CONFIGURE_INSTANCE panel when JenkinsLocationConfiguration.url is set, even when skipFirstUser is called.

* Add nullability annotation
Co-Authored-By: NOleg Nenashev <o.v.nenashev@gmail.com>
Co-authored-by: NOleg Nenashev <o.v.nenashev@gmail.com>
上级 3ade716f
......@@ -304,6 +304,7 @@ import hudson.util.LogTaskListener;
import static java.util.logging.Level.*;
import javax.annotation.Nonnegative;
import static javax.servlet.http.HttpServletResponse.*;
import org.kohsuke.accmod.restrictions.DoNotUse;
import org.kohsuke.stapler.WebMethod;
/**
......@@ -2340,6 +2341,15 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
return null;
}
/** Exported alias for {@link JenkinsLocationConfiguration#getUrl}. */
@Exported(name="url")
@Restricted(DoNotUse.class)
@CheckForNull
public String getConfiguredRootUrl() {
JenkinsLocationConfiguration config = JenkinsLocationConfiguration.get();
return config != null ? config.getUrl() : null;
}
/**
* Is Jenkins running in HTTPS?
*
......
......@@ -940,7 +940,19 @@ var createPluginSetupWizard = function(appendTarget) {
var skipFirstUser = function() {
$('button').prop({disabled:true});
firstUserSkipped = true;
showConfigureInstance();
jenkins.get('/api/json?tree=url', function(data) {
if (data.url) {
// as in InstallState.ConfigureInstance.initializeState
showSetupCompletePanel({message: translations.installWizard_firstUserSkippedMessage});
} else {
showConfigureInstance();
}
}, {
error: function() {
// give up
showConfigureInstance();
}
});
};
var handleConfigureInstanceResponseSuccess = function (data) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册