| Index: appengine/swarming/ui/res/imp/botlist/bot-filters.html
|
| diff --git a/appengine/swarming/ui/res/imp/botlist/bot-filters.html b/appengine/swarming/ui/res/imp/botlist/bot-filters.html
|
| index 82028d427cf8c09805faf4c12d3e7655f3137ac2..32552ac7be82276fbaa307df6324280019f923a8 100644
|
| --- a/appengine/swarming/ui/res/imp/botlist/bot-filters.html
|
| +++ b/appengine/swarming/ui/res/imp/botlist/bot-filters.html
|
| @@ -47,13 +47,21 @@
|
| None.
|
|
|
| Events:
|
| - None.
|
| + The events this element fires are to work around the fact that modal paper-dialog
|
| + elements need to be outside all other elements on the DOM.
|
| +
|
| + delete-all: The user wishes to delete all dead bots. The parent is expected
|
| + to show a paper-dialog and confirm the details. The event's details
|
| + is {dimensions: {Array:String}} of the dimensions of bots that need be
|
| + deleted. It is expected that the parent will add the &is_dead=TRUE to
|
| + the request.
|
| -->
|
|
|
| <link rel="import" href="/res/imp/bower_components/iron-a11y-keys/iron-a11y-keys.html">
|
| <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-layout-classes.html">
|
| <link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html">
|
| <link rel="import" href="/res/imp/bower_components/iron-selector/iron-selector.html">
|
| +<link rel="import" href="/res/imp/bower_components/paper-button/paper-button.html">
|
| <link rel="import" href="/res/imp/bower_components/paper-checkbox/paper-checkbox.html">
|
| <link rel="import" href="/res/imp/bower_components/paper-icon-button/paper-icon-button.html">
|
| <link rel="import" href="/res/imp/bower_components/paper-input/paper-input.html">
|
| @@ -67,7 +75,10 @@
|
| <dom-module id="bot-filters">
|
| <template>
|
| <style is="custom-style" include="iron-flex iron-flex-alignment iron-positioning query-column-filter-style swarming-app-style">
|
| -
|
| + .delete-button {
|
| + display: block;
|
| + margin-top: 5px;
|
| + }
|
| </style>
|
|
|
| <url-param name="f"
|
| @@ -183,6 +194,11 @@ the fleet.">
|
| value="{{_limit}}">
|
| </paper-input>
|
| <a href$="[[_matchingTasksLink(query_params)]]">View Matching Tasks</a>
|
| + <template is="dom-if" if="[[permissions.delete_bot]]">
|
| + <paper-button class="delete-button" raised on-tap="_promptDelete">
|
| + Delete All Dead bots
|
| + </paper-button>
|
| + </template>
|
| </div>
|
| </div>
|
|
|
| @@ -241,6 +257,9 @@ the fleet.">
|
| type: Array,
|
| notify: true,
|
| },
|
| + permissions: {
|
| + type: Object,
|
| + },
|
| query_params: {
|
| type: Object,
|
| computed: "_extractQueryParams(dimensions.*,_filters.*, _limit)",
|
| @@ -337,6 +356,14 @@ the fleet.">
|
| return this._taskListLink(query_params.dimensions, cols);
|
| },
|
|
|
| + _promptDelete: function() {
|
| + if (!this.query_params.dimensions || !this.query_params.dimensions.length) {
|
| + sk.errorMessage("You must specify at least one dimension to filter by first.", 8000);
|
| + return;
|
| + }
|
| + this.fire("delete-all",{dimensions:this.query_params.dimensions});
|
| + },
|
| +
|
| _showDimensionMessage: function(primarySelected, selectedItems) {
|
| return primarySelected && primarySelected !== "id" && !selectedItems;
|
| }
|
|
|