mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-18 06:22:29 +00:00
Converted the build queue and executors into Widgets.
This commit is contained in:
1 parent
f1669601e4
commit
8e6a3f7f03
7 files changed
+52
-3
No files matched your search
@@ -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:
|
||||
* <l:pane width="2" title="..."> ...body... </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
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
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 {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
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" />
|
||||
@@ -0,0 +1,7 @@
|
||||
package jenkins.widgets.BuildQueueWidget;
|
||||
|
||||
def t = namespace(lib.JenkinsTagLib.class)
|
||||
|
||||
text(request.ancestors.last().object)
|
||||
|
||||
t.queue(items:view.approximateQueueItemsQuickly)
|
||||
@@ -0,0 +1,5 @@
|
||||
package jenkins.widgets.ExecutorsWidget
|
||||
|
||||
def t = namespace(lib.JenkinsTagLib.class)
|
||||
|
||||
t.executors(computers:view.computers)
|
||||
Reference in new issue
Block a user