@girder/jobs 3.2.15 → 3.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/views/JobListWidget.js +14 -16
package/package.json
CHANGED
package/views/JobListWidget.js
CHANGED
|
@@ -311,24 +311,22 @@ var JobListWidget = View.extend({
|
|
|
311
311
|
},
|
|
312
312
|
|
|
313
313
|
_cancelJobs: function () {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
314
|
+
const cancelableJobIds = Object.keys(this.jobCheckedStates).filter((jobId) => {
|
|
315
|
+
var jobModel = this.collection.find((job) => job.id === jobId);
|
|
316
|
+
return JobStatus.isCancelable(jobModel);
|
|
317
|
+
});
|
|
318
|
+
const numJobs = cancelableJobIds.length;
|
|
319
|
+
if (numJobs === 0) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
_whenAll(cancelableJobIds.map((jobId) => restRequest({
|
|
323
|
+
url: `job/${jobId}/cancel`,
|
|
324
|
+
method: 'PUT',
|
|
325
|
+
error: null
|
|
326
|
+
}))).done(() => {
|
|
329
327
|
events.trigger('g:alert', {
|
|
330
328
|
icon: 'ok',
|
|
331
|
-
text: `Cancel ${
|
|
329
|
+
text: `Cancel ${numJobs === 1 ? 'request' : 'requests'} sent for ${numJobs} ${numJobs === 1 ? 'job' : 'jobs'}`,
|
|
332
330
|
type: 'info',
|
|
333
331
|
timeout: 4000
|
|
334
332
|
});
|