Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2259)

Unified Diff: appengine/swarming/ui/res/imp/botlist/bot-filters.html

Issue 2883493002: Add UI to mass delete dead bots (Closed)
Patch Set: Refresh list after Done is tapped Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | appengine/swarming/ui/res/imp/botlist/bot-list.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | appengine/swarming/ui/res/imp/botlist/bot-list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698