KYLIN-2080 allow multiple building jobs for the same cube Signed-off-by: Jason <jiat...@163.com>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/d1bc6e3d Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/d1bc6e3d Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/d1bc6e3d Branch: refs/heads/KYLIN-1971 Commit: d1bc6e3de05a184ba34b641fec9439f2772767b9 Parents: 6366215 Author: luguosheng <550175...@qq.com> Authored: Thu Oct 20 15:29:56 2016 +0800 Committer: Jason <jiat...@163.com> Committed: Thu Oct 20 15:31:39 2016 +0800 ---------------------------------------------------------------------- webapp/app/js/controllers/cubes.js | 12 ++++++++-- webapp/app/partials/jobs/job_merge.html | 6 +---- webapp/app/partials/jobs/job_refresh.html | 6 +---- webapp/app/partials/jobs/job_submit.html | 32 +++++++++++--------------- 4 files changed, 26 insertions(+), 30 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/d1bc6e3d/webapp/app/js/controllers/cubes.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/controllers/cubes.js b/webapp/app/js/controllers/cubes.js index f46953b..499e93c 100644 --- a/webapp/app/js/controllers/cubes.js +++ b/webapp/app/js/controllers/cubes.js @@ -348,6 +348,7 @@ KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location, } if ($scope.metaModel.model.name) { if ($scope.metaModel.model.partition_desc.partition_date_column) { + $modal.open({ templateUrl: 'jobSubmit.html', controller: jobSubmitCtrl, @@ -362,6 +363,7 @@ KylinApp.controller('CubesCtrl', function ($scope, $q, $routeParams, $location, return 'BUILD'; }, scope:function(){ + return $scope; } } @@ -543,7 +545,7 @@ var cubeCloneCtrl = function ($scope, $modalInstance, CubeService, MessageServic } -var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageService, $location, cube, metaModel, buildType, SweetAlert, loadingRequest, scope, CubeList) { +var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageService, $location, cube, metaModel, buildType, SweetAlert, loadingRequest, scope, CubeList,$filter) { $scope.cubeList = CubeList; $scope.cube = cube; $scope.metaModel = metaModel; @@ -553,7 +555,13 @@ var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageServic endTime: 0 }; $scope.message = ""; - + var startTime; + if(cube.segments.length == 0){ + startTime = (!!cube.detail.partition_date_start)?cube.detail.partition_date_start:0; + }else{ + startTime = cube.segments[cube.segments.length-1].date_range_end; + } + $scope.jobBuildRequest.startTime=startTime; $scope.rebuild = function () { $scope.message = null; http://git-wip-us.apache.org/repos/asf/kylin/blob/d1bc6e3d/webapp/app/partials/jobs/job_merge.html ---------------------------------------------------------------------- diff --git a/webapp/app/partials/jobs/job_merge.html b/webapp/app/partials/jobs/job_merge.html index f5c3965..2c1e034 100644 --- a/webapp/app/partials/jobs/job_merge.html +++ b/webapp/app/partials/jobs/job_merge.html @@ -28,7 +28,7 @@ <span class="text-info">NO SEGMENT TO MERGE.</span> </div> <div ng-if="cube.segments.length >= 2" class="row"> - <table class="table table-striped list" ng-if="(cube.segments|filter: {status: 'NEW'}).length == 0"> + <table class="table table-striped list" > <tbody> <tr> <td>PARTITION DATE COLUMN</td> @@ -102,10 +102,6 @@ </tr> </tbody> </table> - - <div ng-if="(cube.segments|filter: {status: 'NEW'}).length > 0"> - <span class="text-warning">There exists a build request of this cube, the job may be running or error. If you need a new build, please wait for its complete or discard it.</span> - </div> </div> <div ng-if="message"> <span class="text-warning">{{message}}</span> http://git-wip-us.apache.org/repos/asf/kylin/blob/d1bc6e3d/webapp/app/partials/jobs/job_refresh.html ---------------------------------------------------------------------- diff --git a/webapp/app/partials/jobs/job_refresh.html b/webapp/app/partials/jobs/job_refresh.html index 83e1d01..074406e 100644 --- a/webapp/app/partials/jobs/job_refresh.html +++ b/webapp/app/partials/jobs/job_refresh.html @@ -28,7 +28,7 @@ <span class="text-info">No Segment to refresh.</span> </div> <div ng-if="cube.segments.length > 0" class="row"> - <table class="table table-striped list" ng-if="(cube.segments|filter: {status: 'NEW'}).length == 0"> + <table class="table table-striped list" > <tbody> <tr> <td>PARTITION DATE COLUMN</td> @@ -69,10 +69,6 @@ </tr> </tbody> </table> - - <div ng-if="(cube.segments|filter: {status: 'NEW'}).length > 0"> - <span class="text-warning">There exists a build request of this cube, the job may be running or error. If you need a new build, please wait for its complete or discard it.</span> - </div> </div> <div ng-if="message"> <span class="text-warning">{{message}}</span> http://git-wip-us.apache.org/repos/asf/kylin/blob/d1bc6e3d/webapp/app/partials/jobs/job_submit.html ---------------------------------------------------------------------- diff --git a/webapp/app/partials/jobs/job_submit.html b/webapp/app/partials/jobs/job_submit.html index fbf1e4b..1dc9ae2 100644 --- a/webapp/app/partials/jobs/job_submit.html +++ b/webapp/app/partials/jobs/job_submit.html @@ -25,8 +25,7 @@ <div class="col-md-2"></div> <div class="col-md-8"> <div class="row"> - <table class="table table-striped list" - ng-if="(cube.segments | filter: {status: 'NEW'}).length == 0"> + <table class="table table-striped list"> <tbody> <tr> <td>PARTITION DATE COLUMN</td> @@ -35,18 +34,19 @@ <tr> <td>Start Date (Include)</td> <td> - <!--no need convert UTC again--> - <div ng-if="cube.segments.length == 0"> - {{jobBuildRequest.startTime = - (!!cube.detail.partition_date_start)?cube.detail.partition_date_start:0 - | reverseToGMT0 }} - </div> - <div ng-if="cube.segments.length > 0"> - <!--no need to convert--> - <div ng-if="metaModel.model.partition_desc.partition_type=='APPEND'"> - {{ jobBuildRequest.startTime = cube.segments[cube.segments.length-1].date_range_end| reverseToGMT0 }} - </div> - </div> + + <div class="dropdown" style="width: 98%;"> + <a class="dropdown-toggle" id="dropdown1" role="button" data-toggle="dropdown" data-target="#" href="#"> + <div class="input-group"><input type="text" class="form-control" date-timepicker-timezone data-ng-model="jobBuildRequest.startTime" > + <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span> + </div> + </a> + <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> + <datetimepicker data-ng-model="jobBuildRequest.startTime" data-datetimepicker-config="{ dropdownSelector: '#dropdown1' }"/> + </ul> + </div> + + </td> </tr> <tr> @@ -71,10 +71,6 @@ </tr> </tbody> </table> - - <div ng-if="(cube.segments|filter: {status: 'NEW'}).length > 0"> - <span class="text-warning">There exists a build request of this cube, the job may be running or error. If you need a new build, please wait for its complete or discard it.</span> - </div> </div> <div ng-if="message"> <span class="text-warning">{{message}}</span>