浏览代码

AMBARI-23952. Blueprint export from Amin / Cluster Information is broken

hiveww 7 年之前
父节点
当前提交
e5e29cd8e0

+ 2 - 2
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ClusterInformationCtrl.js

@@ -55,13 +55,13 @@ function($scope, $http, $location, Cluster, $routeParams, $translate, $rootScope
 
   $scope.downloadBlueprint = function () {
     if (window.navigator.msSaveOrOpenBlob) {
-      var blob = new Blob([decodeURIComponent(encodeURI($scope.blueprint))], {
+      var blob = new Blob([decodeURIComponent(encodeURIComponent($scope.blueprint))], {
         type: "text/csv;charset=utf-8;"
       });
       navigator.msSaveBlob(blob, 'blueprint.json');
     } else {
       var a = document.createElement('a');
-      a.href = 'data:attachment/csv;charset=utf-8,' + encodeURI($scope.blueprint);
+      a.href = 'data:attachment/json;charset=utf-8,' + encodeURIComponent($scope.blueprint);
       a.target = '_blank';
       a.download = 'blueprint.json';
       document.body.appendChild(a);