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