[ZEPPELIN-1376] Improve error popup display

This commit is contained in:
doanduyhai 2016-10-01 22:24:21 +02:00
parent 177fbd309f
commit b8d44e7d77
7 changed files with 23 additions and 8 deletions

View file

@ -21,6 +21,7 @@
function ConfigurationCtrl($scope, $rootScope, $http, baseUrlSrv, ngToast) {
$scope.configrations = [];
$scope._ = _;
ngToast.dismiss();
var getConfigurations = function() {
$http.get(baseUrlSrv.getRestApiBase() + '/configurations/all').

View file

@ -20,6 +20,7 @@
function CredentialCtrl($scope, $rootScope, $http, baseUrlSrv, ngToast) {
$scope._ = _;
ngToast.dismiss();
$scope.credentialInfo = [];
$scope.showAddNewCredentialInfo = false;

View file

@ -21,10 +21,12 @@
'notebookListDataFactory',
'websocketMsgSrv',
'$rootScope',
'arrayOrderingSrv'
'arrayOrderingSrv',
'ngToast'
];
function HomeCtrl($scope, notebookListDataFactory, websocketMsgSrv, $rootScope, arrayOrderingSrv) {
function HomeCtrl($scope, notebookListDataFactory, websocketMsgSrv, $rootScope, arrayOrderingSrv, ngToast) {
ngToast.dismiss();
var vm = this;
vm.notes = notebookListDataFactory;
vm.websocketMsgSrv = websocketMsgSrv;

View file

@ -25,6 +25,7 @@
$scope.showAddNewSetting = false;
$scope.showRepositoryInfo = false;
$scope._ = _;
ngToast.dismiss();
$scope.openPermissions = function() {
$scope.showInterpreterAuth = true;
@ -112,13 +113,15 @@
var setting = $scope.interpreterSettings[index];
if (setting.status === 'DOWNLOADING_DEPENDENCIES') {
isDownloading = true;
break;
} else if (setting.status === 'ERROR') {
}
if (setting.status === 'ERROR' || setting.errorReason) {
ngToast.danger({content: 'Error setting properties for interpreter \'' +
setting.group + '.' + setting.name + '\': ' + setting.errorReason,
verticalPosition: 'top', dismissOnTimeout: false});
}
}
if (isDownloading) {
$timeout(function() {
if ($route.current.$$route.originalPath === '/interpreter') {

View file

@ -16,9 +16,10 @@
angular.module('zeppelinWebApp').controller('JobmanagerCtrl', JobmanagerCtrl);
JobmanagerCtrl.$inject = ['$scope', 'websocketMsgSrv', '$interval'];
JobmanagerCtrl.$inject = ['$scope', 'websocketMsgSrv', '$interval', 'ngToast'];
function JobmanagerCtrl($scope, websocketMsgSrv, $interval) {
function JobmanagerCtrl($scope, websocketMsgSrv, $interval, ngToast) {
ngToast.dismiss();
$scope.filterValueToName = function(filterValue) {
var index = _.findIndex($scope.ACTIVE_INTERPRETERS, {value: filterValue});

View file

@ -26,11 +26,16 @@
'websocketMsgSrv',
'baseUrlSrv',
'$timeout',
'saveAsService'
'saveAsService',
'ngToast'
];
function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope,
$http, websocketMsgSrv, baseUrlSrv, $timeout, saveAsService) {
$http, websocketMsgSrv, baseUrlSrv, $timeout, saveAsService,
ngToast) {
ngToast.dismiss();
$scope.note = null;
$scope.moment = moment;
$scope.editorToggled = false;

View file

@ -433,6 +433,7 @@ public class InterpreterFactory implements InterpreterGroupFactory {
private void loadInterpreterDependencies(final InterpreterSetting setting) {
setting.setStatus(InterpreterSetting.Status.DOWNLOADING_DEPENDENCIES);
setting.setErrorReason(null);
interpreterSettings.put(setting.getId(), setting);
synchronized (interpreterSettings) {
final Thread t = new Thread() {
@ -461,6 +462,7 @@ public class InterpreterFactory implements InterpreterGroupFactory {
}
setting.setStatus(InterpreterSetting.Status.READY);
setting.setErrorReason(null);
} catch (Exception e) {
logger.error(String.format("Error while downloading repos for interpreter group : %s," +
" go to interpreter setting page click on edit and save it again to make " +