From ef32ccd167c922630a7b39b779ddb2c620dd3343 Mon Sep 17 00:00:00 2001 From: jiazhong Date: Fri, 12 Dec 2014 17:39:24 +0800 Subject: [PATCH 1/4] update admin page style & alert style --- webapp/app/js/controllers/access.js | 4 ++-- webapp/app/js/controllers/admin.js | 3 +-- webapp/app/js/controllers/cubeEdit.js | 28 +++++++++++++++++----------- webapp/app/js/controllers/cubes.js | 25 ++++++------------------- webapp/app/js/controllers/job.js | 6 +++--- webapp/app/js/controllers/projects.js | 4 ++-- webapp/app/less/app.less | 4 ++++ webapp/app/partials/admin/admin.html | 22 +++++++++++----------- 8 files changed, 46 insertions(+), 50 deletions(-) diff --git a/webapp/app/js/controllers/access.js b/webapp/app/js/controllers/access.js index a8e7a68..faee735 100644 --- a/webapp/app/js/controllers/access.js +++ b/webapp/app/js/controllers/access.js @@ -77,9 +77,9 @@ KylinApp.controller('AccessCtrl', function ($scope,AccessService, MessageService $scope.revoke = function (type, access, entity) { SweetAlert.swal({ - title: 'Confirm', + title: '', text: 'Are you sure to revoke the access?', - type: 'warning', + type: 'info', showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: "Yes", diff --git a/webapp/app/js/controllers/admin.js b/webapp/app/js/controllers/admin.js index 5476a1f..af3624d 100644 --- a/webapp/app/js/controllers/admin.js +++ b/webapp/app/js/controllers/admin.js @@ -149,11 +149,10 @@ KylinApp.controller('AdminCtrl', function ($scope,AdminService, CacheService, Ta }; $scope.calculate = function () { $modalInstance.dismiss(); - SweetAlert.swal('Success!', 'A cardinality task has been submitted', 'success'); TableService.genCardinality({tableName: $scope.tableName}, {delimiter: $scope.delimiter, format: $scope.format}, function (result) { -// MessageService.sendMsg('Cardinality job was calculated successfully. Click Refresh button ...', 'success', {}); SweetAlert.swal('Success!', 'Cardinality job was calculated successfully. . Click Refresh button ...', 'success'); },function(e){ + console.log(e); if(e.data&& e.data.exception){ var message =e.data.exception; var msg = !!(message) ? message : 'Failed to take action.'; diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js index 02c1acc..ca67a9d 100644 --- a/webapp/app/js/controllers/cubeEdit.js +++ b/webapp/app/js/controllers/cubeEdit.js @@ -191,7 +191,7 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio } SweetAlert.swal({ - title: 'Confirm', + title: '', text: 'Are you sure to save the cube ?', type: 'info', showCancelButton: true, @@ -211,17 +211,23 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio design_form.$invalid = true; } } else { - MessageService.sendMsg("

Failed to deal the request:

"+$scope.state.cubeSchema+"
","error",{},true); + $scope.cubeMetaFrame.project = $scope.state.project; + if(request.message){ + var message =request.message; + var msg = !!(message) ? message : 'Failed to take action.'; + MessageService.sendMsg("

Failed to deal the request:

"+msg+"

"+$scope.state.cubeSchema+"
","error",{},true); + }else{ + SweetAlert.swal('Oops...', "Failed to take action.", 'error'); + } } //end loading loadingRequest.hide(); recoveryCubeStatus(); }, function (e) { - if(e.data&& e.data.exception){ var message =e.data.exception; var msg = !!(message) ? message : 'Failed to take action.'; - MessageService.sendMsg("

Failed to deal the request:"+msg+"

"+$scope.state.cubeSchema+"
","error",{},true); + MessageService.sendMsg("

Failed to deal the request:

"+msg+"

"+$scope.state.cubeSchema+"
","error",{},true); }else{ SweetAlert.swal('Oops...', "Failed to take action.", 'error'); } @@ -231,19 +237,19 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio } else { CubeService.save({}, {cubeDescData: $scope.state.cubeSchema, project: $scope.state.project}, function (request) { - if (request.successful) { + if(request.successful) { $scope.state.cubeSchema = request.cubeDescData; MessageService.sendMsg("Created cube successful.","success",{},true); } else { $scope.cubeMetaFrame.project = $scope.state.project; - var e = request; - if(e.data&& e.data.exception){ - var message =e.data.exception; + if(request.message){ + var message =request.message; var msg = !!(message) ? message : 'Failed to take action.'; - MessageService.sendMsg("

Failed to deal the request:

"+msg+"

"+$scope.state.cubeSchema+"
","error",{},true); + MessageService.sendMsg("

Failed to deal the request:

"+msg+"

"+$scope.state.cubeSchema+"
","error",{},true); }else{ SweetAlert.swal('Oops...', "Failed to take action.", 'error'); - } } + } + } //end loading loadingRequest.hide(); @@ -252,7 +258,7 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio if(e.data&& e.data.exception){ var message =e.data.exception; var msg = !!(message) ? message : 'Failed to take action.'; - MessageService.sendMsg("

Failed to deal the request:

"+msg+"

"+$scope.state.cubeSchema+"
","error",{},true); + MessageService.sendMsg("

Failed to deal the request:

"+msg+"

"+$scope.state.cubeSchema+"
","error",{},true); }else{ SweetAlert.swal('Oops...', "Failed to take action.", 'error'); } diff --git a/webapp/app/js/controllers/cubes.js b/webapp/app/js/controllers/cubes.js index 80aa7d8..47e0c21 100644 --- a/webapp/app/js/controllers/cubes.js +++ b/webapp/app/js/controllers/cubes.js @@ -122,7 +122,7 @@ KylinApp SweetAlert.swal({ title: '', text: 'Are you sure to enable the cube? Please note: if cube schema is changed in the disabled period, all segments of the cube will be discarded due to data and schema mismatch.', - type: 'warning', + type: 'info', showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: "Yes", @@ -156,7 +156,7 @@ KylinApp SweetAlert.swal({ title: '', text: 'Are you sure to purge the cube? ', - type: 'warning', + type: 'info', showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: "Yes", @@ -185,7 +185,7 @@ KylinApp SweetAlert.swal({ title: '', text: 'Are you sure to disable the cube? ', - type: 'warning', + type: 'info', showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: "Yes", @@ -213,8 +213,8 @@ KylinApp SweetAlert.swal({ title: '', - text: "Are you sure to drop the cube? Once it's dropped, your cube’s metadata and data will be cleaned up and can’t be restored back. ", - type: 'warning', + text: " Once it's dropped, your cube’s metadata and data will be cleaned up and can’t be restored back. ", + type: 'info', showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: "Yes", @@ -265,7 +265,7 @@ KylinApp SweetAlert.swal({ title: '', text: "Are you sure to start the build? ", - type: 'warning', + type: 'info', showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: "Yes", @@ -354,16 +354,6 @@ var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageServic $scope.rebuild = function () { - SweetAlert.swal({ - title: '', - text: "Are you sure to rebuild the cube? ", - type: 'warning', - showCancelButton: true, - confirmButtonColor: '#DD6B55', - confirmButtonText: "Yes", - closeOnConfirm: true - }, function(isConfirm) { - if(isConfirm){ $scope.message = null; $scope.jobBuildRequest.startTime = new Date($scope.jobBuildRequest.startTime).getTime(); $scope.jobBuildRequest.endTime = new Date($scope.jobBuildRequest.endTime).getTime(); @@ -393,9 +383,6 @@ var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageServic SweetAlert.swal('Oops...', "Failed to take action.", 'error'); } }); - } - - }); }; // used by cube segment refresh diff --git a/webapp/app/js/controllers/job.js b/webapp/app/js/controllers/job.js index 9324eb2..c98864b 100644 --- a/webapp/app/js/controllers/job.js +++ b/webapp/app/js/controllers/job.js @@ -103,9 +103,9 @@ KylinApp }); $scope.resume = function (job) { SweetAlert.swal({ - title: 'Confirm', + title: '', text: 'Are you sure to resume the job?', - type: 'warning', + type: 'info', showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: "Yes", @@ -134,7 +134,7 @@ KylinApp SweetAlert.swal({ title: 'Confirm', text: 'Are you sure to discard the job?', - type: 'warning', + type: 'info', showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: "Yes", diff --git a/webapp/app/js/controllers/projects.js b/webapp/app/js/controllers/projects.js index 4f5a375..ab584a5 100644 --- a/webapp/app/js/controllers/projects.js +++ b/webapp/app/js/controllers/projects.js @@ -49,9 +49,9 @@ KylinApp $scope.delete = function(project){ SweetAlert.swal({ - title: 'Confirm', + title: '', text: 'Are you sure to delete ?', - type: 'warning', + type: 'info', showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: "Yes", diff --git a/webapp/app/less/app.less b/webapp/app/less/app.less index 9ece77c..a807ad1 100644 --- a/webapp/app/less/app.less +++ b/webapp/app/less/app.less @@ -526,3 +526,7 @@ ul.messenger .messenger-message-inner { -o-user-select: text; user-select: text; } + +.load-hive-metawrapper input[type="radio"]{ + margin-left:0px !important; +} \ No newline at end of file diff --git a/webapp/app/partials/admin/admin.html b/webapp/app/partials/admin/admin.html index c3c3e5b..ef5b402 100644 --- a/webapp/app/partials/admin/admin.html +++ b/webapp/app/partials/admin/admin.html @@ -21,29 +21,29 @@

Actions

-
+
-
+
-
+
-
+
-
+
@@ -61,7 +61,7 @@ -
+ + + + + +