| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 This in an HTML Import-able file that contains the definition | 2 This in an HTML Import-able file that contains the definition |
| 3 of the following elements: | 3 of the following elements: |
| 4 | 4 |
| 5 <task-mass-cancel> | 5 <task-mass-cancel> |
| 6 | 6 |
| 7 Usage: | 7 Usage: |
| 8 | 8 |
| 9 <task-mass-cancel></task-mass-cancel> | 9 <task-mass-cancel></task-mass-cancel> |
| 10 | 10 |
| 11 task-mass-cancel offers an interface for the user to cancel multiple tasks | 11 task-mass-cancel offers an interface for the user to cancel multiple tasks |
| 12 (and hopefully avoid doing so on accident). | 12 (and hopefully avoid doing so on accident). |
| 13 | 13 |
| 14 Properties: | 14 Properties: |
| 15 //input | 15 //input |
| 16 auth_headers: | 16 auth_headers: Object, the OAuth2 header to include in the request. This |
| 17 should come from swarming-app. |
| 17 tags: Array<String> the tags that match the tasks being canceled. | 18 tags: Array<String> the tags that match the tasks being canceled. |
| 18 | 19 |
| 19 // output | 20 // output |
| 20 started_canceling: Boolean, If the user has hit the big red button to start
canceling tasks. | 21 started_canceling: Boolean, If the user has hit the big red button to start |
| 21 finished_canceling: Boolean, If the dialog has finished canceling all the ta
sks. | 22 canceling tasks. |
| 23 finished_canceling: Boolean, If the dialog has finished canceling all the |
| 24 tasks. |
| 22 | 25 |
| 23 Methods: | 26 Methods: |
| 24 prompt() Set up the dialog, resetting started_canceling and finished_canceli
ng to false. | 27 prompt() Set up the dialog, resetting started_canceling and |
| 28 finished_canceling to false. |
| 25 | 29 |
| 26 Events: | 30 Events: |
| 27 None. | 31 None. |
| 28 --> | 32 --> |
| 29 <link rel="import" href="/res/imp/bower_components/paper-button/paper-button.htm
l"> | 33 <link rel="import" href="/res/imp/bower_components/paper-button/paper-button.htm
l"> |
| 30 | 34 |
| 31 <dom-module id="task-mass-cancel"> | 35 <dom-module id="task-mass-cancel"> |
| 32 <template> | 36 <template> |
| 33 <style> | 37 <style> |
| 34 .container { | 38 .container { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 64 <paper-button | 68 <paper-button |
| 65 class="cancel-button" | 69 class="cancel-button" |
| 66 raised | 70 raised |
| 67 disabled$="[[!_ready_to_cancel]]" | 71 disabled$="[[!_ready_to_cancel]]" |
| 68 hidden$="[[started_canceling]]" | 72 hidden$="[[started_canceling]]" |
| 69 on-tap="_cancel"> | 73 on-tap="_cancel"> |
| 70 Cancel the Tasks | 74 Cancel the Tasks |
| 71 </paper-button> | 75 </paper-button> |
| 72 | 76 |
| 73 <div > | 77 <div > |
| 74 <div hidden$="[[!started_canceling]]">Progress: [[_canceled_count]] queu
ed for cancelation</div> | 78 <div hidden$="[[!started_canceling]]">Progress: [[_canceled_count]] queu
ed for cancellation</div> |
| 75 <div>Note: tasks queued for cancellation will be canceled as soon as pos
sible, but there may be some delay between when this dialog box is closed and al
l tasks actually being canceled.</div> | 79 <div>Note: tasks queued for cancellation will be canceled as soon as pos
sible, but there may be some delay between when this dialog box is closed and al
l tasks actually being canceled.</div> |
| 76 </div> | 80 </div> |
| 77 | 81 |
| 78 </div> | 82 </div> |
| 79 | 83 |
| 80 </template> | 84 </template> |
| 81 <script> | 85 <script> |
| 82 (function(){ | 86 (function(){ |
| 83 var CANCEL_BATCH_SIZE = 100; | 87 var CANCEL_BATCH_SIZE = 100; |
| 84 Polymer({ | 88 Polymer({ |
| 85 is: 'task-mass-cancel', | 89 is: "task-mass-cancel", |
| 86 | 90 |
| 87 properties: { | 91 properties: { |
| 88 // input | 92 // input |
| 89 auth_headers: { | 93 auth_headers: { |
| 90 type: Object, | 94 type: Object, |
| 91 }, | 95 }, |
| 92 tags: { | 96 tags: { |
| 93 type: Array, | 97 type: Array, |
| 94 }, | 98 }, |
| 95 // output | 99 // output |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 }.bind(this)) | 179 }.bind(this)) |
| 176 .catch(function(e){ | 180 .catch(function(e){ |
| 177 console.log(e); | 181 console.log(e); |
| 178 sk.errorMessage(e); | 182 sk.errorMessage(e); |
| 179 }); | 183 }); |
| 180 }, | 184 }, |
| 181 }); | 185 }); |
| 182 })() | 186 })() |
| 183 </script> | 187 </script> |
| 184 </dom-module> | 188 </dom-module> |
| OLD | NEW |