mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Add congiguration.controller.js
This commit is contained in:
parent
6adb5225ab
commit
7e88eef244
1 changed files with 34 additions and 29 deletions
|
|
@ -11,36 +11,41 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
'use strict';
|
||||
'use strict';
|
||||
(function() {
|
||||
|
||||
angular.module('zeppelinWebApp').controller('ConfigurationCtrl', function($scope, $rootScope, $http,
|
||||
baseUrlSrv, ngToast) {
|
||||
$scope.configrations = [];
|
||||
$scope._ = _;
|
||||
angular.module('zeppelinWebApp').controller('ConfigurationCtrl', ConfigurationCtrl);
|
||||
|
||||
var getConfigurations = function() {
|
||||
$http.get(baseUrlSrv.getRestApiBase() + '/configurations/all').
|
||||
success(function(data, status, headers, config) {
|
||||
$scope.configurations = data.body;
|
||||
}).
|
||||
error(function(data, status, headers, config) {
|
||||
if (status === 401) {
|
||||
ngToast.danger({
|
||||
content: 'You don\'t have permission on this page',
|
||||
verticalPosition: 'bottom',
|
||||
timeout: '3000'
|
||||
});
|
||||
setTimeout(function() {
|
||||
window.location.replace('/');
|
||||
}, 3000);
|
||||
}
|
||||
console.log('Error %o %o', status, data.message);
|
||||
});
|
||||
};
|
||||
ConfigurationCtrl.$inject = ['$scope', '$rootScope', '$http', 'baseUrlSrv', 'ngToast'];
|
||||
|
||||
var init = function() {
|
||||
getConfigurations();
|
||||
};
|
||||
function ConfigurationCtrl($scope, $rootScope, $http, baseUrlSrv, ngToast) {
|
||||
$scope.configrations = [];
|
||||
$scope._ = _;
|
||||
|
||||
init();
|
||||
});
|
||||
var getConfigurations = function() {
|
||||
$http.get(baseUrlSrv.getRestApiBase() + '/configurations/all').
|
||||
success(function(data, status, headers, config) {
|
||||
$scope.configurations = data.body;
|
||||
}).
|
||||
error(function(data, status, headers, config) {
|
||||
if (status === 401) {
|
||||
ngToast.danger({
|
||||
content: 'You don\'t have permission on this page',
|
||||
verticalPosition: 'bottom',
|
||||
timeout: '3000'
|
||||
});
|
||||
setTimeout(function() {
|
||||
window.location.replace('/');
|
||||
}, 3000);
|
||||
}
|
||||
console.log('Error %o %o', status, data.message);
|
||||
});
|
||||
};
|
||||
|
||||
var init = function() {
|
||||
getConfigurations();
|
||||
};
|
||||
|
||||
init();
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue