提交 8e6a3f7f 编写于 作者: K Kohsuke Kawaguchi

Converted the build queue and executors into Widgets.

上级 f1669601
......@@ -24,6 +24,7 @@
package hudson.widgets;
import hudson.ExtensionPoint;
import hudson.model.View;
/**
* Box to be rendered in the side panel.
......@@ -32,6 +33,8 @@ import hudson.ExtensionPoint;
* <ul>
* <li><b>index.jelly</b> should display the widget. It should have:
* &lt;l:pane width="2" title="..."> ...body... &lt;/l:pane> structure.
* In this view, "it" points to the {@link Widget} and "view" points to {@link View}
* that's rendering the widget.
*
* @author Kohsuke Kawaguchi
* @since 1.146
......
package jenkins.widgets;
import hudson.Extension;
import hudson.widgets.Widget;
import jenkins.model.Jenkins;
/**
* Show the default build queue.
*
* A plugin may remove this from {@link Jenkins#getWidgets()} and swap in their own.
*
* @author Kohsuke Kawaguchi
* @sine 1.514
*/
@Extension(ordinal=200) // historically this was the top most widget
public class BuildQueueWidget extends Widget {
}
package jenkins.widgets;
import hudson.Extension;
import hudson.widgets.Widget;
import jenkins.model.Jenkins;
/**
* The default executors widget.
*
* A plugin may remove this from {@link Jenkins#getWidgets()} and swap in their own.
*
* @author Kohsuke Kawaguchi
* @since 1.514
*/
@Extension(ordinal=100) // historically this was above normal widgets and below BuildQueueWidget
public class ExecutorsWidget extends Widget {
}
......@@ -70,9 +70,8 @@ THE SOFTWARE.
<st:include page="tasks-bottom.jelly" it="${it.owner}" optional="true" />
<t:actions />
</l:tasks>
<t:queue items="${it.approximateQueueItemsQuickly}" />
<t:executors computers="${it.computers}" />
<j:forEach var="w" items="${it.widgets}">
<j:set var="view" value="${it}" /><!-- expose the view that's rendering this sidepanel to the widget -->
<st:include it="${w}" page="index.jelly" />
</j:forEach>
</l:side-panel>
......
......@@ -22,5 +22,5 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
Li<?jelly escape-by-default='true'?>
<st:include it="${it.primaryView}" page="sidepanel.jelly" xmlns:st="jelly:stapler" />
\ No newline at end of file
package jenkins.widgets.BuildQueueWidget;
def t = namespace(lib.JenkinsTagLib.class)
text(request.ancestors.last().object)
t.queue(items:view.approximateQueueItemsQuickly)
\ No newline at end of file
package jenkins.widgets.ExecutorsWidget
def t = namespace(lib.JenkinsTagLib.class)
t.executors(computers:view.computers)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册