You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by bo...@apache.org on 2019/07/14 11:07:09 UTC
[kylin] branch master updated: KYLIN-4013 Only show the cubes under
one model
This is an automated email from the ASF dual-hosted git repository.
boblu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/master by this push:
new 58f990c KYLIN-4013 Only show the cubes under one model
58f990c is described below
commit 58f990c90762b27ca397fd050324f291398e4f53
Author: yuzhang <sh...@163.com>
AuthorDate: Sun Jun 23 11:56:08 2019 +0800
KYLIN-4013 Only show the cubes under one model
---
webapp/app/js/controllers/models.js | 30 ++++++++++++++++++++++++++++-
webapp/app/partials/models/models_tree.html | 1 +
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/webapp/app/js/controllers/models.js b/webapp/app/js/controllers/models.js
index d79c464..84e99e6 100644
--- a/webapp/app/js/controllers/models.js
+++ b/webapp/app/js/controllers/models.js
@@ -18,7 +18,7 @@
'use strict';
-KylinApp.controller('ModelsCtrl', function ($scope, $q, $routeParams, $location, $window, $modal, MessageService, CubeDescService, CubeService, JobService, UserService, ProjectService, SweetAlert, loadingRequest, $log, modelConfig, ProjectModel, ModelService, MetaModel, modelsManager, cubesManager, TableModel, AccessService, MessageBox) {
+KylinApp.controller('ModelsCtrl', function ($scope, $q, $routeParams, $location, $window, $modal, MessageService, CubeDescService, CubeService, JobService, UserService, ProjectService, SweetAlert, loadingRequest, $log, modelConfig, ProjectModel, ModelService, MetaModel, modelsManager, cubesManager, TableModel, AccessService, MessageBox, CubeList) {
//tree data
@@ -171,6 +171,34 @@ KylinApp.controller('ModelsCtrl', function ($scope, $q, $routeParams, $location,
});
}
+ $scope.listCubes = function(model) {
+ var defer = $q.defer();
+ var queryParam = {modelName: model.name};
+ if (!$scope.projectModel.isSelectedProjectValid() || !$scope.projectModel.projects.length) {
+ SweetAlert.swal('Oops...', "Please select target project.", 'info');
+ defer.resolve([]);
+ return defer.promise;
+ }
+
+ queryParam.projectName = $scope.projectModel.selectedProject;
+
+ $scope.loading = true;
+ CubeList.removeAll();
+ return CubeList.list(queryParam).then(function (resp) {
+ angular.forEach(CubeList.cubes, function(cube, index) {
+ })
+
+ $scope.loading = false;
+ defer.resolve(resp);
+ return defer.promise;
+
+ }, function(resp) {
+ $scope.loading = false;
+ defer.resolve([]);
+ SweetAlert.swal('Oops...', resp, 'error');
+ return defer.promise;
+ });
+ }
$scope.openModal = function (model) {
diff --git a/webapp/app/partials/models/models_tree.html b/webapp/app/partials/models/models_tree.html
index c064525..1009f86 100644
--- a/webapp/app/partials/models/models_tree.html
+++ b/webapp/app/partials/models/models_tree.html
@@ -56,6 +56,7 @@
Action <span class="ace-icon fa fa-caret-down icon-on-right"></span>
</button>
<ul class="dropdown-menu" role="menu" style="right:0;left:auto;" ng-if="(userService.hasRole('ROLE_ADMIN') || hasPermission('model',model, permissions.ADMINISTRATION.mask, permissions.MANAGEMENT.mask))">
+ <li><a ng-click="listCubes(model)" title="Using Cubes" style="cursor:pointer;margin-right: 8px;" >Cubes</a></li>
<li><a ng-click="editModel(model, false)" title="Edit Model" style="cursor:pointer;margin-right: 8px;" >Edit</a></li>
<li><a ng-click="cloneModel(model)" title="Clone Model" style="cursor:pointer;margin-right: 8px;" >Clone </a></li>
<li><a ng-click="dropModel(model)" title="Drop Model" style="cursor:pointer;margin-right: 8px;">Drop</a></li>