Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Fix the notebook bugs. #1465

Merged
merged 2 commits into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -20,64 +20,80 @@ <h3 class="text-center">Action Usage</h3>
<tr>
<th>Action</th>
<th>Arguments</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>cache</td>
<td>allssd</td>
<td>-file $file</td>
<td>Move $file to SSD storage</td>
</tr>
<tr>
<td>uncache</td>
<td>archive</td>
<td>-file $file</td>
<td>Archive $file</td>
</tr>
<tr>
<td>delete</td>
<td>cache</td>
<td>-file $file</td>
<td>Cache $file to HDFS cache</td>
</tr>
<tr>
<td>copy</td>
<td>-file $src -dest $dest -offset $offset-length $length-bufSize $size</td>
<td>checkstorage</td>
<td>-file $file</td>
<td>Show the storage type of $file</td>
</tr>
<tr>
<td>write</td>
<td>-file $file -bufSize $size -length $length</td>
<td>concat</td>
<td>-file $src -dest $dest</td>
<td>Concatenate the files in $src which lists at least two files
separated by comma and $dest is the target file</td>
</tr>
<tr>
<td>read</td>
<td>-file $file -bufSize $size</td>
<td>copy</td>
<td>-file $src -dest $dest [-offset $offset] [-length $length] [-bufSize $size]</td>
<td>Copy the file in $src with $offset offset, $length length and $size buffer size</td>
</tr>
<tr>
<td>allssd</td>
<td>delete</td>
<td>-file $file</td>
<td>Delete $file</td>
</tr>
<tr>
<td>checkstorage</td>
<td>-file $file</td>
<td>hello</td>
<td>-print_message $message</td>
<td>Print $message</td>
</tr>
<tr>
<td>archive</td>
<td>-file $file</td>
<td>list</td>
<td>-file $src</td>
<td>List all the files in $src</td>
</tr>
<tr>
<td>concat</td>
<td>-file $src -dest $dest</td>
<td>onessd</td>
<td>-file $file</td>
<td>Move one replica of $file to SSD</td>
</tr>
<tr>
<td>list</td>
<td>-file $src</td>
<td>read</td>
<td>-file $file [-bufSize $size]</td>
<td>Read $file with $size buffer size</td>
</tr>
<tr>
<td>rename</td>
<td>-file $src -dest $dest</td>
<td>Rename $src to $dest</td>
</tr>
<tr>
<td>onessd</td>
<td>uncache</td>
<td>-file $file</td>
<td>Uncache $file from HDFS cache</td>
</tr>
<tr>
<td>hello</td>
<td>-print_message $message</td>
<td>write</td>
<td>-file $file -length $length [-bufSize $size]</td>
<td>Write random data to $file with $size buffer size and $length length</td>
</tr>
</tbody>
</table>
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