提交 35fe7ac9 编写于 作者: K kohsuke

When a new plugin is uploaded, a message will indicate that the restart is...

When a new plugin is uploaded, a message will indicate that the restart is needed for plugins to take effect (#705)


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4185 71c3de6d-444a-0410-be80-ed276b4c234a
上级 09a145b4
......@@ -189,6 +189,13 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node
*/
private int slaveAgentPort =0;
/**
* Once plugin is uploaded, this flag becomes true.
* This is used to report a message that Hudson needs to be restarted
* for new plugins to take effect.
*/
private transient boolean pluginUploaded =false;
/**
* All labels known to Hudson. This allows us to reuse the same label instances
* as much as possible, even though that's not a strict requirement.
......@@ -1429,6 +1436,10 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node
rsp.sendRedirect2(req.getContextPath()+"/");
}
public boolean isPluginUploaded() {
return pluginUploaded;
}
/**
* Uploads a plugin.
*/
......@@ -1447,9 +1458,10 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node
return;
}
fileItem.write(new File(getPluginManager().rootDir, fileName));
fileItem.delete();
pluginUploaded=true;
rsp.sendRedirect2("managePlugins");
} catch (IOException e) {
throw e;
......
......@@ -8,6 +8,13 @@
<s:form method="post" action="configSubmit">
<s:block>
<h1>Installed Plugins</h1>
<j:if test="${app.isPluginUploaded()}">
<div style="margin: 1em; height: 1em">
<div class="error">
New plugins will take effect once you restart Hudson
</div>
</div>
</j:if>
<div style="margin: 1em; height: 1em">
<div class="error" id="needRestart" style="display:none">
Changes will take effect when you restart Hudson
......@@ -16,7 +23,7 @@
<j:choose>
<j:when test="${empty(it.pluginManager.plugins) &amp;&amp; empty(it.pluginManager.failedPlugins)}">
No plugins installed.
<span id="pluginList"/><!-- dummy to keep JavaScript happy -->
<span id="pluginList" style="display:none"/><!-- dummy to keep JavaScript happy -->
</j:when>
<j:otherwise>
<table id="pluginList">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册