##// END OF EJS Templates
components: added scope for breadcrumbs
ergo -
Show More
This diff has been collapsed as it changes many lines, (1806 lines changed) Show them Hide them
@@ -2547,7 +2547,7 b' function decodeEncodedJSON (input){'
2547 delete doc;
2547 delete doc;
2548 return val;
2548 return val;
2549 }catch(exc){
2549 }catch(exc){
2550
2550 console.error('decodeEncodedJSON:' + exc + ' input:' + input);
2551 delete doc;
2551 delete doc;
2552 }
2552 }
2553 }
2553 }
@@ -2600,16 +2600,16 b' function timeSpanToStartDate(timeSpan){'
2600 /* Sets server validation messages on form using angular machinery +
2600 /* Sets server validation messages on form using angular machinery +
2601 * custom key holding actual error messages */
2601 * custom key holding actual error messages */
2602 function setServerValidation(form, errors){
2602 function setServerValidation(form, errors){
2603
2603 console.log('form', form);
2604 if (typeof form.ae_validation === 'undefined'){
2604 if (typeof form.ae_validation === 'undefined'){
2605 form.ae_validation = {};
2605 form.ae_validation = {};
2606
2606 console.log('create ae_validation key');
2607 }
2607 }
2608 for (var key in form.ae_validation){
2608 for (var key in form.ae_validation){
2609 form.ae_validation[key] = [];
2609 form.ae_validation[key] = [];
2610
2610 console.log('clear key:', key);
2611 }
2611 }
2612
2612 console.log('errors:',errors);
2613
2613
2614 for (var key in form){
2614 for (var key in form){
2615 if (key[0] !== '$' && key !== 'ae_validation'){
2615 if (key[0] !== '$' && key !== 'ae_validation'){
@@ -2684,6 +2684,10 b" angular.module('appenlight.components', ["
2684 'appenlight.components.eventBrowserView',
2684 'appenlight.components.eventBrowserView',
2685 'appenlight.components.userProfileView',
2685 'appenlight.components.userProfileView',
2686 'appenlight.components.userIdentitiesView',
2686 'appenlight.components.userIdentitiesView',
2687 'appenlight.components.userPasswordView',
2688 'appenlight.components.userAuthTokensView',
2689 'appenlight.components.userAlertChannelsListView',
2690 'appenlight.components.userAlertChannelsEmailNewView',
2687 'appenlight.components.settingsView'
2691 'appenlight.components.settingsView'
2688 ]);
2692 ]);
2689 angular.module('appenlight.directives', [
2693 angular.module('appenlight.directives', [
@@ -2716,7 +2720,7 b' var pluginsToLoad = _.map(decodeEncodedJSON(window.AE.plugins),'
2716 function(item){
2720 function(item){
2717 return item.config.angular_module
2721 return item.config.angular_module
2718 });
2722 });
2719
2723 console.log(pluginsToLoad);
2720 angular.module('appenlight.plugins', pluginsToLoad);
2724 angular.module('appenlight.plugins', pluginsToLoad);
2721
2725
2722 var app = angular.module('appenlight', [
2726 var app = angular.module('appenlight', [
@@ -2812,7 +2816,7 b' function kickstartAE(initialUserData) {'
2812 AeConfig.urls.otherRoutes.lostPassword,
2816 AeConfig.urls.otherRoutes.lostPassword,
2813 AeConfig.urls.otherRoutes.lostPasswordGenerate
2817 AeConfig.urls.otherRoutes.lostPasswordGenerate
2814 ];
2818 ];
2815
2819 console.log('$transitions.onBefore', path, $transition$.to().name, $state);
2816 _.each(openViews, function (url) {
2820 _.each(openViews, function (url) {
2817 var url = '/' + url.split('/').slice(3).join('/');
2821 var url = '/' + url.split('/').slice(3).join('/');
2818 if (url === path) {
2822 if (url === path) {
@@ -2821,7 +2825,7 b' function kickstartAE(initialUserData) {'
2821 });
2825 });
2822 if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) {
2826 if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) {
2823 if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) {
2827 if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) {
2824
2828 console.log('redirect to register');
2825 var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location);
2829 var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location);
2826 // fix infinite digest here
2830 // fix infinite digest here
2827 $rootScope.$on('$locationChangeStart',
2831 $rootScope.$on('$locationChangeStart',
@@ -3503,6 +3507,194 b' function kickstartAE(initialUserData) {'
3503 );
3507 );
3504
3508
3505
3509
3510 $templateCache.put('components/views/user-alert-channel-email-new-view/user-alert-channel-email-new-view.html',
3511 "<ng-include src=\"'templates/loader.html'\" ng-if=\"$ctrl.loading.email\"></ng-include>\n" +
3512 "\n" +
3513 "<div ng-show=\"!$ctrl.loading.email\">\n" +
3514 "\n" +
3515 " <div class=\"panel panel-default\">\n" +
3516 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
3517 " <div class=\"panel-body\">\n" +
3518 " <p>Adding email alert channel - after you authorize your email in the system we can send alerts directly to this mailbox.</p>\n" +
3519 " <form class=\"form-horizontal\" name=\"$ctrl.channelForm\" ng-submit=\"$ctrl.createChannel()\">\n" +
3520 " <div class=\"form-group\" id=\"row-email\">\n" +
3521 " <data-form-errors errors=\"$ctrl.channelForm.ae_validation.email\"></data-form-errors>\n" +
3522 " <label id=\"label-email\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3523 " Email Address\n" +
3524 " <span class=\"required\">*</span>\n" +
3525 " </label>\n" +
3526 " <div class=\"col-sm-8 col-lg-9\">\n" +
3527 " <input class=\"form-control\" type=\"text\" ng-model=\"$ctrl.form.email\">\n" +
3528 " </div>\n" +
3529 " </div>\n" +
3530 " <div class=\"form-group\">\n" +
3531 " <label for=\"submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3532 " </label>\n" +
3533 " <div class=\"col-sm-8 col-lg-9\">\n" +
3534 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Add email channel\">\n" +
3535 " </div>\n" +
3536 " </div>\n" +
3537 " </form>\n" +
3538 " </div>\n" +
3539 " </div>\n" +
3540 "</div>\n"
3541 );
3542
3543
3544 $templateCache.put('components/views/user-alert-channels-list-view/user-alert-channels-list-view.html',
3545 "<ng-include src=\"'templates/loader.html'\" ng-if=\"$ctrl.loading.channels || $ctrl.loading.applications\"></ng-include>\n" +
3546 "\n" +
3547 "<div ng-if=\"!$ctrl.loading.channels && !$ctrl.loading.applications && !$ctrl.loading.actions\">\n" +
3548 "\n" +
3549 " <div class=\"panel panel-default\">\n" +
3550 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
3551 " <div class=\"panel-body\">\n" +
3552 " <h1>Report alert rules</h1>\n" +
3553 " <p>\n" +
3554 " <a class=\"btn btn-info\" ng-click=\"$ctrl.addAction()\"><span class=\"fa fa-plus-circle\"></span> Add top-level rule</a>\n" +
3555 " </p>\n" +
3556 "\n" +
3557 " <report-alert-action action=\"action\" rule-definitions=\"$ctrl.ruleDefinitions\"\n" +
3558 " possible-channels=\"$ctrl.alertChannels\"\n" +
3559 " actions=\"$ctrl.alertActions\" applications=\"$ctrl.applications\"\n" +
3560 " ng-repeat=\"action in $ctrl.alertActions | filter: {type:'report'}\"></report-alert-action>\n" +
3561 "\n" +
3562 " </div>\n" +
3563 " </div>\n" +
3564 "\n" +
3565 " <div class=\"panel panel-default\">\n" +
3566 " <div class=\"panel-body\">\n" +
3567 " <h1>Alert channels</h1>\n" +
3568 "\n" +
3569 " <p>Here you can configure your <em>alert channels</em>.</p>\n" +
3570 "\n" +
3571 " <p>An alert channel serves as means of delivery of notifications about important events that happen in your applications.</p>\n" +
3572 "\n" +
3573 " <div class=\"alert alert-success\">You can add more integrations that support different alert channels via application management panel.</div>\n" +
3574 "\n" +
3575 " <table class=\"table table-striped\">\n" +
3576 " <tr ng-repeat=\"channel in $ctrl.alertChannels\" class=\"animate-repeat\">\n" +
3577 " <td><strong>{{ channel.channel_visible_value }}</strong></td>\n" +
3578 " <td class=\"text-right\">\n" +
3579 " <span class=\"btn btn-default\" data-uib-tooltip=\"Channel is {{ channel.channel_validated? '' :'NOT' }} validated\" tooltip-append-to-body=\"true\"\n" +
3580 " ng-class=\"{dim:!channel.channel_validated}\">\n" +
3581 " <span class=\"fa\" ng-class=\"{'fa-check-circle':channel.channel_validated, 'fa-times-circle':!channel.channel_validated}\"></span>\n" +
3582 " </span>\n" +
3583 " <a class=\"btn btn-default\" data-uib-tooltip=\"Press to turn {{ channel.send_alerts ? 'OFF' : 'ON' }} alerting on this chanel\"\n" +
3584 " ng-click=\"$ctrl.updateChannel(channel,'send_alerts')\" ng-class=\"{dim:!channel.send_alerts}\" tooltip-append-to-body=\"true\">\n" +
3585 " <span class=\"fa fa-rss\"></span> Alerts\n" +
3586 " </a>\n" +
3587 " <a class=\"btn btn-default\" data-uib-tooltip=\"Press to turn {{ channel.daily_digest ? 'OFF' : 'ON' }} daily digests on this channel\"\n" +
3588 " ng-click=\"$ctrl.updateChannel(channel,'daily_digest')\" ng-class=\"{dim:!channel.daily_digest}\" tooltip-append-to-body=\"true\">\n" +
3589 " <span class=\"fa fa-envelope\"></span> Daily digests\n" +
3590 " </a>\n" +
3591 "\n" +
3592 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
3593 " <a class=\"btn btn-default\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove</a>\n" +
3594 " <ul class=\"dropdown-menu\">\n" +
3595 " <li><a>No</a></li>\n" +
3596 " <li><a ng-click=\"$ctrl.removeChannel(channel)\">Yes</a></li>\n" +
3597 " </ul>\n" +
3598 " </span>\n" +
3599 "\n" +
3600 " </td>\n" +
3601 " </tr>\n" +
3602 " </table>\n" +
3603 "\n" +
3604 " </div>\n" +
3605 " </div>\n" +
3606 "\n" +
3607 "</div>\n"
3608 );
3609
3610
3611 $templateCache.put('components/views/user-auth-tokens-view/user-auth-tokens-view.html',
3612 "<ng-include src=\"'templates/loader.html'\" ng-if=\"$ctrl.loading.tokens\"></ng-include>\n" +
3613 "\n" +
3614 "<div ng-show=\"!$ctrl.loading.tokens\">\n" +
3615 "\n" +
3616 " <div class=\"panel panel-default\">\n" +
3617 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
3618 "\n" +
3619 " <div class=\"panel-body\">\n" +
3620 "\n" +
3621 " <div class=\"alert alert-success\">You can use those tokens to authenticate yourself when performing various API calls</div>\n" +
3622 "\n" +
3623 " <hr/>\n" +
3624 "\n" +
3625 " <form method=\"post\" class=\"form-inline\" name=\"$ctrl.TokenForm\" ng-submit=\"$ctrl.addToken()\" novalidate>\n" +
3626 " <data-form-errors errors=\"$ctrl.TokenForm.ae_validation.description\"></data-form-errors>\n" +
3627 " <data-form-errors errors=\"$ctrl.TokenForm.ae_validation.expires\"></data-form-errors>\n" +
3628 " <div class=\"form-group\">\n" +
3629 " <label>\n" +
3630 " Description\n" +
3631 " </label>\n" +
3632 " <input class=\"form-control\" name=\"description\" placeholder=\"Token description\" type=\"text\" ng-model=\"$ctrl.form.description\">\n" +
3633 " </div>\n" +
3634 " <div class=\"form-group\">\n" +
3635 " <label>\n" +
3636 " Expires\n" +
3637 " </label>\n" +
3638 " <select class=\"form-control\" ng-model=\"$ctrl.form.expires\" ng-options=\"i.key as i.label for i in $ctrl.expireOptions | objectToOrderedArray:'minutes'\">\n" +
3639 " <option value=\"\">Never</option>\n" +
3640 " </select>\n" +
3641 " </div>\n" +
3642 " <div class=\"form-group\">\n" +
3643 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3644 " </label>\n" +
3645 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Create Token\">\n" +
3646 " </div>\n" +
3647 " </form>\n" +
3648 "\n" +
3649 " </div>\n" +
3650 "\n" +
3651 "\n" +
3652 " </div>\n" +
3653 "\n" +
3654 " <div class=\"panel panel-default\">\n" +
3655 " <table st-table=\"displayedCollection\" st-safe-src=\"$ctrl.tokens\" class=\"table table-striped\">\n" +
3656 " <caption>Your current tokens</caption>\n" +
3657 " <thead>\n" +
3658 " <tr>\n" +
3659 " <th st-sort=\"description\"><a>Description</a></th>\n" +
3660 " <th class=\"created\"><a>Created</a></th>\n" +
3661 " <th class=\"expires\"><a>Expires</a></th>\n" +
3662 " <th class=\"options\"></th>\n" +
3663 " </tr>\n" +
3664 " <tr>\n" +
3665 " <th><input st-search=\"description\" placeholder=\"search for description\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3666 " <th></th>\n" +
3667 " <th></th>\n" +
3668 " <th></th>\n" +
3669 " </tr>\n" +
3670 " </thead>\n" +
3671 " <tbody>\n" +
3672 "\n" +
3673 " <tr ng-repeat=\"token in displayedCollection\">\n" +
3674 " <td><p>{{token.description}}</p>\n" +
3675 " <pre ng-init=\"token.limit = 8\" ng-mouseover=\"token.limit = 99\" ng-mouseleave=\"token.limit = 8\">{{token.token| limitTo:token.limit}}...</pre>\n" +
3676 " </td>\n" +
3677 " <td><span data-uib-tooltip=\"{{token.creation_date}}\">{{token.creation_date | isoToRelativeTime}}</span></td>\n" +
3678 " <td><span ng-if=\"token.expires\" data-uib-tooltip=\"{{token.expires}}\">{{token.expires | isoToRelativeTime}}</span>\n" +
3679 " <span ng-if=\"!token.expires\">Never</span></td>\n" +
3680 " <td>\n" +
3681 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
3682 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3683 " <ul class=\"dropdown-menu\">\n" +
3684 " <li><a>No</a></li>\n" +
3685 " <li><a ng-click=\"$ctrl.removeToken(token)\">Yes</a></li>\n" +
3686 " </ul>\n" +
3687 " </span>\n" +
3688 " </td>\n" +
3689 " </tr>\n" +
3690 " </tbody>\n" +
3691 " </table>\n" +
3692 " </div>\n" +
3693 "\n" +
3694 "</div>\n"
3695 );
3696
3697
3506 $templateCache.put('components/views/user-identities-view/user-identities-view.html',
3698 $templateCache.put('components/views/user-identities-view/user-identities-view.html',
3507 "<ng-include src=\"'templates/loader.html'\" ng-if=\"$ctrl.loading.identities\"></ng-include>\n" +
3699 "<ng-include src=\"'templates/loader.html'\" ng-if=\"$ctrl.loading.identities\"></ng-include>\n" +
3508 "\n" +
3700 "\n" +
@@ -3555,6 +3747,60 b' function kickstartAE(initialUserData) {'
3555 );
3747 );
3556
3748
3557
3749
3750 $templateCache.put('components/views/user-password-view/user-password-view.html',
3751 "<ng-include src=\"'templates/loader.html'\" ng-if=\"$ctrl.loading.password\"></ng-include>\n" +
3752 "\n" +
3753 "<div ng-show=\"!$ctrl.loading.password\">\n" +
3754 "\n" +
3755 " <div class=\"panel panel-default\">\n" +
3756 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
3757 " <div class=\"panel-body\">\n" +
3758 "\n" +
3759 " <form class=\"form-horizontal\" name=\"$ctrl.passwordForm\" ng-submit=\"$ctrl.updatePassword()\">\n" +
3760 " <div class=\"form-group\" id=\"row-old_password\">\n" +
3761 " <data-form-errors errors=\"$ctrl.passwordForm.ae_validation.old_password\"></data-form-errors>\n" +
3762 " <label for=\"old_password\" id=\"label-old_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3763 " Old Password\n" +
3764 " <span class=\"required\">*</span>\n" +
3765 " </label>\n" +
3766 " <div class=\"col-sm-8 col-lg-9\">\n" +
3767 " <input class=\"form-control\" id=\"old_password\" name=\"old_password\" type=\"password\" ng-model=\"$ctrl.form.old_password\">\n" +
3768 " </div>\n" +
3769 " </div>\n" +
3770 " <div class=\"form-group\" id=\"row-new_password\">\n" +
3771 " <data-form-errors errors=\"$ctrl.passwordForm.ae_validation.new_password\"></data-form-errors>\n" +
3772 " <label for=\"new_password\" id=\"label-new_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3773 " New Password\n" +
3774 " <span class=\"required\">*</span>\n" +
3775 " </label>\n" +
3776 " <div class=\"col-sm-8 col-lg-9\">\n" +
3777 " <input class=\"form-control\" id=\"new_password\" name=\"new_password\" type=\"password\" ng-model=\"$ctrl.form.new_password\">\n" +
3778 " </div>\n" +
3779 " </div>\n" +
3780 " <div class=\"form-group\" id=\"row-new_password_confirm\">\n" +
3781 " <data-form-errors errors=\"$ctrl.passwordForm.ae_validation.new_password_confirm\"></data-form-errors>\n" +
3782 " <label for=\"new_password_confirm\" id=\"label-new_password_confirm\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3783 " Confirm Password\n" +
3784 " <span class=\"required\">*</span>\n" +
3785 " </label>\n" +
3786 " <div class=\"col-sm-8 col-lg-9\">\n" +
3787 " <input class=\"form-control\" id=\"new_password_confirm\" name=\"new_password_confirm\" type=\"password\" ng-model=\"$ctrl.form.new_password_confirm\">\n" +
3788 " </div>\n" +
3789 " </div>\n" +
3790 " <div class=\"form-group\" id=\"row-submit\">\n" +
3791 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\"></label>\n" +
3792 " <div class=\"col-sm-8 col-lg-9\">\n" +
3793 " <input class=\"form-control SubmitField btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Change Password\">\n" +
3794 " </div>\n" +
3795 " </div>\n" +
3796 " </form>\n" +
3797 "\n" +
3798 " </div>\n" +
3799 " </div>\n" +
3800 "</div>\n"
3801 );
3802
3803
3558 $templateCache.put('components/views/user-profile-view/user-profile-view.html',
3804 $templateCache.put('components/views/user-profile-view/user-profile-view.html',
3559 "<ui-view></ui-view><ng-include src=\"'templates/loader.html'\" ng-if=\"$ctrl.loading.profile\"></ng-include>\n" +
3805 "<ui-view></ui-view><ng-include src=\"'templates/loader.html'\" ng-if=\"$ctrl.loading.profile\"></ng-include>\n" +
3560 "\n" +
3806 "\n" +
@@ -6854,274 +7100,22 b' function kickstartAE(initialUserData) {'
6854 );
7100 );
6855
7101
6856
7102
6857 $templateCache.put('templates/user/alert_channels_email.html',
7103 $templateCache.put('templates/user/breadcrumbs.html',
6858 "<ng-include src=\"'templates/loader.html'\" ng-if=\"email.loading.email\"></ng-include>\n" +
7104 "<ol class=\"breadcrumb\" ng-show=\"$ctrl.$state.includes('user.profile')\">\n" +
6859 "\n" +
7105 " <li>Settings</li>\n" +
6860 "<div ng-show=\"!email.loading.email\">\n" +
7106 " <li ng-show=\"$ctrl.$state.includes('user.profile.edit')\" ng-class=\"{bold:$ctrl.$state.is('user.profile.edit')}\">User Profile</li>\n" +
6861 "\n" +
7107 " <li ng-show=\"$ctrl.$state.includes('user.profile.password')\" ng-class=\"{bold:$ctrl.$state.is('user.profile.password')}\">Password</li>\n" +
6862 " <div class=\"panel panel-default\">\n" +
7108 " <li ng-show=\"$ctrl.$state.includes('user.profile.identities')\" ng-class=\"{bold:$ctrl.$state.is('user.profile.identities')}\">Identities</li>\n" +
6863 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
7109 " <li ng-show=\"$ctrl.$state.includes('user.profile.auth_tokens')\" ng-class=\"{bold:$ctrl.$state.is('user.profile.auth_tokens')}\">Auth Tokens</li>\n" +
6864 " <div class=\"panel-body\">\n" +
7110 "</ol>\n" +
6865 " <p>Adding email alert channel - after you authorize your email in the system we can send alerts directly to this mailbox.</p>\n" +
7111 "<ol class=\"breadcrumb\" ng-show=\"$ctrl.$state.includes('user.alert_channels')\">\n" +
6866 " <form class=\"form-horizontal\" name=\"email.channelForm\" ng-submit=\"email.createChannel()\">\n" +
7112 "<li>Notifications</li>\n" +
6867 " <div class=\"form-group\" id=\"row-email\">\n" +
7113 "<li ng-show=\"$ctrl.$state.includes('user.alert_channels.list')\" ng-class=\"{bold:$ctrl.$state.is('user.alert_channels.list')}\">Alert Channels</li>\n" +
6868 " <data-form-errors errors=\"email.channelForm.ae_validation.email\"></data-form-errors>\n" +
7114 "<li ng-show=\"$ctrl.$state.includes('user.alert_channels.email')\" ng-class=\"{bold:$ctrl.$state.is('user.alert_channels.email')}\">Create email channel</li>\n" +
6869 " <label id=\"label-email\" class=\"control-label col-sm-4 col-lg-3\">\n" +
7115 "</ol>\n"
6870 " Email Address\n" +
6871 " <span class=\"required\">*</span>\n" +
6872 " </label>\n" +
6873 " <div class=\"col-sm-8 col-lg-9\">\n" +
6874 " <input class=\"form-control\" type=\"text\" ng-model=\"email.form.email\">\n" +
6875 " </div>\n" +
6876 " </div>\n" +
6877 " <div class=\"form-group\">\n" +
6878 " <label for=\"submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6879 " </label>\n" +
6880 " <div class=\"col-sm-8 col-lg-9\">\n" +
6881 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Add email channel\">\n" +
6882 " </div>\n" +
6883 " </div>\n" +
6884 " </form>\n" +
6885 " </div>\n" +
6886 " </div>\n" +
6887 "</div>\n"
6888 );
7116 );
6889
7117
6890
7118 }]);
6891 $templateCache.put('templates/user/alert_channels_list.html',
6892 "<ng-include src=\"'templates/loader.html'\" ng-if=\"channels.loading.channels || channels.loading.applications\"></ng-include>\n" +
6893 "\n" +
6894 "<div ng-if=\"!channels.loading.channels && !channels.loading.applications && !channels.loading.actions\">\n" +
6895 "\n" +
6896 " <div class=\"panel panel-default\">\n" +
6897 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6898 " <div class=\"panel-body\">\n" +
6899 " <h1>Report alert rules</h1>\n" +
6900 " <p>\n" +
6901 " <a class=\"btn btn-info\" ng-click=\"channels.addAction()\"><span class=\"fa fa-plus-circle\"></span> Add top-level rule</a>\n" +
6902 " </p>\n" +
6903 "\n" +
6904 " <report-alert-action action=\"action\" rule-definitions=\"channels.ruleDefinitions\"\n" +
6905 " possible-channels=\"channels.alertChannels\"\n" +
6906 " actions=\"channels.alertActions\" applications=\"channels.applications\"\n" +
6907 " ng-repeat=\"action in channels.alertActions | filter: {type:'report'}\"></report-alert-action>\n" +
6908 "\n" +
6909 " </div>\n" +
6910 " </div>\n" +
6911 "\n" +
6912 " <div class=\"panel panel-default\">\n" +
6913 " <div class=\"panel-body\">\n" +
6914 " <h1>Alert channels</h1>\n" +
6915 "\n" +
6916 " <p>Here you can configure your <em>alert channels</em>.</p>\n" +
6917 "\n" +
6918 " <p>An alert channel serves as means of delivery of notifications about important events that happen in your applications.</p>\n" +
6919 "\n" +
6920 " <div class=\"alert alert-success\">You can add more integrations that support different alert channels via application management panel.</div>\n" +
6921 "\n" +
6922 " <table class=\"table table-striped\">\n" +
6923 " <tr ng-repeat=\"channel in channels.alertChannels\" class=\"animate-repeat\">\n" +
6924 " <td><strong>{{ channel.channel_visible_value }}</strong></td>\n" +
6925 " <td class=\"text-right\">\n" +
6926 " <span class=\"btn btn-default\" data-uib-tooltip=\"Channel is {{ channel.channel_validated? '' :'NOT' }} validated\" tooltip-append-to-body=\"true\"\n" +
6927 " ng-class=\"{dim:!channel.channel_validated}\">\n" +
6928 " <span class=\"fa\" ng-class=\"{'fa-check-circle':channel.channel_validated, 'fa-times-circle':!channel.channel_validated}\"></span>\n" +
6929 " </span>\n" +
6930 " <a class=\"btn btn-default\" data-uib-tooltip=\"Press to turn {{ channel.send_alerts ? 'OFF' : 'ON' }} alerting on this chanel\"\n" +
6931 " ng-click=\"channels.updateChannel(channel,'send_alerts')\" ng-class=\"{dim:!channel.send_alerts}\" tooltip-append-to-body=\"true\">\n" +
6932 " <span class=\"fa fa-rss\"></span> Alerts\n" +
6933 " </a>\n" +
6934 " <a class=\"btn btn-default\" data-uib-tooltip=\"Press to turn {{ channel.daily_digest ? 'OFF' : 'ON' }} daily digests on this channel\"\n" +
6935 " ng-click=\"channels.updateChannel(channel,'daily_digest')\" ng-class=\"{dim:!channel.daily_digest}\" tooltip-append-to-body=\"true\">\n" +
6936 " <span class=\"fa fa-envelope\"></span> Daily digests\n" +
6937 " </a>\n" +
6938 "\n" +
6939 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
6940 " <a class=\"btn btn-default\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove</a>\n" +
6941 " <ul class=\"dropdown-menu\">\n" +
6942 " <li><a>No</a></li>\n" +
6943 " <li><a ng-click=\"channels.removeChannel(channel)\">Yes</a></li>\n" +
6944 " </ul>\n" +
6945 " </span>\n" +
6946 "\n" +
6947 " </td>\n" +
6948 " </tr>\n" +
6949 " </table>\n" +
6950 "\n" +
6951 " </div>\n" +
6952 " </div>\n" +
6953 "\n" +
6954 "</div>\n"
6955 );
6956
6957
6958 $templateCache.put('templates/user/alert_channels.html',
6959 "<ui-view></ui-view>"
6960 );
6961
6962
6963 $templateCache.put('templates/user/auth_tokens.html',
6964 "<ng-include src=\"'templates/loader.html'\" ng-if=\"auth_tokens.loading.tokens\"></ng-include>\n" +
6965 "\n" +
6966 "<div ng-show=\"!auth_tokens.loading.tokens\">\n" +
6967 "\n" +
6968 " <div class=\"panel panel-default\">\n" +
6969 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6970 "\n" +
6971 " <div class=\"panel-body\">\n" +
6972 "\n" +
6973 " <div class=\"alert alert-success\">You can use those tokens to authenticate yourself when performing various API calls</div>\n" +
6974 "\n" +
6975 " <hr/>\n" +
6976 "\n" +
6977 " <form method=\"post\" class=\"form-inline\" name=\"auth_tokens.TokenForm\" ng-submit=\"auth_tokens.addToken()\" novalidate>\n" +
6978 " <data-form-errors errors=\"auth_tokens.TokenForm.ae_validation.description\"></data-form-errors>\n" +
6979 " <data-form-errors errors=\"auth_tokens.TokenForm.ae_validation.expires\"></data-form-errors>\n" +
6980 " <div class=\"form-group\">\n" +
6981 " <label>\n" +
6982 " Description\n" +
6983 " </label>\n" +
6984 " <input class=\"form-control\" name=\"description\" placeholder=\"Token description\" type=\"text\" ng-model=\"auth_tokens.form.description\">\n" +
6985 " </div>\n" +
6986 " <div class=\"form-group\">\n" +
6987 " <label>\n" +
6988 " Expires\n" +
6989 " </label>\n" +
6990 " <select class=\"form-control\" ng-model=\"auth_tokens.form.expires\" ng-options=\"i.key as i.label for i in auth_tokens.expireOptions | objectToOrderedArray:'minutes'\">\n" +
6991 " <option value=\"\">Never</option>\n" +
6992 " </select>\n" +
6993 " </div>\n" +
6994 " <div class=\"form-group\">\n" +
6995 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
6996 " </label>\n" +
6997 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Create Token\">\n" +
6998 " </div>\n" +
6999 " </form>\n" +
7000 "\n" +
7001 " </div>\n" +
7002 "\n" +
7003 "\n" +
7004 " </div>\n" +
7005 "\n" +
7006 " <div class=\"panel panel-default\">\n" +
7007 " <table st-table=\"displayedCollection\" st-safe-src=\"auth_tokens.tokens\" class=\"table table-striped\">\n" +
7008 " <caption>Your current tokens</caption>\n" +
7009 " <thead>\n" +
7010 " <tr>\n" +
7011 " <th st-sort=\"description\"><a>Description</a></th>\n" +
7012 " <th class=\"created\"><a>Created</a></th>\n" +
7013 " <th class=\"expires\"><a>Expires</a></th>\n" +
7014 " <th class=\"options\"></th>\n" +
7015 " </tr>\n" +
7016 " <tr>\n" +
7017 " <th><input st-search=\"description\" placeholder=\"search for description\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
7018 " <th></th>\n" +
7019 " <th></th>\n" +
7020 " <th></th>\n" +
7021 " </tr>\n" +
7022 " </thead>\n" +
7023 " <tbody>\n" +
7024 "\n" +
7025 " <tr ng-repeat=\"token in displayedCollection\">\n" +
7026 " <td><p>{{token.description}}</p>\n" +
7027 " <pre ng-init=\"token.limit = 8\" ng-mouseover=\"token.limit = 99\" ng-mouseleave=\"token.limit = 8\">{{token.token| limitTo:token.limit}}...</pre>\n" +
7028 " </td>\n" +
7029 " <td><span data-uib-tooltip=\"{{token.creation_date}}\">{{token.creation_date | isoToRelativeTime}}</span></td>\n" +
7030 " <td><span ng-if=\"token.expires\" data-uib-tooltip=\"{{token.expires}}\">{{token.expires | isoToRelativeTime}}</span>\n" +
7031 " <span ng-if=\"!token.expires\">Never</span></td>\n" +
7032 " <td>\n" +
7033 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
7034 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
7035 " <ul class=\"dropdown-menu\">\n" +
7036 " <li><a>No</a></li>\n" +
7037 " <li><a ng-click=\"auth_tokens.removeToken(token)\">Yes</a></li>\n" +
7038 " </ul>\n" +
7039 " </span>\n" +
7040 " </td>\n" +
7041 " </tr>\n" +
7042 " </tbody>\n" +
7043 " </table>\n" +
7044 " </div>\n" +
7045 "\n" +
7046 "</div>\n"
7047 );
7048
7049
7050 $templateCache.put('templates/user/breadcrumbs.html',
7051 "<ol class=\"breadcrumb\" ng-show=\"$state.includes('user.profile')\">\n" +
7052 " <li>Settings</li>\n" +
7053 " <li ng-show=\"$state.includes('user.profile.edit')\" ng-class=\"{bold:$state.is('user.profile.edit')}\">User Profile</li>\n" +
7054 " <li ng-show=\"$state.includes('user.profile.password')\" ng-class=\"{bold:$state.is('user.profile.password')}\">Password</li>\n" +
7055 " <li ng-show=\"$state.includes('user.profile.identities')\" ng-class=\"{bold:$state.is('user.profile.identities')}\">Identities</li>\n" +
7056 "</ol>\n" +
7057 "\n" +
7058 "<ol class=\"breadcrumb\" ng-show=\"$state.includes('user.alert_channels')\">\n" +
7059 "<li>Notifications</li>\n" +
7060 "<li ng-show=\"$state.includes('user.alert_channels.list')\" ng-class=\"{bold:$state.is('user.alert_channels.list')}\">Alert Channels</li>\n" +
7061 "<li ng-show=\"$state.includes('user.alert_channels.email')\" ng-class=\"{bold:$state.is('user.alert_channels.email')}\">Create email channel</li>\n" +
7062 "</ol>\n"
7063 );
7064
7065
7066 $templateCache.put('templates/user/index.html',
7067 ""
7068 );
7069
7070
7071 $templateCache.put('templates/user/profile_password.html',
7072 "<ng-include src=\"'templates/loader.html'\" ng-if=\"password.loading.password\"></ng-include>\n" +
7073 "\n" +
7074 "<div ng-show=\"!password.loading.password\">\n" +
7075 "\n" +
7076 " <div class=\"panel panel-default\">\n" +
7077 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
7078 " <div class=\"panel-body\">\n" +
7079 "\n" +
7080 " <form class=\"form-horizontal\" name=\"password.passwordForm\" ng-submit=\"password.updatePassword()\">\n" +
7081 " <div class=\"form-group\" id=\"row-old_password\">\n" +
7082 " <data-form-errors errors=\"password.passwordForm.ae_validation.old_password\"></data-form-errors>\n" +
7083 " <label for=\"old_password\" id=\"label-old_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
7084 " Old Password\n" +
7085 " <span class=\"required\">*</span>\n" +
7086 " </label>\n" +
7087 " <div class=\"col-sm-8 col-lg-9\">\n" +
7088 " <input class=\"form-control\" id=\"old_password\" name=\"old_password\" type=\"password\" ng-model=\"password.form.old_password\">\n" +
7089 " </div>\n" +
7090 " </div>\n" +
7091 " <div class=\"form-group\" id=\"row-new_password\">\n" +
7092 " <data-form-errors errors=\"password.passwordForm.ae_validation.new_password\"></data-form-errors>\n" +
7093 " <label for=\"new_password\" id=\"label-new_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
7094 " New Password\n" +
7095 " <span class=\"required\">*</span>\n" +
7096 " </label>\n" +
7097 " <div class=\"col-sm-8 col-lg-9\">\n" +
7098 " <input class=\"form-control\" id=\"new_password\" name=\"new_password\" type=\"password\" ng-model=\"password.form.new_password\">\n" +
7099 " </div>\n" +
7100 " </div>\n" +
7101 " <div class=\"form-group\" id=\"row-new_password_confirm\">\n" +
7102 " <data-form-errors errors=\"password.passwordForm.ae_validation.new_password_confirm\"></data-form-errors>\n" +
7103 " <label for=\"new_password_confirm\" id=\"label-new_password_confirm\" class=\"control-label col-sm-4 col-lg-3\">\n" +
7104 " Confirm Password\n" +
7105 " <span class=\"required\">*</span>\n" +
7106 " </label>\n" +
7107 " <div class=\"col-sm-8 col-lg-9\">\n" +
7108 " <input class=\"form-control\" id=\"new_password_confirm\" name=\"new_password_confirm\" type=\"password\" ng-model=\"password.form.new_password_confirm\">\n" +
7109 " </div>\n" +
7110 " </div>\n" +
7111 " <div class=\"form-group\" id=\"row-submit\">\n" +
7112 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\"></label>\n" +
7113 " <div class=\"col-sm-8 col-lg-9\">\n" +
7114 " <input class=\"form-control SubmitField btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Change Password\">\n" +
7115 " </div>\n" +
7116 " </div>\n" +
7117 " </form>\n" +
7118 "\n" +
7119 " </div>\n" +
7120 " </div>\n" +
7121 "</div>\n"
7122 );
7123
7124 }]);
7125
7119
7126 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7120 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7127 // #
7121 // #
@@ -7151,7 +7145,7 b" angular.module('appenlight.components.appenlightApp', [])"
7151 AppEnlightAppController.$inject = ['$scope','$state', 'stateHolder', 'AeConfig'];
7145 AppEnlightAppController.$inject = ['$scope','$state', 'stateHolder', 'AeConfig'];
7152
7146
7153 function AppEnlightAppController($scope, $state, stateHolder, AeConfig){
7147 function AppEnlightAppController($scope, $state, stateHolder, AeConfig){
7154
7148 console.log('app start');
7155 // to keep bw compatibility
7149 // to keep bw compatibility
7156 $scope.$state = $state;
7150 $scope.$state = $state;
7157 $scope.stateHolder = stateHolder;
7151 $scope.stateHolder = stateHolder;
@@ -7247,7 +7241,7 b' function AppEnlightHeaderController($state, stateHolder, AeConfig){'
7247 $state.go('uptime', {resource:event.resource_id, start_date:event.start_date});
7241 $state.go('uptime', {resource:event.resource_id, start_date:event.start_date});
7248 }
7242 }
7249 else{
7243 else{
7250
7244 console.log('other');
7251 }
7245 }
7252 }
7246 }
7253 }
7247 }
@@ -7288,13 +7282,13 b' function ChannelstreamController($rootScope, stateHolder, userSelfPropertyResour'
7288 userSelfPropertyResource.get({key: 'websocket'}, function (data) {
7282 userSelfPropertyResource.get({key: 'websocket'}, function (data) {
7289 stateHolder.websocket = new ReconnectingWebSocket(this.config.ws_url + '/ws?conn_id=' + data.conn_id);
7283 stateHolder.websocket = new ReconnectingWebSocket(this.config.ws_url + '/ws?conn_id=' + data.conn_id);
7290 stateHolder.websocket.onopen = function (event) {
7284 stateHolder.websocket.onopen = function (event) {
7291
7285 console.log('open');
7292 };
7286 };
7293 stateHolder.websocket.onmessage = function (event) {
7287 stateHolder.websocket.onmessage = function (event) {
7294 var data = JSON.parse(event.data);
7288 var data = JSON.parse(event.data);
7295 $rootScope.$apply(function (scope) {
7289 $rootScope.$apply(function (scope) {
7296 _.each(data, function (message) {
7290 _.each(data, function (message) {
7297
7291 console.log('channelstream-message', message);
7298 if(typeof message.message.topic !== 'undefined'){
7292 if(typeof message.message.topic !== 'undefined'){
7299 $rootScope.$emit(
7293 $rootScope.$emit(
7300 'channelstream-message.'+message.message.topic, message);
7294 'channelstream-message.'+message.message.topic, message);
@@ -7306,11 +7300,11 b' function ChannelstreamController($rootScope, stateHolder, userSelfPropertyResour'
7306 });
7300 });
7307 };
7301 };
7308 stateHolder.websocket.onclose = function (event) {
7302 stateHolder.websocket.onclose = function (event) {
7309
7303 console.log('closed');
7310 };
7304 };
7311
7305
7312 stateHolder.websocket.onerror = function (event) {
7306 stateHolder.websocket.onerror = function (event) {
7313
7307 console.log('error');
7314 };
7308 };
7315 }.bind(this));
7309 }.bind(this));
7316 }
7310 }
@@ -7356,7 +7350,7 b' function EventBrowserController(eventsNoIdResource, eventsResource) {'
7356
7350
7357
7351
7358 vm.closeEvent = function (event) {
7352 vm.closeEvent = function (event) {
7359
7353 console.log('closeEvent');
7360 eventsResource.update({eventId: event.id}, {status: 0}, function (data) {
7354 eventsResource.update({eventId: event.id}, {status: 0}, function (data) {
7361 event.status = 0;
7355 event.status = 0;
7362 });
7356 });
@@ -7778,7 +7772,7 b' function IndexDashboardController($rootScope, $scope, $location, $cookies, $inte'
7778
7772
7779 if (!vm.resource){
7773 if (!vm.resource){
7780 var cookieResource = $cookies.getObject('resource');
7774 var cookieResource = $cookies.getObject('resource');
7781
7775 console.log('cookieResource', cookieResource);
7782
7776
7783 if (cookieResource) {
7777 if (cookieResource) {
7784 vm.resource = cookieResource;
7778 vm.resource = cookieResource;
@@ -8028,7 +8022,6 b' function IndexDashboardController($rootScope, $scope, $location, $cookies, $inte'
8028 if (stateHolder.AeUser.applications.length){
8022 if (stateHolder.AeUser.applications.length){
8029 vm.show_dashboard = true;
8023 vm.show_dashboard = true;
8030 vm.determineStartState();
8024 vm.determineStartState();
8031 vm.refreshData();
8032 }
8025 }
8033 }
8026 }
8034
8027
@@ -8296,7 +8289,7 b' function LogsBrowserController($location, stateHolder, typeAheadTagHelper, logsN'
8296 searchParams['view'] = 'fetch_series';
8289 searchParams['view'] = 'fetch_series';
8297 vm.isLoading.series = true;
8290 vm.isLoading.series = true;
8298 sectionViewResource.query(searchParams, function (data) {
8291 sectionViewResource.query(searchParams, function (data) {
8299
8292 console.log('show node here');
8300 vm.logEventsChartData = {
8293 vm.logEventsChartData = {
8301 json: data,
8294 json: data,
8302 xFormat: '%Y-%m-%dT%H:%M:%S',
8295 xFormat: '%Y-%m-%dT%H:%M:%S',
@@ -8356,9 +8349,10 b" angular.module('appenlight.components.settingsView', [])"
8356 controller: SettingsViewController
8349 controller: SettingsViewController
8357 });
8350 });
8358
8351
8359 SettingsViewController.$inject = [];
8352 SettingsViewController.$inject = ['$state'];
8360
8353
8361 function SettingsViewController() {
8354 function SettingsViewController($state) {
8355 this.$state = $state;
8362 console.info('SettingsViewController');
8356 console.info('SettingsViewController');
8363 }
8357 }
8364
8358
@@ -8381,43 +8375,35 b' function SettingsViewController() {'
8381 // # services, and proprietary license terms, please see
8375 // # services, and proprietary license terms, please see
8382 // # https://rhodecode.com/licenses/
8376 // # https://rhodecode.com/licenses/
8383
8377
8384 angular.module('appenlight.components.userIdentitiesView', [])
8378 angular.module('appenlight.components.userAlertChannelsEmailNewView', [])
8385 .component('userIdentitiesView', {
8379 .component('userAlertChannelsEmailNewView', {
8386 templateUrl: 'components/views/user-identities-view/user-identities-view.html',
8380 templateUrl: 'components/views/user-alert-channel-email-new-view/user-alert-channel-email-new-view.html',
8387 controller: UserIdentitiesController
8381 controller: AlertChannelsEmailController
8388 });
8382 });
8389
8383
8390 UserIdentitiesController.$inject = ['userSelfPropertyResource', 'AeConfig'];
8384 AlertChannelsEmailController.$inject = ['$state','userSelfPropertyResource'];
8391
8385
8392 function UserIdentitiesController(userSelfPropertyResource, AeConfig) {
8386 function AlertChannelsEmailController($state, userSelfPropertyResource) {
8393
8387 console.debug('AlertChannelsEmailController');
8394 var vm = this;
8388 var vm = this;
8395 vm.AeConfig = AeConfig;
8389 vm.$state = $state;
8396 vm.loading = {identities: true};
8390 vm.loading = {email: false};
8391 vm.form = {};
8397
8392
8398 vm.identities = userSelfPropertyResource.query(
8393 vm.createChannel = function () {
8399 {key: 'external_identities'},
8394 vm.loading.email = true;
8400 function (data) {
8395 console.log('createChannel');
8401 vm.loading.identities = false;
8396 userSelfPropertyResource.save({key: 'alert_channels'}, vm.form, function () {
8402
8397 //vm.loading.email = false;
8398 //setServerValidation(vm.channelForm);
8399 //vm.form = {};
8400 $state.go('user.alert_channels.list');
8401 }, function (response) {
8402 if (response.status == 422) {
8403 setServerValidation(vm.channelForm, response.data);
8404 }
8405 vm.loading.email = false;
8403 });
8406 });
8404
8405 vm.removeProvider = function (provider) {
8406
8407 userSelfPropertyResource.delete(
8408 {
8409 key: 'external_identities',
8410 provider: provider.provider,
8411 id: provider.id
8412 },
8413 function (status) {
8414 if (status){
8415 vm.identities = _.filter(vm.identities, function (item) {
8416 return item != provider
8417 });
8418 }
8419
8420 });
8421 }
8407 }
8422 }
8408 }
8423
8409
@@ -8440,39 +8426,122 b' function UserIdentitiesController(userSelfPropertyResource, AeConfig) {'
8440 // # services, and proprietary license terms, please see
8426 // # services, and proprietary license terms, please see
8441 // # https://rhodecode.com/licenses/
8427 // # https://rhodecode.com/licenses/
8442
8428
8443 angular.module('appenlight.components.userProfileView', [])
8429 angular.module('appenlight.components.userAlertChannelsListView', [])
8444 .component('userProfileView', {
8430 .component('userAlertChannelsListView', {
8445 templateUrl: 'components/views/user-profile-view/user-profile-view.html',
8431 templateUrl: 'components/views/user-alert-channels-list-view/user-alert-channels-list-view.html',
8446 controller: UserProfileViewController
8432 controller: userAlertChannelsListViewController
8447 });
8433 });
8448
8434
8449 UserProfileViewController.$inject = ['userSelfResource'];
8435 userAlertChannelsListViewController.$inject = ['$state','userSelfPropertyResource', 'applicationsNoIdResource'];
8450
8436
8451 function UserProfileViewController(userSelfResource) {
8437 function userAlertChannelsListViewController($state, userSelfPropertyResource, applicationsNoIdResource) {
8452
8438 console.debug('AlertChannelsController');
8453 var vm = this;
8439 var vm = this;
8454 vm.loading = {profile: true};
8440 vm.$state = $state;
8455
8441 vm.loading = {channels: true, applications: true, actions:true};
8456 vm.user = userSelfResource.get(null, function (data) {
8457 vm.loading.profile = false;
8458
8459 });
8460
8461 vm.updateProfile = function () {
8462 vm.loading.profile = true;
8463
8442
8464
8443 vm.alertChannels = userSelfPropertyResource.query({key: 'alert_channels'},
8465 vm.user.$update(null, function () {
8444 function (data) {
8466 vm.loading.profile = false;
8445 vm.loading.channels = false;
8467 setServerValidation(vm.profileForm);
8468 }, function (response) {
8469 if (response.status == 422) {
8470 setServerValidation(vm.profileForm, response.data);
8471 }
8472 vm.loading.profile = false;
8473 });
8446 });
8474 }
8447
8475 }
8448 vm.alertActions = userSelfPropertyResource.query({key: 'alert_actions'},
8449 function (data) {
8450 vm.loading.actions = false;
8451 });
8452
8453 vm.applications = applicationsNoIdResource.query({permission: 'view'},
8454 function (data) {
8455 vm.loading.applications = false;
8456 });
8457
8458 var allOps = {
8459 'eq': 'Equal',
8460 'ne': 'Not equal',
8461 'ge': 'Greater or equal',
8462 'gt': 'Greater than',
8463 'le': 'Lesser or equal',
8464 'lt': 'Lesser than',
8465 'startswith': 'Starts with',
8466 'endswith': 'Ends with',
8467 'contains': 'Contains'
8468 };
8469
8470 var fieldOps = {};
8471 fieldOps['http_status'] = ['eq', 'ne', 'ge', 'le'];
8472 fieldOps['group:priority'] = ['eq', 'ne', 'ge', 'le'];
8473 fieldOps['duration'] = ['ge', 'le'];
8474 fieldOps['url_domain'] = ['eq', 'ne', 'startswith', 'endswith',
8475 'contains'];
8476 fieldOps['url_path'] = ['eq', 'ne', 'startswith', 'endswith',
8477 'contains'];
8478 fieldOps['error'] = ['eq', 'ne', 'startswith', 'endswith',
8479 'contains'];
8480 fieldOps['tags:server_name'] = ['eq', 'ne', 'startswith', 'endswith',
8481 'contains'];
8482 fieldOps['group:occurences'] = ['eq', 'ne', 'ge', 'le'];
8483
8484 var possibleFields = {
8485 '__AND__': 'All met (composite rule)',
8486 '__OR__': 'One met (composite rule)',
8487 '__NOT__': 'Not met (composite rule)',
8488 'http_status': 'HTTP Status',
8489 'duration': 'Request duration',
8490 'group:priority': 'Group -> Priority',
8491 'url_domain': 'Domain',
8492 'url_path': 'URL Path',
8493 'error': 'Error',
8494 'tags:server_name': 'Tag -> Server name',
8495 'group:occurences': 'Group -> Occurences'
8496 };
8497
8498 vm.ruleDefinitions = {
8499 fieldOps: fieldOps,
8500 allOps: allOps,
8501 possibleFields: possibleFields
8502 };
8503
8504 vm.addAction = function (channel) {
8505 console.log('test');
8506 userSelfPropertyResource.save({key: 'alert_channels_rules'}, {}, function (data) {
8507 vm.alertActions.push(data);
8508 }, function (response) {
8509 if (response.status == 422) {
8510 console.log('scope', response);
8511 }
8512 });
8513 };
8514
8515 vm.updateChannel = function (channel, subKey) {
8516 var params = {
8517 key: 'alert_channels',
8518 channel_name: channel['channel_name'],
8519 channel_value: channel['channel_value']
8520 };
8521 var toUpdate = {};
8522 if (['daily_digest', 'send_alerts'].indexOf(subKey) !== -1) {
8523 toUpdate[subKey] = !channel[subKey];
8524 }
8525 userSelfPropertyResource.update(params, toUpdate, function (data) {
8526 _.extend(channel, data);
8527 });
8528 };
8529
8530 vm.removeChannel = function (channel) {
8531 console.log(channel);
8532 userSelfPropertyResource.delete({
8533 key: 'alert_channels',
8534 channel_name: channel.channel_name,
8535 channel_value: channel.channel_value
8536 }, function () {
8537 vm.alertChannels = _.filter(vm.alertChannels, function(item){
8538 return item != channel;
8539 });
8540 });
8541
8542 }
8543
8544 }
8476
8545
8477 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8546 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8478 // #
8547 // #
@@ -8493,22 +8562,57 b' function UserProfileViewController(userSelfResource) {'
8493 // # services, and proprietary license terms, please see
8562 // # services, and proprietary license terms, please see
8494 // # https://rhodecode.com/licenses/
8563 // # https://rhodecode.com/licenses/
8495
8564
8496 var aeconfig = angular.module('appenlight.config', []);
8565 angular.module('appenlight.components.userAuthTokensView', [])
8497 aeconfig.factory('AeConfig', function () {
8566 .component('userAuthTokensView', {
8498 var obj = {};
8567 templateUrl: 'components/views/user-auth-tokens-view/user-auth-tokens-view.html',
8499 obj.flashMessages = decodeEncodedJSON(window.AE.flash_messages);
8568 controller: userAuthTokensViewController
8500 obj.timeOptions = decodeEncodedJSON(window.AE.timeOptions);
8569 });
8501 obj.plugins = decodeEncodedJSON(window.AE.plugins);
8570
8502 obj.topNav = decodeEncodedJSON(window.AE.topNav);
8571 userAuthTokensViewController.$inject = ['$state', 'userSelfPropertyResource', 'AeConfig'];
8503 obj.ws_url = window.AE.ws_url;
8572
8504 obj.urls = window.AE.urls;
8573 function userAuthTokensViewController($state, userSelfPropertyResource, AeConfig) {
8505 // set keys on values because we wont be able to retrieve them everywhere
8574 console.debug('userAuthTokensViewController');
8506 for (var key in obj.timeOptions) {
8575 var vm = this;
8507 obj.timeOptions[key]['key'] = key;
8576 vm.$state = $state;
8577 vm.loading = {tokens: true};
8578
8579 vm.expireOptions = AeConfig.timeOptions;
8580
8581 vm.tokens = userSelfPropertyResource.query({key: 'auth_tokens'},
8582 function (data) {
8583 vm.loading.tokens = false;
8584 });
8585
8586 vm.addToken = function () {
8587 vm.loading.tokens = true;
8588 userSelfPropertyResource.save({key: 'auth_tokens'},
8589 vm.form,
8590 function (data) {
8591 vm.loading.tokens = false;
8592 setServerValidation(vm.TokenForm);
8593 vm.form = {};
8594 vm.tokens.push(data);
8595 }, function (response) {
8596 vm.loading.tokens = false;
8597 if (response.status == 422) {
8598 setServerValidation(vm.TokenForm, response.data);
8599 }
8600 })
8601 };
8602
8603 vm.removeToken = function (token) {
8604 userSelfPropertyResource.delete({
8605 key: 'auth_tokens',
8606 token: token.token
8607 },
8608 function () {
8609 var index = vm.tokens.indexOf(token);
8610 if (index !== -1) {
8611 vm.tokens.splice(index, 1);
8612 }
8613 })
8508 }
8614 }
8509 console.info('config', obj);
8615 }
8510 return obj;
8511 });
8512
8616
8513 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8617 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8514 // #
8618 // #
@@ -8529,22 +8633,46 b" aeconfig.factory('AeConfig', function () {"
8529 // # services, and proprietary license terms, please see
8633 // # services, and proprietary license terms, please see
8530 // # https://rhodecode.com/licenses/
8634 // # https://rhodecode.com/licenses/
8531
8635
8532 angular.module('appenlight.controllers').controller('AdminApplicationsListController', AdminApplicationsListController);
8636 angular.module('appenlight.components.userIdentitiesView', [])
8637 .component('userIdentitiesView', {
8638 templateUrl: 'components/views/user-identities-view/user-identities-view.html',
8639 controller: UserIdentitiesController
8640 });
8533
8641
8534 AdminApplicationsListController.$inject = ['applicationsResource'];
8642 UserIdentitiesController.$inject = ['$state', 'userSelfPropertyResource', 'AeConfig'];
8535
8643
8536 function AdminApplicationsListController(applicationsResource) {
8644 function UserIdentitiesController($state, userSelfPropertyResource, AeConfig) {
8537
8645 console.debug('UserIdentitiesController');
8538 var vm = this;
8646 var vm = this;
8539 vm.loading = {applications: true};
8647 vm.$state = $state;
8648 vm.AeConfig = AeConfig;
8649 vm.loading = {identities: true};
8540
8650
8541 vm.applications = applicationsResource.query({
8651 vm.identities = userSelfPropertyResource.query(
8542 root_list: true,
8652 {key: 'external_identities'},
8543 resource_type: 'application'
8653 function (data) {
8544 }, function (data) {
8654 vm.loading.identities = false;
8545 vm.loading = {applications: false};
8655 console.log(vm.identities);
8546 });
8656 });
8547 };
8657
8658 vm.removeProvider = function (provider) {
8659 console.log('provider', provider);
8660 userSelfPropertyResource.delete(
8661 {
8662 key: 'external_identities',
8663 provider: provider.provider,
8664 id: provider.id
8665 },
8666 function (status) {
8667 if (status){
8668 vm.identities = _.filter(vm.identities, function (item) {
8669 return item != provider
8670 });
8671 }
8672
8673 });
8674 }
8675 }
8548
8676
8549 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8677 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8550 // #
8678 // #
@@ -8565,44 +8693,38 b' function AdminApplicationsListController(applicationsResource) {'
8565 // # services, and proprietary license terms, please see
8693 // # services, and proprietary license terms, please see
8566 // # https://rhodecode.com/licenses/
8694 // # https://rhodecode.com/licenses/
8567
8695
8568 angular.module('appenlight.controllers').controller('ConfigsListController', ConfigsListController);
8696 angular.module('appenlight.components.userPasswordView', [])
8697 .component('userPasswordView', {
8698 templateUrl: 'components/views/user-password-view/user-password-view.html',
8699 controller: UserPasswordViewController
8700 });
8569
8701
8570 ConfigsListController.$inject = ['configsResource', 'configsNoIdResource'];
8702 UserPasswordViewController.$inject = ['$state', 'userSelfPropertyResource'];
8571
8703
8572 function ConfigsListController(configsResource, configsNoIdResource) {
8704 function UserPasswordViewController($state, userSelfPropertyResource) {
8705 console.debug('UserPasswordViewController');
8573 var vm = this;
8706 var vm = this;
8574 vm.loading = {config: true};
8707 vm.$state = $state;
8575
8708 vm.loading = {password: false};
8576 var filters = [
8709 vm.form = {};
8577 'template_footer_html:global',
8578 'list_groups_to_non_admins:global',
8579 'per_application_reports_rate_limit:global',
8580 'per_application_logs_rate_limit:global',
8581 'per_application_metrics_rate_limit:global',
8582 ];
8583
8584 vm.configs = {};
8585
8586 vm.configList = configsResource.query({filter: filters},
8587 function (data) {
8588 vm.loading = {config: false};
8589 _.each(data, function (item) {
8590 if (vm.configs[item.section] === undefined) {
8591 vm.configs[item.section] = {};
8592 }
8593 vm.configs[item.section][item.key] = item;
8594 });
8595 });
8596
8710
8597 vm.save = function () {
8711 vm.updatePassword = function () {
8598 vm.loading.config = true;
8712 vm.loading.password = true;
8599 _.each(vm.configList, function (item) {
8713 console.log('updatePassword');
8600 item.$save();
8714 userSelfPropertyResource.update({key: 'password'}, vm.form, function () {
8715 vm.loading.password = false;
8716 vm.form = {};
8717 setServerValidation(vm.passwordForm);
8718 }, function (response) {
8719 if (response.status == 422) {
8720 console.log('vm', vm);
8721 setServerValidation(vm.passwordForm, response.data);
8722 console.log(response.data);
8723 }
8724 vm.loading.password = false;
8601 });
8725 });
8602 vm.loading.config = false;
8726 }
8603 };
8727 }
8604
8605 };
8606
8728
8607 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8729 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8608 // #
8730 // #
@@ -8623,16 +8745,200 b' function ConfigsListController(configsResource, configsNoIdResource) {'
8623 // # services, and proprietary license terms, please see
8745 // # services, and proprietary license terms, please see
8624 // # https://rhodecode.com/licenses/
8746 // # https://rhodecode.com/licenses/
8625
8747
8626 angular.module('appenlight.controllers').controller('AdminGroupsCreateController', AdminGroupsCreateController);
8748 angular.module('appenlight.components.userProfileView', [])
8749 .component('userProfileView', {
8750 templateUrl: 'components/views/user-profile-view/user-profile-view.html',
8751 controller: UserProfileViewController
8752 });
8627
8753
8628 AdminGroupsCreateController.$inject = ['$state', 'groupsResource', 'groupsPropertyResource', 'sectionViewResource', 'AeConfig'];
8754 UserProfileViewController.$inject = ['$state', 'userSelfResource'];
8629
8755
8630 function AdminGroupsCreateController($state, groupsResource, groupsPropertyResource, sectionViewResource, AeConfig) {
8756 function UserProfileViewController($state, userSelfResource) {
8631
8757 console.debug('UserProfileViewController');
8632 var vm = this;
8758 var vm = this;
8633 vm.loading = {
8759 vm.$state = $state;
8634 group: false,
8760 vm.loading = {profile: true};
8635 resource_permissions: false,
8761
8762 vm.user = userSelfResource.get(null, function (data) {
8763 vm.loading.profile = false;
8764 console.log('loaded profile');
8765 });
8766
8767 vm.updateProfile = function () {
8768 vm.loading.profile = true;
8769
8770 console.log('updateProfile');
8771 vm.user.$update(null, function () {
8772 vm.loading.profile = false;
8773 setServerValidation(vm.profileForm);
8774 }, function (response) {
8775 if (response.status == 422) {
8776 setServerValidation(vm.profileForm, response.data);
8777 }
8778 vm.loading.profile = false;
8779 });
8780 }
8781 }
8782
8783 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8784 // #
8785 // # This program is free software: you can redistribute it and/or modify
8786 // # it under the terms of the GNU Affero General Public License, version 3
8787 // # (only), as published by the Free Software Foundation.
8788 // #
8789 // # This program is distributed in the hope that it will be useful,
8790 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8791 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8792 // # GNU General Public License for more details.
8793 // #
8794 // # You should have received a copy of the GNU Affero General Public License
8795 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8796 // #
8797 // # This program is dual-licensed. If you wish to learn more about the
8798 // # AppEnlight Enterprise Edition, including its added features, Support
8799 // # services, and proprietary license terms, please see
8800 // # https://rhodecode.com/licenses/
8801
8802 var aeconfig = angular.module('appenlight.config', []);
8803 aeconfig.factory('AeConfig', function () {
8804 var obj = {};
8805 obj.flashMessages = decodeEncodedJSON(window.AE.flash_messages);
8806 obj.timeOptions = decodeEncodedJSON(window.AE.timeOptions);
8807 obj.plugins = decodeEncodedJSON(window.AE.plugins);
8808 obj.topNav = decodeEncodedJSON(window.AE.topNav);
8809 obj.ws_url = window.AE.ws_url;
8810 obj.urls = window.AE.urls;
8811 // set keys on values because we wont be able to retrieve them everywhere
8812 for (var key in obj.timeOptions) {
8813 obj.timeOptions[key]['key'] = key;
8814 }
8815 console.info('config', obj);
8816 return obj;
8817 });
8818
8819 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8820 // #
8821 // # This program is free software: you can redistribute it and/or modify
8822 // # it under the terms of the GNU Affero General Public License, version 3
8823 // # (only), as published by the Free Software Foundation.
8824 // #
8825 // # This program is distributed in the hope that it will be useful,
8826 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8827 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8828 // # GNU General Public License for more details.
8829 // #
8830 // # You should have received a copy of the GNU Affero General Public License
8831 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8832 // #
8833 // # This program is dual-licensed. If you wish to learn more about the
8834 // # AppEnlight Enterprise Edition, including its added features, Support
8835 // # services, and proprietary license terms, please see
8836 // # https://rhodecode.com/licenses/
8837
8838 angular.module('appenlight.controllers').controller('AdminApplicationsListController', AdminApplicationsListController);
8839
8840 AdminApplicationsListController.$inject = ['applicationsResource'];
8841
8842 function AdminApplicationsListController(applicationsResource) {
8843 console.debug('AdminApplicationsListController');
8844 var vm = this;
8845 vm.loading = {applications: true};
8846
8847 vm.applications = applicationsResource.query({
8848 root_list: true,
8849 resource_type: 'application'
8850 }, function (data) {
8851 vm.loading = {applications: false};
8852 });
8853 };
8854
8855 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8856 // #
8857 // # This program is free software: you can redistribute it and/or modify
8858 // # it under the terms of the GNU Affero General Public License, version 3
8859 // # (only), as published by the Free Software Foundation.
8860 // #
8861 // # This program is distributed in the hope that it will be useful,
8862 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8863 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8864 // # GNU General Public License for more details.
8865 // #
8866 // # You should have received a copy of the GNU Affero General Public License
8867 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8868 // #
8869 // # This program is dual-licensed. If you wish to learn more about the
8870 // # AppEnlight Enterprise Edition, including its added features, Support
8871 // # services, and proprietary license terms, please see
8872 // # https://rhodecode.com/licenses/
8873
8874 angular.module('appenlight.controllers').controller('ConfigsListController', ConfigsListController);
8875
8876 ConfigsListController.$inject = ['configsResource', 'configsNoIdResource'];
8877
8878 function ConfigsListController(configsResource, configsNoIdResource) {
8879 var vm = this;
8880 vm.loading = {config: true};
8881
8882 var filters = [
8883 'template_footer_html:global',
8884 'list_groups_to_non_admins:global',
8885 'per_application_reports_rate_limit:global',
8886 'per_application_logs_rate_limit:global',
8887 'per_application_metrics_rate_limit:global',
8888 ];
8889
8890 vm.configs = {};
8891
8892 vm.configList = configsResource.query({filter: filters},
8893 function (data) {
8894 vm.loading = {config: false};
8895 _.each(data, function (item) {
8896 if (vm.configs[item.section] === undefined) {
8897 vm.configs[item.section] = {};
8898 }
8899 vm.configs[item.section][item.key] = item;
8900 });
8901 });
8902
8903 vm.save = function () {
8904 vm.loading.config = true;
8905 _.each(vm.configList, function (item) {
8906 item.$save();
8907 });
8908 vm.loading.config = false;
8909 };
8910
8911 };
8912
8913 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8914 // #
8915 // # This program is free software: you can redistribute it and/or modify
8916 // # it under the terms of the GNU Affero General Public License, version 3
8917 // # (only), as published by the Free Software Foundation.
8918 // #
8919 // # This program is distributed in the hope that it will be useful,
8920 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8921 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8922 // # GNU General Public License for more details.
8923 // #
8924 // # You should have received a copy of the GNU Affero General Public License
8925 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8926 // #
8927 // # This program is dual-licensed. If you wish to learn more about the
8928 // # AppEnlight Enterprise Edition, including its added features, Support
8929 // # services, and proprietary license terms, please see
8930 // # https://rhodecode.com/licenses/
8931
8932 angular.module('appenlight.controllers').controller('AdminGroupsCreateController', AdminGroupsCreateController);
8933
8934 AdminGroupsCreateController.$inject = ['$state', 'groupsResource', 'groupsPropertyResource', 'sectionViewResource', 'AeConfig'];
8935
8936 function AdminGroupsCreateController($state, groupsResource, groupsPropertyResource, sectionViewResource, AeConfig) {
8937 console.debug('AdminGroupsCreateController');
8938 var vm = this;
8939 vm.loading = {
8940 group: false,
8941 resource_permissions: false,
8636 users: false
8942 users: false
8637 };
8943 };
8638
8944
@@ -8658,7 +8964,7 b' function AdminGroupsCreateController($state, groupsResource, groupsPropertyResou'
8658 }
8964 }
8659 };
8965 };
8660 _.each(data, function (item) {
8966 _.each(data, function (item) {
8661
8967 console.log(item);
8662 var section = tmpObj[item.type][item.resource_type];
8968 var section = tmpObj[item.type][item.resource_type];
8663 if (typeof section[item.resource_id] == 'undefined') {
8969 if (typeof section[item.resource_id] == 'undefined') {
8664 section[item.resource_id] = {
8970 section[item.resource_id] = {
@@ -8669,6 +8975,7 b' function AdminGroupsCreateController($state, groupsResource, groupsPropertyResou'
8669 section[item.resource_id].permissions.push(item.perm_name);
8975 section[item.resource_id].permissions.push(item.perm_name);
8670
8976
8671 });
8977 });
8978 console.log(tmpObj)
8672 vm.resourcePermissions = tmpObj;
8979 vm.resourcePermissions = tmpObj;
8673 });
8980 });
8674
8981
@@ -8733,7 +9040,7 b' function AdminGroupsCreateController($state, groupsResource, groupsPropertyResou'
8733 }
9040 }
8734
9041
8735 vm.searchUsers = function (searchPhrase) {
9042 vm.searchUsers = function (searchPhrase) {
8736
9043 console.log(searchPhrase);
8737 return sectionViewResource.query({
9044 return sectionViewResource.query({
8738 section: 'users_section',
9045 section: 'users_section',
8739 view: 'search_users',
9046 view: 'search_users',
@@ -8770,7 +9077,7 b" angular.module('appenlight.controllers').controller('AdminGroupsController', Adm"
8770 AdminGroupsController.$inject = ['groupsResource'];
9077 AdminGroupsController.$inject = ['groupsResource'];
8771
9078
8772 function AdminGroupsController(groupsResource) {
9079 function AdminGroupsController(groupsResource) {
8773
9080 console.debug('AdminGroupsController');
8774 var vm = this;
9081 var vm = this;
8775 vm.loading = {groups: true};
9082 vm.loading = {groups: true};
8776
9083
@@ -8782,13 +9089,13 b' function AdminGroupsController(groupsResource) {'
8782 }
9089 }
8783 return memo;
9090 return memo;
8784 }, 0);
9091 }, 0);
8785
9092 console.log(vm.groups);
8786 });
9093 });
8787
9094
8788
9095
8789 vm.removeGroup = function (group) {
9096 vm.removeGroup = function (group) {
8790 groupsResource.remove({groupId: group.id}, function (data, responseHeaders) {
9097 groupsResource.remove({groupId: group.id}, function (data, responseHeaders) {
8791
9098 console.log('x',data, responseHeaders());
8792 if (data) {
9099 if (data) {
8793 var index = vm.groups.indexOf(group);
9100 var index = vm.groups.indexOf(group);
8794 if (index !== -1) {
9101 if (index !== -1) {
@@ -8859,7 +9166,7 b' function AdminPartitionsController(sectionViewResource) {'
8859 else {
9166 else {
8860 var val = false;
9167 var val = false;
8861 }
9168 }
8862
9169 console.log('scope', scope);
8863 _.each(vm[scope], function (item) {
9170 _.each(vm[scope], function (item) {
8864 _.each(item[1].pg, function (index) {
9171 _.each(item[1].pg, function (index) {
8865 index.checked = val;
9172 index.checked = val;
@@ -8911,7 +9218,7 b' function AdminPartitionsController(sectionViewResource) {'
8911 }
9218 }
8912 });
9219 });
8913 });
9220 });
8914
9221 console.log(es_indices, pg_indices);
8915
9222
8916 vm.loading = {partitions: true};
9223 vm.loading = {partitions: true};
8917 sectionViewResource.save({section:'admin_section',
9224 sectionViewResource.save({section:'admin_section',
@@ -8994,7 +9301,7 b" angular.module('appenlight.controllers').controller('AdminUsersCreateController'"
8994 AdminUsersCreateController.$inject = ['$state', 'usersResource', 'usersPropertyResource', 'sectionViewResource', 'AeConfig'];
9301 AdminUsersCreateController.$inject = ['$state', 'usersResource', 'usersPropertyResource', 'sectionViewResource', 'AeConfig'];
8995
9302
8996 function AdminUsersCreateController($state, usersResource, usersPropertyResource, sectionViewResource, AeConfig) {
9303 function AdminUsersCreateController($state, usersResource, usersPropertyResource, sectionViewResource, AeConfig) {
8997
9304 console.debug('AdminUsersCreateController');
8998 var vm = this;
9305 var vm = this;
8999 vm.loading = {user: false};
9306 vm.loading = {user: false};
9000
9307
@@ -9024,7 +9331,7 b' function AdminUsersCreateController($state, usersResource, usersPropertyResource'
9024 }
9331 }
9025 };
9332 };
9026 _.each(data, function (item) {
9333 _.each(data, function (item) {
9027
9334 console.log(item);
9028 var section = tmpObj[item.type][item.resource_type];
9335 var section = tmpObj[item.type][item.resource_type];
9029 if (typeof section[item.resource_id] == 'undefined'){
9336 if (typeof section[item.resource_id] == 'undefined'){
9030 section[item.resource_id] = {
9337 section[item.resource_id] = {
@@ -9035,6 +9342,7 b' function AdminUsersCreateController($state, usersResource, usersPropertyResource'
9035 section[item.resource_id].permissions.push(item.perm_name);
9342 section[item.resource_id].permissions.push(item.perm_name);
9036
9343
9037 });
9344 });
9345 console.log(tmpObj)
9038 vm.resourcePermissions = tmpObj;
9346 vm.resourcePermissions = tmpObj;
9039 });
9347 });
9040
9348
@@ -9055,7 +9363,7 b' function AdminUsersCreateController($state, usersResource, usersPropertyResource'
9055
9363
9056 vm.createUser = function () {
9364 vm.createUser = function () {
9057 vm.loading.user = true;
9365 vm.loading.user = true;
9058
9366 console.log('updateProfile');
9059 if (userId) {
9367 if (userId) {
9060 usersResource.update({userId: vm.user.id}, vm.user, function (data) {
9368 usersResource.update({userId: vm.user.id}, vm.user, function (data) {
9061 setServerValidation(vm.profileForm);
9369 setServerValidation(vm.profileForm);
@@ -9077,7 +9385,7 b' function AdminUsersCreateController($state, usersResource, usersPropertyResource'
9077 vm.gen_pass += charset.charAt(Math.floor(Math.random() * n));
9385 vm.gen_pass += charset.charAt(Math.floor(Math.random() * n));
9078 }
9386 }
9079 vm.user.user_password = '' + vm.gen_pass;
9387 vm.user.user_password = '' + vm.gen_pass;
9080
9388 console.log('x', vm.gen_pass);
9081 }
9389 }
9082
9390
9083 vm.reloginUser = function () {
9391 vm.reloginUser = function () {
@@ -9115,7 +9423,7 b" angular.module('appenlight.controllers').controller('AdminUsersController', Admi"
9115 AdminUsersController.$inject = ['usersResource'];
9423 AdminUsersController.$inject = ['usersResource'];
9116
9424
9117 function AdminUsersController(usersResource) {
9425 function AdminUsersController(usersResource) {
9118
9426 console.debug('AdminUsersController');
9119 var vm = this;
9427 var vm = this;
9120 vm.loading = {users: true};
9428 vm.loading = {users: true};
9121
9429
@@ -9127,13 +9435,13 b' function AdminUsersController(usersResource) {'
9127 }
9435 }
9128 return memo;
9436 return memo;
9129 }, 0);
9437 }, 0);
9130
9438 console.log(vm.users);
9131 });
9439 });
9132
9440
9133
9441
9134 vm.removeUser = function (user) {
9442 vm.removeUser = function (user) {
9135 usersResource.remove({userId: user.id}, function (data, responseHeaders) {
9443 usersResource.remove({userId: user.id}, function (data, responseHeaders) {
9136
9444 console.log('x',data, responseHeaders());
9137 if (data) {
9445 if (data) {
9138 var index = vm.users.indexOf(user);
9446 var index = vm.users.indexOf(user);
9139 if (index !== -1) {
9447 if (index !== -1) {
@@ -9171,7 +9479,7 b" ApplicationsUpdateController.$inject = ['$state', 'applicationsNoIdResource', 'a"
9171
9479
9172 function ApplicationsUpdateController($state, applicationsNoIdResource, applicationsResource, applicationsPropertyResource, stateHolder) {
9480 function ApplicationsUpdateController($state, applicationsNoIdResource, applicationsResource, applicationsPropertyResource, stateHolder) {
9173 'use strict';
9481 'use strict';
9174
9482 console.debug('ApplicationsUpdateController');
9175 var vm = this;
9483 var vm = this;
9176 vm.loading = {application: false};
9484 vm.loading = {application: false};
9177
9485
@@ -9223,7 +9531,7 b' function ApplicationsUpdateController($state, applicationsNoIdResource, applicat'
9223 setServerValidation(vm.BasicForm, response.data);
9531 setServerValidation(vm.BasicForm, response.data);
9224 }
9532 }
9225 vm.loading.application = false;
9533 vm.loading.application = false;
9226
9534 console.log(vm.BasicForm);
9227 });
9535 });
9228 }
9536 }
9229 else {
9537 else {
@@ -9242,7 +9550,7 b' function ApplicationsUpdateController($state, applicationsNoIdResource, applicat'
9242 };
9550 };
9243
9551
9244 vm.addRule = function () {
9552 vm.addRule = function () {
9245
9553 console.log('addrule');
9246 applicationsPropertyResource.save({
9554 applicationsPropertyResource.save({
9247 resourceId: vm.resource.resource_id,
9555 resourceId: vm.resource.resource_id,
9248 key: 'postprocessing_rules'
9556 key: 'postprocessing_rules'
@@ -9268,7 +9576,7 b' function ApplicationsUpdateController($state, applicationsNoIdResource, applicat'
9268 function (response) {
9576 function (response) {
9269 if (response.status == 422) {
9577 if (response.status == 422) {
9270 setServerValidation(vm.regenerateAPIKeysForm, response.data);
9578 setServerValidation(vm.regenerateAPIKeysForm, response.data);
9271
9579 console.log(response.data);
9272 }
9580 }
9273 vm.loading.application = false;
9581 vm.loading.application = false;
9274 }
9582 }
@@ -9288,7 +9596,7 b' function ApplicationsUpdateController($state, applicationsNoIdResource, applicat'
9288 function (response) {
9596 function (response) {
9289 if (response.status == 422) {
9597 if (response.status == 422) {
9290 setServerValidation(vm.formDelete, response.data);
9598 setServerValidation(vm.formDelete, response.data);
9291
9599 console.log(response.data);
9292 }
9600 }
9293 vm.loading.application = false;
9601 vm.loading.application = false;
9294 }
9602 }
@@ -9307,7 +9615,7 b' function ApplicationsUpdateController($state, applicationsNoIdResource, applicat'
9307 function (response) {
9615 function (response) {
9308 if (response.status == 422) {
9616 if (response.status == 422) {
9309 setServerValidation(vm.formTransfer, response.data);
9617 setServerValidation(vm.formTransfer, response.data);
9310
9618 console.log(response.data);
9311 }
9619 }
9312 vm.loading.application = false;
9620 vm.loading.application = false;
9313 }
9621 }
@@ -9341,7 +9649,7 b" angular.module('appenlight.controllers')"
9341 IntegrationController.$inject = ['$state', 'integrationResource'];
9649 IntegrationController.$inject = ['$state', 'integrationResource'];
9342
9650
9343 function IntegrationController($state, integrationResource) {
9651 function IntegrationController($state, integrationResource) {
9344
9652 console.debug('IntegrationController');
9345 var vm = this;
9653 var vm = this;
9346 vm.loading = {integration: true};
9654 vm.loading = {integration: true};
9347 vm.config = integrationResource.get(
9655 vm.config = integrationResource.get(
@@ -9401,7 +9709,7 b' function IntegrationController($state, integrationResource) {'
9401 });
9709 });
9402 }
9710 }
9403
9711
9404
9712 console.log(vm);
9405 }
9713 }
9406
9714
9407 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9715 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
@@ -9429,7 +9737,7 b" angular.module('appenlight.controllers')"
9429 IntegrationsListController.$inject = ['$state', 'applicationsResource'];
9737 IntegrationsListController.$inject = ['$state', 'applicationsResource'];
9430
9738
9431 function IntegrationsListController($state, applicationsResource) {
9739 function IntegrationsListController($state, applicationsResource) {
9432
9740 console.debug('IntegrationsListController');
9433 var vm = this;
9741 var vm = this;
9434 vm.loading = {application: true};
9742 vm.loading = {application: true};
9435 vm.resource = applicationsResource.get({resourceId: $state.params.resourceId}, function (data) {
9743 vm.resource = applicationsResource.get({resourceId: $state.params.resourceId}, function (data) {
@@ -9463,7 +9771,7 b" angular.module('appenlight.controllers')"
9463 ApplicationsListController.$inject = ['applicationsResource'];
9771 ApplicationsListController.$inject = ['applicationsResource'];
9464
9772
9465 function ApplicationsListController(applicationsResource) {
9773 function ApplicationsListController(applicationsResource) {
9466
9774 console.debug('ApplicationsListController');
9467 var vm = this;
9775 var vm = this;
9468 vm.loading = {applications: true};
9776 vm.loading = {applications: true};
9469 vm.applications = applicationsResource.query(null, function(){
9777 vm.applications = applicationsResource.query(null, function(){
@@ -9496,7 +9804,7 b" angular.module('appenlight.controllers')"
9496 ApplicationsPurgeLogsController.$inject = ['applicationsResource', 'sectionViewResource', 'logsNoIdResource'];
9804 ApplicationsPurgeLogsController.$inject = ['applicationsResource', 'sectionViewResource', 'logsNoIdResource'];
9497
9805
9498 function ApplicationsPurgeLogsController(applicationsResource, sectionViewResource, logsNoIdResource) {
9806 function ApplicationsPurgeLogsController(applicationsResource, sectionViewResource, logsNoIdResource) {
9499
9807 console.debug('ApplicationsPurgeLogsController');
9500 var vm = this;
9808 var vm = this;
9501 vm.loading = {applications: true};
9809 vm.loading = {applications: true};
9502
9810
@@ -9780,7 +10088,7 b' function JiraIntegrationCtrl($uibModalInstance, $state, report, integrationName,'
9780 vm.form.responsible = vm.assignees[0];
10088 vm.form.responsible = vm.assignees[0];
9781 vm.form.priority = vm.priorities[0];
10089 vm.form.priority = vm.priorities[0];
9782 }, function (error_data) {
10090 }, function (error_data) {
9783
10091 console.log('ERROR');
9784 if (error_data.data.error_messages) {
10092 if (error_data.data.error_messages) {
9785 vm.error_messages = error_data.data.error_messages;
10093 vm.error_messages = error_data.data.error_messages;
9786 }
10094 }
@@ -10171,7 +10479,7 b' function ReportsListSlowController($location, $cookies, stateHolder, typeAheadTa'
10171 vm.is_loading = true;
10479 vm.is_loading = true;
10172 slowReportsResource.query(searchParams, function (data, getResponseHeaders) {
10480 slowReportsResource.query(searchParams, function (data, getResponseHeaders) {
10173 var headers = getResponseHeaders();
10481 var headers = getResponseHeaders();
10174
10482 console.log(headers);
10175 vm.is_loading = false;
10483 vm.is_loading = false;
10176 vm.reportsPage = _.map(data, function (item) {
10484 vm.reportsPage = _.map(data, function (item) {
10177 return reportPresentation(item);
10485 return reportPresentation(item);
@@ -10488,7 +10796,7 b' function ReportsListController($location, $cookies, stateHolder,'
10488 vm.is_loading = true;
10796 vm.is_loading = true;
10489 reportsResource.query(searchParams, function (data, getResponseHeaders) {
10797 reportsResource.query(searchParams, function (data, getResponseHeaders) {
10490 var headers = getResponseHeaders();
10798 var headers = getResponseHeaders();
10491
10799 console.log(headers);
10492 vm.is_loading = false;
10800 vm.is_loading = false;
10493 vm.reportsPage = _.map(data, function (item) {
10801 vm.reportsPage = _.map(data, function (item) {
10494 return reportPresentation(item);
10802 return reportPresentation(item);
@@ -10512,7 +10820,7 b' function ReportsListController($location, $cookies, stateHolder,'
10512 vm.searchParams = parseSearchToTags($location.search());
10820 vm.searchParams = parseSearchToTags($location.search());
10513 vm.page = Number(vm.searchParams.page) || 1;
10821 vm.page = Number(vm.searchParams.page) || 1;
10514 var params = parseTagsToSearch(vm.searchParams);
10822 var params = parseTagsToSearch(vm.searchParams);
10515
10823 console.log(params);
10516 vm.fetchReports(params);
10824 vm.fetchReports(params);
10517 };
10825 };
10518 // initial load
10826 // initial load
@@ -10642,7 +10950,7 b' function ReportsViewController($window, $location, $state, $uibModal, $cookies, '
10642 };
10950 };
10643
10951
10644 vm.searchTag = function (tag, value) {
10952 vm.searchTag = function (tag, value) {
10645
10953 console.log(tag, value);
10646 if (vm.report.report_type === 3) {
10954 if (vm.report.report_type === 3) {
10647 $location.url($state.href('report.list_slow'));
10955 $location.url($state.href('report.list_slow'));
10648 }
10956 }
@@ -10720,448 +11028,158 b' function ReportsViewController($window, $location, $state, $uibModal, $cookies, '
10720 vm.traceback = data.traceback;
11028 vm.traceback = data.traceback;
10721 _.each(vm.traceback, function (frame) {
11029 _.each(vm.traceback, function (frame) {
10722 if (frame.line) {
11030 if (frame.line) {
10723 vm.rawTraceback += 'File ' + frame.file + ' line ' + frame.line + ' in ' + frame.fn + ": \r\n";
11031 vm.rawTraceback += 'File ' + frame.file + ' line ' + frame.line + ' in ' + frame.fn + ": \r\n";
10724 }
11032 }
10725 vm.rawTraceback += ' ' + frame.cline + "\r\n";
11033 vm.rawTraceback += ' ' + frame.cline + "\r\n";
10726 });
11034 });
10727
10728 if (stateHolder.AeUser.id){
10729 vm.fetchHistory();
10730 }
10731
10732 vm.selectedTab($cookies.selectedReportTab);
10733
10734 }, function (response) {
10735
10736 if (response.status == 403) {
10737 var uid = response.headers('x-appenlight-uid');
10738 if (!uid) {
10739 window.location = '/register?came_from=' + encodeURIComponent(window.location);
10740 }
10741 }
10742 vm.is_loading.report = false;
10743 });
10744 };
10745
10746 vm.selectedTab = function(tab_name){
10747 $cookies.selectedReportTab = tab_name;
10748 if (tab_name == 'logs' && vm.reportLogs === null) {
10749 vm.fetchLogs();
10750 }
10751 };
10752
10753 vm.markFixed = function () {
10754 reportGroupResource.update({
10755 groupId: vm.report.group_id
10756 }, {fixed: !vm.report.group.fixed},
10757 function (data) {
10758 vm.report.group.fixed = data.fixed;
10759 });
10760 };
10761
10762 vm.markPublic = function () {
10763 reportGroupResource.update({
10764 groupId: vm.report.group_id
10765 }, {public: !vm.report.group.public},
10766 function (data) {
10767 vm.report.group.public = data.public;
10768 });
10769 };
10770
10771 vm.delete = function () {
10772 reportGroupResource.delete({'groupId': vm.report.group_id},
10773 function (data) {
10774 $state.go('report.list');
10775 })
10776 };
10777
10778 vm.assignUsersModal = function (index) {
10779 vm.opts = {
10780 backdrop: 'static',
10781 templateUrl: 'AssignReportCtrl.html',
10782 controller: 'AssignReportCtrl as ctrl',
10783 resolve: {
10784 report: function () {
10785 return vm.report;
10786 }
10787 }
10788 };
10789 var modalInstance = $uibModal.open(vm.opts);
10790 modalInstance.result.then(function (report) {
10791
10792 }, function () {
10793 console.info('Modal dismissed at: ' + new Date());
10794 });
10795
10796 };
10797
10798 vm.fetchHistory = function () {
10799 reportGroupPropertyResource.query({
10800 groupId: vm.report.group_id,
10801 key: 'history'
10802 }, function (data) {
10803 vm.reportHistoryData = {
10804 json: data,
10805 keys: {
10806 x: 'x',
10807 value: ["reports"]
10808 },
10809 names: {
10810 reports: 'Reports history'
10811 },
10812 type: 'bar'
10813 };
10814 vm.is_loading.history = false;
10815 });
10816 };
10817
10818 vm.nextDetail = function () {
10819 $state.go('report.view_detail', {
10820 groupId: vm.report.group_id,
10821 reportId: vm.report.group.next_report
10822 });
10823 };
10824 vm.previousDetail = function () {
10825 $state.go('report.view_detail', {
10826 groupId: vm.report.group_id,
10827 reportId: vm.report.group.previous_report
10828 });
10829 };
10830
10831 vm.runIntegration = function (integration_name) {
10832
10833 if (integration_name == 'bitbucket') {
10834 var controller = 'BitbucketIntegrationCtrl as ctrl';
10835 var template_url = 'templates/integrations/bitbucket.html';
10836 }
10837 else if (integration_name == 'github') {
10838 var controller = 'GithubIntegrationCtrl as ctrl';
10839 var template_url = 'templates/integrations/github.html';
10840 }
10841 else if (integration_name == 'jira') {
10842 var controller = 'JiraIntegrationCtrl as ctrl';
10843 var template_url = 'templates/integrations/jira.html';
10844 }
10845 else {
10846 return false;
10847 }
10848
10849 vm.opts = {
10850 backdrop: 'static',
10851 templateUrl: template_url,
10852 controller: controller,
10853 resolve: {
10854 integrationName: function () {
10855 return integration_name
10856 },
10857 report: function () {
10858 return vm.report;
10859 }
10860 }
10861 };
10862 var modalInstance = $uibModal.open(vm.opts);
10863 modalInstance.result.then(function (report) {
10864
10865 }, function () {
10866 console.info('Modal dismissed at: ' + new Date());
10867 });
10868
10869 };
10870
10871 // load report
10872 vm.fetchReport();
10873
10874
10875 }
10876
10877 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10878 // #
10879 // # This program is free software: you can redistribute it and/or modify
10880 // # it under the terms of the GNU Affero General Public License, version 3
10881 // # (only), as published by the Free Software Foundation.
10882 // #
10883 // # This program is distributed in the hope that it will be useful,
10884 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10885 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10886 // # GNU General Public License for more details.
10887 // #
10888 // # You should have received a copy of the GNU Affero General Public License
10889 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10890 // #
10891 // # This program is dual-licensed. If you wish to learn more about the
10892 // # AppEnlight Enterprise Edition, including its added features, Support
10893 // # services, and proprietary license terms, please see
10894 // # https://rhodecode.com/licenses/
10895
10896 angular.module('appenlight.controllers')
10897 .controller('AlertChannelsEmailController', AlertChannelsEmailController)
10898
10899 AlertChannelsEmailController.$inject = ['$state','userSelfPropertyResource'];
10900
10901 function AlertChannelsEmailController($state, userSelfPropertyResource) {
10902
10903 var vm = this;
10904 vm.loading = {email: false};
10905 vm.form = {};
10906
10907 vm.createChannel = function () {
10908 vm.loading.email = true;
10909
10910 userSelfPropertyResource.save({key: 'alert_channels'}, vm.form, function () {
10911 //vm.loading.email = false;
10912 //setServerValidation(vm.channelForm);
10913 //vm.form = {};
10914 $state.go('user.alert_channels.list');
10915 }, function (response) {
10916 if (response.status == 422) {
10917 setServerValidation(vm.channelForm, response.data);
10918 }
10919 vm.loading.email = false;
10920 });
10921 }
10922 }
10923
10924 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10925 // #
10926 // # This program is free software: you can redistribute it and/or modify
10927 // # it under the terms of the GNU Affero General Public License, version 3
10928 // # (only), as published by the Free Software Foundation.
10929 // #
10930 // # This program is distributed in the hope that it will be useful,
10931 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10932 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10933 // # GNU General Public License for more details.
10934 // #
10935 // # You should have received a copy of the GNU Affero General Public License
10936 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10937 // #
10938 // # This program is dual-licensed. If you wish to learn more about the
10939 // # AppEnlight Enterprise Edition, including its added features, Support
10940 // # services, and proprietary license terms, please see
10941 // # https://rhodecode.com/licenses/
10942
10943 angular.module('appenlight.controllers').controller('AlertChannelsController', AlertChannelsController);
10944
10945 AlertChannelsController.$inject = ['userSelfPropertyResource', 'applicationsNoIdResource'];
10946
10947 function AlertChannelsController(userSelfPropertyResource, applicationsNoIdResource) {
10948
10949 var vm = this;
10950 vm.loading = {channels: true, applications: true, actions:true};
10951
10952 vm.alertChannels = userSelfPropertyResource.query({key: 'alert_channels'},
10953 function (data) {
10954 vm.loading.channels = false;
10955 });
10956
10957 vm.alertActions = userSelfPropertyResource.query({key: 'alert_actions'},
10958 function (data) {
10959 vm.loading.actions = false;
10960 });
10961
10962 vm.applications = applicationsNoIdResource.query({permission: 'view'},
10963 function (data) {
10964 vm.loading.applications = false;
10965 });
10966
10967 var allOps = {
10968 'eq': 'Equal',
10969 'ne': 'Not equal',
10970 'ge': 'Greater or equal',
10971 'gt': 'Greater than',
10972 'le': 'Lesser or equal',
10973 'lt': 'Lesser than',
10974 'startswith': 'Starts with',
10975 'endswith': 'Ends with',
10976 'contains': 'Contains'
10977 };
10978
10979 var fieldOps = {};
10980 fieldOps['http_status'] = ['eq', 'ne', 'ge', 'le'];
10981 fieldOps['group:priority'] = ['eq', 'ne', 'ge', 'le'];
10982 fieldOps['duration'] = ['ge', 'le'];
10983 fieldOps['url_domain'] = ['eq', 'ne', 'startswith', 'endswith',
10984 'contains'];
10985 fieldOps['url_path'] = ['eq', 'ne', 'startswith', 'endswith',
10986 'contains'];
10987 fieldOps['error'] = ['eq', 'ne', 'startswith', 'endswith',
10988 'contains'];
10989 fieldOps['tags:server_name'] = ['eq', 'ne', 'startswith', 'endswith',
10990 'contains'];
10991 fieldOps['group:occurences'] = ['eq', 'ne', 'ge', 'le'];
10992
10993 var possibleFields = {
10994 '__AND__': 'All met (composite rule)',
10995 '__OR__': 'One met (composite rule)',
10996 '__NOT__': 'Not met (composite rule)',
10997 'http_status': 'HTTP Status',
10998 'duration': 'Request duration',
10999 'group:priority': 'Group -> Priority',
11000 'url_domain': 'Domain',
11001 'url_path': 'URL Path',
11002 'error': 'Error',
11003 'tags:server_name': 'Tag -> Server name',
11004 'group:occurences': 'Group -> Occurences'
11005 };
11006
11035
11007 vm.ruleDefinitions = {
11036 if (stateHolder.AeUser.id){
11008 fieldOps: fieldOps,
11037 vm.fetchHistory();
11009 allOps: allOps,
11038 }
11010 possibleFields: possibleFields
11039
11011 };
11040 vm.selectedTab($cookies.selectedReportTab);
11012
11041
11013 vm.addAction = function (channel) {
11014
11015 userSelfPropertyResource.save({key: 'alert_channels_rules'}, {}, function (data) {
11016 vm.alertActions.push(data);
11017 }, function (response) {
11042 }, function (response) {
11018 if (response.status == 422) {
11043 console.log(response);
11019
11044 if (response.status == 403) {
11045 var uid = response.headers('x-appenlight-uid');
11046 if (!uid) {
11047 window.location = '/register?came_from=' + encodeURIComponent(window.location);
11048 }
11020 }
11049 }
11050 vm.is_loading.report = false;
11021 });
11051 });
11022 };
11052 };
11023
11053
11024 vm.updateChannel = function (channel, subKey) {
11054 vm.selectedTab = function(tab_name){
11025 var params = {
11055 $cookies.selectedReportTab = tab_name;
11026 key: 'alert_channels',
11056 if (tab_name == 'logs' && vm.reportLogs === null) {
11027 channel_name: channel['channel_name'],
11057 vm.fetchLogs();
11028 channel_value: channel['channel_value']
11029 };
11030 var toUpdate = {};
11031 if (['daily_digest', 'send_alerts'].indexOf(subKey) !== -1) {
11032 toUpdate[subKey] = !channel[subKey];
11033 }
11058 }
11034 userSelfPropertyResource.update(params, toUpdate, function (data) {
11035 _.extend(channel, data);
11036 });
11037 };
11059 };
11038
11060
11039 vm.removeChannel = function (channel) {
11061 vm.markFixed = function () {
11040
11062 reportGroupResource.update({
11041 userSelfPropertyResource.delete({
11063 groupId: vm.report.group_id
11042 key: 'alert_channels',
11064 }, {fixed: !vm.report.group.fixed},
11043 channel_name: channel.channel_name,
11065 function (data) {
11044 channel_value: channel.channel_value
11066 vm.report.group.fixed = data.fixed;
11045 }, function () {
11046 vm.alertChannels = _.filter(vm.alertChannels, function(item){
11047 return item != channel;
11048 });
11067 });
11049 });
11068 };
11050
11051 }
11052
11069
11053 }
11070 vm.markPublic = function () {
11071 reportGroupResource.update({
11072 groupId: vm.report.group_id
11073 }, {public: !vm.report.group.public},
11074 function (data) {
11075 vm.report.group.public = data.public;
11076 });
11077 };
11054
11078
11055 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11079 vm.delete = function () {
11056 // #
11080 reportGroupResource.delete({'groupId': vm.report.group_id},
11057 // # This program is free software: you can redistribute it and/or modify
11081 function (data) {
11058 // # it under the terms of the GNU Affero General Public License, version 3
11082 $state.go('report.list');
11059 // # (only), as published by the Free Software Foundation.
11083 })
11060 // #
11084 };
11061 // # This program is distributed in the hope that it will be useful,
11062 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11063 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11064 // # GNU General Public License for more details.
11065 // #
11066 // # You should have received a copy of the GNU Affero General Public License
11067 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11068 // #
11069 // # This program is dual-licensed. If you wish to learn more about the
11070 // # AppEnlight Enterprise Edition, including its added features, Support
11071 // # services, and proprietary license terms, please see
11072 // # https://rhodecode.com/licenses/
11073
11085
11074 angular.module('appenlight.controllers').controller('UserAuthTokensController', UserAuthTokensController);
11086 vm.assignUsersModal = function (index) {
11087 vm.opts = {
11088 backdrop: 'static',
11089 templateUrl: 'AssignReportCtrl.html',
11090 controller: 'AssignReportCtrl as ctrl',
11091 resolve: {
11092 report: function () {
11093 return vm.report;
11094 }
11095 }
11096 };
11097 var modalInstance = $uibModal.open(vm.opts);
11098 modalInstance.result.then(function (report) {
11075
11099
11076 UserAuthTokensController.$inject = ['$filter', 'userSelfPropertyResource', 'AeConfig'];
11100 }, function () {
11101 console.info('Modal dismissed at: ' + new Date());
11102 });
11077
11103
11078 function UserAuthTokensController($filter, userSelfPropertyResource, AeConfig) {
11104 };
11079
11080 var vm = this;
11081 vm.loading = {tokens: true};
11082
11105
11083 vm.expireOptions = AeConfig.timeOptions;
11106 vm.fetchHistory = function () {
11107 reportGroupPropertyResource.query({
11108 groupId: vm.report.group_id,
11109 key: 'history'
11110 }, function (data) {
11111 vm.reportHistoryData = {
11112 json: data,
11113 keys: {
11114 x: 'x',
11115 value: ["reports"]
11116 },
11117 names: {
11118 reports: 'Reports history'
11119 },
11120 type: 'bar'
11121 };
11122 vm.is_loading.history = false;
11123 });
11124 };
11084
11125
11085 vm.tokens = userSelfPropertyResource.query({key: 'auth_tokens'},
11126 vm.nextDetail = function () {
11086 function (data) {
11127 $state.go('report.view_detail', {
11087 vm.loading.tokens = false;
11128 groupId: vm.report.group_id,
11129 reportId: vm.report.group.next_report
11130 });
11131 };
11132 vm.previousDetail = function () {
11133 $state.go('report.view_detail', {
11134 groupId: vm.report.group_id,
11135 reportId: vm.report.group.previous_report
11088 });
11136 });
11137 };
11089
11138
11090 vm.addToken = function () {
11139 vm.runIntegration = function (integration_name) {
11091 vm.loading.tokens = true;
11140 console.log(integration_name);
11092 userSelfPropertyResource.save({key: 'auth_tokens'},
11141 if (integration_name == 'bitbucket') {
11093 vm.form,
11142 var controller = 'BitbucketIntegrationCtrl as ctrl';
11094 function (data) {
11143 var template_url = 'templates/integrations/bitbucket.html';
11095 vm.loading.tokens = false;
11144 }
11096 setServerValidation(vm.TokenForm);
11145 else if (integration_name == 'github') {
11097 vm.form = {};
11146 var controller = 'GithubIntegrationCtrl as ctrl';
11098 vm.tokens.push(data);
11147 var template_url = 'templates/integrations/github.html';
11099 }, function (response) {
11148 }
11100 vm.loading.tokens = false;
11149 else if (integration_name == 'jira') {
11101 if (response.status == 422) {
11150 var controller = 'JiraIntegrationCtrl as ctrl';
11102 setServerValidation(vm.TokenForm, response.data);
11151 var template_url = 'templates/integrations/jira.html';
11103 }
11152 }
11104 })
11153 else {
11105 }
11154 return false;
11155 }
11106
11156
11107 vm.removeToken = function (token) {
11157 vm.opts = {
11108 userSelfPropertyResource.delete({key: 'auth_tokens',
11158 backdrop: 'static',
11109 token:token.token},
11159 templateUrl: template_url,
11110 function () {
11160 controller: controller,
11111 var index = vm.tokens.indexOf(token);
11161 resolve: {
11112 if (index !== -1) {
11162 integrationName: function () {
11113 vm.tokens.splice(index, 1);
11163 return integration_name
11164 },
11165 report: function () {
11166 return vm.report;
11114 }
11167 }
11115 })
11168 }
11116 }
11169 };
11117 }
11170 var modalInstance = $uibModal.open(vm.opts);
11171 modalInstance.result.then(function (report) {
11118
11172
11119 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11173 }, function () {
11120 // #
11174 console.info('Modal dismissed at: ' + new Date());
11121 // # This program is free software: you can redistribute it and/or modify
11175 });
11122 // # it under the terms of the GNU Affero General Public License, version 3
11123 // # (only), as published by the Free Software Foundation.
11124 // #
11125 // # This program is distributed in the hope that it will be useful,
11126 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11127 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11128 // # GNU General Public License for more details.
11129 // #
11130 // # You should have received a copy of the GNU Affero General Public License
11131 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11132 // #
11133 // # This program is dual-licensed. If you wish to learn more about the
11134 // # AppEnlight Enterprise Edition, including its added features, Support
11135 // # services, and proprietary license terms, please see
11136 // # https://rhodecode.com/licenses/
11137
11176
11138 angular.module('appenlight.controllers')
11177 };
11139 .controller('UserPasswordController', UserPasswordController)
11140
11178
11141 UserPasswordController.$inject = ['userSelfPropertyResource'];
11179 // load report
11180 vm.fetchReport();
11142
11181
11143 function UserPasswordController(userSelfPropertyResource) {
11144
11145 var vm = this;
11146 vm.loading = {password: false};
11147 vm.form = {};
11148
11182
11149 vm.updatePassword = function () {
11150 vm.loading.password = true;
11151
11152 userSelfPropertyResource.update({key: 'password'}, vm.form, function () {
11153 vm.loading.password = false;
11154 vm.form = {};
11155 setServerValidation(vm.passwordForm);
11156 }, function (response) {
11157 if (response.status == 422) {
11158
11159 setServerValidation(vm.passwordForm, response.data);
11160
11161 }
11162 vm.loading.password = false;
11163 });
11164 }
11165 }
11183 }
11166
11184
11167 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11185 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
@@ -11199,7 +11217,7 b" angular.module('appenlight.directives.c3chart', [])"
11199 if (!_.isEmpty($scope.data)) {
11217 if (!_.isEmpty($scope.data)) {
11200 _.extend(config.data, angular.copy($scope.data));
11218 _.extend(config.data, angular.copy($scope.data));
11201 }
11219 }
11202
11220 console.log('ChartCtrl.showGraph', config);
11203 config.onresized = function () {
11221 config.onresized = function () {
11204 if (this.currentWidth < 400){
11222 if (this.currentWidth < 400){
11205 $scope.chart.internal.config.axis_x_tick_culling_max = 3;
11223 $scope.chart.internal.config.axis_x_tick_culling_max = 3;
@@ -11218,19 +11236,19 b" angular.module('appenlight.directives.c3chart', [])"
11218 originalXTickCount = $scope.chart.internal.config.axis_x_tick_culling_max;
11236 originalXTickCount = $scope.chart.internal.config.axis_x_tick_culling_max;
11219 $scope.chart.internal.config.onresized.call($scope.chart.internal);
11237 $scope.chart.internal.config.onresized.call($scope.chart.internal);
11220 }
11238 }
11221
11239 console.log('should update', $scope.update);
11222 if ($scope.update) {
11240 if ($scope.update) {
11223
11241 console.log('reload driven');
11224 $scope.$watch('data', function () {
11242 $scope.$watch('data', function () {
11225 if (!firstLoad) {
11243 if (!firstLoad) {
11226
11244 console.log('data updated', $scope.data);
11227 $scope.chart.load(angular.copy($scope.data), {unload: true});
11245 $scope.chart.load(angular.copy($scope.data), {unload: true});
11228 if (typeof $scope.data.groups != 'undefined') {
11246 if (typeof $scope.data.groups != 'undefined') {
11229
11247 console.log('add groups');
11230 $scope.chart.groups($scope.data.groups);
11248 $scope.chart.groups($scope.data.groups);
11231 }
11249 }
11232 if (typeof $scope.data.names != 'undefined') {
11250 if (typeof $scope.data.names != 'undefined') {
11233
11251 console.log('add names');
11234 $scope.chart.data.names($scope.data.names);
11252 $scope.chart.data.names($scope.data.names);
11235 }
11253 }
11236 $scope.chart.flush();
11254 $scope.chart.flush();
@@ -11242,7 +11260,7 b" angular.module('appenlight.directives.c3chart', [])"
11242 return
11260 return
11243 }
11261 }
11244 if (typeof $scope.config.regions != 'undefined') {
11262 if (typeof $scope.config.regions != 'undefined') {
11245
11263 console.log('update regions', $scope.config.regions);
11246 $scope.chart.regions($scope.config.regions);
11264 $scope.chart.regions($scope.config.regions);
11247 }
11265 }
11248 });
11266 });
@@ -11318,7 +11336,7 b" directive('confirmValidate', [function () {"
11318 link: function ($scope, elem, attrs, ngModel) {
11336 link: function ($scope, elem, attrs, ngModel) {
11319 ngModel.$validators.confirm = function (modelValue, viewValue) {
11337 ngModel.$validators.confirm = function (modelValue, viewValue) {
11320 var value = modelValue || viewValue;
11338 var value = modelValue || viewValue;
11321
11339 console.log('validate', value.toLowerCase() == 'confirm');
11322 if (value.toLowerCase() == 'confirm') {
11340 if (value.toLowerCase() == 'confirm') {
11323 return true;
11341 return true;
11324 }
11342 }
@@ -11495,7 +11513,7 b' function ApplicationPermissionsController(sectionViewResource, applicationsPrope'
11495 vm.form.selectedGroup = vm.possibleGroups[0].id;
11513 vm.form.selectedGroup = vm.possibleGroups[0].id;
11496 }
11514 }
11497 });
11515 });
11498
11516 console.log('g', vm.possibleGroups);
11499 vm.possibleUsers = [];
11517 vm.possibleUsers = [];
11500 _.each(vm.resource.possible_permissions, function (perm) {
11518 _.each(vm.resource.possible_permissions, function (perm) {
11501 vm.form.selectedUserPermissions[perm] = false;
11519 vm.form.selectedUserPermissions[perm] = false;
@@ -11511,7 +11529,7 b' function ApplicationPermissionsController(sectionViewResource, applicationsPrope'
11511 group: {}
11529 group: {}
11512 };
11530 };
11513 _.each(vm.currentPermissions, function (perm) {
11531 _.each(vm.currentPermissions, function (perm) {
11514
11532 console.log(perm);
11515 if (perm.type == 'user') {
11533 if (perm.type == 'user') {
11516 if (typeof tmpObj[perm.type][perm.user_name] === 'undefined') {
11534 if (typeof tmpObj[perm.type][perm.user_name] === 'undefined') {
11517 tmpObj[perm.type][perm.user_name] = {
11535 tmpObj[perm.type][perm.user_name] = {
@@ -11541,10 +11559,10 b' function ApplicationPermissionsController(sectionViewResource, applicationsPrope'
11541 group: _.values(tmpObj.group),
11559 group: _.values(tmpObj.group),
11542 };
11560 };
11543
11561
11544
11562 console.log('test', tmpObj, vm.currentPermissions);
11545
11563
11546 vm.searchUsers = function (searchPhrase) {
11564 vm.searchUsers = function (searchPhrase) {
11547
11565 console.log('SEARCHING');
11548 vm.searchingUsers = true;
11566 vm.searchingUsers = true;
11549 return sectionViewResource.query({
11567 return sectionViewResource.query({
11550 section: 'users_section',
11568 section: 'users_section',
@@ -11593,7 +11611,7 b' function ApplicationPermissionsController(sectionViewResource, applicationsPrope'
11593
11611
11594
11612
11595 vm.setUserPermission = function () {
11613 vm.setUserPermission = function () {
11596
11614 console.log('set permissions');
11597 var POSTObj = {
11615 var POSTObj = {
11598 'user_name': vm.form.autocompleteUser,
11616 'user_name': vm.form.autocompleteUser,
11599 'permissions': []
11617 'permissions': []
@@ -11623,8 +11641,8 b' function ApplicationPermissionsController(sectionViewResource, applicationsPrope'
11623 }
11641 }
11624
11642
11625 vm.removeUserPermission = function (perm_name, curr_perm) {
11643 vm.removeUserPermission = function (perm_name, curr_perm) {
11626
11644 console.log(perm_name);
11627
11645 console.log(curr_perm);
11628 var POSTObj = {
11646 var POSTObj = {
11629 key: 'user_permissions',
11647 key: 'user_permissions',
11630 user_name: curr_perm.self.user_name,
11648 user_name: curr_perm.self.user_name,
@@ -11641,7 +11659,7 b' function ApplicationPermissionsController(sectionViewResource, applicationsPrope'
11641 }
11659 }
11642
11660
11643 vm.removeGroupPermission = function (perm_name, curr_perm) {
11661 vm.removeGroupPermission = function (perm_name, curr_perm) {
11644
11662 console.log('g', curr_perm);
11645 var POSTObj = {
11663 var POSTObj = {
11646 key: 'group_permissions',
11664 key: 'group_permissions',
11647 group_id: curr_perm.self.group_id,
11665 group_id: curr_perm.self.group_id,
@@ -11748,7 +11766,7 b" angular.module('appenlight.directives.postProcessAction', []).directive('postPro"
11748 };
11766 };
11749 function postProcessActionController(){
11767 function postProcessActionController(){
11750 var vm = this;
11768 var vm = this;
11751
11769 console.log(vm);
11752 var allOps = {
11770 var allOps = {
11753 'eq': 'Equal',
11771 'eq': 'Equal',
11754 'ne': 'Not equal',
11772 'ne': 'Not equal',
@@ -11832,7 +11850,7 b" angular.module('appenlight.directives.postProcessAction', []).directive('postPro"
11832
11850
11833 vm.setDirty = function() {
11851 vm.setDirty = function() {
11834 vm.action.dirty = true;
11852 vm.action.dirty = true;
11835
11853 console.log('set dirty');
11836 };
11854 };
11837 }
11855 }
11838
11856
@@ -11928,14 +11946,14 b" angular.module('appenlight.directives.reportAlertAction', []).directive('reportA"
11928 channel_pkey: vm.channelToBind.pkey,
11946 channel_pkey: vm.channelToBind.pkey,
11929 action_pkey: vm.action.pkey
11947 action_pkey: vm.action.pkey
11930 };
11948 };
11931
11949 console.log(post);
11932 userSelfPropertyResource.save({key: 'alert_channels_actions_binds'}, post,
11950 userSelfPropertyResource.save({key: 'alert_channels_actions_binds'}, post,
11933 function (data) {
11951 function (data) {
11934 vm.action.channels = [];
11952 vm.action.channels = [];
11935 vm.action.channels = data.channels;
11953 vm.action.channels = data.channels;
11936 }, function (response) {
11954 }, function (response) {
11937 if (response.status == 422) {
11955 if (response.status == 422) {
11938
11956 console.log('scope', response);
11939 }
11957 }
11940 });
11958 });
11941 };
11959 };
@@ -11951,7 +11969,7 b" angular.module('appenlight.directives.reportAlertAction', []).directive('reportA"
11951 vm.action.channels = data.channels;
11969 vm.action.channels = data.channels;
11952 }, function (response) {
11970 }, function (response) {
11953 if (response.status == 422) {
11971 if (response.status == 422) {
11954
11972 console.log('scope', response);
11955 }
11973 }
11956 });
11974 });
11957 };
11975 };
@@ -11988,7 +12006,7 b" angular.module('appenlight.directives.reportAlertAction', []).directive('reportA"
11988
12006
11989 vm.setDirty = function() {
12007 vm.setDirty = function() {
11990 vm.action.dirty = true;
12008 vm.action.dirty = true;
11991
12009 console.log('set dirty');
11992 };
12010 };
11993 }
12011 }
11994
12012
@@ -12087,10 +12105,10 b" angular.module('appenlight.directives.rule', []).directive('rule', function () {"
12087
12105
12088 vm.setDirty = function() {
12106 vm.setDirty = function() {
12089 vm.rule.dirty = true;
12107 vm.rule.dirty = true;
12090
12108 console.log('set dirty');
12091 if (vm.parentObj){
12109 if (vm.parentObj){
12092
12110 console.log('p', vm.parentObj);
12093
12111 console.log('set parent dirty');
12094 vm.parentObj.dirty = true;
12112 vm.parentObj.dirty = true;
12095 }
12113 }
12096 };
12114 };
@@ -12104,13 +12122,13 b" angular.module('appenlight.directives.rule', []).directive('rule', function () {"
12104 vm.rule.op = vm.ruleDefinitions.fieldOps[vm.rule.field][0];
12122 vm.rule.op = vm.ruleDefinitions.fieldOps[vm.rule.field][0];
12105 }
12123 }
12106 if ((new_is_compound && !old_was_compound)) {
12124 if ((new_is_compound && !old_was_compound)) {
12107
12125 console.log('resetting config');
12108 delete vm.rule.value;
12126 delete vm.rule.value;
12109 vm.rule.rules = [];
12127 vm.rule.rules = [];
12110 vm.add();
12128 vm.add();
12111 }
12129 }
12112 else if (!new_is_compound && old_was_compound) {
12130 else if (!new_is_compound && old_was_compound) {
12113
12131 console.log('resetting config');
12114 delete vm.rule.rules;
12132 delete vm.rule.rules;
12115 vm.rule.value = '';
12133 vm.rule.value = '';
12116 }
12134 }
@@ -12460,8 +12478,7 b" angular.module('appenlight').config(['$stateProvider', '$urlRouterProvider', fun"
12460
12478
12461 $stateProvider.state('user.profile.password', {
12479 $stateProvider.state('user.profile.password', {
12462 url: '/password',
12480 url: '/password',
12463 templateUrl: 'templates/user/profile_password.html',
12481 component: 'userPasswordView'
12464 controller: 'UserPasswordController as password'
12465 });
12482 });
12466
12483
12467 $stateProvider.state('user.profile.identities', {
12484 $stateProvider.state('user.profile.identities', {
@@ -12471,26 +12488,23 b" angular.module('appenlight').config(['$stateProvider', '$urlRouterProvider', fun"
12471
12488
12472 $stateProvider.state('user.profile.auth_tokens', {
12489 $stateProvider.state('user.profile.auth_tokens', {
12473 url: '/auth_tokens',
12490 url: '/auth_tokens',
12474 templateUrl: 'templates/user/auth_tokens.html',
12491 component: 'userAuthTokensView'
12475 controller: 'UserAuthTokensController as auth_tokens'
12476 });
12492 });
12477
12493
12478 $stateProvider.state('user.alert_channels', {
12494 $stateProvider.state('user.alert_channels', {
12479 abstract: true,
12495 abstract: true,
12480 url: '/alert_channels',
12496 url: '/alert_channels',
12481 templateUrl: 'templates/user/alert_channels.html'
12497 template: '<ui-view></ui-view>'
12482 });
12498 });
12483
12499
12484 $stateProvider.state('user.alert_channels.list', {
12500 $stateProvider.state('user.alert_channels.list', {
12485 url: '/list',
12501 url: '/list',
12486 templateUrl: 'templates/user/alert_channels_list.html',
12502 component: 'userAlertChannelsListView'
12487 controller: 'AlertChannelsController as channels'
12488 });
12503 });
12489
12504
12490 $stateProvider.state('user.alert_channels.email', {
12505 $stateProvider.state('user.alert_channels.email', {
12491 url: '/email',
12506 url: '/email',
12492 templateUrl: 'templates/user/alert_channels_email.html',
12507 component: 'userAlertChannelsEmailNewView'
12493 controller: 'AlertChannelsEmailController as email'
12494 });
12508 });
12495
12509
12496 $stateProvider.state('applications', {
12510 $stateProvider.state('applications', {
@@ -12913,7 +12927,7 b" angular.module('appenlight.services.stateHolder', []).factory('stateHolder',"
12913 }
12927 }
12914 }
12928 }
12915 }.bind(this));
12929 }.bind(this));
12916
12930 console.log('AeUser.hasContextPermission', permName, hasPerm);
12917 return hasPerm;
12931 return hasPerm;
12918 };
12932 };
12919
12933
@@ -12927,7 +12941,7 b" angular.module('appenlight.services.stateHolder', []).factory('stateHolder',"
12927 list: [],
12941 list: [],
12928 timeout: null,
12942 timeout: null,
12929 extend: function (values) {
12943 extend: function (values) {
12930
12944 console.log('pushing flash', this);
12931 if (this.list.length > 2) {
12945 if (this.list.length > 2) {
12932 this.list.splice(0, this.list.length - 2);
12946 this.list.splice(0, this.list.length - 2);
12933 }
12947 }
@@ -12936,7 +12950,7 b" angular.module('appenlight.services.stateHolder', []).factory('stateHolder',"
12936 this.removeMessages();
12950 this.removeMessages();
12937 },
12951 },
12938 pop: function () {
12952 pop: function () {
12939
12953 console.log('popping flash');
12940 this.list.pop();
12954 this.list.pop();
12941 },
12955 },
12942 cancelTimeout: function () {
12956 cancelTimeout: function () {
@@ -13031,7 +13045,7 b" angular.module('appenlight.services.typeAheadTagHelper', []).factory('typeAheadT"
13031 return true;
13045 return true;
13032 };
13046 };
13033 typeAheadTagHelper.removeSearchTag = function (tag) {
13047 typeAheadTagHelper.removeSearchTag = function (tag) {
13034
13048 console.log(typeAheadTagHelper.tags);
13035 var indexValue = _.indexOf(typeAheadTagHelper.tags, tag);
13049 var indexValue = _.indexOf(typeAheadTagHelper.tags, tag);
13036 typeAheadTagHelper.tags.splice(indexValue, 1);
13050 typeAheadTagHelper.tags.splice(indexValue, 1);
13037
13051
@@ -28,6 +28,7 b" AlertChannelsEmailController.$inject = ['$state','userSelfPropertyResource'];"
28 function AlertChannelsEmailController($state, userSelfPropertyResource) {
28 function AlertChannelsEmailController($state, userSelfPropertyResource) {
29 console.debug('AlertChannelsEmailController');
29 console.debug('AlertChannelsEmailController');
30 var vm = this;
30 var vm = this;
31 vm.$state = $state;
31 vm.loading = {email: false};
32 vm.loading = {email: false};
32 vm.form = {};
33 vm.form = {};
33
34
@@ -23,11 +23,12 b" angular.module('appenlight.components.userAlertChannelsListView', [])"
23 controller: userAlertChannelsListViewController
23 controller: userAlertChannelsListViewController
24 });
24 });
25
25
26 userAlertChannelsListViewController.$inject = ['userSelfPropertyResource', 'applicationsNoIdResource'];
26 userAlertChannelsListViewController.$inject = ['$state','userSelfPropertyResource', 'applicationsNoIdResource'];
27
27
28 function userAlertChannelsListViewController(userSelfPropertyResource, applicationsNoIdResource) {
28 function userAlertChannelsListViewController($state, userSelfPropertyResource, applicationsNoIdResource) {
29 console.debug('AlertChannelsController');
29 console.debug('AlertChannelsController');
30 var vm = this;
30 var vm = this;
31 vm.$state = $state;
31 vm.loading = {channels: true, applications: true, actions:true};
32 vm.loading = {channels: true, applications: true, actions:true};
32
33
33 vm.alertChannels = userSelfPropertyResource.query({key: 'alert_channels'},
34 vm.alertChannels = userSelfPropertyResource.query({key: 'alert_channels'},
@@ -23,11 +23,12 b" angular.module('appenlight.components.userAuthTokensView', [])"
23 controller: userAuthTokensViewController
23 controller: userAuthTokensViewController
24 });
24 });
25
25
26 userAuthTokensViewController.$inject = ['userSelfPropertyResource', 'AeConfig'];
26 userAuthTokensViewController.$inject = ['$state', 'userSelfPropertyResource', 'AeConfig'];
27
27
28 function userAuthTokensViewController(userSelfPropertyResource, AeConfig) {
28 function userAuthTokensViewController($state, userSelfPropertyResource, AeConfig) {
29 console.debug('userAuthTokensViewController');
29 console.debug('userAuthTokensViewController');
30 var vm = this;
30 var vm = this;
31 vm.$state = $state;
31 vm.loading = {tokens: true};
32 vm.loading = {tokens: true};
32
33
33 vm.expireOptions = AeConfig.timeOptions;
34 vm.expireOptions = AeConfig.timeOptions;
@@ -23,11 +23,12 b" angular.module('appenlight.components.userIdentitiesView', [])"
23 controller: UserIdentitiesController
23 controller: UserIdentitiesController
24 });
24 });
25
25
26 UserIdentitiesController.$inject = ['userSelfPropertyResource', 'AeConfig'];
26 UserIdentitiesController.$inject = ['$state', 'userSelfPropertyResource', 'AeConfig'];
27
27
28 function UserIdentitiesController(userSelfPropertyResource, AeConfig) {
28 function UserIdentitiesController($state, userSelfPropertyResource, AeConfig) {
29 console.debug('UserIdentitiesController');
29 console.debug('UserIdentitiesController');
30 var vm = this;
30 var vm = this;
31 vm.$state = $state;
31 vm.AeConfig = AeConfig;
32 vm.AeConfig = AeConfig;
32 vm.loading = {identities: true};
33 vm.loading = {identities: true};
33
34
@@ -23,11 +23,12 b" angular.module('appenlight.components.userPasswordView', [])"
23 controller: UserPasswordViewController
23 controller: UserPasswordViewController
24 });
24 });
25
25
26 UserPasswordViewController.$inject = ['userSelfPropertyResource'];
26 UserPasswordViewController.$inject = ['$state', 'userSelfPropertyResource'];
27
27
28 function UserPasswordViewController(userSelfPropertyResource) {
28 function UserPasswordViewController($state, userSelfPropertyResource) {
29 console.debug('UserPasswordViewController');
29 console.debug('UserPasswordViewController');
30 var vm = this;
30 var vm = this;
31 vm.$state = $state;
31 vm.loading = {password: false};
32 vm.loading = {password: false};
32 vm.form = {};
33 vm.form = {};
33
34
@@ -23,11 +23,12 b" angular.module('appenlight.components.userProfileView', [])"
23 controller: UserProfileViewController
23 controller: UserProfileViewController
24 });
24 });
25
25
26 UserProfileViewController.$inject = ['userSelfResource'];
26 UserProfileViewController.$inject = ['$state', 'userSelfResource'];
27
27
28 function UserProfileViewController(userSelfResource) {
28 function UserProfileViewController($state, userSelfResource) {
29 console.debug('UserProfileViewController');
29 console.debug('UserProfileViewController');
30 var vm = this;
30 var vm = this;
31 vm.$state = $state;
31 vm.loading = {profile: true};
32 vm.loading = {profile: true};
32
33
33 vm.user = userSelfResource.get(null, function (data) {
34 vm.user = userSelfResource.get(null, function (data) {
@@ -1,11 +1,12 b''
1 <ol class="breadcrumb" ng-show="$state.includes('user.profile')">
1 <ol class="breadcrumb" ng-show="$ctrl.$state.includes('user.profile')">
2 <li>Settings</li>
2 <li>Settings</li>
3 <li ng-show="$state.includes('user.profile.edit')" ng-class="{bold:$state.is('user.profile.edit')}">User Profile</li>
3 <li ng-show="$ctrl.$state.includes('user.profile.edit')" ng-class="{bold:$ctrl.$state.is('user.profile.edit')}">User Profile</li>
4 <li ng-show="$state.includes('user.profile.password')" ng-class="{bold:$state.is('user.profile.password')}">Password</li>
4 <li ng-show="$ctrl.$state.includes('user.profile.password')" ng-class="{bold:$ctrl.$state.is('user.profile.password')}">Password</li>
5 <li ng-show="$state.includes('user.profile.identities')" ng-class="{bold:$state.is('user.profile.identities')}">Identities</li>
5 <li ng-show="$ctrl.$state.includes('user.profile.identities')" ng-class="{bold:$ctrl.$state.is('user.profile.identities')}">Identities</li>
6 <li ng-show="$ctrl.$state.includes('user.profile.auth_tokens')" ng-class="{bold:$ctrl.$state.is('user.profile.auth_tokens')}">Auth Tokens</li>
6 </ol>
7 </ol>
7 <ol class="breadcrumb" ng-show="$state.includes('user.alert_channels')">
8 <ol class="breadcrumb" ng-show="$ctrl.$state.includes('user.alert_channels')">
8 <li>Notifications</li>
9 <li>Notifications</li>
9 <li ng-show="$state.includes('user.alert_channels.list')" ng-class="{bold:$state.is('user.alert_channels.list')}">Alert Channels</li>
10 <li ng-show="$ctrl.$state.includes('user.alert_channels.list')" ng-class="{bold:$ctrl.$state.is('user.alert_channels.list')}">Alert Channels</li>
10 <li ng-show="$state.includes('user.alert_channels.email')" ng-class="{bold:$state.is('user.alert_channels.email')}">Create email channel</li>
11 <li ng-show="$ctrl.$state.includes('user.alert_channels.email')" ng-class="{bold:$ctrl.$state.is('user.alert_channels.email')}">Create email channel</li>
11 </ol>
12 </ol>
General Comments 0
You need to be logged in to leave comments. Login now