From 19aaed8cf79fd0661b85245b67a61f49ef8724d4 Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 14 Jul 2020 12:12:50 +1000 Subject: [PATCH] fix ui bugs --- src/main/ui/static/analysis/settle_tasks.js | 12 +++++++++++- .../analysis/templates/settle_tasks_index.html | 11 +++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/main/ui/static/analysis/settle_tasks.js b/src/main/ui/static/analysis/settle_tasks.js index 5731c2431..294d91159 100644 --- a/src/main/ui/static/analysis/settle_tasks.js +++ b/src/main/ui/static/analysis/settle_tasks.js @@ -89,6 +89,16 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { $scope.editingTask.whitelist_clients.splice(idx, 1); } }; + $scope.dropTask = function (task) { + let index = $scope.currentTasks.indexOf(task); + if (index >= 0) { + $scope.currentTasks.splice(index, 1); + } + } + + $scope.clearTasks = function () { + $scope.currentTasks = []; + } $scope.newTask = function () { $uibModal.open({ @@ -131,7 +141,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { } tasks.push(submitTask) } - $http.post('/sys/settle_tasks', tasks).then(function () { + $http.post('/sys/settle_tasks', tasks).then(function (resp) { commonDialog.alert({type: 'success', title: 'Success', content: resp.data.message}) ctrl.update_task = $interval(function () { $scope.checkProgressStatus() diff --git a/src/main/ui/static/analysis/templates/settle_tasks_index.html b/src/main/ui/static/analysis/templates/settle_tasks_index.html index 5cb6f4883..7973ea9c8 100644 --- a/src/main/ui/static/analysis/templates/settle_tasks_index.html +++ b/src/main/ui/static/analysis/templates/settle_tasks_index.html @@ -29,8 +29,15 @@
Tasks Prepare - - + + +