You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by bi...@apache.org on 2017/06/21 13:46:47 UTC
kylin git commit: KYLIN-2677 There is no place to view the project
configuration and can only be viewed on the edit project page.
Repository: kylin
Updated Branches:
refs/heads/master 15b7a030e -> 5749aed4e
KYLIN-2677 There is no place to view the project configuration and can only be viewed on the edit project page.
Signed-off-by: Billy Liu <bi...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/5749aed4
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/5749aed4
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/5749aed4
Branch: refs/heads/master
Commit: 5749aed4e23c0deecf23bc3971ccadafd861d600
Parents: 15b7a03
Author: 10069681 <pe...@zte.com.cn>
Authored: Wed Jun 21 16:37:54 2017 +0800
Committer: Billy Liu <bi...@apache.org>
Committed: Wed Jun 21 21:46:01 2017 +0800
----------------------------------------------------------------------
webapp/app/js/controllers/page.js | 5 +++
webapp/app/js/controllers/projects.js | 38 +++++++++++---------
.../app/partials/projects/project_detail.html | 29 +++++++++++++++
3 files changed, 55 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/5749aed4/webapp/app/js/controllers/page.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/page.js b/webapp/app/js/controllers/page.js
index c426516..575f455 100644
--- a/webapp/app/js/controllers/page.js
+++ b/webapp/app/js/controllers/page.js
@@ -197,11 +197,13 @@ var projCtrl = function ($scope, $location, $modalInstance, ProjectService, Mess
$scope.isEdit = false;
$scope.proj = {name: '', description: '', override_kylin_properties: {}};
$scope.convertedProperties = [];
+ $scope.originOverrideKylinProperties = {};
if (project) {
$scope.state.isEdit = true;
$scope.state.oldProjName = project.name;
$scope.proj = project;
+ angular.copy(project.override_kylin_properties, $scope.originOverrideKylinProperties);
for (var key in $scope.proj.override_kylin_properties) {
$scope.convertedProperties.push({
@@ -219,6 +221,7 @@ var projCtrl = function ($scope, $location, $modalInstance, ProjectService, Mess
}
$scope.createOrUpdate = function () {
+ delete $scope.proj.override_kylin_properties[""];
if ($scope.state.isEdit) {
ProjectService.update({}, {formerProjectName: $scope.state.oldProjName, projectDescData: angular.toJson($scope.proj)}, function (newProj) {
SweetAlert.swal('Success!', 'Project update successfully!', 'success');
@@ -269,7 +272,9 @@ var projCtrl = function ($scope, $location, $modalInstance, ProjectService, Mess
$scope.cancel = function () {
if ($scope.state.isEdit) {
projects[$scope.state.projectIdx].name = $scope.state.oldProjName;
+ project.override_kylin_properties = $scope.originOverrideKylinProperties;
}
+ delete $scope.proj.override_kylin_properties[""];
$modalInstance.dismiss('cancel');
};
http://git-wip-us.apache.org/repos/asf/kylin/blob/5749aed4/webapp/app/js/controllers/projects.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/projects.js b/webapp/app/js/controllers/projects.js
index b9dae73..efad67c 100644
--- a/webapp/app/js/controllers/projects.js
+++ b/webapp/app/js/controllers/projects.js
@@ -61,7 +61,7 @@ KylinApp
});
}
- $scope.delete = function(project){
+ $scope.delete = function(project) {
SweetAlert.swal({
title: '',
text: 'Are you sure to delete ?',
@@ -72,25 +72,29 @@ KylinApp
closeOnConfirm: true
}, function(isConfirm) {
if(isConfirm){
- ProjectService.delete({projecId: project.name}, function(){
- var pIndex = $scope.projects.indexOf(project);
- if (pIndex > -1) {
- $scope.projects.splice(pIndex, 1);
- }
- ProjectModel.removeProject(project.name);
- SweetAlert.swal('Success!',"Project [" + project.name + "] has been deleted successfully!", 'success');
- },function(e){
- 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');
- }
- });
+ ProjectService.delete({projecId: project.name}, function(){
+ var pIndex = $scope.projects.indexOf(project);
+ if (pIndex > -1) {
+ $scope.projects.splice(pIndex, 1);
+ }
+ ProjectModel.removeProject(project.name);
+ SweetAlert.swal('Success!',"Project [" + project.name + "] has been deleted successfully!", 'success');
+ },function(e){
+ 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');
+ }
+ });
}
});
}
+
+ $scope.getMapLength = function(map) {
+ return Object.keys(map).length;
+ }
}
);
http://git-wip-us.apache.org/repos/asf/kylin/blob/5749aed4/webapp/app/partials/projects/project_detail.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/projects/project_detail.html b/webapp/app/partials/projects/project_detail.html
index 89fbf52..431073a 100644
--- a/webapp/app/partials/projects/project_detail.html
+++ b/webapp/app/partials/projects/project_detail.html
@@ -24,6 +24,9 @@
<li class="{{project.visiblePage=='access'? 'active':''}}">
<a href="" ng-click="project.visiblePage='access';listAccess(project, 'ProjectInstance');">Access</a>
</li>
+ <li class="{{project.visiblePage=='config'? 'active':''}}">
+ <a href="" ng-click="project.visiblePage='config';">Configuration Overwrites</a>
+ </li>
</ul>
<div class="cube-detail" ng-if="project.visiblePage=='cubes'">
@@ -52,6 +55,32 @@
</div>
</div>
+ <div class="cube-detail" ng-if="project.visiblePage=='config'">
+ <div class="row">
+ <div class="col-xs-1"></div>
+
+ <div class="col-xs-10">
+ <div class="space-8"></div>
+ <table ng-if="getMapLength(project.override_kylin_properties) > 0" class="table table-striped table-hover" >
+ <thead>
+ <tr>
+ <th>Key</th>
+ <th>Value</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="(key,value) in project.override_kylin_properties">
+ <td>{{key}}</td>
+ <td>{{value}}</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div no-result ng-if="getMapLength(project.override_kylin_properties) == 0"></div>
+ <div class="col-xs-1"></div>
+ </div>
+ </div>
+
<div class="cube-detail" ng-if="project.visiblePage=='access'">
<div class="row">
<div class="col-xs-1"></div>