2.0.11 • Published 6 years ago

oasi-logs v2.0.11

Weekly downloads
23
License
ISC
Repository
-
Last release
6 years ago

На примере ГПЗУ

 let module = angular.module('oasi-gpzu-logs', ['ui.router']);

 //server writer
 module.run([function () {
     ServerLogger.init('gpzu');
 }]);

 //js errors
 module.config(globalExceptionHandlerConfig);

 //http layer interceptors
 module.factory('httpErrorInterceptor', ['$stateParams', '$q', function ($stateParams, $q) {
     return new HttpErrorInterceptor($q);
 }]);
 module.factory('loginInterceptor', ['$stateParams', '$q', function ($stateParams, $q) {
     два похожих запроса - поиск по АД и авторизация
     return new LoginInterceptor(new UrlPatternMatcher('api/v1/user', ['users'], null));
 }]);
 module.factory('authenticationInterceptor', ['$stateParams', '$q', function ($stateParams, $q) {
     return new LogoutInterceptor(new UrlPatternMatcher('api/v1/logout', null, null));
 }]);
 module.factory('activityTaskInterceptor', ['$stateParams', '$q', function ($stateParams, $q) {
     return new ActivityTaskInterceptor($stateParams, new UrlPatternMatcher('activiti-rest/service/runtime/tasks', null, null));
 }]);
 module.factory('documentsSearchInterceptor', ['$stateParams', '$q', function ($stateParams, $q) {
     return new DocumentsSearchInterceptor(new UrlPatternMatcher('api/v1/datatable/', null, ['allMyTasks']));
 }]);
 module.factory('documentUpdateInterceptor', ['$stateParams', '$q', function ($stateParams, $q) {
     return new DocumentUpdateInterceptor($stateParams, new UrlPatternMatcher('api/v1/documents', null, null));
 }]);
 module.factory('fileUploadInterceptor', ['$stateParams', '$q', function ($stateParams, $q) {
     return new FileUploadInterceptor($stateParams, new UrlPatternMatcher('api/v1/files',
         ['createFolder', 'changeFolderInfo', 'sign', 'hashhex', 'folderinfo', 'delete', 'folderContent', 'fileinfo', 'verify'],
         null));
 }]);
 module.factory('fileDownloadInterceptor', ['$stateParams', '$q', function ($stateParams, $q) {
     return new FileDownloadInterceptor($stateParams, new UrlPatternMatcher('api/v1/files',
         ['createFolder', 'changeFolderInfo', 'sign', 'hashhex', 'folderinfo', 'delete', 'folderContent', 'fileinfo', 'verify'],
         null));
 }]);

 module.config(['$httpProvider', function ($httpProvider: ng.IHttpProvider) {
     $httpProvider.interceptors.push('httpErrorInterceptor');
     $httpProvider.interceptors.push('loginInterceptor');
     $httpProvider.interceptors.push('authenticationInterceptor');
     $httpProvider.interceptors.push('activityTaskInterceptor');
     $httpProvider.interceptors.push('documentsSearchInterceptor');
     $httpProvider.interceptors.push('documentUpdateInterceptor');
     $httpProvider.interceptors.push('fileUploadInterceptor');
     $httpProvider.interceptors.push('fileDownloadInterceptor');
 }]);

 //app transitions monitor
 module.run(['$stateParams', '$state', '$rootScope', function ($stateParams, $state, $rootScope) {
     let monitor = new RoutesTransitionMonitor($stateParams, $rootScope);

     //showcases
     monitor.statesMap.push(['app.gpzu.allMyTasks', ($stateParams) => {
         serverLog(new Action(ActionType.OPEN_FORM, new OpenFormMessage('Витрина Мои Задачи')))
     }]);

     monitor.statesMap.push(['app.gpzu.requests', ($stateParams) => {
         serverLog(new Action(ActionType.OPEN_FORM, new OpenFormMessage('Витрина Все Заявления')));
     }]);

     monitor.statesMap.push(['app.gpzu.myGpzu', ($stateParams) => {
         serverLog(new Action(ActionType.OPEN_FORM, new OpenFormMessage('Витрина Мои ГПЗУ')));
     }]);

     monitor.statesMap.push(['app.gpzu.allGpzu', ($stateParams) => {
         serverLog(new Action(ActionType.OPEN_FORM, new OpenFormMessage('Витрина Все ГПЗУ')));
     }]);

     //card
     monitor.statesMap.push(['app.gpzu.request', ($stateParams) => {
         serverLog(new Action(ActionType.OPEN_FORM, new OpenFormMessage('Карточка Заявления', $stateParams['requestId'])));
     }]);

     monitor.statesMap.push(['app.gpzu.card.main.view', ($stateParams) => {
         serverLog(new Action(ActionType.OPEN_FORM, new OpenFormMessage('Карточка ГПЗУ', $stateParams['requestId'])));
     }]);

     monitor.statesMap.push(['app.gpzu.card.main.edit', ($stateParams) => {
         serverLog(new Action(ActionType.OPEN_FORM, new OpenFormMessage('Карточка ГПЗУ - Редактирование', $stateParams['requestId'])));
     }]);

     monitor.statesMap.push(['app.gpzu.card.json', ($stateParams) => {
         serverLog(new Action(ActionType.OPEN_FORM, new OpenFormMessage('JSON Editor', $stateParams['requestId'])));
     }]);

     //tasks
     monitor.statesMap.push(['app.gpzu.task', ($stateParams) => {
         serverLog(new Action(ActionType.OPEN_TASK, new OpenTaskMessage($stateParams['id'], $stateParams['taskId'], $stateParams['formKey'])))
     }]);

     monitor.start();
 }]);
2.0.11

6 years ago

2.0.10

6 years ago

2.0.9

6 years ago

2.0.8

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago