Skip to content

Commit

Permalink
Fix the notebook bugs. (#1465)
Browse files Browse the repository at this point in the history
* Fix the notebook bugs.
  • Loading branch information
zhiqiang authored and littlezhou committed Jan 30, 2018
1 parent 3b1ce18 commit 2bcc073
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
3 changes: 0 additions & 3 deletions smart-zeppelin/zeppelin-web/src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ var zeppelinWebApp = angular.module('zeppelinWebApp', [
resolve: {
rules0: ['models', function (models) {
return models.$get.rules();
}],
notebookInfo: ['models', function (models) {
return models.$get.notebookInfo();
}]
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ NotebookCtrl.$inject = [
'$scope',
'ngToast',
'rules0',
'notebookInfo'
'$rootScope'
];

function NotebookCtrl($scope, ngToast, rules0, notenookInfo) {
function NotebookCtrl($scope, ngToast, rules0, $rootScope) {

ngToast.dismiss();

Expand All @@ -46,7 +46,7 @@ function NotebookCtrl($scope, ngToast, rules0, notenookInfo) {

/** Init the new controller */
var initNotebook = function() {
$scope.note = notenookInfo;
$scope.note = $rootScope.note;
};

initNotebook();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat

$scope.runParagraph = function(data) {
var submitFn;
$scope.paragraph.config.enabled = false;
if ($scope.paragraph.id === 'add_rule') {
submitFn = restapi.submitRule;
} else if ($scope.paragraph.id === 'run_action') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function NavCtrl($scope, $rootScope, $http, $routeParams, $location,
initController();

function getZeppelinVersion() {
$http.get(baseUrlSrv.getRestApiRoot() + 'smart/api/' + conf.restapiProtocol + '/system/version').success(
$http.get(baseUrlSrv.getSmartApiRoot() + conf.restapiProtocol + '/system/version').success(
function(data, status, headers, config) {
$rootScope.zeppelinVersion = data.body;
}).error(
Expand All @@ -54,6 +54,16 @@ function NavCtrl($scope, $rootScope, $http, $routeParams, $location,
});
}

function getNoteInfo() {
$http.get(baseUrlSrv.getSmartApiRoot() + conf.restapiProtocol + '/note/info').success(
function(data, status, headers, config) {
$rootScope.note = data;
}).error(
function(data, status, headers, config) {
console.log('Error %o %o', status, data.message);
});
}

function initController() {
$scope.isDrawNavbarNoteList = false;
angular.element('#notebook-list').perfectScrollbar({suppressScrollX: true});
Expand All @@ -65,7 +75,7 @@ function NavCtrl($scope, $rootScope, $http, $routeParams, $location,
if ($rootScope.ticket && $location.path() === '/') {
$location.path('/notebook');
}

getNoteInfo();
getZeppelinVersion();
}

Expand Down

0 comments on commit 2bcc073

Please sign in to comment.