瀏覽代碼

[jb] Uncheck jobs that transition between completed and running

The Job Browser page is split in two tables, one for running and one for completed jobs. When a user checks an item in the running table and performs some action, that moves the item to the completed table, the selected item might not be visible anymore. This can cause confusion when there are many jobs as some actions are only allowed when a single item is checked.
Johan Åhlén 3 年之前
父節點
當前提交
0e4c632ca2
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

+ 6 - 0
apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

@@ -2890,6 +2890,12 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
         return ['RUNNING', 'PAUSED'].indexOf(self.apiStatus()) != -1 || job.isRunning;
       });
 
+      self.isRunning.subscribe(function () {
+        // The JB page for jobs is split in two tables, "Running" and "Completed", this esentially unchecks any job
+        // that moves from one table to the other.
+        ko.utils.arrayRemoveItem(vm.jobs.selectedJobs(), self)
+      });
+
       self.user = ko.observableDefault(job.user);
       self.queue = ko.observableDefault(job.queue);
       self.cluster = ko.observableDefault(job.cluster);