From c78850792ca48cce0f1381abfc3d19204c99ff05 Mon Sep 17 00:00:00 2001 From: jiazhong Date: Fri, 28 Nov 2014 19:11:23 +0800 Subject: [PATCH] print exception log and new reload logic on cube&job js --- .../main/java/com/kylinolap/rest/controller/CubeController.java | 1 + webapp/app/js/controllers/cubes.js | 7 ++++--- webapp/app/js/controllers/job.js | 2 +- webapp/app/js/directives/directives.js | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/com/kylinolap/rest/controller/CubeController.java b/server/src/main/java/com/kylinolap/rest/controller/CubeController.java index 5f6f214..7a36d77 100644 --- a/server/src/main/java/com/kylinolap/rest/controller/CubeController.java +++ b/server/src/main/java/com/kylinolap/rest/controller/CubeController.java @@ -357,6 +357,7 @@ public CubeRequest updateCubeDesc(@RequestBody CubeRequest cubeRequest) { throw new ForbiddenException("You don't have right to update this cube."); } catch (Exception e) { logger.error("Failed to deal with the request.", e); + e.printStackTrace(); throw new InternalErrorException("Failed to deal with the request.", e); } diff --git a/webapp/app/js/controllers/cubes.js b/webapp/app/js/controllers/cubes.js index edffc56..d48c103 100644 --- a/webapp/app/js/controllers/cubes.js +++ b/webapp/app/js/controllers/cubes.js @@ -73,9 +73,10 @@ KylinApp }; $scope.$watch('project.selectedProject', function (newValue, oldValue) { - if(newValue){ - $scope.cubes=[]; - $scope.reload(); + //exclude when refresh page oldValue=null,first time set value for project (will have page auto reload ,incase duplicate) oldvalue is null + if(oldValue){ + $scope.cubes=[]; + $scope.reload(); } }); diff --git a/webapp/app/js/controllers/job.js b/webapp/app/js/controllers/job.js index 84afd1e..68b1f37 100644 --- a/webapp/app/js/controllers/job.js +++ b/webapp/app/js/controllers/job.js @@ -82,7 +82,7 @@ KylinApp $scope.$watch('project.selectedProject', function (newValue, oldValue) { - if(newValue){ + if(oldValue){ $scope.jobs={}; $scope.state.projectName = newValue; $scope.reload(); diff --git a/webapp/app/js/directives/directives.js b/webapp/app/js/directives/directives.js index d024fcd..264cb05 100644 --- a/webapp/app/js/directives/directives.js +++ b/webapp/app/js/directives/directives.js @@ -16,6 +16,7 @@ KylinApp.directive('kylinPagination', function ($parse, $q) { scope.loadFunc = $parse(attrs.loadFunc)(scope.$parent); scope.autoLoad = true; + scope.$watch("action.reload", function (newValue, oldValue) { if (newValue != oldValue) { scope.reload();