mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 17:38:54 +00:00
40 lines
949 B
JavaScript
40 lines
949 B
JavaScript
|
import { Paginator } from '../../utils';
|
||
|
import template from './list.html';
|
||
|
|
||
|
function GroupsCtrl($scope, $location, $uibModal, toastr, currentUser, Events, Group) {
|
||
|
Events.record(currentUser, 'view', 'page', 'groups');
|
||
|
// $scope.$parent.pageTitle = 'Groups';
|
||
|
|
||
|
$scope.currentUser = currentUser;
|
||
|
$scope.groups = new Paginator([], { itemsPerPage: 20 });
|
||
|
Group.query((groups) => {
|
||
|
$scope.groups.updateRows(groups);
|
||
|
});
|
||
|
|
||
|
$scope.newGroup = () => {
|
||
|
$uibModal.open({
|
||
|
component: 'editGroupDialog',
|
||
|
size: 'sm',
|
||
|
resolve: {
|
||
|
group() {
|
||
|
return new Group({});
|
||
|
},
|
||
|
},
|
||
|
});
|
||
|
};
|
||
|
}
|
||
|
|
||
|
export default function (ngModule) {
|
||
|
// $routeProvider.when('/groups', {
|
||
|
// templateUrl: '/views/groups/list.html',
|
||
|
// controller: 'GroupsCtrl'
|
||
|
// });
|
||
|
ngModule.controller('GroupsCtrl', GroupsCtrl);
|
||
|
return {
|
||
|
'/groups': {
|
||
|
template,
|
||
|
controller: 'GroupsCtrl',
|
||
|
},
|
||
|
};
|
||
|
}
|