KYLIN-2070 UI changes for allowing concurrent build/refresh/merge Signed-off-by: shaofengshi <shaofeng...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/efa945e5 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/efa945e5 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/efa945e5 Branch: refs/heads/master Commit: efa945e56b1d07648c3f0507831b769d0a018e7e Parents: 7a793e5 Author: luguosheng <550175...@qq.com> Authored: Fri Oct 21 11:40:19 2016 +0800 Committer: shaofengshi <shaofeng...@apache.org> Committed: Thu Oct 27 09:10:23 2016 +0800 ---------------------------------------------------------------------- webapp/app/js/controllers/cubes.js | 40 ++++++++++++++++++++++++++++----- webapp/app/js/services/cubes.js | 1 + 2 files changed, 36 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/efa945e5/webapp/app/js/controllers/cubes.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/controllers/cubes.js b/webapp/app/js/controllers/cubes.js index 499e93c..f735fb8 100644 --- a/webapp/app/js/controllers/cubes.js +++ b/webapp/app/js/controllers/cubes.js @@ -334,12 +334,42 @@ KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location, $scope.loadDetail(cube); // for streaming cube build tip if(cube.streaming){ - $modal.open({ - templateUrl: 'streamingBuild.html', - controller: streamingBuildCtrl, - resolve: { + + SweetAlert.swal({ + title: '', + text: "Are you sure to start the build?", + type: '', + showCancelButton: true, + confirmButtonColor: '#DD6B55', + confirmButtonText: "Yes", + closeOnConfirm: true + }, function(isConfirm) { + if(isConfirm){ + loadingRequest.show(); + CubeService.rebuildStreamingCube( + { + cubeId: cube.name + }, + { + sourceOffsetStart:0, + sourceOffsetEnd:'9223372036854775807', + buildType:'BUILD' + }, function (job) { + loadingRequest.hide(); + SweetAlert.swal('Success!', 'Rebuild job was submitted successfully', 'success'); + },function(e){ + + loadingRequest.hide(); + if(e.data&& e.data.exception){ + var message =e.data.exception; + var msg = !!(message) ? message : 'Failed to take action.'; + SweetAlert.swal('Oops...', msg, 'error'); + }else{ + SweetAlert.swal('Oops...', "Failed to take action.", 'error'); + } + }); } - }); + }) return; } http://git-wip-us.apache.org/repos/asf/kylin/blob/efa945e5/webapp/app/js/services/cubes.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/services/cubes.js b/webapp/app/js/services/cubes.js index 953f157..de60f55 100644 --- a/webapp/app/js/services/cubes.js +++ b/webapp/app/js/services/cubes.js @@ -26,6 +26,7 @@ KylinApp.factory('CubeService', ['$resource', function ($resource, config) { cost: {method: 'PUT', params: {action: 'cost'}, isArray: false}, rebuildLookUp: {method: 'PUT', params: {propName: 'segs', action: 'refresh_lookup'}, isArray: false}, rebuildCube: {method: 'PUT', params: {action: 'rebuild'}, isArray: false}, + rebuildStreamingCube: {method: 'PUT', params: {action: 'build2'}, isArray: false}, disable: {method: 'PUT', params: {action: 'disable'}, isArray: false}, enable: {method: 'PUT', params: {action: 'enable'}, isArray: false}, purge: {method: 'PUT', params: {action: 'purge'}, isArray: false},