Repository: kylin Updated Branches: refs/heads/master 8eb4a845e -> 67cade982
KYLIN-1920-WEB 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/67cade98 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/67cade98 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/67cade98 Branch: refs/heads/master Commit: 67cade98299afed04abe583effe1467290c44eb7 Parents: 8eb4a84 Author: zx chen <346839...@qq.com> Authored: Mon Jul 25 18:32:40 2016 +0800 Committer: Jason <jiat...@163.com> Committed: Thu Aug 4 13:40:28 2016 +0800 ---------------------------------------------------------------------- webapp/app/js/controllers/cubeEdit.js | 23 +++++++++++ webapp/app/partials/cubes/cube_json_view.html | 44 ++++++++++++++++++++++ webapp/app/partials/cubes/cubes.html | 3 +- webapp/app/routes.json | 10 ++++- 4 files changed, 78 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/67cade98/webapp/app/js/controllers/cubeEdit.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js index 3fba2c9..86c039a 100755 --- a/webapp/app/js/controllers/cubeEdit.js +++ b/webapp/app/js/controllers/cubeEdit.js @@ -166,6 +166,7 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio // ~ Define data $scope.state = { "cubeSchema": "", + "cubeInstance":"", "mode": 'edit' }; @@ -195,6 +196,28 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio } }); + var queryParam = { + cube_name: $routeParams.cubeName + }; + CubeService.list(queryParam, {},function(instance){ + if (instance.length > 0) { + $scope.instance = instance[0]; + $scope.state.cubeInstance =angular.toJson($scope.instance,true); + + } else { + SweetAlert.swal('Oops...', "No cube detail info loaded.", 'error'); + } + + },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'); + } + }); + } else { http://git-wip-us.apache.org/repos/asf/kylin/blob/67cade98/webapp/app/partials/cubes/cube_json_view.html ---------------------------------------------------------------------- diff --git a/webapp/app/partials/cubes/cube_json_view.html b/webapp/app/partials/cubes/cube_json_view.html new file mode 100644 index 0000000..b353d49 --- /dev/null +++ b/webapp/app/partials/cubes/cube_json_view.html @@ -0,0 +1,44 @@ +<!-- +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +--> + +<div ng-controller="CubeSchemaCtrl"> + <div class="row"> + <div class="col-xs-3"> + <div ng-include src="'partials/tables/source_table_tree.html'" ng-controller="SourceMetaCtrl"></div> + </div> + <div class="col-xs-9"> + <form role="form" name="cube_form" novalidate> + <section style="padding-bottom: 20px"> + <div style="height: 620px; font-size: 14px;" ui-ace="{ + useWrapMode : true, + showGutter: true, + theme:'chrome', + mode: 'json', + onLoad: aceLoaded, + + onChange: aceChanged + }" ng-model="state.cubeInstance"> + </div> + </section> + + </form> + </div> + </div> +</div> + + http://git-wip-us.apache.org/repos/asf/kylin/blob/67cade98/webapp/app/partials/cubes/cubes.html ---------------------------------------------------------------------- diff --git a/webapp/app/partials/cubes/cubes.html b/webapp/app/partials/cubes/cubes.html index 72a3222..fceca4c 100644 --- a/webapp/app/partials/cubes/cubes.html +++ b/webapp/app/partials/cubes/cubes.html @@ -105,7 +105,8 @@ Action <span class="ace-icon fa fa-caret-down icon-on-right"></span> </button> <ul class="dropdown-menu" role="menu"> - <li ng-if="cube.status=='DISABLED'"><a href="cubes/edit/{{cube.name}}/json">Edit(JSON)</a></li> + <li ng-if="cube.status=='DISABLED'"><a href="cubes/edit/{{cube.name}}/descriptionjson">Edit CubeDesc</a></li> + <li ng-if="cube.status=='DISABLED'"><a href="cubes/view/{{cube.name}}/instancejson">View Cube</a></li> </ul> </div> </td> http://git-wip-us.apache.org/repos/asf/kylin/blob/67cade98/webapp/app/routes.json ---------------------------------------------------------------------- diff --git a/webapp/app/routes.json b/webapp/app/routes.json index 75be448..b4dcced 100644 --- a/webapp/app/routes.json +++ b/webapp/app/routes.json @@ -24,7 +24,7 @@ } }, { - "url": "/cubes/edit/:cubeName/json", + "url": "/cubes/edit/:cubeName/descriptionjson", "params": { "templateUrl": "partials/cubes/cube_json_edit.html", "tab": "models", @@ -32,6 +32,14 @@ } }, { + "url": "/cubes/view/:cubeName/instancejson", + "params": { + "templateUrl": "partials/cubes/cube_json_view.html", + "tab": "models", + "controller": "CubeEditCtrl" + } + }, + { "url": "/cubes/edit/:cubeName", "params": { "templateUrl": "partials/cubes/cube_edit.html",