From 9e8e8cf68ff2f1ae811004345e2112c307dc25c7 Mon Sep 17 00:00:00 2001 From: zx chen <346839943@qq.com> Date: Mon, 25 Jul 2016 18:32:40 +0800 Subject: [PATCH] KYLIN-1920-WEB --- 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(-) create mode 100644 webapp/app/partials/cubes/cube_json_view.html diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js index b6fc875..c4fda2e 100755 --- a/webapp/app/js/controllers/cubeEdit.js +++ b/webapp/app/js/controllers/cubeEdit.js @@ -155,6 +155,7 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio // ~ Define data $scope.state = { "cubeSchema": "", + "cubeInstance":"", "mode": 'edit' }; @@ -184,6 +185,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 { 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 @@ + + +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ + 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 diff --git a/webapp/app/routes.json b/webapp/app/routes.json index f4a2e91..2bc0e33 100644 --- a/webapp/app/routes.json +++ b/webapp/app/routes.json @@ -24,13 +24,21 @@ } }, { - "url": "/cubes/edit/:cubeName/json", + "url": "/cubes/edit/:cubeName/descriptionjson", "params": { "templateUrl": "partials/cubes/cube_json_edit.html", "tab": "models", "controller": "CubeEditCtrl" } }, + { + "url": "/cubes/view/:cubeName/instancejson", + "params": { + "templateUrl": "partials/cubes/cube_json_view.html", + "tab": "models", + "controller": "CubeEditCtrl" + } + }, { "url": "/cubes/edit/:cubeName", "params": { -- 2.7.2.windows.1