提交 3a3ca6b3 编写于 作者: K Kohsuke Kawaguchi

UI brush up to clarify the distinction between "download & install later" vs...

UI brush up to clarify the distinction between "download & install later" vs "download and install now"
上级 4951383f
......@@ -954,10 +954,9 @@ public class UpdateCenter extends AbstractModelObject implements Saveable {
LOGGER.info("Installation successful: "+getName());
status = new Success();
onSuccess();
} catch (RestartRequiredException e) {
status = new SuccessButRequiresRestart(e.message);
LOGGER.log(Level.INFO, "Installation successful but restart required: "+getName(), e);
onSuccess();
} catch (InstallationStatus e) {
status = e;
if (status.isSuccess()) onSuccess();
} catch (Throwable e) {
LOGGER.log(Level.SEVERE, "Failed to install "+getName(),e);
status = new Failure(e);
......@@ -965,7 +964,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable {
}
}
protected void _run() throws IOException, RestartRequiredException {
protected void _run() throws IOException, InstallationStatus {
URL src = getURL();
config.preValidate(this, src);
......@@ -996,7 +995,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable {
* <p>
* Instances of this class is immutable.
*/
public abstract class InstallationStatus {
public abstract class InstallationStatus extends Throwable {
public final int id = iota.incrementAndGet();
public boolean isSuccess() {
return false;
......@@ -1013,7 +1012,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable {
this.problem = problem;
}
public String getStackTrace() {
public String getProblemStackTrace() {
return Functions.printThrowable(problem);
}
}
......@@ -1023,7 +1022,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable {
*
* @see
*/
public class SuccessButRequiresRestart extends InstallationStatus {
public class SuccessButRequiresRestart extends Success {
private final Localizable message;
public SuccessButRequiresRestart(Localizable message) {
......@@ -1108,7 +1107,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable {
}
@Override
public void _run() throws IOException, RestartRequiredException {
public void _run() throws IOException, InstallationStatus {
super._run();
// if this is a bundled plugin, make sure it won't get overwritten
......@@ -1125,10 +1124,12 @@ public class UpdateCenter extends AbstractModelObject implements Saveable {
try {
pm.dynamicLoad(getDestination());
} catch (RestartRequiredException e) {
throw e; // pass through
throw new SuccessButRequiresRestart(e.message);
} catch (Exception e) {
throw new IOException2("Failed to dynamically deploy this plugin",e);
}
} else {
throw new SuccessButRequiresRestart(Messages._UpdateCenter_DownloadButNotActivated());
}
}
......
......@@ -137,7 +137,7 @@ THE SOFTWARE.
<j:if test="${!empty(list)}">
<div style="margin-top:1em">
<f:submit value="${%Install}" name="dynamicLoad" />
<f:submit value="${%Install without restart}" name="dynamicLoad" />
<span style="margin-left:2em;"></span>
<f:submit value="${%Download now and install after restart}" />
</div>
......
......@@ -228,6 +228,7 @@ Slave.UnableToLaunch=Unable to launch the slave agent for {0}{1}
Slave.UnixSlave=This is a Unix slave
Slave.WindowsSlave=This is a Windows slave
UpdateCenter.DownloadButNotActivated=Downloaded Successfully. Will be activated during the next boot
View.Permissions.Title=View
View.CreatePermission.Description=\
This permission allows users to create new views.
......
......@@ -30,5 +30,5 @@ THE SOFTWARE.
<a href="" onclick="var n=findNext(this,function(e){return e.tagName=='PRE'});
n.style.display='block';this.style.display='none';return false">${%Details}</a>
</div>
<pre style="display:none">${it.stackTrace}</pre>
<pre style="display:none">${it.problemStackTrace}</pre>
</j:jelly>
......@@ -39,7 +39,8 @@ THE SOFTWARE.
<div id="scheduleRestartBlock" style="padding-top:2em">
<form method="post" id="scheduleRestart" action="">
<p class="info" style="font-weight: normal">
<a href="${rootURL}/">Go back to the top page</a>
<a href="${rootURL}/">${%Go back to the top page}</a> <br/>
(you can start using the installed plugins right away) <!-- leave this text in for a while until users are retrained to expect plugins to work right away without restart -->
</p>
<p class="info" style="font-weight: normal">
<j:if test="${app.lifecycle.canRestart()}">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册