##// END OF EJS Templates
front dashboard: turn into component
ergo -
Show More
This diff has been collapsed as it changes many lines, (6515 lines changed) Show them Hide them
@@ -2678,7 +2678,8 b" angular.module('appenlight.controllers', ["
2678 2678 angular.module('appenlight.components', [
2679 2679 'appenlight.components.channelstream',
2680 2680 'appenlight.components.appenlightApp',
2681 'appenlight.components.appenlightHeader'
2681 'appenlight.components.appenlightHeader',
2682 'appenlight.components.indexDashboardView'
2682 2683 ]);
2683 2684 angular.module('appenlight.directives', [
2684 2685 'appenlight.directives.c3chart',
@@ -2952,1090 +2953,878 b' function kickstartAE(initialUserData) {'
2952 2953 );
2953 2954
2954 2955
2955 $templateCache.put('directives/permissions/permissions.html',
2956 "<div class=\"panel panel-default\">\n" +
2957 " <div class=\"panel-heading\">\n" +
2958 " <h3 class=\"panel-title\">Permissions</h3>\n" +
2959 " </div>\n" +
2960 " <div class=\"panel-body\">\n" +
2961 " <p>Here you can <strong>set permissions</strong> for others to access your app data.</p>\n" +
2956 $templateCache.put('components/views/index-dashboard/index-dashboard.html',
2957 "<style type=\"text/css\">\n" +
2958 " #metrics_chart .c3-line {\n" +
2959 " stroke-width: 0px;\n" +
2960 " }\n" +
2962 2961 "\n" +
2963 " <p>For example you can let other staff member view or alter error reports.</p>\n" +
2962 " #metrics_chart .c3-area {\n" +
2963 " stroke-width: 0;\n" +
2964 " opacity: 0.75;\n" +
2965 " }\n" +
2966 "</style>\n" +
2964 2967 "\n" +
2965 " <div ng-if=\"permissions.possibleGroups.length > 0\">\n" +
2966 " <h3>Group permissions</h3>\n" +
2968 "<div class=\"row\">\n" +
2969 " <div class=\"col-sm-12 dashboard\" id=\"content\">\n" +
2970 " <div ng-if=\"!$ctrl.stateHolder.AeUser.applications.length\">\n" +
2967 2971 "\n" +
2968 " <ul class=\"list-group\">\n" +
2969 " <li ng-repeat=\"perm in permissions.currentPermissions.group\" class=\"animate-repeat list-group-item\">\n" +
2970 " <strong>{{ perm.self.group_name }}</strong>\n" +
2971 " <div ng-repeat=\"perm_name in perm.permissions\" class=\"pull-right animate-repeat m-l-1\">\n" +
2972 " <span ng-if=\"perm_name == '__all_permissions__'\">Resource owner</span>\n" +
2973 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"perm_name != '__all_permissions__'\">\n" +
2974 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> {{ perm_name }}</a>\n" +
2975 " <ul class=\"dropdown-menu\">\n" +
2976 " <li><a>No</a></li>\n" +
2977 " <li><a ng-click=\"permissions.removeGroupPermission(perm_name, perm)\">Yes</a></li>\n" +
2978 " </ul>\n" +
2979 " </span>\n" +
2980 " </div>\n" +
2981 " </li>\n" +
2982 " </ul>\n" +
2972 " <div ng-include=\"'templates/quickstart.html'\"></div>\n" +
2983 2973 "\n" +
2984 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"permissions.setGroupPermission()\">\n" +
2985 " <div class=\"form-group\">\n" +
2986 " <select class=\"form-control\" ng-model=\"permissions.form.selectedGroup\" ng-options=\"g.id as g.group_name for g in permissions.possibleGroups\"></select>\n" +
2987 " </div>\n" +
2988 " <div class=\"form-group\">\n" +
2989 " <span ng-repeat=\"permission in permissions.possiblePermissions\">\n" +
2990 " <input type=\"checkbox\" ng-model=\"permissions.form.selectedGroupPermissions[permission]\"> {{ permission }}\n" +
2991 " </span>\n" +
2992 " </div>\n" +
2993 " <div class=\"form-group\">\n" +
2994 " <button class=\"btn btn-info\"><span class=\"fa fa-user\"></span> Give permission</button>\n" +
2995 2974 " </div>\n" +
2996 " </form>\n" +
2997 2975 "\n" +
2998 " </div>\n" +
2976 " <div ng-if=\"$ctrl.stateHolder.AeUser.applications.length\">\n" +
2999 2977 "\n" +
3000 " <h3>User permissions</h3>\n" +
3001 " <div>\n" +
3002 " <ul class=\"list-group\">\n" +
3003 " <li ng-repeat=\"perm in permissions.currentPermissions.user\" class=\"animate-repeat list-group-item\">\n" +
3004 " <strong>{{ perm.self.user_name }}</strong>\n" +
3005 " <div ng-repeat=\"perm_name in perm.permissions\" class=\"pull-right animate-repeat m-l-1\">\n" +
3006 " <span ng-if=\"perm_name == '__all_permissions__'\">Resource owner</span>\n" +
3007 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"perm_name != '__all_permissions__'\">\n" +
3008 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> {{ perm_name }}</a>\n" +
3009 " <ul class=\"dropdown-menu\">\n" +
3010 " <li><a>No</a></li>\n" +
3011 " <li><a ng-click=\"permissions.removeUserPermission(perm_name,perm)\">Yes</a></li>\n" +
3012 " </ul>\n" +
3013 " </span>\n" +
3014 " </div>\n" +
3015 " </li>\n" +
3016 " </ul>\n" +
3017 " </div>\n" +
3018 " <div>\n" +
3019 " <p>First enter username or full email of person you want to give access to (the person needs to be <strong>already registered in AppEnlight</strong>)</p>\n" +
2978 " <div class=\"row\">\n" +
2979 " <div class=\"col-sm-6\">\n" +
2980 " <div class=\"panel panel-default\">\n" +
2981 " <div class=\"panel-body\">\n" +
2982 " <form class=\"graph-type form-inline\">\n" +
2983 " <select ng-model=\"$ctrl.resource\" ng-options=\"r.resource_id as r.resource_name for r in $ctrl.stateHolder.AeUser.applications\" ng-change=\"$ctrl.updateSearchParams()\"\n" +
2984 " class=\"SelectField form-control input-sm slim-input\"></select>\n" +
3020 2985 "\n" +
3021 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"permissions.setUserPermission()\">\n" +
3022 " <div class=\"form-group\">\n" +
3023 " <input type=\"text\" class=\"autocomplete form-control\" placeholder=\"Search for user/email\" ng-model=\"permissions.form.autocompleteUser\"\n" +
3024 " uib-typeahead=\"u.user for u in permissions.searchUsers($viewValue) | limitTo:8\" typeahead-loading=\"permissions.searchingUsers\" typeahead-wait-ms=\"250\"\n" +
3025 " typeahead-template-url=\"templates/directives/user_search_type_ahead.html\"\n" +
3026 " />\n" +
3027 " </div>\n" +
3028 " <div class=\"form-group\">\n" +
3029 " <span ng-repeat=\"permission in permissions.possiblePermissions\">\n" +
3030 " <input type=\"checkbox\" ng-model=\"permissions.form.selectedUserPermissions[permission]\"> {{ permission }}\n" +
3031 " </span>\n" +
3032 " </div>\n" +
3033 " <div class=\"form-group\">\n" +
3034 " <button class=\"btn btn-info\" ng-disabled=\"!permissions.form.autocompleteUser\"><span class=\"fa fa-user\"></span> Give permission</button>\n" +
3035 " </div>\n" +
3036 " </form>\n" +
3037 " </div>\n" +
3038 " </div>\n" +
3039 "</div>\n"
3040 );
3041
3042
3043 $templateCache.put('directives/plugin_config/plugin_config.html',
3044 "<div ng-repeat=\"tmpl in plugin_ctrlr.inclusions track by $index\">\n" +
3045 " <div><strong>Plugin: {{tmpl.name}}</strong></div>\n" +
3046 " <ng-include src=\"tmpl.template\"></ng-include>\n" +
3047 " <hr/>\n" +
3048 "</div>\n"
3049 );
3050
3051
3052 $templateCache.put('directives/postprocess_action/postprocess_action.html',
3053 "<div class=\"panel panel-default action\">\n" +
3054 " <div class=\"panel-body form-inline\">\n" +
3055 " <div class=\"pull-right\">\n" +
3056 " <span class=\"dropdown\" data-uib-dropdown>\n" +
3057 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3058 " <ul class=\"dropdown-menu\">\n" +
3059 " <li><a>No</a></li>\n" +
3060 " <li><a ng-click=\"ctrl.deleteAction(ctrl.action)\">Yes</a></li>\n" +
3061 " </ul>\n" +
3062 " </span>\n" +
3063 " </div>\n" +
2986 " <select class=\"SelectField form-control input-sm slim-input\" ng-model=\"$ctrl.timeSpan\"\n" +
2987 " ng-options=\"i as i.label for i in $ctrl.timeOptions | objectToOrderedArray:'minutes'\" ng-change=\"$ctrl.updateSearchParams()\"\n" +
2988 " class=\"SelectField\"></select>\n" +
3064 2989 "\n" +
3065 " <div class=\"form-group\">\n" +
3066 " <label>Action</label>\n" +
3067 2990 "\n" +
3068 " <div class=\"form-group\">\n" +
3069 " <select class=\"form-control\" ng-model=\"ctrl.action.new_value\" ng-options=\"f[0] as f[1] for f in ctrl.possibleActions\" ng-change=\"ctrl.setDirty()\"></select>\n" +
2991 " <div class=\"btn-group\">\n" +
2992 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"$ctrl.graphType.selected\" ng-change=\"$ctrl.updateSearchParams()\"\n" +
2993 " uib-btn-radio=\"'requests_graphs'\" data-uib-tooltip=\"Requests per second\">\n" +
2994 " <span class=\"fa fa-line-chart\"></span>\n" +
2995 " </button>\n" +
2996 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"$ctrl.graphType.selected\" ng-change=\"$ctrl.updateSearchParams()\"\n" +
2997 " uib-btn-radio=\"'response_graphs'\" data-uib-tooltip=\"Average response time\">\n" +
2998 " <span class=\"fa fa-random\"></span>\n" +
2999 " </button>\n" +
3000 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"$ctrl.graphType.selected\" ng-change=\"$ctrl.updateSearchParams()\"\n" +
3001 " uib-btn-radio=\"'metrics_graphs'\" data-uib-tooltip=\"Time spent per request\">\n" +
3002 " <span class=\"fa fa-bar-chart-o\"></span>\n" +
3003 " </button>\n" +
3004 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"$ctrl.graphType.selected\" ng-change=\"$ctrl.updateSearchParams()\"\n" +
3005 " uib-btn-radio=\"'report_graphs'\" data-uib-tooltip=\"Errors\">\n" +
3006 " <span class=\"fa fa-exclamation-triangle\"></span>\n" +
3007 " </button>\n" +
3008 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"$ctrl.graphType.selected\" ng-change=\"$ctrl.updateSearchParams()\"\n" +
3009 " uib-btn-radio=\"'slow_report_graphs'\" data-uib-tooltip=\"Slow reports\">\n" +
3010 " <span class=\"fa fa-clock-o\"></span>\n" +
3011 " </button>\n" +
3070 3012 " </div>\n" +
3013 " </form>\n" +
3014 " <div class=\"clearfix\"></div>\n" +
3071 3015 "\n" +
3072 " <a class=\"btn btn-success\" ng-if=\"ctrl.action.dirty\" ng-click=\"ctrl.saveAction()\"><span class=\"fa fa-save\"></span> &nbsp;Save changes</a>\n" +
3016 " <p ng-if=\"$ctrl.loading.series != false\" class=\"text-center\">\n" +
3017 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
3018 " </p>\n" +
3073 3019 "\n" +
3074 " </div>\n" +
3075 " <hr/>\n" +
3076 " <p>Meeting following criteria:</p>\n" +
3077 " <form-errors errors=\"ctrl.errors\"></form-errors>\n" +
3078 " {{ctrl.rule}}\n" +
3079 " <rule rule=\"ctrl.action.rule\" rule-definitions=\"ctrl.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"ctrl.action\"></rule>\n" +
3080 " </div>\n" +
3081 "</div>\n"
3082 );
3083
3084
3085 $templateCache.put('directives/report_alert_action/report_alert_action.html',
3086 "<div class=\"panel panel-default action\">\n" +
3087 " <div class=\"panel-body form-inline\">\n" +
3088 " <div class=\"pull-right\">\n" +
3089 " <span class=\"dropdown\" data-uib-dropdown>\n" +
3090 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3091 " <ul class=\"dropdown-menu\">\n" +
3092 " <li><a>No</a></li>\n" +
3093 " <li><a ng-click=\"ctrl.deleteAction(ctrl.actions, ctrl.action)\">Yes</a></li>\n" +
3094 " </ul>\n" +
3095 " </span>\n" +
3020 " <div ng-if=\"$ctrl.loading.series == false\">\n" +
3021 " <div ng-if=\"$ctrl.graphType.selected == 'requests_graphs'\">\n" +
3022 " <c3chart data-domid=\"reponse_chart\" data-data=\"$ctrl.requestsChartData\" data-config=\"$ctrl.requestsChartConfig\" update=\"true\">\n" +
3023 " </c3chart>\n" +
3096 3024 " </div>\n" +
3097 3025 "\n" +
3098 " <div class=\"form-group\">\n" +
3099 " <label>Applies to</label>\n" +
3100 " <select class=\"form-control\" ng-model=\"ctrl.action.resource_id\" ng-options=\"f.resource_id as f.resource_name for f in ctrl.applications\" ng-change=\"ctrl.setDirty()\">\n" +
3101 " <option value=\"\">All Resources</option>\n" +
3102 " </select>\n" +
3026 " <div ng-if=\"$ctrl.graphType.selected == 'response_graphs'\">\n" +
3027 " <c3chart data-domid=\"reponse_chart\" data-data=\"$ctrl.responseChartData\" data-config=\"$ctrl.responseChartConfig\" update=\"true\">\n" +
3028 " </c3chart>\n" +
3103 3029 " </div>\n" +
3104 " <div class=\"form-group\">\n" +
3105 " <label>Notify</label>\n" +
3106 " <select class=\"form-control\" ng-model=\"ctrl.action.action\" ng-change=\"ctrl.setDirty()\" ng-options=\"f[0] as f[1] for f in ctrl.possibleNotifications\"></select>\n" +
3107 "\n" +
3108 " <a class=\"btn btn-success\" ng-if=\"ctrl.action.dirty\" ng-click=\"ctrl.saveAction()\"><span class=\"fa fa-save\"></span> &nbsp;Save changes</a>\n" +
3109 3030 "\n" +
3031 " <div ng-if=\"$ctrl.graphType.selected == 'metrics_graphs'\">\n" +
3032 " <c3chart data-domid=\"metrics_chart\" data-data=\"$ctrl.metricsChartData\" data-config=\"$ctrl.metricsChartConfig\" update=\"true\">\n" +
3033 " </c3chart>\n" +
3110 3034 " </div>\n" +
3111 " <div>\n" +
3112 " <p><strong>Channels:</strong></p>\n" +
3113 " <ul class=\"list-group\">\n" +
3114 " <li class=\"list-group-item\" ng-repeat=\"channel in ctrl.action.channels\">\n" +
3115 " <strong>{{channel.channel_visible_value}}</strong>\n" +
3116 " <div class=\"pull-right\">\n" +
3117 " <span class=\"dropdown\" data-uib-dropdown>\n" +
3118 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3119 " <ul class=\"dropdown-menu\">\n" +
3120 " <li><a>No</a></li>\n" +
3121 " <li><a ng-click=\"ctrl.unBindChannel(channel)\">Yes</a></li>\n" +
3122 " </ul>\n" +
3123 " </span>\n" +
3124 " </div>\n" +
3125 " </li>\n" +
3126 " </ul>\n" +
3127 " <div class=\"form-group\" ng-if=\"ctrl.possibleChannels.length\">\n" +
3128 " <select class=\"form-control\" ng-model=\"ctrl.channelToBind\" ng-options=\"c as c.channel_visible_value for c in ctrl.possibleChannels |filter: c.supports_report_alerting\"></select>\n" +
3129 " <a class=\"btn btn-info\" ng-click=\"ctrl.bindChannel(channel, ctrl.action)\"><span class=\"fa fa-plus-circle\"></span> Add Channel</a>\n" +
3130 " </div>\n" +
3131 " <div class=\"alert alert-danger\" ng-if=\"!ctrl.possibleChannels.length\">\n" +
3132 " <span class=\"fa fa-exclamation-triangle \"></span>You need to create an alert channel before you can assign it to your rule.\n" +
3035 " <div ng-if=\"$ctrl.graphType.selected == 'report_graphs'\">\n" +
3036 " <c3chart data-domid=\"reports_chart\" data-data=\"$ctrl.reportChartData\" data-config=\"$ctrl.reportChartConfig\" update=\"true\">\n" +
3037 " </c3chart>\n" +
3133 3038 " </div>\n" +
3134 3039 "\n" +
3040 " <div ng-if=\"$ctrl.graphType.selected == 'slow_report_graphs'\">\n" +
3041 " <c3chart data-domid=\"slow_reports_chart\" data-data=\"$ctrl.reportSlowChartData\" data-config=\"$ctrl.reportSlowChartConfig\" update=\"true\">\n" +
3042 " </c3chart>\n" +
3135 3043 " </div>\n" +
3136 " <hr/>\n" +
3137 " <p>Meeting following criteria:</p>\n" +
3138 " <form-errors errors=\"ctrl.errors\"></form-errors>\n" +
3139 " <rule rule=\"ctrl.action.rule\" rule-definitions=\"ctrl.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"ctrl.action\"></rule>\n" +
3140 " </div>\n" +
3141 "</div>\n"
3142 );
3143
3144
3145 $templateCache.put('directives/rule_read_only/rule_read_only.html',
3146 "<div class=\"rule-read-only\">\n" +
3147 3044 "\n" +
3148 " <span class=\"form-group\">\n" +
3149 " {{rule_ctrlr.readOnlyPossibleFields[rule_ctrlr.rule.field]}}\n" +
3150 " </span>\n" +
3045 " <p ng-if=\"$ctrl.graphType.selected == 'requests_graphs'\" class=\"text-center\">\n" +
3046 " <small>Average requests per second from all servers</small>\n" +
3047 " </p>\n" +
3151 3048 "\n" +
3152 " <span ng-if=\"rule_ctrlr.rule.field != '__AND__' && rule_ctrlr.rule.field !='__OR__' && rule_ctrlr.rule.field !='__NOT__'\">\n" +
3153 " is {{rule_ctrlr.ruleDefinitions.allOps[rule_ctrlr.rule.op]}} {{rule_ctrlr.rule.value}}\n" +
3154 " </span>\n" +
3049 " <p ng-if=\"$ctrl.graphType.selected == 'response_graphs'\" class=\"text-center\">\n" +
3050 " <small>Average response time from all servers</small>\n" +
3051 " </p>\n" +
3155 3052 "\n" +
3156 " <span ng-if=\"rule_ctrlr.rule.field == '__AND__' || rule_ctrlr.rule.field =='__OR__' || rule_ctrlr.rule.field =='__NOT__'\">\n" +
3157 " <p ng-if=\"parent\"><strong>Subrules</strong></p>\n" +
3158 " <div ng-repeat=\"subrule in rule_ctrlr.rule.rules\" class=\"m-l-2\">\n" +
3053 " <p ng-if=\"$ctrl.graphType.selected == 'metrics_graphs'\" class=\"text-center\">\n" +
3054 " <small>Aggregated average time spent per request - broken to layers</small>\n" +
3055 " </p>\n" +
3159 3056 "\n" +
3160 " <div class=\"panel panel-default\">\n" +
3161 " <div class=\"panel-body form-inline\">\n" +
3162 " <recursive>\n" +
3163 " <rule-read-only rule=\"subrule\" rule-definitions=\"rule_ctrlr.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"rule_ctrlr.parentObj\"></rule-read-only>\n" +
3164 " </recursive>\n" +
3057 " <p ng-if=\"$ctrl.graphType.selected == 'report_graphs'\" class=\"text-center\">\n" +
3058 " <small>Aggregated reports sent by your application</small>\n" +
3059 " </p>\n" +
3060 "\n" +
3061 " <p ng-if=\"$ctrl.graphType.selected == 'slow_report_graphs'\" class=\"text-center\">\n" +
3062 " <small>Aggregated slow reports sent by your application</small>\n" +
3063 " </p>\n" +
3165 3064 " </div>\n" +
3166 3065 " </div>\n" +
3167 3066 " </div>\n" +
3168 "\n" +
3169 " </span>\n" +
3170 "</div>\n"
3171 );
3172
3173
3174 $templateCache.put('directives/rule/rule.html',
3175 "<div class=\"rule form-inline\">\n" +
3176 "\n" +
3177 " <div class=\"form-group\">\n" +
3178 " <select class=\"form-control\"\n" +
3179 " ng-model=\"rule_ctrlr.rule.field\"\n" +
3180 " ng-change=\"rule_ctrlr.fieldChange()\"\n" +
3181 " ng-options=\"key as label for (key, label) in rule_ctrlr.ruleDefinitions.possibleFields\"></select>\n" +
3182 3067 " </div>\n" +
3183 3068 "\n" +
3184 " <div ng-if=\"rule_ctrlr.rule.field != '__AND__' && rule_ctrlr.rule.field !='__OR__' && rule_ctrlr.rule.field !='__NOT__'\" class=\"form-group\">\n" +
3185 3069 "\n" +
3186 " <select ng-model=\"rule_ctrlr.rule.op\" class=\"form-control\"\n" +
3187 " ng-change=\"rule_ctrlr.setDirty()\"\n" +
3188 " ng-options=\"op as rule_ctrlr.ruleDefinitions.allOps[op] for op in rule_ctrlr.ruleDefinitions.fieldOps[rule_ctrlr.rule.field]\">\n" +
3189 " </select>\n" +
3070 " <div class=\"col-sm-6\">\n" +
3190 3071 "\n" +
3191 " <input type=\"text\" placeholder=\"Value\" ng-model=\"rule_ctrlr.rule.value\" ng-change=\"rule_ctrlr.setDirty()\" class=\"form-control\">\n" +
3072 " <div id=\"server-container\">\n" +
3192 3073 "\n" +
3193 " </div>\n" +
3074 " <div ng-if=\"$ctrl.loading.apdex==false\" class=\"text-center m-b-1\">\n" +
3194 3075 "\n" +
3195 " <span ng-if=\"rule_ctrlr.rule.field == '__AND__' || rule_ctrlr.rule.field =='__OR__' || rule_ctrlr.rule.field =='__NOT__'\">\n" +
3196 " <p ng-if=\"parent\"><strong>Subrules</strong></p>\n" +
3197 " <div ng-repeat=\"subrule in rule_ctrlr.rule.rules\" class=\"m-l-2\">\n" +
3198 " <div class=\"panel panel-default\">\n" +
3199 " <div class=\"panel-body form-inline\">\n" +
3200 " <recursive>\n" +
3201 " <rule rule=\"subrule\" rule-definitions=\"rule_ctrlr.ruleDefinitions\" parent-rule=\"rule_ctrlr.rule\" parent-obj=\"rule_ctrlr.parentObj\"></rule>\n" +
3202 " </recursive>\n" +
3203 " </div>\n" +
3204 " </div>\n" +
3205 " </div>\n" +
3076 " <a data-ui-sref=\"report.list({resource:$ctrl.resource, start_date:$ctrl.startDateFilter})\" class=\"combined-stat text-center\" id=\"error-rate\">\n" +
3077 " <small>Exceptions</small>\n" +
3078 " <br/>\n" +
3079 " <strong>{{ $ctrl.exceptions|numberToThousands}}</strong>\n" +
3080 " <span class=\"fa fa-chevron-right\"></span>\n" +
3081 " </a><!--\n" +
3206 3082 "\n" +
3207 " <span ng-if=\"(rule_ctrlr.config.disable_subrules == false) == false\" class=\"btn btn-info\" ng-click=\"rule_ctrlr.add()\"><span class=\"fa fa-plus-circle\"></span> Add rule</span>\n" +
3083 " --><a data-ui-sref=\"report.list_slow({resource:$ctrl.resource, min_duration:4, start_date:$ctrl.startDateFilter})\" class=\"combined-stat text-center\" id=\"frustrating-requests\" data-uib-tooltip=\"Requests over 4s\">\n" +
3084 " <small>Frustrating req.</small>\n" +
3085 " <br/>\n" +
3086 " <strong>{{$ctrl.frustratingRequests|numberToThousands}}</strong>\n" +
3087 " <span class=\"fa fa-chevron-right\"></span>\n" +
3088 " </a><!--\n" +
3208 3089 "\n" +
3209 " </span>\n" +
3210 " <div class=\"pull-right\" ng-if=\"rule_ctrlr.parentRule\">\n" +
3211 " <span class=\"dropdown\" data-uib-dropdown>\n" +
3212 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3213 " <ul class=\"dropdown-menu\">\n" +
3214 " <li><a>No</a></li>\n" +
3215 " <li><a ng-click=\"rule_ctrlr.deleteRule(rule_ctrlr.parentRule, rule_ctrlr.rule)\">Yes</a></li>\n" +
3216 " </ul>\n" +
3217 " </span>\n" +
3218 " </div>\n" +
3219 "</div>\n"
3220 );
3221
3222
3223 $templateCache.put('templates/admin/applications/applications_list.html',
3224 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications.loading.applications\"></ng-include>\n" +
3090 " --><a data-ui-sref=\"report.list_slow({resource:$ctrl.resource, min_duration:1, max_duration:4, start_date:$ctrl.startDateFilter})\" class=\"combined-stat text-center\" id=\"tolerated-requests\"\n" +
3091 " data-uib-tooltip=\"Requests under 4s\">\n" +
3092 " <small>Tolerated req.</small>\n" +
3093 " <br/>\n" +
3094 " <strong>{{$ctrl.toleratedRequests|numberToThousands}}</strong>\n" +
3095 " <span class=\"fa fa-chevron-right\"></span>\n" +
3096 " </a><!--\n" +
3225 3097 " \n" +
3226 "<div class=\"panel panel-default\" ng-if=\"!applications.loading.applications\">\n" +
3227 " <div class=\"panel-heading\">\n" +
3098 " --><a class=\"combined-stat text-center\" id=\"satisfying-requests\" data-uib-tooltip=\"Requests under 1s\">\n" +
3099 " <small>Satisfying req.</small>\n" +
3100 " <br/>\n" +
3101 " <strong>{{$ctrl.satisfyingRequests|numberToThousands}}</strong>\n" +
3102 " </a><!--\n" +
3228 3103 "\n" +
3229 " Currently active applications: {{applications.applications.length}}\n" +
3104 " --><a data-ui-sref=\"uptime({resource:$ctrl.resource})\" class=\"combined-stat text-center\" id=\"uptime-stats\" data-uib-tooltip=\"Uptime\">\n" +
3105 " <small>Uptime</small>\n" +
3106 " <br/>\n" +
3107 " <strong>{{$ctrl.uptimeStats}}%</strong>\n" +
3108 " <span class=\"fa fa-chevron-right\"></span>\n" +
3109 " </a>\n" +
3230 3110 "\n" +
3111 " <div class=\"clearfix\"></div>\n" +
3231 3112 " </div>\n" +
3232 3113 "\n" +
3233 " <table st-table=\"displayedCollection\" st-safe-src=\"applications.applications\" class=\"table table-striped\">\n" +
3114 " <div id=\"apdex-rate\" class=\"m-b-1 panel panel-default\">\n" +
3115 " <table class=\"servers table table-striped\">\n" +
3234 3116 " <thead>\n" +
3235 3117 " <tr>\n" +
3236 " <th st-sort=\"resource_name\"><a>Application name</a></th>\n" +
3237 " <th st-sort=\"owner_user_name\"><a>Owner User</a></th>\n" +
3238 " <th st-sort=\"owner_group_name\"><a>Owner Group</a></th>\n" +
3239 " <th class=\"options\"></th>\n" +
3240 " </tr>\n" +
3241 " <tr>\n" +
3242 " <th><input st-search=\"resource_name\" placeholder=\"search for application\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3243 " <th><input st-search=\"owner_user_name\" placeholder=\"search for user\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3244 " <th><input st-search=\"owner_group_name\" placeholder=\"search for group\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3245 3118 " <th></th>\n" +
3119 " <th>Server</th>\n" +
3120 " <th>Apdex\n" +
3121 " <span class=\"fa fa-question-circle\"\n" +
3122 " data-uib-tooltip=\"Application Performance Index - measures viewer satisfaction based on response times and error rates\"></span>\n" +
3123 " </th>\n" +
3124 " <th>rpm</th>\n" +
3125 " <th>avg. response</th>\n" +
3246 3126 " </tr>\n" +
3247 3127 " </thead>\n" +
3248 3128 " <tbody>\n" +
3249 "\n" +
3250 " <tr ng-repeat=\"resource in displayedCollection track by resource.resource_id\">\n" +
3251 " <td> {{resource.resource_name}}</td>\n" +
3252 " <td>{{resource.owner_user_name}}</td>\n" +
3253 " <td>{{resource.owner_group_name}}</td>\n" +
3129 " <tr ng-if=\"$ctrl.loading.apdex!=false\" class=\"text-center\">\n" +
3130 " <td colspan=\"5\"><span class=\"fa fa-cog fa-spin fa-5x loader\"></span></td>\n" +
3131 " </tr>\n" +
3132 " <tr ng-repeat=\"server in $ctrl.apdexStats\" class=\"{{ server | apdexValue }}\"\n" +
3133 " ng-if=\"$ctrl.loading.apdex==false\">\n" +
3134 " <td><span class=\"fa fa-hdd-o\"></span></td>\n" +
3254 3135 " <td>\n" +
3255 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"applications.update({resourceId:resource.resource_id})\" data-toggle=\"tooltip\" title=\"Update application\"><span class=\"fa fa-cog\"></span></a>\n" +
3136 " <small><strong>{{ server.name }}</strong></small>\n" +
3256 3137 " </td>\n" +
3257 " </tr>\n" +
3258 " <tfoot>\n" +
3259 " <tr>\n" +
3260 " <td colspan=\"4\" class=\"text-center\">\n" +
3261 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
3138 " <td class=\"apdex\">\n" +
3139 " <small><strong>{{ server.apdex }} %</strong></small>\n" +
3140 " </td>\n" +
3141 " <td>\n" +
3142 " <small><strong>{{ server.rpm }}rpm</strong></small>\n" +
3143 " </td>\n" +
3144 " <td>\n" +
3145 " <small><strong>{{ server.avg_response_time }}s</strong></small>\n" +
3262 3146 " </td>\n" +
3263 3147 " </tr>\n" +
3264 " </tfoot>\n" +
3265 3148 " </tbody>\n" +
3266 3149 " </table>\n" +
3267 3150 "\n" +
3268 "</div>\n"
3269 );
3270
3271
3272 $templateCache.put('templates/admin/configs/edit.html',
3273 "<ng-include src=\"'templates/loader.html'\" ng-if=\"configs.loading.config\"></ng-include>\n" +
3274 "\n" +
3275 "<div class=\"panel panel-default\" ng-show=\"!configs.loading.config\">\n" +
3276 " <div class=\"panel-heading\">\n" +
3277 " <h3 class=\"panel-title\">Basic Configuration</h3>\n" +
3278 3151 " </div>\n" +
3279 " <div class=\"panel-body\">\n" +
3280 " <h2>Visual</h2>\n" +
3281 " <form class=\"form-horizontal\">\n" +
3282 " <div class=\"form-group\">\n" +
3283 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3284 " Footer HTML\n" +
3285 " </label>\n" +
3286 " <div class=\"col-sm-8 col-lg-9\">\n" +
3287 " <textarea class=\"form-control\" type=\"text\" ng-model=\"configs.configs.global.template_footer_html.value\" style=\"min-height: 150px\"></textarea>\n" +
3288 3152 " </div>\n" +
3153 "\n" +
3289 3154 " </div>\n" +
3290 " </form>\n" +
3291 3155 "\n" +
3292 " <h2>Functional</h2>\n" +
3293 3156 "\n" +
3294 " <form class=\"form-horizontal\">\n" +
3295 " <div class=\"form-group\">\n" +
3296 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3297 " Show user groups to non-admin users\n" +
3298 " </label>\n" +
3299 " <div class=\"col-sm-8 col-lg-9\">\n" +
3300 " <button type=\"button\" class=\"btn btn-default\" ng-model=\"configs.configs.global.list_groups_to_non_admins.value\" uib-btn-checkbox>\n" +
3301 " Enable\n" +
3302 " </button>\n" +
3303 3157 " </div>\n" +
3304 " </div>\n" +
3305 " </form>\n" +
3306 3158 "\n" +
3307 " <h2>Global Rate Limiting</h2>\n" +
3159 " <div class=\"row\">\n" +
3160 " <div class=\"col-sm-6\">\n" +
3308 3161 "\n" +
3309 " <form class=\"form-horizontal\">\n" +
3310 " <div class=\"form-group\">\n" +
3311 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3312 " Ignore reports per minute/per application\n" +
3313 " </label>\n" +
3314 " <div class=\"col-sm-8 col-lg-9\">\n" +
3315 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_reports_rate_limit.value\" />\n" +
3316 " </div>\n" +
3317 " </div>\n" +
3162 " <div class=\"panel panel-default\">\n" +
3163 " <div class=\"panel-heading position-relative\">\n" +
3164 " <h3 class=\"panel-title\"><span class=\"fa fa-exclamation-triangle\"></span> Newest errors (real-time)\n" +
3165 " </h3>\n" +
3166 " <a tooltip-append-to-body=\"true\" data-uib-tooltip=\"Play/Pause stream\" class=\"btn btn-primary btn-sm pause_stream\" ng-model=\"$ctrl.stream.paused\" uib-btn-checkbox>\n" +
3167 " <span class=\"fa {{stream.paused ? 'fa-play' : 'fa-pause'}}\"></span>\n" +
3168 " </a>\n" +
3169 " <a tooltip-append-to-body=\"true\" data-uib-tooltip=\"Limit reports to current application\" class=\"btn btn-primary btn-sm limit_stream\" ng-model=\"$ctrl.stream.filtered\" uib-btn-checkbox>\n" +
3170 " <span class=\"fa fa-lock\"></span>\n" +
3171 " </a>\n" +
3318 3172 "\n" +
3319 " <div class=\"form-group\">\n" +
3320 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3321 " Ignore logs per minute/per application\n" +
3322 " </label>\n" +
3323 " <div class=\"col-sm-8 col-lg-9\">\n" +
3324 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_logs_rate_limit.value\" />\n" +
3325 " </div>\n" +
3326 " </div>\n" +
3327 3173 "\n" +
3328 " <div class=\"form-group\">\n" +
3329 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3330 " Ignore metrics per minute/per application\n" +
3331 " </label>\n" +
3332 " <div class=\"col-sm-8 col-lg-9\">\n" +
3333 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_metrics_rate_limit.value\" />\n" +
3334 3174 " </div>\n" +
3335 " </div>\n" +
3336 "\n" +
3337 " </form>\n" +
3175 " <div class=\"panel-body\">\n" +
3338 3176 "\n" +
3339 " <hr/>\n" +
3177 " <p ng-if=\"$ctrl.stream.reports.length === 0\">No new reports</p>\n" +
3340 3178 "\n" +
3341 " <a class=\"btn btn-primary\" ng-click=\"configs.save()\">Save configuration</a>\n" +
3179 " <div small-report-list reports=\"$ctrl.stream.reports\" applications=\"$ctrl.applications\"></div>\n" +
3180 " </div>\n" +
3342 3181 " </div>\n" +
3343 "\n" +
3344 3182 " </div>\n" +
3345 3183 "\n" +
3184 " <div class=\"col-sm-6\">\n" +
3346 3185 "\n" +
3347 3186 " <div class=\"panel panel-default\">\n" +
3348 3187 " <div class=\"panel-heading\">\n" +
3349 " <h3 class=\"panel-title\">Plugin Configuration</h3>\n" +
3188 " <h3 class=\"panel-title\"><span class=\"fa fa-sort-amount-desc\"></span> Request breakdown over {{ $ctrl.timeSpan.label }}</h3>\n" +
3350 3189 " </div>\n" +
3351 " <div class=\"panel-body\">\n" +
3352 " <plugin-config section=\"'admin.config'\">\n" +
3353 " </plugin-config>\n" +
3190 " <div class=\"panel-body\" id=\"view-breakdown-container\">\n" +
3191 " <p ng-if=\"$ctrl.loading.requestsBreakdown!=false\" class=\"text-center\">\n" +
3192 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
3193 " </p>\n" +
3194 "\n" +
3195 " <div class=\"report-list\">\n" +
3196 " <div ng-if=\"$ctrl.loading.requestsBreakdown==false\" ng-repeat=\"view in $ctrl.requestsBreakdown\">\n" +
3197 " <div class=\"view-info\">\n" +
3198 " <div class=\"view-name\">\n" +
3199 " <div class=\"bar\" style=\"width: {{view.percentage}}%\">\n" +
3354 3200 " </div>\n" +
3355 "</div>\n"
3356 );
3357
3358
3359 $templateCache.put('templates/admin/configs/parent_view.html',
3360 "<div ui-view></div>"
3361 );
3362
3363
3364 $templateCache.put('templates/admin/groups/groups_create.html',
3365 "<ng-include src=\"'templates/loader.html'\" ng-if=\"group.loading.group\"></ng-include>\n" +
3201 " </div>\n" +
3202 " <strong ng-if=\"view.latest_details.length\">\n" +
3203 " <a data-ui-sref=\"report.list_slow({view_name:view.view_name})\">{{view.view_name}}</a></strong>\n" +
3204 " <strong ng-if=\"!view.latest_details.length\">{{view.view_name}}</strong>\n" +
3366 3205 "\n" +
3367 "<div ng-show=\"!group.loading.group\">\n" +
3206 " <div class=\"stats\">\n" +
3207 " <small>\n" +
3208 " avg. response <strong>{{view.avg_response}}s</strong> in\n" +
3209 " <span class=\"requests\"\n" +
3210 " data-uib-tooltip=\"Requests\"><strong>{{view.requests|numberToThousands}}</strong> requests</span>\n" +
3368 3211 "\n" +
3369 " <div class=\"panel panel-default\">\n" +
3370 " <div class=\"panel-body\">\n" +
3371 " <form name=\"group.groupForm\" class=\"form-horizontal\" ng-submit=\"group.createGroup()\">\n" +
3372 " <div class=\"form-group\" id=\"row-group_name\">\n" +
3373 " <data-form-errors errors=\"group.groupForm.ae_validation.group_name\"></data-form-errors>\n" +
3374 " <label for=\"group_name\" id=\"label-group_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3375 " Group name\n" +
3376 " <span class=\"required\">*</span>\n" +
3377 " </label>\n" +
3378 " <div class=\"col-sm-8 col-lg-9\">\n" +
3379 " <input class=\"form-control\" id=\"group_name\" name=\"group_name\" type=\"text\" ng-model=\"group.group.group_name\">\n" +
3212 " <span ng-if=\"view.latest_details\">\n" +
3213 " &nbsp;&nbsp; Latest reports:\n" +
3214 " <a ng-repeat=\"d in view.latest_details\" target=\"_blank\" ui-sref=\"report.view_detail({groupId:d.group_id, reportId:d.report_id})\"> <strong>{{$index+1}}</strong></a>\n" +
3215 " </span>\n" +
3216 " </small>\n" +
3380 3217 " </div>\n" +
3218 "\n" +
3381 3219 " </div>\n" +
3382 3220 "\n" +
3383 " <div class=\"form-group\" id=\"row-description\">\n" +
3384 " <data-form-errors errors=\"group.groupForm.ae_validation.description\"></data-form-errors>\n" +
3385 " <label for=\"description\" id=\"label-description\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3386 " Description\n" +
3387 " <span class=\"required\">*</span>\n" +
3388 " </label>\n" +
3389 " <div class=\"col-sm-8 col-lg-9\">\n" +
3390 " <input class=\"form-control\" id=\"description\" name=\"description\" type=\"text\" ng-model=\"group.group.description\">\n" +
3391 3221 " </div>\n" +
3392 3222 " </div>\n" +
3393 3223 "\n" +
3394 3224 "\n" +
3395 " <div class=\"form-group\" id=\"row-submit\">\n" +
3396 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3397 " </label>\n" +
3398 " <div class=\"col-sm-8 col-lg-9\">\n" +
3399 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"{{$state.params.groupId ? 'Update' : 'Add'}} Group\">\n" +
3400 3225 " </div>\n" +
3401 3226 " </div>\n" +
3402 " </form>\n" +
3227 "\n" +
3403 3228 " </div>\n" +
3229 "\n" +
3404 3230 " </div>\n" +
3405 3231 "\n" +
3232 " <div class=\"row\">\n" +
3233 " <div class=\"col-sm-6\">\n" +
3406 3234 "\n" +
3407 " <div class=\"panel panel-default\" ng-if=\"group.group.id\">\n" +
3235 " <div class=\"panel panel-default\">\n" +
3408 3236 " <div class=\"panel-heading\">\n" +
3409 " <h3 class=\"panel-title\">Permissions summary</h3>\n" +
3237 " <h3 class=\"panel-title\">\n" +
3238 " <span class=\"fa fa-exclamation-triangle\"></span> Report groups trending over {{ $ctrl.timeSpan.label }}\n" +
3239 " </h3>\n" +
3410 3240 " </div>\n" +
3411 3241 " <div class=\"panel-body\">\n" +
3412 " <h3>Direct application permissions</h3>\n" +
3242 " <p ng-if=\"$ctrl.loading.reports != false\" class=\"text-center\">\n" +
3243 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
3244 " </p>\n" +
3413 3245 "\n" +
3414 " <ul class=\"list-group\">\n" +
3415 " <li ng-repeat=\"perm in group.resourcePermissions.group.application\" class=\"animate-repeat list-group-item\">\n" +
3416 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3417 "\n" +
3418 " <div class=\"pull-right\">\n" +
3419 "\n" +
3420 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
3246 " <p ng-if=\"$ctrl.trendingReports.length == 0 && $ctrl.loading.reports == false\">\n" +
3247 " No reports found\n" +
3248 " </p>\n" +
3421 3249 "\n" +
3422 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Application\" data-ui-sref=\"applications.update({resourceId:perm.self.resource_id})\">\n" +
3423 " <span class=\"fa fa-cog\"></span>\n" +
3424 " </a>\n" +
3250 " <div small-report-group-list groups=\"$ctrl.trendingReports\" applications=\"$ctrl.applications\" ng-if=\"$ctrl.loading.reports==false\"></div>\n" +
3425 3251 " </div>\n" +
3426 " </li>\n" +
3427 " </ul>\n" +
3428 "\n" +
3429 " <h3>Direct dashboard permissions</h3>\n" +
3430 "\n" +
3431 " <ul class=\"list-group\">\n" +
3432 " <li ng-repeat=\"perm in group.resourcePermissions.group.dashboard\" class=\"animate-repeat list-group-item\">\n" +
3433 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3434 "\n" +
3435 " <div class=\"pull-right\">\n" +
3436 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
3437 "\n" +
3438 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Dashboard\" data-ui-sref=\"dashboard.update({resourceId:perm.self.resource_id})\">\n" +
3439 " <span class=\"fa fa-cog\"></span>\n" +
3440 " </a>\n" +
3441 3252 " </div>\n" +
3442 " </li>\n" +
3443 " </ul>\n" +
3444 3253 "\n" +
3445 3254 " </div>\n" +
3446 3255 "\n" +
3447 " </div>\n" +
3256 " <div class=\"col-sm-6\">\n" +
3448 3257 "\n" +
3449 3258 "\n" +
3450 " <div class=\"panel panel-default\" ng-if=\"group.group.id\">\n" +
3259 " <div class=\"panel panel-default\">\n" +
3451 3260 " <div class=\"panel-heading\">\n" +
3452 " <h3 class=\"panel-title\">User list</h3>\n" +
3261 " <h3 class=\"panel-title\">\n" +
3262 " Most common slow calls over {{ $ctrl.timeSpan.label }}\n" +
3263 " </h3>\n" +
3453 3264 " </div>\n" +
3454 3265 " <div class=\"panel-body\">\n" +
3455 3266 "\n" +
3456 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"group.addUser()\">\n" +
3457 " <div class=\"form-group\">\n" +
3458 " <input placeholder=\"Username or email\" type=\"text\" class=\"autocomplete form-control\" ng-model=\"group.form.autocompleteUser\" uib-typeahead=\"u for u in group.searchUsers($viewValue) | limitTo:8\" typeahead-loading=\"searchingUsers\" typeahead-wait-ms=\"250\"/>\n" +
3459 " </div>\n" +
3460 " <div class=\"form-group\">\n" +
3461 " <button class=\"btn btn-info\" ng-disabled=\"!group.form.autocompleteUser\"><span class=\"fa fa-user\"></span> Add user</button>\n" +
3462 " </div>\n" +
3463 " </form>\n" +
3464 "\n" +
3267 " <div ng-if=\"$ctrl.loading.slowCalls!=false\" class=\"text-center\">\n" +
3268 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
3465 3269 " </div>\n" +
3466 3270 "\n" +
3467 " <table st-table=\"displayedCollection\" st-safe-src=\"group.users\" class=\"table table-striped\">\n" +
3468 " <thead>\n" +
3469 " <tr>\n" +
3470 " <th st-sort=\"user_name\"><a>Username</a></th>\n" +
3471 " <th st-sort=\"email\"><a>Email</a></th>\n" +
3472 " <th st-sort=\"status\"><a>Status</a></th>\n" +
3473 " <th st-sort=\"first_name\"><a>First Name</a></th>\n" +
3474 " <th st-sort=\"last_name\"><a>Last Name</a></th>\n" +
3475 " <th st-sort=\"last_login_date\"><a>Last login</a></th>\n" +
3476 " <th class=\"options\" style=\"width: 130px\"></th>\n" +
3477 " </tr>\n" +
3478 " <tr>\n" +
3479 " <th><input st-search=\"user_name\" placeholder=\"search for user name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3480 " <th><input st-search=\"email\" placeholder=\"search for email\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3481 " <th></th>\n" +
3482 " <th><input st-search=\"first_name\" placeholder=\"search for first name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3483 " <th><input st-search=\"last_name\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3484 " <th><input st-search=\"last_login_date\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3485 " <th></th>\n" +
3486 " </tr>\n" +
3487 " </thead>\n" +
3271 " <table id=\"slow-statements\" ng-if=\"$ctrl.loading.slowCalls==false\">\n" +
3488 3272 " <tbody>\n" +
3489 "\n" +
3490 " <tr ng-repeat=\"user in displayedCollection\">\n" +
3491 " <td><img src=\"{{user.gravatar_url}}\" class=\"avatar\"> {{user.user_name}}</td>\n" +
3492 " <td>{{user.email}}</td>\n" +
3493 " <td class=\"text-center\"><span class=\"fa\" ng-class=\"{'fa-check-circle':user.status, 'fa-times':!user.status}\"></span></td>\n" +
3494 " <td>{{user.first_name}}</td>\n" +
3495 " <td>{{user.last_name}}</td>\n" +
3496 " <td><span data-uib-tooltip=\"{{user.last_login_date}}\">{{user.last_login_date | isoToRelativeTime}}</span></td>\n" +
3497 " <td>\n" +
3498 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"admin.user.update({userId:user.id})\"><span class=\"fa fa-cog\"></span></a>\n" +
3499 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
3500 " <a class=\"btn btn-danger btn-sm\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3501 " <ul class=\"dropdown-menu\">\n" +
3502 " <li><a>No</a></li>\n" +
3503 " <li><a ng-click=\"group.removeUser(user)\">Yes</a></li>\n" +
3504 " </ul>\n" +
3273 " <tr ng-repeat=\"call in $ctrl.slowCalls\">\n" +
3274 " <td class=\"occurences\">\n" +
3275 " <span class=\"occurences\" data-uib-tooltip=\"Occurences\">{{call.occurences|numberToThousands}}</span>\n" +
3276 " </td>\n" +
3277 " <td class=\"ellipsis\">\n" +
3278 " <small title=\"{{call.statement}}\" class=\"statement\">{{call.statement}}</small>\n" +
3279 " <br/>\n" +
3280 " <span class=\"type\">{{call.statement_type}}</span>\n" +
3281 " <span class=\"subtype\">{{call.statement_subtype}}</span>\n" +
3282 " <span class=\"duration\" data-uib-tooltip=\"Average duration\">{{call.total_duration/call.occurences|round:2}}s</span>\n" +
3283 " <span class=\"report-list\">\n" +
3284 " Latest reports:\n" +
3285 " <a ng-repeat=\"d in call.latest_details\" target=\"_blank\" ui-sref=\"report.view_detail({groupId:d.group_id, reportId:d.report_id})\"> <strong>{{$index+1}}</strong> </a>\n" +
3505 3286 " </span>\n" +
3506 " </tr>\n" +
3507 " <tfoot>\n" +
3508 " <tr>\n" +
3509 " <td colspan=\"7\" class=\"text-center\">\n" +
3510 " <div st-pagination=\"\" st-items-by-page=\"50\" st-displayed-pages=\"7\"></div>\n" +
3511 3287 " </td>\n" +
3512 3288 " </tr>\n" +
3513 " </tfoot>\n" +
3514 3289 " </tbody>\n" +
3515 3290 " </table>\n" +
3516 3291 "\n" +
3292 "\n" +
3293 " </div>\n" +
3517 3294 " </div>\n" +
3518 3295 "\n" +
3519 3296 "\n" +
3297 " </div>\n" +
3298 "\n" +
3299 " </div>\n" +
3300 " </div>\n" +
3301 " </div>\n" +
3520 3302 "</div>\n"
3521 3303 );
3522 3304
3523 3305
3524 $templateCache.put('templates/admin/groups/groups_list.html',
3525 "<ng-include src=\"'templates/loader.html'\" ng-if=\"groups.loading.groups\"></ng-include>\n" +
3306 $templateCache.put('directives/permissions/permissions.html',
3307 "<div class=\"panel panel-default\">\n" +
3308 " <div class=\"panel-heading\">\n" +
3309 " <h3 class=\"panel-title\">Permissions</h3>\n" +
3310 " </div>\n" +
3311 " <div class=\"panel-body\">\n" +
3312 " <p>Here you can <strong>set permissions</strong> for others to access your app data.</p>\n" +
3526 3313 "\n" +
3527 "<div class=\"panel panel-default\" ng-show=\"!groups.loading.groups\">\n" +
3314 " <p>For example you can let other staff member view or alter error reports.</p>\n" +
3528 3315 "\n" +
3529 " <table st-table=\"displayedCollection\" st-safe-src=\"groups.groups\" class=\"table table-striped\">\n" +
3530 " <thead>\n" +
3531 " <tr>\n" +
3532 " <th st-sort=\"group_name\"><a>Group name</a></th>\n" +
3533 " <th st-sort=\"description\"><a>Description</a></th>\n" +
3534 " <th st-sort=\"members\"><a>Member count</a></th>\n" +
3535 " <th class=\"options\"></th>\n" +
3536 " </tr>\n" +
3537 " <tr>\n" +
3538 " <th><input st-search=\"group_name\" placeholder=\"search for group name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3539 " <th><input st-search=\"description\" placeholder=\"search for description\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3540 " <th></th>\n" +
3541 " <th></th>\n" +
3542 " </tr>\n" +
3543 " </thead>\n" +
3544 " <tbody>\n" +
3316 " <div ng-if=\"permissions.possibleGroups.length > 0\">\n" +
3317 " <h3>Group permissions</h3>\n" +
3545 3318 "\n" +
3546 " <tr ng-repeat=\"group in displayedCollection track by group.id\">\n" +
3547 " <td>{{group.group_name}}</td>\n" +
3548 " <td>{{group.description}}</td>\n" +
3549 " <td>{{group.member_count}}</td>\n" +
3550 " <td>\n" +
3551 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"admin.group.update({groupId:group.id})\"><span class=\"fa fa-cog\"></span></a>\n" +
3552 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
3553 " <a class=\"btn btn-danger btn-sm\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3319 " <ul class=\"list-group\">\n" +
3320 " <li ng-repeat=\"perm in permissions.currentPermissions.group\" class=\"animate-repeat list-group-item\">\n" +
3321 " <strong>{{ perm.self.group_name }}</strong>\n" +
3322 " <div ng-repeat=\"perm_name in perm.permissions\" class=\"pull-right animate-repeat m-l-1\">\n" +
3323 " <span ng-if=\"perm_name == '__all_permissions__'\">Resource owner</span>\n" +
3324 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"perm_name != '__all_permissions__'\">\n" +
3325 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> {{ perm_name }}</a>\n" +
3554 3326 " <ul class=\"dropdown-menu\">\n" +
3555 3327 " <li><a>No</a></li>\n" +
3556 " <li><a ng-click=\"groups.removeGroup(group)\">Yes</a></li>\n" +
3328 " <li><a ng-click=\"permissions.removeGroupPermission(perm_name, perm)\">Yes</a></li>\n" +
3557 3329 " </ul>\n" +
3558 3330 " </span>\n" +
3559 " </tr>\n" +
3560 " <tfoot>\n" +
3561 " <tr>\n" +
3562 " <td colspan=\"4\" class=\"text-center\">\n" +
3563 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
3564 " </td>\n" +
3565 " </tr>\n" +
3566 " </tfoot>\n" +
3567 " </tbody>\n" +
3568 " </table>\n" +
3569 "\n" +
3570 3331 " </div>\n" +
3571 "\n"
3572 );
3573
3574
3575 $templateCache.put('templates/admin/groups/parent_view.html',
3576 "<div ui-view></div>"
3577 );
3578
3579
3580 $templateCache.put('templates/admin/parent_view.html',
3581 "<div class=\"col-sm-3\" id=\"menu\">\n" +
3582 " <div class=\"panel panel-default\">\n" +
3583 " <div class=\"panel-heading\">Users and groups</div>\n" +
3584 " <ul class=\"list-group\">\n" +
3585 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.user.list\"> Users</a></li>\n" +
3586 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.user.create\"> Create user</a></li>\n" +
3587 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.group.list\"> Groups</a></li>\n" +
3588 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.group.create\"> Create group</a></li>\n" +
3332 " </li>\n" +
3589 3333 " </ul>\n" +
3334 "\n" +
3335 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"permissions.setGroupPermission()\">\n" +
3336 " <div class=\"form-group\">\n" +
3337 " <select class=\"form-control\" ng-model=\"permissions.form.selectedGroup\" ng-options=\"g.id as g.group_name for g in permissions.possibleGroups\"></select>\n" +
3590 3338 " </div>\n" +
3591 " <div class=\"panel panel-default\">\n" +
3592 " <div class=\"panel-heading\">Resources</div>\n" +
3593 " <ul class=\"list-group\">\n" +
3594 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.application.list\"> List applications</a></li>\n" +
3595 " </ul>\n" +
3339 " <div class=\"form-group\">\n" +
3340 " <span ng-repeat=\"permission in permissions.possiblePermissions\">\n" +
3341 " <input type=\"checkbox\" ng-model=\"permissions.form.selectedGroupPermissions[permission]\"> {{ permission }}\n" +
3342 " </span>\n" +
3343 " </div>\n" +
3344 " <div class=\"form-group\">\n" +
3345 " <button class=\"btn btn-info\"><span class=\"fa fa-user\"></span> Give permission</button>\n" +
3346 " </div>\n" +
3347 " </form>\n" +
3348 "\n" +
3596 3349 " </div>\n" +
3597 3350 "\n" +
3598 " <div class=\"panel panel-default\">\n" +
3599 " <div class=\"panel-heading\">System</div>\n" +
3351 " <h3>User permissions</h3>\n" +
3352 " <div>\n" +
3600 3353 " <ul class=\"list-group\">\n" +
3601 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.configs.list\"> Config variables</a></li>\n" +
3602 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.system\"> System</a></li>\n" +
3603 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.partitions\"> Partition Management</a></li>\n" +
3354 " <li ng-repeat=\"perm in permissions.currentPermissions.user\" class=\"animate-repeat list-group-item\">\n" +
3355 " <strong>{{ perm.self.user_name }}</strong>\n" +
3356 " <div ng-repeat=\"perm_name in perm.permissions\" class=\"pull-right animate-repeat m-l-1\">\n" +
3357 " <span ng-if=\"perm_name == '__all_permissions__'\">Resource owner</span>\n" +
3358 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"perm_name != '__all_permissions__'\">\n" +
3359 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> {{ perm_name }}</a>\n" +
3360 " <ul class=\"dropdown-menu\">\n" +
3361 " <li><a>No</a></li>\n" +
3362 " <li><a ng-click=\"permissions.removeUserPermission(perm_name,perm)\">Yes</a></li>\n" +
3604 3363 " </ul>\n" +
3364 " </span>\n" +
3605 3365 " </div>\n" +
3366 " </li>\n" +
3367 " </ul>\n" +
3606 3368 " </div>\n" +
3369 " <div>\n" +
3370 " <p>First enter username or full email of person you want to give access to (the person needs to be <strong>already registered in AppEnlight</strong>)</p>\n" +
3607 3371 "\n" +
3608 "\n" +
3609 "<div class=\"col-sm-9\" ui-view></div>\n"
3372 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"permissions.setUserPermission()\">\n" +
3373 " <div class=\"form-group\">\n" +
3374 " <input type=\"text\" class=\"autocomplete form-control\" placeholder=\"Search for user/email\" ng-model=\"permissions.form.autocompleteUser\"\n" +
3375 " uib-typeahead=\"u.user for u in permissions.searchUsers($viewValue) | limitTo:8\" typeahead-loading=\"permissions.searchingUsers\" typeahead-wait-ms=\"250\"\n" +
3376 " typeahead-template-url=\"templates/directives/user_search_type_ahead.html\"\n" +
3377 " />\n" +
3378 " </div>\n" +
3379 " <div class=\"form-group\">\n" +
3380 " <span ng-repeat=\"permission in permissions.possiblePermissions\">\n" +
3381 " <input type=\"checkbox\" ng-model=\"permissions.form.selectedUserPermissions[permission]\"> {{ permission }}\n" +
3382 " </span>\n" +
3383 " </div>\n" +
3384 " <div class=\"form-group\">\n" +
3385 " <button class=\"btn btn-info\" ng-disabled=\"!permissions.form.autocompleteUser\"><span class=\"fa fa-user\"></span> Give permission</button>\n" +
3386 " </div>\n" +
3387 " </form>\n" +
3388 " </div>\n" +
3389 " </div>\n" +
3390 "</div>\n"
3610 3391 );
3611 3392
3612 3393
3613 $templateCache.put('templates/admin/partitions.html',
3614 "<ng-include src=\"'templates/loader.html'\" ng-if=\"partitions.loading.partitions\"></ng-include>\n" +
3615 "\n" +
3616 "<div ng-show=\"!partitions.loading.partitions\">\n" +
3617 "\n" +
3618 " <div class=\"panel panel-default\">\n" +
3619 " <div class=\"panel-heading\">\n" +
3620 " DELETE Daily Partitions\n" +
3621 " </div>\n" +
3622 "\n" +
3623 " <form name=\"partitions.dailyPartitionsForm\"\n" +
3624 " novalidate ng-submit=\"partitions.partitionsDelete('dailyPartitions')\"\n" +
3625 " class=\"form-inline\"\n" +
3626 " ng-class=\"{'has-error':partitions.dailyPartitionsForm.$invalid}\">\n" +
3394 $templateCache.put('directives/plugin_config/plugin_config.html',
3395 "<div ng-repeat=\"tmpl in plugin_ctrlr.inclusions track by $index\">\n" +
3396 " <div><strong>Plugin: {{tmpl.name}}</strong></div>\n" +
3397 " <ng-include src=\"tmpl.template\"></ng-include>\n" +
3398 " <hr/>\n" +
3399 "</div>\n"
3400 );
3401
3402
3403 $templateCache.put('directives/postprocess_action/postprocess_action.html',
3404 "<div class=\"panel panel-default action\">\n" +
3405 " <div class=\"panel-body form-inline\">\n" +
3406 " <div class=\"pull-right\">\n" +
3407 " <span class=\"dropdown\" data-uib-dropdown>\n" +
3408 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3409 " <ul class=\"dropdown-menu\">\n" +
3410 " <li><a>No</a></li>\n" +
3411 " <li><a ng-click=\"ctrl.deleteAction(ctrl.action)\">Yes</a></li>\n" +
3412 " </ul>\n" +
3413 " </span>\n" +
3414 " </div>\n" +
3627 3415 "\n" +
3628 " <div class=\"panel-body\">\n" +
3416 " <div class=\"form-group\">\n" +
3417 " <label>Action</label>\n" +
3629 3418 "\n" +
3630 " <input type=\"text\" name=\"confirm\"\n" +
3631 " placeholder=\"Enter CONFIRM to proceed\" class=\"form-control input-autosize\" confirm-validate required ng-model=\"partitions.dailyConfirm\">\n" +
3632 " <input type=\"submit\" class=\"btn btn-danger\" ng-disabled=\"partitions.dailyPartitionsForm.$invalid\">\n" +
3633 " <input type=\"checkbox\" ng-model=\"partitions.dailyChecked\" ng-change=\"partitions.setCheckedList('dailyPartitions')\"> Check All\n" +
3419 " <div class=\"form-group\">\n" +
3420 " <select class=\"form-control\" ng-model=\"ctrl.action.new_value\" ng-options=\"f[0] as f[1] for f in ctrl.possibleActions\" ng-change=\"ctrl.setDirty()\"></select>\n" +
3421 " </div>\n" +
3422 "\n" +
3423 " <a class=\"btn btn-success\" ng-if=\"ctrl.action.dirty\" ng-click=\"ctrl.saveAction()\"><span class=\"fa fa-save\"></span> &nbsp;Save changes</a>\n" +
3634 3424 "\n" +
3635 3425 " </div>\n" +
3426 " <hr/>\n" +
3427 " <p>Meeting following criteria:</p>\n" +
3428 " <form-errors errors=\"ctrl.errors\"></form-errors>\n" +
3429 " {{ctrl.rule}}\n" +
3430 " <rule rule=\"ctrl.action.rule\" rule-definitions=\"ctrl.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"ctrl.action\"></rule>\n" +
3431 " </div>\n" +
3432 "</div>\n"
3433 );
3434
3435
3436 $templateCache.put('directives/report_alert_action/report_alert_action.html',
3437 "<div class=\"panel panel-default action\">\n" +
3438 " <div class=\"panel-body form-inline\">\n" +
3439 " <div class=\"pull-right\">\n" +
3440 " <span class=\"dropdown\" data-uib-dropdown>\n" +
3441 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3442 " <ul class=\"dropdown-menu\">\n" +
3443 " <li><a>No</a></li>\n" +
3444 " <li><a ng-click=\"ctrl.deleteAction(ctrl.actions, ctrl.action)\">Yes</a></li>\n" +
3445 " </ul>\n" +
3446 " </span>\n" +
3447 " </div>\n" +
3636 3448 "\n" +
3637 " <table class=\"table table-striped\">\n" +
3638 " <tr>\n" +
3639 " <th class=\"c1 date\">Date</th>\n" +
3640 " <th class=\"c2 indices\">Indices</th>\n" +
3641 " </tr>\n" +
3642 " <tr class=\"r{{$index}}\" ng-repeat=\"row in partitions.dailyPartitions\">\n" +
3643 " <td class=\"c1\">{{row[0]}}</td>\n" +
3644 " <td class=\"c2\">\n" +
3449 " <div class=\"form-group\">\n" +
3450 " <label>Applies to</label>\n" +
3451 " <select class=\"form-control\" ng-model=\"ctrl.action.resource_id\" ng-options=\"f.resource_id as f.resource_name for f in ctrl.applications\" ng-change=\"ctrl.setDirty()\">\n" +
3452 " <option value=\"\">All Resources</option>\n" +
3453 " </select>\n" +
3454 " </div>\n" +
3455 " <div class=\"form-group\">\n" +
3456 " <label>Notify</label>\n" +
3457 " <select class=\"form-control\" ng-model=\"ctrl.action.action\" ng-change=\"ctrl.setDirty()\" ng-options=\"f[0] as f[1] for f in ctrl.possibleNotifications\"></select>\n" +
3458 "\n" +
3459 " <a class=\"btn btn-success\" ng-if=\"ctrl.action.dirty\" ng-click=\"ctrl.saveAction()\"><span class=\"fa fa-save\"></span> &nbsp;Save changes</a>\n" +
3460 "\n" +
3461 " </div>\n" +
3462 " <div>\n" +
3463 " <p><strong>Channels:</strong></p>\n" +
3645 3464 " <ul class=\"list-group\">\n" +
3646 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].elasticsearch\">\n" +
3647 " <input name=\"es_index\" type=\"checkbox\" ng-model=\"partition.checked\"> ES: {{partition.name}}\n" +
3648 " </li>\n" +
3649 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].pg\">\n" +
3650 " <input name=\"pg_index\" type=\"checkbox\" ng-model=\"partition.checked\"> PG: {{partition.name}}\n" +
3465 " <li class=\"list-group-item\" ng-repeat=\"channel in ctrl.action.channels\">\n" +
3466 " <strong>{{channel.channel_visible_value}}</strong>\n" +
3467 " <div class=\"pull-right\">\n" +
3468 " <span class=\"dropdown\" data-uib-dropdown>\n" +
3469 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3470 " <ul class=\"dropdown-menu\">\n" +
3471 " <li><a>No</a></li>\n" +
3472 " <li><a ng-click=\"ctrl.unBindChannel(channel)\">Yes</a></li>\n" +
3473 " </ul>\n" +
3474 " </span>\n" +
3475 " </div>\n" +
3651 3476 " </li>\n" +
3652 3477 " </ul>\n" +
3653 " </td>\n" +
3654 " </tr>\n" +
3655 " </table>\n" +
3656 " </form>\n" +
3657 "\n" +
3478 " <div class=\"form-group\" ng-if=\"ctrl.possibleChannels.length\">\n" +
3479 " <select class=\"form-control\" ng-model=\"ctrl.channelToBind\" ng-options=\"c as c.channel_visible_value for c in ctrl.possibleChannels |filter: c.supports_report_alerting\"></select>\n" +
3480 " <a class=\"btn btn-info\" ng-click=\"ctrl.bindChannel(channel, ctrl.action)\"><span class=\"fa fa-plus-circle\"></span> Add Channel</a>\n" +
3481 " </div>\n" +
3482 " <div class=\"alert alert-danger\" ng-if=\"!ctrl.possibleChannels.length\">\n" +
3483 " <span class=\"fa fa-exclamation-triangle \"></span>You need to create an alert channel before you can assign it to your rule.\n" +
3658 3484 " </div>\n" +
3659 3485 "\n" +
3660 " <div class=\"panel panel-default\">\n" +
3661 " <div class=\"panel-heading\">\n" +
3662 " DELETE Permanent Partitions\n" +
3663 3486 " </div>\n" +
3487 " <hr/>\n" +
3488 " <p>Meeting following criteria:</p>\n" +
3489 " <form-errors errors=\"ctrl.errors\"></form-errors>\n" +
3490 " <rule rule=\"ctrl.action.rule\" rule-definitions=\"ctrl.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"ctrl.action\"></rule>\n" +
3491 " </div>\n" +
3492 "</div>\n"
3493 );
3494
3495
3496 $templateCache.put('directives/rule_read_only/rule_read_only.html',
3497 "<div class=\"rule-read-only\">\n" +
3664 3498 "\n" +
3665 " <form name=\"partitions.permanentPartitionsForm\" novalidate\n" +
3666 " ng-submit=\"partitions.partitionsDelete('permanentPartitions')\"\n" +
3667 " class=\"form-inline\"\n" +
3668 " ng-class=\"{'has-error':partitions.permanentPartitionsForm.$invalid}\">\n" +
3499 " <span class=\"form-group\">\n" +
3500 " {{rule_ctrlr.readOnlyPossibleFields[rule_ctrlr.rule.field]}}\n" +
3501 " </span>\n" +
3669 3502 "\n" +
3503 " <span ng-if=\"rule_ctrlr.rule.field != '__AND__' && rule_ctrlr.rule.field !='__OR__' && rule_ctrlr.rule.field !='__NOT__'\">\n" +
3504 " is {{rule_ctrlr.ruleDefinitions.allOps[rule_ctrlr.rule.op]}} {{rule_ctrlr.rule.value}}\n" +
3505 " </span>\n" +
3670 3506 "\n" +
3671 " <div class=\"panel-body\">\n" +
3507 " <span ng-if=\"rule_ctrlr.rule.field == '__AND__' || rule_ctrlr.rule.field =='__OR__' || rule_ctrlr.rule.field =='__NOT__'\">\n" +
3508 " <p ng-if=\"parent\"><strong>Subrules</strong></p>\n" +
3509 " <div ng-repeat=\"subrule in rule_ctrlr.rule.rules\" class=\"m-l-2\">\n" +
3672 3510 "\n" +
3673 " <div class=\"form-group\">\n" +
3674 " <input type=\"text\" name=\"confirm\"\n" +
3675 " placeholder=\"Enter CONFIRM to proceed\" class=\"form-control\" confirm-validate required ng-model=\"partitions.permConfirm\">\n" +
3676 " <input type=\"submit\" class=\"btn btn-danger\" ng-disabled=\"partitions.permanentPartitionsForm.$invalid\">\n" +
3677 " <input type=\"checkbox\" ng-model=\"partitions.permChecked\" ng-change=\"partitions.setCheckedList('permanentPartitions')\"> Check All\n" +
3511 " <div class=\"panel panel-default\">\n" +
3512 " <div class=\"panel-body form-inline\">\n" +
3513 " <recursive>\n" +
3514 " <rule-read-only rule=\"subrule\" rule-definitions=\"rule_ctrlr.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"rule_ctrlr.parentObj\"></rule-read-only>\n" +
3515 " </recursive>\n" +
3678 3516 " </div>\n" +
3679 "\n" +
3680 3517 " </div>\n" +
3681 "\n" +
3682 " <table class=\"table table-striped\">\n" +
3683 " <tr>\n" +
3684 " <th class=\"c1 date\">Date</th>\n" +
3685 " <th class=\"c2 indices\">Indices</th>\n" +
3686 " </tr>\n" +
3687 " <tr class=\"r{{$index}}\" ng-repeat=\"row in partitions.permanentPartitions\">\n" +
3688 " <td class=\"c1\">{{row[0]}}</td>\n" +
3689 " <td class=\"c2\">\n" +
3690 " <ul class=\"list-group\">\n" +
3691 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].elasticsearch\">\n" +
3692 " <input name=\"es_index\" type=\"checkbox\" ng-model=\"partition.checked\"> ES: {{partition.name}}\n" +
3693 " </li>\n" +
3694 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].pg\">\n" +
3695 " <input name=\"pg_index\" type=\"checkbox\" ng-model=\"partition.checked\"> PG: {{partition.name}}\n" +
3696 " </li>\n" +
3697 " </ul>\n" +
3698 " </td>\n" +
3699 " </tr>\n" +
3700 " </table>\n" +
3701 " </form>\n" +
3702 "\n" +
3703 3518 " </div>\n" +
3704 3519 "\n" +
3520 " </span>\n" +
3705 3521 "</div>\n"
3706 3522 );
3707 3523
3708 3524
3709 $templateCache.put('templates/admin/system.html',
3710 "<ng-include src=\"'templates/loader.html'\" ng-if=\"system.loading.system\"></ng-include>\n" +
3525 $templateCache.put('directives/rule/rule.html',
3526 "<div class=\"rule form-inline\">\n" +
3711 3527 "\n" +
3712 "<div ng-if=\"system.loading.system == false\">\n" +
3713 " <div class=\"row\">\n" +
3714 " <div class=\"col-sm-12\">\n" +
3715 " <div class=\"panel panel-default\">\n" +
3716 " <div class=\"panel-heading\">\n" +
3717 " <h3 class=\"panel-title\">\n" +
3718 " System Info\n" +
3719 " </h3>\n" +
3528 " <div class=\"form-group\">\n" +
3529 " <select class=\"form-control\"\n" +
3530 " ng-model=\"rule_ctrlr.rule.field\"\n" +
3531 " ng-change=\"rule_ctrlr.fieldChange()\"\n" +
3532 " ng-options=\"key as label for (key, label) in rule_ctrlr.ruleDefinitions.possibleFields\"></select>\n" +
3720 3533 " </div>\n" +
3721 " <div class=\"panel-body\">\n" +
3722 3534 "\n" +
3723 " <p><strong>System Load:</strong>\n" +
3724 " 1min: {{system.systemLoad[0]}}, 5min: {{system.systemLoad[1]}}, 15min: {{system.systemLoad[2]}}\n" +
3725 " </p>\n" +
3726 " <p><strong>Awaiting tasks:</strong>\n" +
3727 " <ul>\n" +
3728 " <li>reports: {{system.queueStats.waiting_reports}}</li>\n" +
3729 " <li>logs: {{system.queueStats.waiting_logs}}</li>\n" +
3730 " <li>metrics: {{system.queueStats.waiting_metrics}}</li>\n" +
3731 " <li>other: {{system.queueStats.waiting_other}}</li>\n" +
3732 " </ul>\n" +
3733 " </p>\n" +
3734 " <p><strong>Queue stats from last minute:</strong>\n" +
3735 " <ul>\n" +
3736 " <li>Processed reports: {{system.queueStats.processed_reports}}</li>\n" +
3737 " <li>Processed logs: {{system.queueStats.processed_logs}}</li>\n" +
3738 " <li>Processed metrics: {{system.queueStats.processed_metrics}}</li>\n" +
3739 " </ul>\n" +
3740 " </p>\n" +
3535 " <div ng-if=\"rule_ctrlr.rule.field != '__AND__' && rule_ctrlr.rule.field !='__OR__' && rule_ctrlr.rule.field !='__NOT__'\" class=\"form-group\">\n" +
3741 3536 "\n" +
3742 " <p><strong>Disks:</strong>\n" +
3743 " <ul>\n" +
3744 " <li ng-repeat=\"disk in system.disks\">\n" +
3745 " <strong>{{disk.device}}</strong> {{disk.free}}/{{disk.total}}, {{disk.percentage}}% used\n" +
3746 " </li>\n" +
3747 " </ul>\n" +
3748 " </p>\n" +
3537 " <select ng-model=\"rule_ctrlr.rule.op\" class=\"form-control\"\n" +
3538 " ng-change=\"rule_ctrlr.setDirty()\"\n" +
3539 " ng-options=\"op as rule_ctrlr.ruleDefinitions.allOps[op] for op in rule_ctrlr.ruleDefinitions.fieldOps[rule_ctrlr.rule.field]\">\n" +
3540 " </select>\n" +
3749 3541 "\n" +
3750 " <p><strong>Process stats:</strong>\n" +
3751 " <ul>\n" +
3752 " <li>FD soft limits: {{system.selfInfo.fds.soft}}</li>\n" +
3753 " <li>FD hard limits: {{system.selfInfo.fds.hard}}</li>\n" +
3754 " <li>Memlock soft limits: {{system.selfInfo.memlock.soft}}</li>\n" +
3755 " <li>Memlock hard limits: {{system.selfInfo.memlock.hard}}</li>\n" +
3756 " </ul>\n" +
3757 " </p>\n" +
3542 " <input type=\"text\" placeholder=\"Value\" ng-model=\"rule_ctrlr.rule.value\" ng-change=\"rule_ctrlr.setDirty()\" class=\"form-control\">\n" +
3758 3543 "\n" +
3759 3544 " </div>\n" +
3545 "\n" +
3546 " <span ng-if=\"rule_ctrlr.rule.field == '__AND__' || rule_ctrlr.rule.field =='__OR__' || rule_ctrlr.rule.field =='__NOT__'\">\n" +
3547 " <p ng-if=\"parent\"><strong>Subrules</strong></p>\n" +
3548 " <div ng-repeat=\"subrule in rule_ctrlr.rule.rules\" class=\"m-l-2\">\n" +
3549 " <div class=\"panel panel-default\">\n" +
3550 " <div class=\"panel-body form-inline\">\n" +
3551 " <recursive>\n" +
3552 " <rule rule=\"subrule\" rule-definitions=\"rule_ctrlr.ruleDefinitions\" parent-rule=\"rule_ctrlr.rule\" parent-obj=\"rule_ctrlr.parentObj\"></rule>\n" +
3553 " </recursive>\n" +
3760 3554 " </div>\n" +
3761 3555 " </div>\n" +
3762 3556 " </div>\n" +
3763 " <div class=\"row\">\n" +
3764 " <div class=\"col-sm-12\">\n" +
3765 "\n" +
3766 " <div class=\"panel panel-default\">\n" +
3767 " <div class=\"panel-body\">\n" +
3768 3557 "\n" +
3769 " <uib-tabset>\n" +
3770 " <uib-tab>\n" +
3771 " <uib-tab-heading>\n" +
3772 " Postgresql Tables\n" +
3773 " </uib-tab-heading>\n" +
3558 " <span ng-if=\"(rule_ctrlr.config.disable_subrules == false) == false\" class=\"btn btn-info\" ng-click=\"rule_ctrlr.add()\"><span class=\"fa fa-plus-circle\"></span> Add rule</span>\n" +
3774 3559 "\n" +
3775 " <table class=\"table table-striped\">\n" +
3776 " <thead>\n" +
3777 " <tr>\n" +
3778 " <th class=\"c1 tablename\">Table name</th>\n" +
3779 " <th class=\"c2 size_human\">Size</th>\n" +
3780 " </tr>\n" +
3781 " </thead>\n" +
3782 " <tbody>\n" +
3783 " <tr class=\"r{{$index}}\" ng-repeat=\"row in system.DBtables\">\n" +
3784 " <td class=\"c1\">{{row.table_name}}</td>\n" +
3785 " <td class=\"c2\">{{row.size_human}}</td>\n" +
3786 " </tr>\n" +
3787 " </tbody>\n" +
3788 " </table>\n" +
3560 " </span>\n" +
3561 " <div class=\"pull-right\" ng-if=\"rule_ctrlr.parentRule\">\n" +
3562 " <span class=\"dropdown\" data-uib-dropdown>\n" +
3563 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3564 " <ul class=\"dropdown-menu\">\n" +
3565 " <li><a>No</a></li>\n" +
3566 " <li><a ng-click=\"rule_ctrlr.deleteRule(rule_ctrlr.parentRule, rule_ctrlr.rule)\">Yes</a></li>\n" +
3567 " </ul>\n" +
3568 " </span>\n" +
3569 " </div>\n" +
3570 "</div>\n"
3571 );
3572
3573
3574 $templateCache.put('templates/admin/applications/applications_list.html',
3575 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications.loading.applications\"></ng-include>\n" +
3789 3576 "\n" +
3790 " </uib-tab>\n" +
3577 "<div class=\"panel panel-default\" ng-if=\"!applications.loading.applications\">\n" +
3578 " <div class=\"panel-heading\">\n" +
3791 3579 "\n" +
3792 " <uib-tab>\n" +
3793 " <uib-tab-heading>\n" +
3794 " Elasticsearch Indices\n" +
3795 " </uib-tab-heading>\n" +
3580 " Currently active applications: {{applications.applications.length}}\n" +
3796 3581 "\n" +
3797 " <table class=\"table table-striped\">\n" +
3582 " </div>\n" +
3583 "\n" +
3584 " <table st-table=\"displayedCollection\" st-safe-src=\"applications.applications\" class=\"table table-striped\">\n" +
3798 3585 " <thead>\n" +
3799 3586 " <tr>\n" +
3800 " <th class=\"c1 tablename\">Index name</th>\n" +
3801 " <th class=\"c2 size_human\">Size</th>\n" +
3802 " </tr>\n" +
3803 " </thead>\n" +
3804 " <tbody>\n" +
3805 " <tr class=\"r{{$index}}\" ng-repeat=\"row in system.ESIndices\">\n" +
3806 " <td class=\"c1\">{{row.name}}</td>\n" +
3807 " <td class=\"c2\">{{row.size_human}}</td>\n" +
3587 " <th st-sort=\"resource_name\"><a>Application name</a></th>\n" +
3588 " <th st-sort=\"owner_user_name\"><a>Owner User</a></th>\n" +
3589 " <th st-sort=\"owner_group_name\"><a>Owner Group</a></th>\n" +
3590 " <th class=\"options\"></th>\n" +
3808 3591 " </tr>\n" +
3809 " </tbody>\n" +
3810 " </table>\n" +
3811 "\n" +
3812 " </uib-tab>\n" +
3813 "\n" +
3814 " <uib-tab>\n" +
3815 " <uib-tab-heading>\n" +
3816 " Processes\n" +
3817 " </uib-tab-heading>\n" +
3818 "\n" +
3819 " <table class=\"table table-striped\">\n" +
3820 " <thead>\n" +
3821 3592 " <tr>\n" +
3822 " <th class=\"c1 tablename\">Owner</th>\n" +
3823 " <th class=\"c2 tablename\">PID</th>\n" +
3824 " <th class=\"c3 tablename\">CPU</th>\n" +
3825 " <th class=\"c4 tablename\">MEM</th>\n" +
3826 " <th class=\"c4 tablename\">Name</th>\n" +
3593 " <th><input st-search=\"resource_name\" placeholder=\"search for application\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3594 " <th><input st-search=\"owner_user_name\" placeholder=\"search for user\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3595 " <th><input st-search=\"owner_group_name\" placeholder=\"search for group\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3596 " <th></th>\n" +
3827 3597 " </tr>\n" +
3828 3598 " </thead>\n" +
3829 3599 " <tbody>\n" +
3830 " <tr class=\"r{{$index}}\" ng-repeat-start=\"row in system.processInfo\">\n" +
3831 " <td class=\"c1\">{{row.owner}}</td>\n" +
3832 " <td class=\"c2\">{{row.pid}}</td>\n" +
3833 " <td class=\"c3\">{{row.cpu}}</td>\n" +
3834 " <td class=\"c4\">{{row.mem_usage}} ({{row.mem_percentage}}%)</td>\n" +
3835 " <td class=\"c5\"><strong>{{row.name}}</strong></td>\n" +
3600 "\n" +
3601 " <tr ng-repeat=\"resource in displayedCollection track by resource.resource_id\">\n" +
3602 " <td> {{resource.resource_name}}</td>\n" +
3603 " <td>{{resource.owner_user_name}}</td>\n" +
3604 " <td>{{resource.owner_group_name}}</td>\n" +
3605 " <td>\n" +
3606 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"applications.update({resourceId:resource.resource_id})\" data-toggle=\"tooltip\" title=\"Update application\"><span class=\"fa fa-cog\"></span></a>\n" +
3607 " </td>\n" +
3836 3608 " </tr>\n" +
3837 " <tr ng-repeat-end>\n" +
3838 " <td colspan=\"5\" class=\"word-wrap\">{{row.command}}</td>\n" +
3609 " <tfoot>\n" +
3610 " <tr>\n" +
3611 " <td colspan=\"4\" class=\"text-center\">\n" +
3612 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
3613 " </td>\n" +
3839 3614 " </tr>\n" +
3615 " </tfoot>\n" +
3840 3616 " </tbody>\n" +
3841 3617 " </table>\n" +
3842 3618 "\n" +
3843 " </uib-tab>\n" +
3844 "\n" +
3845 " <uib-tab>\n" +
3846 " <uib-tab-heading>\n" +
3847 " Python packages\n" +
3848 " </uib-tab-heading>\n" +
3849 "\n" +
3850 " <table class=\"table\">\n" +
3851 " <tr ng-repeat=\"package in system.packages\">\n" +
3852 " <td>{{package.name}}</td>\n" +
3853 " <td>{{package.version}}</td>\n" +
3854 " </tr>\n" +
3855 " </table>\n" +
3856 " </p>\n" +
3857 "\n" +
3858 " </uib-tab>\n" +
3859 "\n" +
3860 " </uib-tabset>\n" +
3861 " </div>\n" +
3862 " </div>\n" +
3863 " </div>\n" +
3864 " </div>\n" +
3865 3619 "</div>\n"
3866 3620 );
3867 3621
3868 3622
3869 $templateCache.put('templates/admin/users/parent_view.html',
3870 "<div ui-view></div>"
3871 );
3872
3873
3874 $templateCache.put('templates/admin/users/users_create.html',
3875 "<ng-include src=\"'templates/loader.html'\" ng-if=\"user.loading.user\"></ng-include>\n" +
3876 "\n" +
3877 "<div ng-show=\"!user.loading.user\">\n" +
3623 $templateCache.put('templates/admin/configs/edit.html',
3624 "<ng-include src=\"'templates/loader.html'\" ng-if=\"configs.loading.config\"></ng-include>\n" +
3878 3625 "\n" +
3879 " <div class=\"panel panel-default\">\n" +
3626 "<div class=\"panel panel-default\" ng-show=\"!configs.loading.config\">\n" +
3627 " <div class=\"panel-heading\">\n" +
3628 " <h3 class=\"panel-title\">Basic Configuration</h3>\n" +
3629 " </div>\n" +
3880 3630 " <div class=\"panel-body\">\n" +
3881 "\n" +
3882 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"user.user.id\">\n" +
3883 " <a class=\"btn btn-default\" data-uib-dropdown-toggle><span class=\"fa fa-user-secret\"></span> Re-login to user</a>\n" +
3884 " <ul class=\"dropdown-menu\">\n" +
3885 " <li><a>No</a></li>\n" +
3886 " <li><a ng-click=\"user.reloginUser(user)\">Yes</a></li>\n" +
3887 " </ul>\n" +
3888 " </span>\n" +
3889 "\n" +
3890 " <form name=\"user.profileForm\" class=\"form-horizontal\" ng-submit=\"user.createUser()\">\n" +
3891 " <div class=\"form-group\" id=\"row-user_name\">\n" +
3892 " <data-form-errors errors=\"user.profileForm.ae_validation.user_name\"></data-form-errors>\n" +
3893 " <label for=\"user_name\" id=\"label-user_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3894 " User name\n" +
3895 " <span class=\"required\">*</span>\n" +
3631 " <h2>Visual</h2>\n" +
3632 " <form class=\"form-horizontal\">\n" +
3633 " <div class=\"form-group\">\n" +
3634 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3635 " Footer HTML\n" +
3896 3636 " </label>\n" +
3897 3637 " <div class=\"col-sm-8 col-lg-9\">\n" +
3898 " <input class=\"form-control\" id=\"user_name\" name=\"user_name\" type=\"text\" ng-model=\"user.user.user_name\">\n" +
3638 " <textarea class=\"form-control\" type=\"text\" ng-model=\"configs.configs.global.template_footer_html.value\" style=\"min-height: 150px\"></textarea>\n" +
3899 3639 " </div>\n" +
3900 3640 " </div>\n" +
3641 " </form>\n" +
3901 3642 "\n" +
3902 " <div class=\"form-group\" id=\"row-user_password\">\n" +
3903 " <data-form-errors errors=\"user.profileForm.ae_validation.user_password\"></data-form-errors>\n" +
3904 " <label for=\"user_password\" id=\"label-user_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3905 " Password\n" +
3906 " <span class=\"required\">*</span>\n" +
3643 " <h2>Functional</h2>\n" +
3644 "\n" +
3645 " <form class=\"form-horizontal\">\n" +
3646 " <div class=\"form-group\">\n" +
3647 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3648 " Show user groups to non-admin users\n" +
3907 3649 " </label>\n" +
3908 3650 " <div class=\"col-sm-8 col-lg-9\">\n" +
3909 " <input class=\"form-control\" id=\"user_password\" name=\"user_password\" type=\"password\" ng-model=\"user.user.user_password\">\n" +
3910 "\n" +
3911 " <p class=\"m-t-1\"><a class=\"btn btn-info btn-sm\" ng-click=\"user.generatePassword()\"><span class=\"fa fa-lock\"></span> Generate password</a>\n" +
3912 " <span ng-show=\"user.gen_pass.length > 0\">(generated password: {{user.gen_pass}})</span>\n" +
3913 " </p>\n" +
3914 "\n" +
3651 " <button type=\"button\" class=\"btn btn-default\" ng-model=\"configs.configs.global.list_groups_to_non_admins.value\" uib-btn-checkbox>\n" +
3652 " Enable\n" +
3653 " </button>\n" +
3915 3654 " </div>\n" +
3916 3655 " </div>\n" +
3656 " </form>\n" +
3917 3657 "\n" +
3658 " <h2>Global Rate Limiting</h2>\n" +
3918 3659 "\n" +
3919 " <div class=\"form-group\" id=\"row-email\">\n" +
3920 " <data-form-errors errors=\"user.profileForm.ae_validation.email\"></data-form-errors>\n" +
3921 " <label for=\"email\" id=\"label-email\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3922 " Email Address\n" +
3923 " <span class=\"required\">*</span>\n" +
3660 " <form class=\"form-horizontal\">\n" +
3661 " <div class=\"form-group\">\n" +
3662 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3663 " Ignore reports per minute/per application\n" +
3924 3664 " </label>\n" +
3925 3665 " <div class=\"col-sm-8 col-lg-9\">\n" +
3926 " <input class=\"form-control\" id=\"email\" name=\"email\" type=\"text\" ng-model=\"user.user.email\">\n" +
3666 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_reports_rate_limit.value\" />\n" +
3927 3667 " </div>\n" +
3928 3668 " </div>\n" +
3929 3669 "\n" +
3930 " <div class=\"form-group\" id=\"row-first_name\">\n" +
3931 " <data-form-errors errors=\"user.profileForm.ae_validation.first_name\"></data-form-errors>\n" +
3932 " <label for=\"first_name\" id=\"label-first_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3933 " First Name\n" +
3934 " </label>\n" +
3935 " <div class=\"col-sm-8 col-lg-9\">\n" +
3936 " <input class=\"form-control\" id=\"first_name\" name=\"first_name\" type=\"text\" ng-model=\"user.user.first_name\">\n" +
3937 " </div>\n" +
3938 " </div>\n" +
3939 " <div class=\"form-group\" id=\"row-last_name\">\n" +
3940 " <data-form-errors errors=\"user.profileForm.ae_validation.last_name\"></data-form-errors>\n" +
3941 " <label for=\"last_name\" id=\"label-last_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3942 " Last Name\n" +
3670 " <div class=\"form-group\">\n" +
3671 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3672 " Ignore logs per minute/per application\n" +
3943 3673 " </label>\n" +
3944 3674 " <div class=\"col-sm-8 col-lg-9\">\n" +
3945 " <input class=\"form-control\" id=\"last_name\" name=\"last_name\" type=\"text\" ng-model=\"user.user.last_name\">\n" +
3675 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_logs_rate_limit.value\" />\n" +
3946 3676 " </div>\n" +
3947 3677 " </div>\n" +
3948 3678 "\n" +
3949 " <div class=\"form-group\" id=\"row-status\">\n" +
3950 " <data-form-errors errors=\"user.profileForm.ae_validation.status\"></data-form-errors>\n" +
3951 " <label for=\"status\" id=\"label-status\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3952 " Active\n" +
3679 " <div class=\"form-group\">\n" +
3680 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3681 " Ignore metrics per minute/per application\n" +
3953 3682 " </label>\n" +
3954 3683 " <div class=\"col-sm-8 col-lg-9\">\n" +
3955 " <input checked class=\"form-control\" id=\"status\" name=\"status\" type=\"checkbox\" ng-model=\"user.user.status\">\n" +
3684 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_metrics_rate_limit.value\" />\n" +
3956 3685 " </div>\n" +
3957 3686 " </div>\n" +
3958 3687 "\n" +
3959 " <div class=\"form-group\" id=\"row-submit\">\n" +
3960 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3961 " </label>\n" +
3962 " <div class=\"col-sm-8 col-lg-9\">\n" +
3963 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"{{$state.params.userId ? 'Update' : 'Add'}} User\">\n" +
3964 " </div>\n" +
3965 " </div>\n" +
3966 3688 " </form>\n" +
3689 "\n" +
3690 " <hr/>\n" +
3691 "\n" +
3692 " <a class=\"btn btn-primary\" ng-click=\"configs.save()\">Save configuration</a>\n" +
3967 3693 " </div>\n" +
3694 "\n" +
3968 3695 "</div>\n" +
3969 3696 "\n" +
3970 3697 "\n" +
3971 " <div class=\"panel panel-default\" ng-if=\"user.user.id\">\n" +
3698 "<div class=\"panel panel-default\">\n" +
3972 3699 " <div class=\"panel-heading\">\n" +
3973 " <h3 class=\"panel-title\">Permission Summary</h3>\n" +
3700 " <h3 class=\"panel-title\">Plugin Configuration</h3>\n" +
3974 3701 " </div>\n" +
3975 3702 " <div class=\"panel-body\">\n" +
3976 " <h3>Direct application permissions</h3>\n" +
3977 "\n" +
3978 " <ul class=\"list-group\">\n" +
3979 " <li ng-repeat=\"perm in user.resourcePermissions.user.application\" class=\"animate-repeat list-group-item\">\n" +
3980 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3981 " <div class=\"pull-right\">\n" +
3982 "\n" +
3983 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
3984 "\n" +
3985 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Application\" data-ui-sref=\"applications.update({resourceId:perm.self.resource_id})\">\n" +
3986 " <span class=\"fa fa-cog\"></span>\n" +
3987 " </a>\n" +
3703 " <plugin-config section=\"'admin.config'\">\n" +
3704 " </plugin-config>\n" +
3988 3705 " </div>\n" +
3989 " </li>\n" +
3990 " </ul>\n" +
3706 "</div>\n"
3707 );
3708
3709
3710 $templateCache.put('templates/admin/configs/parent_view.html',
3711 "<div ui-view></div>"
3712 );
3713
3714
3715 $templateCache.put('templates/admin/groups/groups_create.html',
3716 "<ng-include src=\"'templates/loader.html'\" ng-if=\"group.loading.group\"></ng-include>\n" +
3991 3717 "\n" +
3992 " <h3>Direct dashboard permissions</h3>\n" +
3718 "<div ng-show=\"!group.loading.group\">\n" +
3719 "\n" +
3720 " <div class=\"panel panel-default\">\n" +
3721 " <div class=\"panel-body\">\n" +
3722 " <form name=\"group.groupForm\" class=\"form-horizontal\" ng-submit=\"group.createGroup()\">\n" +
3723 " <div class=\"form-group\" id=\"row-group_name\">\n" +
3724 " <data-form-errors errors=\"group.groupForm.ae_validation.group_name\"></data-form-errors>\n" +
3725 " <label for=\"group_name\" id=\"label-group_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3726 " Group name\n" +
3727 " <span class=\"required\">*</span>\n" +
3728 " </label>\n" +
3729 " <div class=\"col-sm-8 col-lg-9\">\n" +
3730 " <input class=\"form-control\" id=\"group_name\" name=\"group_name\" type=\"text\" ng-model=\"group.group.group_name\">\n" +
3731 " </div>\n" +
3732 " </div>\n" +
3733 "\n" +
3734 " <div class=\"form-group\" id=\"row-description\">\n" +
3735 " <data-form-errors errors=\"group.groupForm.ae_validation.description\"></data-form-errors>\n" +
3736 " <label for=\"description\" id=\"label-description\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3737 " Description\n" +
3738 " <span class=\"required\">*</span>\n" +
3739 " </label>\n" +
3740 " <div class=\"col-sm-8 col-lg-9\">\n" +
3741 " <input class=\"form-control\" id=\"description\" name=\"description\" type=\"text\" ng-model=\"group.group.description\">\n" +
3742 " </div>\n" +
3743 " </div>\n" +
3744 "\n" +
3745 "\n" +
3746 " <div class=\"form-group\" id=\"row-submit\">\n" +
3747 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3748 " </label>\n" +
3749 " <div class=\"col-sm-8 col-lg-9\">\n" +
3750 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"{{$state.params.groupId ? 'Update' : 'Add'}} Group\">\n" +
3751 " </div>\n" +
3752 " </div>\n" +
3753 " </form>\n" +
3754 " </div>\n" +
3755 " </div>\n" +
3756 "\n" +
3757 "\n" +
3758 " <div class=\"panel panel-default\" ng-if=\"group.group.id\">\n" +
3759 " <div class=\"panel-heading\">\n" +
3760 " <h3 class=\"panel-title\">Permissions summary</h3>\n" +
3761 " </div>\n" +
3762 " <div class=\"panel-body\">\n" +
3763 " <h3>Direct application permissions</h3>\n" +
3764 "\n" +
3765 " <ul class=\"list-group\">\n" +
3766 " <li ng-repeat=\"perm in group.resourcePermissions.group.application\" class=\"animate-repeat list-group-item\">\n" +
3767 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3993 3768 "\n" +
3994 " <ul class=\"list-group\">\n" +
3995 " <li ng-repeat=\"perm in user.resourcePermissions.user.dashboard\" class=\"animate-repeat list-group-item\">\n" +
3996 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3997 3769 " <div class=\"pull-right\">\n" +
3998 3770 "\n" +
3999 3771 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
4000 3772 "\n" +
4001 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Dashboard\" data-ui-sref=\"dashboard.update({resourceId:perm.self.resource_id})\">\n" +
3773 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Application\" data-ui-sref=\"applications.update({resourceId:perm.self.resource_id})\">\n" +
4002 3774 " <span class=\"fa fa-cog\"></span>\n" +
4003 3775 " </a>\n" +
4004 3776 " </div>\n" +
4005 3777 " </li>\n" +
4006 3778 " </ul>\n" +
4007 3779 "\n" +
4008 " </div>\n" +
3780 " <h3>Direct dashboard permissions</h3>\n" +
4009 3781 "\n" +
4010 " </div>\n" +
3782 " <ul class=\"list-group\">\n" +
3783 " <li ng-repeat=\"perm in group.resourcePermissions.group.dashboard\" class=\"animate-repeat list-group-item\">\n" +
3784 " <strong>{{ perm.self.resource_name }}</strong>\n" +
4011 3785 "\n" +
3786 " <div class=\"pull-right\">\n" +
3787 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
4012 3788 "\n" +
4013 "</div>\n"
4014 );
4015
4016
4017 $templateCache.put('templates/admin/users/users_list.html',
4018 "<ng-include src=\"'templates/loader.html'\" ng-if=\"users.loading.users\"></ng-include>\n" +
3789 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Dashboard\" data-ui-sref=\"dashboard.update({resourceId:perm.self.resource_id})\">\n" +
3790 " <span class=\"fa fa-cog\"></span>\n" +
3791 " </a>\n" +
3792 " </div>\n" +
3793 " </li>\n" +
3794 " </ul>\n" +
4019 3795 "\n" +
4020 "<div ng-show=\"!users.loading.users\">\n" +
3796 " </div>\n" +
3797 "\n" +
3798 " </div>\n" +
4021 3799 "\n" +
4022 " <div class=\"panel panel-default\">\n" +
4023 3800 "\n" +
3801 " <div class=\"panel panel-default\" ng-if=\"group.group.id\">\n" +
4024 3802 " <div class=\"panel-heading\">\n" +
4025 " {{users.activeUsers}} active out of {{users.users.length}} users\n" +
3803 " <h3 class=\"panel-title\">User list</h3>\n" +
3804 " </div>\n" +
3805 " <div class=\"panel-body\">\n" +
3806 "\n" +
3807 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"group.addUser()\">\n" +
3808 " <div class=\"form-group\">\n" +
3809 " <input placeholder=\"Username or email\" type=\"text\" class=\"autocomplete form-control\" ng-model=\"group.form.autocompleteUser\" uib-typeahead=\"u for u in group.searchUsers($viewValue) | limitTo:8\" typeahead-loading=\"searchingUsers\" typeahead-wait-ms=\"250\"/>\n" +
3810 " </div>\n" +
3811 " <div class=\"form-group\">\n" +
3812 " <button class=\"btn btn-info\" ng-disabled=\"!group.form.autocompleteUser\"><span class=\"fa fa-user\"></span> Add user</button>\n" +
4026 3813 " </div>\n" +
3814 " </form>\n" +
4027 3815 "\n" +
3816 " </div>\n" +
4028 3817 "\n" +
4029 " <table st-table=\"displayedCollection\" st-safe-src=\"users.users\" class=\"table table-striped\">\n" +
3818 " <table st-table=\"displayedCollection\" st-safe-src=\"group.users\" class=\"table table-striped\">\n" +
4030 3819 " <thead>\n" +
4031 3820 " <tr>\n" +
4032 " <th class=\"user_name\" st-sort=\"user_name\"><a>Username</a></th>\n" +
4033 " <th class=\"email\" st-sort=\"email\"><a>Email</a></th>\n" +
4034 " <th class=\"status\" st-sort=\"status\"><a>Status</a></th>\n" +
3821 " <th st-sort=\"user_name\"><a>Username</a></th>\n" +
3822 " <th st-sort=\"email\"><a>Email</a></th>\n" +
3823 " <th st-sort=\"status\"><a>Status</a></th>\n" +
4035 3824 " <th st-sort=\"first_name\"><a>First Name</a></th>\n" +
4036 3825 " <th st-sort=\"last_name\"><a>Last Name</a></th>\n" +
4037 3826 " <th st-sort=\"last_login_date\"><a>Last login</a></th>\n" +
4038 " <th class=\"options\"></th>\n" +
3827 " <th class=\"options\" style=\"width: 130px\"></th>\n" +
4039 3828 " </tr>\n" +
4040 3829 " <tr>\n" +
4041 3830 " <th><input st-search=\"user_name\" placeholder=\"search for user name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
@@ -4049,1014 +3838,1211 b' function kickstartAE(initialUserData) {'
4049 3838 " </thead>\n" +
4050 3839 " <tbody>\n" +
4051 3840 "\n" +
4052 " <tr ng-repeat=\"user in displayedCollection track by user.id\">\n" +
3841 " <tr ng-repeat=\"user in displayedCollection\">\n" +
4053 3842 " <td><img src=\"{{user.gravatar_url}}\" class=\"avatar\"> {{user.user_name}}</td>\n" +
4054 " <td class=\"word-wrap small\">{{user.email}}</td>\n" +
3843 " <td>{{user.email}}</td>\n" +
4055 3844 " <td class=\"text-center\"><span class=\"fa\" ng-class=\"{'fa-check-circle':user.status, 'fa-times':!user.status}\"></span></td>\n" +
4056 " <td class=\"word-wrap small\">{{user.first_name}}</td>\n" +
4057 " <td class=\"word-wrap small\">{{user.last_name}}</td>\n" +
4058 " <td><span data-uib-tooltip=\"{{user.last_login_date}}\" class=\"small\">{{user.last_login_date | isoToRelativeTime}}</span></td>\n" +
3845 " <td>{{user.first_name}}</td>\n" +
3846 " <td>{{user.last_name}}</td>\n" +
3847 " <td><span data-uib-tooltip=\"{{user.last_login_date}}\">{{user.last_login_date | isoToRelativeTime}}</span></td>\n" +
4059 3848 " <td>\n" +
4060 3849 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"admin.user.update({userId:user.id})\"><span class=\"fa fa-cog\"></span></a>\n" +
4061 3850 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4062 3851 " <a class=\"btn btn-danger btn-sm\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
4063 3852 " <ul class=\"dropdown-menu\">\n" +
4064 3853 " <li><a>No</a></li>\n" +
4065 " <li><a ng-click=\"users.removeUser(user)\">Yes</a></li>\n" +
3854 " <li><a ng-click=\"group.removeUser(user)\">Yes</a></li>\n" +
4066 3855 " </ul>\n" +
4067 3856 " </span>\n" +
4068 3857 " </tr>\n" +
4069 3858 " <tfoot>\n" +
4070 3859 " <tr>\n" +
4071 " <td colspan=\"6\" class=\"text-center\">\n" +
4072 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
3860 " <td colspan=\"7\" class=\"text-center\">\n" +
3861 " <div st-pagination=\"\" st-items-by-page=\"50\" st-displayed-pages=\"7\"></div>\n" +
4073 3862 " </td>\n" +
4074 3863 " </tr>\n" +
4075 3864 " </tfoot>\n" +
4076 3865 " </tbody>\n" +
4077 3866 " </table>\n" +
4078 3867 "\n" +
4079 "\n" +
4080 3868 " </div>\n" +
3869 "\n" +
3870 "\n" +
4081 3871 "</div>\n"
4082 3872 );
4083 3873
4084 3874
4085 $templateCache.put('templates/applications/applications_purge_logs.html',
4086 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications_purge.loading.applications\"></ng-include>\n" +
4087 "\n" +
4088 "<div ng-show=\"!applications_purge.loading.applications\">\n" +
4089 " <div class=\"panel panel-default\">\n" +
4090 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4091 " <div class=\"panel-body\">\n" +
3875 $templateCache.put('templates/admin/groups/groups_list.html',
3876 "<ng-include src=\"'templates/loader.html'\" ng-if=\"groups.loading.groups\"></ng-include>\n" +
4092 3877 "\n" +
4093 " <form method=\"post\" class=\"form-horizontal\" name=\"applications_purge.form\" ng-submit=\"applications_purge.purgeLogs()\">\n" +
4094 " <div class=\"form-group\">\n" +
4095 " <label class=\"control-label col-sm-3 col-lg-2\">Application:</label>\n" +
3878 "<div class=\"panel panel-default\" ng-show=\"!groups.loading.groups\">\n" +
4096 3879 "\n" +
4097 " <div class=\"col-sm-9 col-lg-10 form-inline\">\n" +
4098 " <select ng-model=\"applications_purge.selectedResource\" ng-change=\"applications_purge.getCommonKeys()\"\n" +
4099 " ng-options=\"r.resource_id as r.resource_name for r in applications_purge.applications\" class=\"form-control\"></select>\n" +
4100 " </div>\n" +
4101 " </div>\n" +
3880 " <table st-table=\"displayedCollection\" st-safe-src=\"groups.groups\" class=\"table table-striped\">\n" +
3881 " <thead>\n" +
3882 " <tr>\n" +
3883 " <th st-sort=\"group_name\"><a>Group name</a></th>\n" +
3884 " <th st-sort=\"description\"><a>Description</a></th>\n" +
3885 " <th st-sort=\"members\"><a>Member count</a></th>\n" +
3886 " <th class=\"options\"></th>\n" +
3887 " </tr>\n" +
3888 " <tr>\n" +
3889 " <th><input st-search=\"group_name\" placeholder=\"search for group name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3890 " <th><input st-search=\"description\" placeholder=\"search for description\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3891 " <th></th>\n" +
3892 " <th></th>\n" +
3893 " </tr>\n" +
3894 " </thead>\n" +
3895 " <tbody>\n" +
4102 3896 "\n" +
4103 " <div class=\"form-group\">\n" +
4104 " <label class=\"control-label col-sm-3 col-lg-2\">Namespace:</label>\n" +
3897 " <tr ng-repeat=\"group in displayedCollection track by group.id\">\n" +
3898 " <td>{{group.group_name}}</td>\n" +
3899 " <td>{{group.description}}</td>\n" +
3900 " <td>{{group.member_count}}</td>\n" +
3901 " <td>\n" +
3902 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"admin.group.update({groupId:group.id})\"><span class=\"fa fa-cog\"></span></a>\n" +
3903 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
3904 " <a class=\"btn btn-danger btn-sm\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3905 " <ul class=\"dropdown-menu\">\n" +
3906 " <li><a>No</a></li>\n" +
3907 " <li><a ng-click=\"groups.removeGroup(group)\">Yes</a></li>\n" +
3908 " </ul>\n" +
3909 " </span>\n" +
3910 " </tr>\n" +
3911 " <tfoot>\n" +
3912 " <tr>\n" +
3913 " <td colspan=\"4\" class=\"text-center\">\n" +
3914 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
3915 " </td>\n" +
3916 " </tr>\n" +
3917 " </tfoot>\n" +
3918 " </tbody>\n" +
3919 " </table>\n" +
4105 3920 "\n" +
4106 " <div class=\"col-sm-9 col-lg-10\">\n" +
4107 " <input type=\"text\" name=\"namespace\" ng-model=\"applications_purge.namespace\"\n" +
4108 " placeholder=\"Namespace to filter on\" uib-typeahead=\"ns for ns in applications_purge.commonNamespaces\"\n" +
4109 " class=\"form-control\">\n" +
4110 3921 "</div>\n" +
3922 "\n"
3923 );
3924
3925
3926 $templateCache.put('templates/admin/groups/parent_view.html',
3927 "<div ui-view></div>"
3928 );
3929
3930
3931 $templateCache.put('templates/admin/parent_view.html',
3932 "<div class=\"col-sm-3\" id=\"menu\">\n" +
3933 " <div class=\"panel panel-default\">\n" +
3934 " <div class=\"panel-heading\">Users and groups</div>\n" +
3935 " <ul class=\"list-group\">\n" +
3936 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.user.list\"> Users</a></li>\n" +
3937 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.user.create\"> Create user</a></li>\n" +
3938 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.group.list\"> Groups</a></li>\n" +
3939 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.group.create\"> Create group</a></li>\n" +
3940 " </ul>\n" +
4111 3941 " </div>\n" +
4112 "\n" +
4113 " <div class=\"form-group\">\n" +
4114 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4115 "\n" +
4116 " <div class=\"col-sm-8 col-lg-9 \">\n" +
4117 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Purge logs meeting the criteria\">\n" +
4118 " </div>\n" +
3942 " <div class=\"panel panel-default\">\n" +
3943 " <div class=\"panel-heading\">Resources</div>\n" +
3944 " <ul class=\"list-group\">\n" +
3945 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.application.list\"> List applications</a></li>\n" +
3946 " </ul>\n" +
4119 3947 " </div>\n" +
4120 3948 "\n" +
4121 " </form>\n" +
3949 " <div class=\"panel panel-default\">\n" +
3950 " <div class=\"panel-heading\">System</div>\n" +
3951 " <ul class=\"list-group\">\n" +
3952 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.configs.list\"> Config variables</a></li>\n" +
3953 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.system\"> System</a></li>\n" +
3954 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.partitions\"> Partition Management</a></li>\n" +
3955 " </ul>\n" +
4122 3956 " </div>\n" +
4123 3957 "</div>\n" +
4124 "</div>\n"
3958 "\n" +
3959 "\n" +
3960 "<div class=\"col-sm-9\" ui-view></div>\n"
4125 3961 );
4126 3962
4127 3963
4128 $templateCache.put('templates/applications/applications_update.html',
4129 "<ng-include src=\"'templates/loader.html'\" ng-if=\"application.loading.application\"></ng-include>\n" +
3964 $templateCache.put('templates/admin/partitions.html',
3965 "<ng-include src=\"'templates/loader.html'\" ng-if=\"partitions.loading.partitions\"></ng-include>\n" +
4130 3966 "\n" +
4131 "<div ng-show=\"!application.loading.application\">\n" +
3967 "<div ng-show=\"!partitions.loading.partitions\">\n" +
4132 3968 "\n" +
4133 3969 " <div class=\"panel panel-default\">\n" +
4134 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
3970 " <div class=\"panel-heading\">\n" +
3971 " DELETE Daily Partitions\n" +
3972 " </div>\n" +
3973 "\n" +
3974 " <form name=\"partitions.dailyPartitionsForm\"\n" +
3975 " novalidate ng-submit=\"partitions.partitionsDelete('dailyPartitions')\"\n" +
3976 " class=\"form-inline\"\n" +
3977 " ng-class=\"{'has-error':partitions.dailyPartitionsForm.$invalid}\">\n" +
3978 "\n" +
4135 3979 " <div class=\"panel-body\">\n" +
4136 3980 "\n" +
4137 " <div class=\"row\" ng-show=\"application.resource.resource_id\">\n" +
4138 " <div class=\"col-sm-6\">\n" +
3981 " <input type=\"text\" name=\"confirm\"\n" +
3982 " placeholder=\"Enter CONFIRM to proceed\" class=\"form-control input-autosize\" confirm-validate required ng-model=\"partitions.dailyConfirm\">\n" +
3983 " <input type=\"submit\" class=\"btn btn-danger\" ng-disabled=\"partitions.dailyPartitionsForm.$invalid\">\n" +
3984 " <input type=\"checkbox\" ng-model=\"partitions.dailyChecked\" ng-change=\"partitions.setCheckedList('dailyPartitions')\"> Check All\n" +
4139 3985 "\n" +
4140 " <uib-tabset>\n" +
4141 " <uib-tab>\n" +
4142 " <uib-tab-heading>\n" +
4143 " API keys\n" +
4144 " </uib-tab-heading>\n" +
3986 " </div>\n" +
4145 3987 "\n" +
4146 " <p><strong>PRIVATE API KEY:</strong></p>\n" +
4147 " <p>\n" +
4148 " <div class=\"well well-sm\">{{ application.resource.api_key }}</div>\n" +
4149 " </p>\n" +
4150 " <p><strong>PUBLIC API KEY</strong> (for javascript clients):</p>\n" +
4151 " <p>\n" +
4152 " <div class=\"well well-sm\">{{ application.resource.public_key }}</div>\n" +
4153 " </p>\n" +
4154 " <p><small>Your key will be used to identify to which application your data\n" +
4155 " belongs to please keep them private at all times.</small></p>\n" +
4156 "\n" +
4157 " </uib-tab>\n" +
3988 " <table class=\"table table-striped\">\n" +
3989 " <tr>\n" +
3990 " <th class=\"c1 date\">Date</th>\n" +
3991 " <th class=\"c2 indices\">Indices</th>\n" +
3992 " </tr>\n" +
3993 " <tr class=\"r{{$index}}\" ng-repeat=\"row in partitions.dailyPartitions\">\n" +
3994 " <td class=\"c1\">{{row[0]}}</td>\n" +
3995 " <td class=\"c2\">\n" +
3996 " <ul class=\"list-group\">\n" +
3997 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].elasticsearch\">\n" +
3998 " <input name=\"es_index\" type=\"checkbox\" ng-model=\"partition.checked\"> ES: {{partition.name}}\n" +
3999 " </li>\n" +
4000 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].pg\">\n" +
4001 " <input name=\"pg_index\" type=\"checkbox\" ng-model=\"partition.checked\"> PG: {{partition.name}}\n" +
4002 " </li>\n" +
4003 " </ul>\n" +
4004 " </td>\n" +
4005 " </tr>\n" +
4006 " </table>\n" +
4007 " </form>\n" +
4158 4008 "\n" +
4159 " <uib-tab>\n" +
4160 " <uib-tab-heading>\n" +
4161 " <span class=\"btn btn-danger btn-xs\"><span class=\"fa fa-exclamation-triangle\"></span></span> Regenerate API keys\n" +
4162 " </uib-tab-heading>\n" +
4163 " <p>Are you sure you want to regenerate API KEY for this application?</p>\n" +
4164 " <p>All client application keys will need to be updated.</p>\n" +
4165 " <form ng-submit=\"application.regenerateAPIKeys()\" name=\"application.regenerateAPIKeysForm\" class=\"form-inline\">\n" +
4166 " <data-form-errors errors=\"application.regenerateAPIKeysForm.ae_validation.password\"></data-form-errors>\n" +
4167 " <div class=\"form-group\">\n" +
4168 " <input type=\"password\" name=\"confirm\"\n" +
4169 " placeholder=\"Enter your password to proceed\" class=\"form-control\" ng-model=\"application.regenerateAPIKeysPassword\">\n" +
4170 " <input type=\"submit\" class=\"btn btn-danger\" value=\"Confirm\">\n" +
4171 4009 " </div>\n" +
4172 " </form>\n" +
4173 " </uib-tab>\n" +
4174 " </uib-tabset>\n" +
4010 "\n" +
4011 " <div class=\"panel panel-default\">\n" +
4012 " <div class=\"panel-heading\">\n" +
4013 " DELETE Permanent Partitions\n" +
4175 4014 " </div>\n" +
4176 " <div class=\"col-sm-6 text-center\">\n" +
4177 " <h2 class=\"m-t-0\">How to connect your application?</h2>\n" +
4178 " <p>Visit our <a href=\"{{AeConfig.urls.docs}}\"><strong>developer documentation</strong></a> for step-by-step integration instructions.</p>\n" +
4179 " <div class=\"clearfix\"></div>\n" +
4180 " <p class=\"text-center\">\n" +
4181 " <a href=\"{{AeConfig.urls.docs}}\"><img src=\"/static/appenlight/images/logos/django_small.png\" alt=\"Django Logo\">\n" +
4182 " <img src=\"/static/appenlight/images/logos/pyramid_small.png\" alt=\"Pyramid Logo\">\n" +
4183 " <img src=\"/static/appenlight/images/logos/flask_small.png\" alt=\"Flask Logo\"></a>\n" +
4184 4015 "\n" +
4185 " <a href=\"{{AeConfig.urls.docs}}\"><img src=\"/static/appenlight/images/logos/js_small.png\" alt=\"Javascript Logo\">\n" +
4186 " <img src=\"/static/appenlight/images/logos/nodejs.png\" alt=\"Node.js\"></a>\n" +
4187 " <img src=\"/static/appenlight/images/logos/ruby_small.png\" alt=\"Ruby Logo\">\n" +
4188 " <img src=\"/static/appenlight/images/logos/php_small.png\" alt=\"PHP Logo\">\n" +
4189 " </a>\n" +
4016 " <form name=\"partitions.permanentPartitionsForm\" novalidate\n" +
4017 " ng-submit=\"partitions.partitionsDelete('permanentPartitions')\"\n" +
4018 " class=\"form-inline\"\n" +
4019 " ng-class=\"{'has-error':partitions.permanentPartitionsForm.$invalid}\">\n" +
4190 4020 "\n" +
4191 " </p>\n" +
4192 " </div>\n" +
4193 " </div>\n" +
4194 4021 "\n" +
4195 " <hr ng-show=\"application.resource.resource_id\">\n" +
4022 " <div class=\"panel-body\">\n" +
4196 4023 "\n" +
4197 " <form method=\"post\" class=\"form-horizontal\" name=\"application.BasicForm\" ng-submit=\"application.updateBasicForm()\" novalidate>\n" +
4198 4024 " <div class=\"form-group\">\n" +
4199 " <data-form-errors errors=\"application.BasicForm.ae_validation.resource_name\"></data-form-errors>\n" +
4200 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4201 " Application name\n" +
4202 " <span class=\"required\">*</span>\n" +
4203 " </label>\n" +
4204 "\n" +
4205 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4206 " <input class=\"form-control\" name=\"resource_name\" placeholder=\"Application Name\" type=\"text\" ng-model=\"application.resource.resource_name\">\n" +
4025 " <input type=\"text\" name=\"confirm\"\n" +
4026 " placeholder=\"Enter CONFIRM to proceed\" class=\"form-control\" confirm-validate required ng-model=\"partitions.permConfirm\">\n" +
4027 " <input type=\"submit\" class=\"btn btn-danger\" ng-disabled=\"partitions.permanentPartitionsForm.$invalid\">\n" +
4028 " <input type=\"checkbox\" ng-model=\"partitions.permChecked\" ng-change=\"partitions.setCheckedList('permanentPartitions')\"> Check All\n" +
4207 4029 " </div>\n" +
4208 4030 "\n" +
4209 "\n" +
4210 4031 " </div>\n" +
4211 4032 "\n" +
4212 " <div class=\"form-group\">\n" +
4213 " <data-form-errors errors=\"application.BasicForm.ae_validation.domains\"></data-form-errors>\n" +
4214 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4215 " Domain names for CORS headers\n" +
4216 " </label>\n" +
4217 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4218 " <textarea class=\"form-control\" name=\"domains\" ng-model=\"application.resource.domains\"></textarea>\n" +
4219 " <p class=\"description\">Required for Javascript error tracking (one line one domain, skip http:// part)</p>\n" +
4033 " <table class=\"table table-striped\">\n" +
4034 " <tr>\n" +
4035 " <th class=\"c1 date\">Date</th>\n" +
4036 " <th class=\"c2 indices\">Indices</th>\n" +
4037 " </tr>\n" +
4038 " <tr class=\"r{{$index}}\" ng-repeat=\"row in partitions.permanentPartitions\">\n" +
4039 " <td class=\"c1\">{{row[0]}}</td>\n" +
4040 " <td class=\"c2\">\n" +
4041 " <ul class=\"list-group\">\n" +
4042 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].elasticsearch\">\n" +
4043 " <input name=\"es_index\" type=\"checkbox\" ng-model=\"partition.checked\"> ES: {{partition.name}}\n" +
4044 " </li>\n" +
4045 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].pg\">\n" +
4046 " <input name=\"pg_index\" type=\"checkbox\" ng-model=\"partition.checked\"> PG: {{partition.name}}\n" +
4047 " </li>\n" +
4048 " </ul>\n" +
4049 " </td>\n" +
4050 " </tr>\n" +
4051 " </table>\n" +
4052 " </form>\n" +
4053 "\n" +
4220 4054 " </div>\n" +
4221 4055 "\n" +
4056 "</div>\n"
4057 );
4058
4059
4060 $templateCache.put('templates/admin/system.html',
4061 "<ng-include src=\"'templates/loader.html'\" ng-if=\"system.loading.system\"></ng-include>\n" +
4222 4062 "\n" +
4063 "<div ng-if=\"system.loading.system == false\">\n" +
4064 " <div class=\"row\">\n" +
4065 " <div class=\"col-sm-12\">\n" +
4066 " <div class=\"panel panel-default\">\n" +
4067 " <div class=\"panel-heading\">\n" +
4068 " <h3 class=\"panel-title\">\n" +
4069 " System Info\n" +
4070 " </h3>\n" +
4223 4071 " </div>\n" +
4224 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
4225 " <data-form-errors errors=\"application.BasicForm.ae_validation.default_grouping\"></data-form-errors>\n" +
4226 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4227 " Default grouping for errors\n" +
4228 " </label>\n" +
4229 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4230 " <select class=\"form-control\" name=\"default_grouping\" ng-model=\"application.resource.default_grouping\" ng-options=\"i[0] as i[1] for i in application.groupingOptions\"></select>\n" +
4231 " </div>\n" +
4072 " <div class=\"panel-body\">\n" +
4232 4073 "\n" +
4233 " </div>\n" +
4234 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
4235 " <data-form-errors errors=\"application.BasicForm.ae_validation.error_report_threshold\"></data-form-errors>\n" +
4236 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4237 " Alert on error reports\n" +
4238 " <span class=\"required\">*</span>\n" +
4239 " </label>\n" +
4240 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4241 " <input class=\"form-control\" name=\"error_report_threshold\" type=\"text\" ng-model=\"application.resource.error_report_threshold\">\n" +
4242 " <p class=\"description\">Application requires to send at least this amount of error reports per minute to open alert</p>\n" +
4243 " </div>\n" +
4244 " </div>\n" +
4245 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
4246 " <data-form-errors errors=\"application.BasicForm.ae_validation.slow_report_threshold\"></data-form-errors>\n" +
4247 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4248 " Alert on slow reports\n" +
4249 " <span class=\"required\">*</span>\n" +
4250 " </label>\n" +
4074 " <p><strong>System Load:</strong>\n" +
4075 " 1min: {{system.systemLoad[0]}}, 5min: {{system.systemLoad[1]}}, 15min: {{system.systemLoad[2]}}\n" +
4076 " </p>\n" +
4077 " <p><strong>Awaiting tasks:</strong>\n" +
4078 " <ul>\n" +
4079 " <li>reports: {{system.queueStats.waiting_reports}}</li>\n" +
4080 " <li>logs: {{system.queueStats.waiting_logs}}</li>\n" +
4081 " <li>metrics: {{system.queueStats.waiting_metrics}}</li>\n" +
4082 " <li>other: {{system.queueStats.waiting_other}}</li>\n" +
4083 " </ul>\n" +
4084 " </p>\n" +
4085 " <p><strong>Queue stats from last minute:</strong>\n" +
4086 " <ul>\n" +
4087 " <li>Processed reports: {{system.queueStats.processed_reports}}</li>\n" +
4088 " <li>Processed logs: {{system.queueStats.processed_logs}}</li>\n" +
4089 " <li>Processed metrics: {{system.queueStats.processed_metrics}}</li>\n" +
4090 " </ul>\n" +
4091 " </p>\n" +
4251 4092 "\n" +
4252 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4253 " <input class=\"form-control\" name=\"slow_report_threshold\" type=\"text\" ng-model=\"application.resource.slow_report_threshold\">\n" +
4254 " <p class=\"description\">Application requires to send at least this amount of slow reports per minute to open alert</p>\n" +
4255 " </div>\n" +
4256 " </div>\n" +
4257 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
4258 " <data-form-errors errors=\"application.BasicForm.ae_validation.allow_permanent_storage\"></data-form-errors>\n" +
4259 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4260 " Permanent logs\n" +
4261 " </label>\n" +
4262 " <div class=\" col-sm-8 col-lg-9\">\n" +
4263 " <input class=\"form-control\" name=\"allow_permanent_storage\" type=\"checkbox\" ng-model=\"application.resource.allow_permanent_storage\">\n" +
4264 " <p class=\"description\">Allow permanent storage of logs in separate DB partitions (only administrator can enable this feature)</p>\n" +
4265 " </div>\n" +
4266 " </div>\n" +
4267 " <div class=\"form-group\">\n" +
4268 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4093 " <p><strong>Disks:</strong>\n" +
4094 " <ul>\n" +
4095 " <li ng-repeat=\"disk in system.disks\">\n" +
4096 " <strong>{{disk.device}}</strong> {{disk.free}}/{{disk.total}}, {{disk.percentage}}% used\n" +
4097 " </li>\n" +
4098 " </ul>\n" +
4099 " </p>\n" +
4269 4100 "\n" +
4270 " </label>\n" +
4101 " <p><strong>Process stats:</strong>\n" +
4102 " <ul>\n" +
4103 " <li>FD soft limits: {{system.selfInfo.fds.soft}}</li>\n" +
4104 " <li>FD hard limits: {{system.selfInfo.fds.hard}}</li>\n" +
4105 " <li>Memlock soft limits: {{system.selfInfo.memlock.soft}}</li>\n" +
4106 " <li>Memlock hard limits: {{system.selfInfo.memlock.hard}}</li>\n" +
4107 " </ul>\n" +
4108 " </p>\n" +
4271 4109 "\n" +
4272 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4273 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"{{application.resource.resource_id? 'Update' : 'Create'}} Application\">\n" +
4274 4110 " </div>\n" +
4275 4111 " </div>\n" +
4276 " </form>\n" +
4277 4112 " </div>\n" +
4278 4113 " </div>\n" +
4114 " <div class=\"row\">\n" +
4115 " <div class=\"col-sm-12\">\n" +
4279 4116 "\n" +
4280 " <div class=\"panel panel-default\" ng-show=\"application.resource.resource_id\">\n" +
4281 " <div class=\"panel-heading\">\n" +
4282 " <h3 class=\"panel-title\">Plugins</h3>\n" +
4283 " </div>\n" +
4117 " <div class=\"panel panel-default\">\n" +
4284 4118 " <div class=\"panel-body\">\n" +
4285 4119 "\n" +
4286 " <plugin-config resource=\"application.resource\"\n" +
4287 " section=\"'application.update'\"\n" +
4288 " ng-if=\"application.resource.resource_id\">\n" +
4289 " </plugin-config>\n" +
4120 " <uib-tabset>\n" +
4121 " <uib-tab>\n" +
4122 " <uib-tab-heading>\n" +
4123 " Postgresql Tables\n" +
4124 " </uib-tab-heading>\n" +
4290 4125 "\n" +
4291 " </div>\n" +
4292 " </div>\n" +
4126 " <table class=\"table table-striped\">\n" +
4127 " <thead>\n" +
4128 " <tr>\n" +
4129 " <th class=\"c1 tablename\">Table name</th>\n" +
4130 " <th class=\"c2 size_human\">Size</th>\n" +
4131 " </tr>\n" +
4132 " </thead>\n" +
4133 " <tbody>\n" +
4134 " <tr class=\"r{{$index}}\" ng-repeat=\"row in system.DBtables\">\n" +
4135 " <td class=\"c1\">{{row.table_name}}</td>\n" +
4136 " <td class=\"c2\">{{row.size_human}}</td>\n" +
4137 " </tr>\n" +
4138 " </tbody>\n" +
4139 " </table>\n" +
4140 "\n" +
4141 " </uib-tab>\n" +
4293 4142 "\n" +
4294 " <div class=\"panel panel-default m-t-1\" ng-show=\"application.resource.resource_id\">\n" +
4295 " <div class=\"panel-heading\">\n" +
4296 " <h3 class=\"panel-title\">API Testing</h3>\n" +
4297 " </div>\n" +
4298 " <div class=\"panel-body\">\n" +
4299 " <p>Please be sure to add at least one <a data-ui-sref=\"user.alert_channels.email\"><strong>email alert channel</strong></a> for your account.</p>\n" +
4300 " <p>This will enable AppEnlight to send you notification emails about errors inside your application.</p>\n" +
4301 " <p><strong>After this is done you can use this CURL commands to test APIs:</strong></p>\n" +
4302 " <p>(Please note that the data like execution times is semi randomly generated)</p>\n" +
4303 " <uib-tabset>\n" +
4304 4143 " <uib-tab>\n" +
4305 4144 " <uib-tab-heading>\n" +
4306 " Log API\n" +
4145 " Elasticsearch Indices\n" +
4307 4146 " </uib-tab-heading>\n" +
4308 4147 "\n" +
4309 " <div class=\"codehilite\">\n" +
4310 " <pre class=\"m-a-0\">\n" +
4311 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/logs?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4312 " [\n" +
4313 " {\n" +
4314 " \"log_level\": \"WARNING\",\n" +
4315 " \"message\": \"OMG ValueError happened\",\n" +
4316 " \"namespace\": \"some.namespace.indicator\",\n" +
4317 " \"request_id\": \"SOME_UUID\",\n" +
4318 " \"permanent\": false,\n" +
4319 " \"primary_key\": \"random_key\",\n" +
4320 " \"server\": \"some.server.hostname\",\n" +
4321 " \"date\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4322 " \"tags\": [[\"tag1\",\"value\"], [\"tag2\", 5]]\n" +
4323 " },\n" +
4324 " {\n" +
4325 " \"log_level\": \"ERROR\",\n" +
4326 " \"message\": \"OMG ValueError happened2\",\n" +
4327 " \"namespace\": \"some.namespace.indicator\",\n" +
4328 " \"request_id\": \"SOME_UUID\",\n" +
4329 " \"permanent\": false,\n" +
4330 " \"server\": \"some.server.hostname\",\n" +
4331 " \"date\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\"\n" +
4332 " }\n" +
4333 " ]'\n" +
4334 " </pre>\n" +
4335 " </div>\n" +
4336 "\n" +
4337 " </uib-tab>\n" +
4338 "\n" +
4339 " <uib-tab>\n" +
4340 " <uib-tab-heading>\n" +
4341 " Report API\n" +
4342 " </uib-tab-heading>\n" +
4343 "\n" +
4344 " <div class=\"codehilite\">\n" +
4345 " <pre class=\"m-a-0\">\n" +
4346 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/reports?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4347 " [{\n" +
4348 " \"client\": \"your-client-name-python\",\n" +
4349 " \"language\": \"python\",\n" +
4350 " \"view_name\": \"views/foo:bar\",\n" +
4351 " \"server\": \"SERVERNAME/INSTANCENAME\",\n" +
4352 " \"priority\": 5,\n" +
4353 " \"error\": \"OMG ValueError happened\",\n" +
4354 " \"occurences\":1,\n" +
4355 " \"http_status\": 500,\n" +
4356 " \"tags\": [[\"tag1\",\"value\"], [\"tag2\", 5]],\n" +
4357 " \"username\": \"USER\",\n" +
4358 " \"url\": \"HTTP://SOMEURL\",\n" +
4359 " \"ip\": \"127.0.0.1\",\n" +
4360 " \"start_time\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4361 " \"end_time\": \"{{application.momentJs.utc().milliseconds(0).add(2, 'seconds').toISOString()}}\",\n" +
4362 " \"user_agent\": \"BROWSER_AGENT\",\n" +
4363 " \"extra\": [[\"message\",\"CUSTOM MESSAGE\"], [\"custom_value\", \"some payload\"]],\n" +
4364 " \"request_id\": \"SOME_UUID\",\n" +
4365 " \"request\": {\"REQUEST_METHOD\": \"GET\",\n" +
4366 " \"PATH_INFO\": \"/FOO/BAR\",\n" +
4367 " \"POST\": {\"FOO\":\"BAZ\",\"XXX\":\"YYY\"}\n" +
4368 " },\n" +
4369 " \"slow_calls\":[{\n" +
4370 " \"start\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4371 " \"end\": \"{{application.momentJs.utc().milliseconds(0).add(1, 'seconds').toISOString()}}\",\n" +
4372 " \"type\": \"sql\",\n" +
4373 " \"subtype\": \"postgresql\",\n" +
4374 " \"parameters\": [\"QPARAM1\",\"QPARAM2\",\"QPARAMX\"],\n" +
4375 " \"statement\": \"QUERY\"\n" +
4376 " }],\n" +
4377 " \"request_stats\": {\n" +
4378 " \"main\": 2.50779,\n" +
4379 " \"nosql\": 0.01008,\n" +
4380 " \"nosql_calls\": 17.0,\n" +
4381 " \"remote\": 0.0,\n" +
4382 " \"remote_calls\": 0.0,\n" +
4383 " \"sql\": 1,\n" +
4384 " \"sql_calls\": 1.0,\n" +
4385 " \"tmpl\": 0.0,\n" +
4386 " \"tmpl_calls\": 0.0,\n" +
4387 " \"custom\": 0.0,\n" +
4388 " \"custom_calls\": 0.0\n" +
4389 " },\n" +
4390 " \"traceback\": [\n" +
4391 " {\"cline\": \"return foo_bar_baz(1,2,3)\",\n" +
4392 " \"file\": \"somedir/somefile.py\",\n" +
4393 " \"fn\": \"somefunction\",\n" +
4394 " \"line\": 454,\n" +
4395 " \"vars\": [[\"a_list\",\n" +
4396 " [\"1\",2,\"4\",\"5\",6]],\n" +
4397 " [\"b\", {\"1\": \"2\", \"ccc\": \"ddd\", \"1\": \"a\"}],\n" +
4398 " [\"obj\", \"object object at 0x7f0030853dc0\"]]\n" +
4399 " },\n" +
4400 " {\"cline\": \"OMG ValueError happened\",\n" +
4401 " \"file\": \"\",\n" +
4402 " \"fn\": \"\",\n" +
4403 " \"line\": \"\",\n" +
4404 " \"vars\": []}\n" +
4405 " ]\n" +
4406 " }]'\n" +
4407 " </pre>\n" +
4408 " </div>\n" +
4148 " <table class=\"table table-striped\">\n" +
4149 " <thead>\n" +
4150 " <tr>\n" +
4151 " <th class=\"c1 tablename\">Index name</th>\n" +
4152 " <th class=\"c2 size_human\">Size</th>\n" +
4153 " </tr>\n" +
4154 " </thead>\n" +
4155 " <tbody>\n" +
4156 " <tr class=\"r{{$index}}\" ng-repeat=\"row in system.ESIndices\">\n" +
4157 " <td class=\"c1\">{{row.name}}</td>\n" +
4158 " <td class=\"c2\">{{row.size_human}}</td>\n" +
4159 " </tr>\n" +
4160 " </tbody>\n" +
4161 " </table>\n" +
4409 4162 "\n" +
4410 4163 " </uib-tab>\n" +
4411 4164 "\n" +
4412 4165 " <uib-tab>\n" +
4413 "\n" +
4414 4166 " <uib-tab-heading>\n" +
4415 " Metrics API\n" +
4167 " Processes\n" +
4416 4168 " </uib-tab-heading>\n" +
4417 4169 "\n" +
4418 " <div class=\"codehilite\">\n" +
4419 " <pre class=\"m-a-0\">\n" +
4420 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/general_metrics?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4421 " [{\n" +
4422 " \"namespace\": \"some.monitor\",\n" +
4423 " \"timestamp\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4424 " \"server_name\": \"server.name\",\n" +
4425 " \"tags\": [[\"value1\", 15.7], [\"value2\", 26]]}]'\n" +
4426 " </pre>\n" +
4427 " </div>\n" +
4170 " <table class=\"table table-striped\">\n" +
4171 " <thead>\n" +
4172 " <tr>\n" +
4173 " <th class=\"c1 tablename\">Owner</th>\n" +
4174 " <th class=\"c2 tablename\">PID</th>\n" +
4175 " <th class=\"c3 tablename\">CPU</th>\n" +
4176 " <th class=\"c4 tablename\">MEM</th>\n" +
4177 " <th class=\"c4 tablename\">Name</th>\n" +
4178 " </tr>\n" +
4179 " </thead>\n" +
4180 " <tbody>\n" +
4181 " <tr class=\"r{{$index}}\" ng-repeat-start=\"row in system.processInfo\">\n" +
4182 " <td class=\"c1\">{{row.owner}}</td>\n" +
4183 " <td class=\"c2\">{{row.pid}}</td>\n" +
4184 " <td class=\"c3\">{{row.cpu}}</td>\n" +
4185 " <td class=\"c4\">{{row.mem_usage}} ({{row.mem_percentage}}%)</td>\n" +
4186 " <td class=\"c5\"><strong>{{row.name}}</strong></td>\n" +
4187 " </tr>\n" +
4188 " <tr ng-repeat-end>\n" +
4189 " <td colspan=\"5\" class=\"word-wrap\">{{row.command}}</td>\n" +
4190 " </tr>\n" +
4191 " </tbody>\n" +
4192 " </table>\n" +
4428 4193 "\n" +
4429 4194 " </uib-tab>\n" +
4430 4195 "\n" +
4431 4196 " <uib-tab>\n" +
4432 "\n" +
4433 4197 " <uib-tab-heading>\n" +
4434 " Request Stats API\n" +
4198 " Python packages\n" +
4435 4199 " </uib-tab-heading>\n" +
4436 4200 "\n" +
4437 " <div class=\"codehilite\">\n" +
4438 " <pre class=\"m-a-0\">\n" +
4439 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/request_stats?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4440 " [{\"server\": \"some.server.hostname\",\n" +
4441 " \"timestamp\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4442 " \"metrics\": [[\"dir/module:func\",\n" +
4443 " {\"custom\": 0.0,\n" +
4444 " \"custom_calls\": 0,\n" +
4445 " \"main\": 0.01664,\n" +
4446 " \"nosql\": 0.00061,\n" +
4447 " \"nosql_calls\": 23,\n" +
4448 " \"remote\": 0.0,\n" +
4449 " \"remote_calls\": 0,\n" +
4450 " \"requests\": 1,\n" +
4451 " \"sql\": 0.00105,\n" +
4452 " \"sql_calls\": 2,\n" +
4453 " \"tmpl\": 0.0,\n" +
4454 " \"tmpl_calls\": 0}],\n" +
4455 " [\"SomeView.function\",\n" +
4456 " {\"custom\": 0.0,\n" +
4457 " \"custom_calls\": 0,\n" +
4458 " \"main\": 0.647261,\n" +
4459 " \"nosql\": 0.306554,\n" +
4460 " \"nosql_calls\": 140,\n" +
4461 " \"remote\": 0.0,\n" +
4462 " \"remote_calls\": 0,\n" +
4463 " \"requests\": 28,\n" +
4464 " \"sql\": 0.0,\n" +
4465 " \"sql_calls\": 0,\n" +
4466 " \"tmpl\": 0.0,\n" +
4467 " \"tmpl_calls\": 0}]]\n" +
4468 " }]'\n" +
4469 " </pre>\n" +
4470 " </div>\n" +
4201 " <table class=\"table\">\n" +
4202 " <tr ng-repeat=\"package in system.packages\">\n" +
4203 " <td>{{package.name}}</td>\n" +
4204 " <td>{{package.version}}</td>\n" +
4205 " </tr>\n" +
4206 " </table>\n" +
4207 " </p>\n" +
4471 4208 "\n" +
4472 4209 " </uib-tab>\n" +
4473 4210 "\n" +
4474 4211 " </uib-tabset>\n" +
4475 "\n" +
4476 4212 " </div>\n" +
4477 4213 " </div>\n" +
4214 " </div>\n" +
4215 " </div>\n" +
4216 "</div>\n"
4217 );
4218
4219
4220 $templateCache.put('templates/admin/users/parent_view.html',
4221 "<div ui-view></div>"
4222 );
4223
4224
4225 $templateCache.put('templates/admin/users/users_create.html',
4226 "<ng-include src=\"'templates/loader.html'\" ng-if=\"user.loading.user\"></ng-include>\n" +
4478 4227 "\n" +
4479 " <permissions-form resource=\"application.resource\" current-permissions=\"application.resource.current_permissions\"\n" +
4480 " possible-permissions=\"application.resource.possible_permissions\" ng-if=\"application.resource.resource_id\"></permissions-form>\n" +
4228 "<div ng-show=\"!user.loading.user\">\n" +
4481 4229 "\n" +
4482 " <div class=\"panel panel-info\" ng-show=\"application.resource.resource_id\">\n" +
4483 " <div class=\"panel-heading\">\n" +
4484 " <h3 class=\"panel-title\">Postprocessing</h3>\n" +
4485 " </div>\n" +
4230 " <div class=\"panel panel-default\">\n" +
4486 4231 " <div class=\"panel-body\">\n" +
4487 " <p>This section allows you influence the rating of report groups - if rule is matched once its not executed anymore</p>\n" +
4488 4232 "\n" +
4489 " <p>\n" +
4490 " <a class=\"btn btn-info\" ng-click=\"application.addRule()\"><span class=\"fa fa-plus-circle\"></span> Add rule</a>\n" +
4491 " </p>\n" +
4233 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"user.user.id\">\n" +
4234 " <a class=\"btn btn-default\" data-uib-dropdown-toggle><span class=\"fa fa-user-secret\"></span> Re-login to user</a>\n" +
4235 " <ul class=\"dropdown-menu\">\n" +
4236 " <li><a>No</a></li>\n" +
4237 " <li><a ng-click=\"user.reloginUser(user)\">Yes</a></li>\n" +
4238 " </ul>\n" +
4239 " </span>\n" +
4492 4240 "\n" +
4493 " <post-process-action action=\"action\" resource=\"application.resource\" ng-repeat=\"action in application.resource.postprocessing_rules\"></post-process-action>\n" +
4241 " <form name=\"user.profileForm\" class=\"form-horizontal\" ng-submit=\"user.createUser()\">\n" +
4242 " <div class=\"form-group\" id=\"row-user_name\">\n" +
4243 " <data-form-errors errors=\"user.profileForm.ae_validation.user_name\"></data-form-errors>\n" +
4244 " <label for=\"user_name\" id=\"label-user_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
4245 " User name\n" +
4246 " <span class=\"required\">*</span>\n" +
4247 " </label>\n" +
4248 " <div class=\"col-sm-8 col-lg-9\">\n" +
4249 " <input class=\"form-control\" id=\"user_name\" name=\"user_name\" type=\"text\" ng-model=\"user.user.user_name\">\n" +
4494 4250 " </div>\n" +
4495 4251 " </div>\n" +
4496 4252 "\n" +
4497 " <div class=\"panel panel-danger\" ng-show=\"application.resource.resource_id\">\n" +
4498 " <div class=\"panel-heading\">\n" +
4499 " <h3 class=\"panel-title\">Administration</h3>\n" +
4500 " </div>\n" +
4501 " <div class=\"panel-body\">\n" +
4502 " <h2>Transfer ownership</h2>\n" +
4503 " <p>Please note that by transfering ownership you WILL lose access to the application data and new owner needs to give you access permission</p>\n" +
4504 " <div class=\"confirmation_form\" ng-submit=\"application.transferApplication()\">\n" +
4505 " <form class=\"form-horizontal\" name=\"application.formTransfer\">\n" +
4506 " <div class=\"form-group\">\n" +
4507 " <data-form-errors errors=\"application.formTransfer.ae_validation.password\"></data-form-errors>\n" +
4508 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4253 " <div class=\"form-group\" id=\"row-user_password\">\n" +
4254 " <data-form-errors errors=\"user.profileForm.ae_validation.user_password\"></data-form-errors>\n" +
4255 " <label for=\"user_password\" id=\"label-user_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
4509 4256 " Password\n" +
4257 " <span class=\"required\">*</span>\n" +
4510 4258 " </label>\n" +
4511 4259 " <div class=\"col-sm-8 col-lg-9\">\n" +
4512 " <input class=\"form-control\" name=\"password\" type=\"password\" ng-model=\"application.formTransferModel.password\">\n" +
4513 " </div>\n" +
4514 " </div>\n" +
4515 " <div class=\"form-group\">\n" +
4516 " <data-form-errors errors=\"application.formTransfer.ae_validation.user_name\"></data-form-errors>\n" +
4517 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4518 " New owners username\n" +
4260 " <input class=\"form-control\" id=\"user_password\" name=\"user_password\" type=\"password\" ng-model=\"user.user.user_password\">\n" +
4261 "\n" +
4262 " <p class=\"m-t-1\"><a class=\"btn btn-info btn-sm\" ng-click=\"user.generatePassword()\"><span class=\"fa fa-lock\"></span> Generate password</a>\n" +
4263 " <span ng-show=\"user.gen_pass.length > 0\">(generated password: {{user.gen_pass}})</span>\n" +
4264 " </p>\n" +
4265 "\n" +
4266 " </div>\n" +
4267 " </div>\n" +
4268 "\n" +
4269 "\n" +
4270 " <div class=\"form-group\" id=\"row-email\">\n" +
4271 " <data-form-errors errors=\"user.profileForm.ae_validation.email\"></data-form-errors>\n" +
4272 " <label for=\"email\" id=\"label-email\" class=\"control-label col-sm-4 col-lg-3\">\n" +
4273 " Email Address\n" +
4274 " <span class=\"required\">*</span>\n" +
4519 4275 " </label>\n" +
4520 4276 " <div class=\"col-sm-8 col-lg-9\">\n" +
4521 " <input class=\"form-control\" name=\"user_name\" type=\"text\" ng-model=\"application.formTransferModel.user_name\">\n" +
4277 " <input class=\"form-control\" id=\"email\" name=\"email\" type=\"text\" ng-model=\"user.user.email\">\n" +
4522 4278 " </div>\n" +
4523 4279 " </div>\n" +
4524 " <div class=\"form-group\">\n" +
4525 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4280 "\n" +
4281 " <div class=\"form-group\" id=\"row-first_name\">\n" +
4282 " <data-form-errors errors=\"user.profileForm.ae_validation.first_name\"></data-form-errors>\n" +
4283 " <label for=\"first_name\" id=\"label-first_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
4284 " First Name\n" +
4526 4285 " </label>\n" +
4527 4286 " <div class=\"col-sm-8 col-lg-9\">\n" +
4528 " <button class=\"btn btn-danger\">\n" +
4529 " <span class=\"fa fa-user-plus\"></span>\n" +
4530 " Transfer ownership of application\n" +
4531 " </button>\n" +
4287 " <input class=\"form-control\" id=\"first_name\" name=\"first_name\" type=\"text\" ng-model=\"user.user.first_name\">\n" +
4532 4288 " </div>\n" +
4533 4289 " </div>\n" +
4534 " </form>\n" +
4290 " <div class=\"form-group\" id=\"row-last_name\">\n" +
4291 " <data-form-errors errors=\"user.profileForm.ae_validation.last_name\"></data-form-errors>\n" +
4292 " <label for=\"last_name\" id=\"label-last_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
4293 " Last Name\n" +
4294 " </label>\n" +
4295 " <div class=\"col-sm-8 col-lg-9\">\n" +
4296 " <input class=\"form-control\" id=\"last_name\" name=\"last_name\" type=\"text\" ng-model=\"user.user.last_name\">\n" +
4297 " </div>\n" +
4535 4298 " </div>\n" +
4536 4299 "\n" +
4537 " <hr/>\n" +
4538 "\n" +
4539 " <h2>Remove application</h2>\n" +
4540 " <p><strong>This operation will wipe out all data from database - there is no undo.</strong></p>\n" +
4541 "\n" +
4542 " <div class=\"confirmation_form\">\n" +
4543 " <form class=\"form-horizontal\" name=\"application.formDelete\" ng-submit=\"application.deleteApplication()\">\n" +
4544 " <div class=\"form-group\">\n" +
4545 " <data-form-errors errors=\"application.formDelete.ae_validation.password\"></data-form-errors>\n" +
4546 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4547 " Password\n" +
4300 " <div class=\"form-group\" id=\"row-status\">\n" +
4301 " <data-form-errors errors=\"user.profileForm.ae_validation.status\"></data-form-errors>\n" +
4302 " <label for=\"status\" id=\"label-status\" class=\"control-label col-sm-4 col-lg-3\">\n" +
4303 " Active\n" +
4548 4304 " </label>\n" +
4549 4305 " <div class=\"col-sm-8 col-lg-9\">\n" +
4550 " <input class=\"form-control\" name=\"password\" type=\"password\" ng-model=\"application.formDeleteModel.password\">\n" +
4306 " <input checked class=\"form-control\" id=\"status\" name=\"status\" type=\"checkbox\" ng-model=\"user.user.status\">\n" +
4551 4307 " </div>\n" +
4552 4308 " </div>\n" +
4553 " <div class=\"form-group\">\n" +
4554 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4555 4309 "\n" +
4310 " <div class=\"form-group\" id=\"row-submit\">\n" +
4311 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
4556 4312 " </label>\n" +
4557 4313 " <div class=\"col-sm-8 col-lg-9\">\n" +
4558 " <button class=\"btn btn-danger\">\n" +
4559 " <span class=\"fa fa-trash-o\"></span>\n" +
4560 " Delete my application\n" +
4561 " </button>\n" +
4314 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"{{$state.params.userId ? 'Update' : 'Add'}} User\">\n" +
4562 4315 " </div>\n" +
4563 4316 " </div>\n" +
4564 4317 " </form>\n" +
4565 4318 " </div>\n" +
4566 4319 " </div>\n" +
4567 " </div>\n" +
4568 "</div>\n"
4569 );
4570
4571
4572 $templateCache.put('templates/applications/breadcrumbs.html',
4573 "<ol class=\"breadcrumb\" ng-show=\"$state.includes('applications')\">\n" +
4574 " <li>Applications</li>\n" +
4575 " <li ng-show=\"$state.includes('applications.list')\" ng-class=\"{bold:$state.is('applications.list')}\">Owned applications</li>\n" +
4576 " <li ng-show=\"$state.includes('applications.update')\" ng-class=\"{bold:$state.is('applications.update')}\">Modify application</li>\n" +
4577 " <li ng-show=\"$state.includes('applications.integrations')\" ng-class=\"{bold:$state.includes('applications.integrations')}\">Integrations</li>\n" +
4578 " <li ng-show=\"$state.includes('applications.purge_logs')\" ng-class=\"{bold:$state.includes('applications.purge_logs')}\">Log Purging</li>\n" +
4579 "</ol>\n"
4580 );
4581
4582
4583 $templateCache.put('templates/applications/integrations.html',
4584 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application && $state.is('applications.integrations')\"></ng-include>\n" +
4585 4320 "\n" +
4586 "<ui-view>\n" +
4587 " <div class=\"panel panel-default\" ng-show=\"!integrations.loading.application\">\n" +
4588 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4321 "\n" +
4322 " <div class=\"panel panel-default\" ng-if=\"user.user.id\">\n" +
4323 " <div class=\"panel-heading\">\n" +
4324 " <h3 class=\"panel-title\">Permission Summary</h3>\n" +
4325 " </div>\n" +
4589 4326 " <div class=\"panel-body\">\n" +
4327 " <h3>Direct application permissions</h3>\n" +
4590 4328 "\n" +
4591 " <a class=\"btn btn-default integration\"\n" +
4592 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'bitbucket'})\">\n" +
4593 " <span class=\"fa fa-fw fa-bitbucket fa-3x pull-left\"></span>\n" +
4594 " <strong>Bitbucket</strong>\n" +
4329 " <ul class=\"list-group\">\n" +
4330 " <li ng-repeat=\"perm in user.resourcePermissions.user.application\" class=\"animate-repeat list-group-item\">\n" +
4331 " <strong>{{ perm.self.resource_name }}</strong>\n" +
4332 " <div class=\"pull-right\">\n" +
4595 4333 "\n" +
4596 " <p>Send issues and reports to Bitbucket</p>\n" +
4334 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
4335 "\n" +
4336 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Application\" data-ui-sref=\"applications.update({resourceId:perm.self.resource_id})\">\n" +
4337 " <span class=\"fa fa-cog\"></span>\n" +
4597 4338 " </a>\n" +
4339 " </div>\n" +
4340 " </li>\n" +
4341 " </ul>\n" +
4598 4342 "\n" +
4599 " <a class=\"btn btn-default integration\"\n" +
4600 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'campfire'})\">\n" +
4601 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4602 " <strong>Campfire</strong>\n" +
4343 " <h3>Direct dashboard permissions</h3>\n" +
4603 4344 "\n" +
4604 " <p>Receive reports and alerts in your Campfire rooms</p>\n" +
4605 " </a>\n" +
4345 " <ul class=\"list-group\">\n" +
4346 " <li ng-repeat=\"perm in user.resourcePermissions.user.dashboard\" class=\"animate-repeat list-group-item\">\n" +
4347 " <strong>{{ perm.self.resource_name }}</strong>\n" +
4348 " <div class=\"pull-right\">\n" +
4606 4349 "\n" +
4607 " <a class=\"btn btn-default integration\"\n" +
4608 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'flowdock'})\">\n" +
4609 " <span class=\"fa fa-fw fa-envelope fa-3x pull-left\"></span>\n" +
4610 " <strong>Flowdock</strong>\n" +
4350 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
4611 4351 "\n" +
4612 " <p>Receive reports and alerts on your Flowdock team\n" +
4613 " inbox</p>\n" +
4352 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Dashboard\" data-ui-sref=\"dashboard.update({resourceId:perm.self.resource_id})\">\n" +
4353 " <span class=\"fa fa-cog\"></span>\n" +
4614 4354 " </a>\n" +
4355 " </div>\n" +
4356 " </li>\n" +
4357 " </ul>\n" +
4615 4358 "\n" +
4616 " <a class=\"btn btn-default integration\"\n" +
4617 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'github'})\">\n" +
4618 " <span class=\"fa fa-fw fa-github fa-3x pull-left\"></span>\n" +
4619 " <strong>Github</strong>\n" +
4359 " </div>\n" +
4620 4360 "\n" +
4621 " <p>Send issues and reports to Github</p>\n" +
4622 " </a>\n" +
4361 " </div>\n" +
4623 4362 "\n" +
4624 " <a class=\"btn btn-default integration\"\n" +
4625 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'hipchat'})\">\n" +
4626 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4627 " <strong>HipChat</strong>\n" +
4628 4363 "\n" +
4629 " <p>Receive reports and alerts in your Hipchat chanels</p>\n" +
4630 " </a>\n" +
4364 "</div>\n"
4365 );
4366
4367
4368 $templateCache.put('templates/admin/users/users_list.html',
4369 "<ng-include src=\"'templates/loader.html'\" ng-if=\"users.loading.users\"></ng-include>\n" +
4631 4370 "\n" +
4632 " <a class=\"btn btn-default integration\"\n" +
4633 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'jira'})\">\n" +
4634 " <span class=\"fa fa-fw fa-ticket fa-3x pull-left\"></span>\n" +
4635 " <strong>Jira</strong>\n" +
4371 "<div ng-show=\"!users.loading.users\">\n" +
4636 4372 "\n" +
4637 " <p>Send issues and reports to Jira</p>\n" +
4638 " </a>\n" +
4373 " <div class=\"panel panel-default\">\n" +
4639 4374 "\n" +
4640 " <a class=\"btn btn-default integration\"\n" +
4641 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'slack'})\">\n" +
4642 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4643 " <strong>Slack</strong>\n" +
4375 " <div class=\"panel-heading\">\n" +
4376 " {{users.activeUsers}} active out of {{users.users.length}} users\n" +
4377 " </div>\n" +
4644 4378 "\n" +
4645 " <p>Receive reports and alerts in your Slack chanels</p>\n" +
4646 " </a>\n" +
4647 4379 "\n" +
4648 " <a class=\"btn btn-default integration\"\n" +
4649 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'webhooks'})\">\n" +
4650 " <span class=\"fa fa-fw fa-cloud-upload fa-3x pull-left\"></span>\n" +
4651 " <strong>Webhooks</strong>\n" +
4380 " <table st-table=\"displayedCollection\" st-safe-src=\"users.users\" class=\"table table-striped\">\n" +
4381 " <thead>\n" +
4382 " <tr>\n" +
4383 " <th class=\"user_name\" st-sort=\"user_name\"><a>Username</a></th>\n" +
4384 " <th class=\"email\" st-sort=\"email\"><a>Email</a></th>\n" +
4385 " <th class=\"status\" st-sort=\"status\"><a>Status</a></th>\n" +
4386 " <th st-sort=\"first_name\"><a>First Name</a></th>\n" +
4387 " <th st-sort=\"last_name\"><a>Last Name</a></th>\n" +
4388 " <th st-sort=\"last_login_date\"><a>Last login</a></th>\n" +
4389 " <th class=\"options\"></th>\n" +
4390 " </tr>\n" +
4391 " <tr>\n" +
4392 " <th><input st-search=\"user_name\" placeholder=\"search for user name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
4393 " <th><input st-search=\"email\" placeholder=\"search for email\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
4394 " <th></th>\n" +
4395 " <th><input st-search=\"first_name\" placeholder=\"search for first name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
4396 " <th><input st-search=\"last_name\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
4397 " <th><input st-search=\"last_login_date\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
4398 " <th></th>\n" +
4399 " </tr>\n" +
4400 " </thead>\n" +
4401 " <tbody>\n" +
4402 "\n" +
4403 " <tr ng-repeat=\"user in displayedCollection track by user.id\">\n" +
4404 " <td><img src=\"{{user.gravatar_url}}\" class=\"avatar\"> {{user.user_name}}</td>\n" +
4405 " <td class=\"word-wrap small\">{{user.email}}</td>\n" +
4406 " <td class=\"text-center\"><span class=\"fa\" ng-class=\"{'fa-check-circle':user.status, 'fa-times':!user.status}\"></span></td>\n" +
4407 " <td class=\"word-wrap small\">{{user.first_name}}</td>\n" +
4408 " <td class=\"word-wrap small\">{{user.last_name}}</td>\n" +
4409 " <td><span data-uib-tooltip=\"{{user.last_login_date}}\" class=\"small\">{{user.last_login_date | isoToRelativeTime}}</span></td>\n" +
4410 " <td>\n" +
4411 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"admin.user.update({userId:user.id})\"><span class=\"fa fa-cog\"></span></a>\n" +
4412 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4413 " <a class=\"btn btn-danger btn-sm\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
4414 " <ul class=\"dropdown-menu\">\n" +
4415 " <li><a>No</a></li>\n" +
4416 " <li><a ng-click=\"users.removeUser(user)\">Yes</a></li>\n" +
4417 " </ul>\n" +
4418 " </span>\n" +
4419 " </tr>\n" +
4420 " <tfoot>\n" +
4421 " <tr>\n" +
4422 " <td colspan=\"6\" class=\"text-center\">\n" +
4423 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
4424 " </td>\n" +
4425 " </tr>\n" +
4426 " </tfoot>\n" +
4427 " </tbody>\n" +
4428 " </table>\n" +
4429 "\n" +
4652 4430 "\n" +
4653 " <p>Notify third party API's of your reports and alerts</p>\n" +
4654 " </a>\n" +
4655 " </div>\n" +
4656 4431 " </div>\n" +
4657 "</ui-view>\n"
4432 "</div>\n"
4658 4433 );
4659 4434
4660 4435
4661 $templateCache.put('templates/applications/integrations/bitbucket.html',
4662 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4436 $templateCache.put('templates/applications/applications_purge_logs.html',
4437 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications_purge.loading.applications\"></ng-include>\n" +
4663 4438 "\n" +
4664 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4439 "<div ng-show=\"!applications_purge.loading.applications\">\n" +
4440 " <div class=\"panel panel-default\">\n" +
4665 4441 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4666 4442 " <div class=\"panel-body\">\n" +
4667 4443 "\n" +
4668 " <h1>Bitbucket Integration</h1>\n" +
4669 "\n" +
4670 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4444 " <form method=\"post\" class=\"form-horizontal\" name=\"applications_purge.form\" ng-submit=\"applications_purge.purgeLogs()\">\n" +
4671 4445 " <div class=\"form-group\">\n" +
4446 " <label class=\"control-label col-sm-3 col-lg-2\">Application:</label>\n" +
4672 4447 "\n" +
4673 " <label class=\"control-label col-sm-3 col-lg-2\">Repository</label>\n" +
4674 "\n" +
4675 " <div class=\"col-sm-8 col-lg-9\">\n" +
4676 "\n" +
4677 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
4678 " <data-form-errors errors=\"integration.integrationForm.ae_validation.repo_name\"></data-form-errors>\n" +
4679 "\n" +
4680 " <div class=\"input-group\">\n" +
4681 " <div class=\"input-group-addon\">https://bitbucket.org/</div>\n" +
4682 " <input class=\"form-control\" ng-model=\"integration.config.user_name\" placeholder=\"user\" type=\"text\">\n" +
4683 " <div class=\"input-group-addon\">/</div>\n" +
4684 " <input class=\"form-control\" ng-model=\"integration.config.repo_name\" placeholder=\"repo_name\" type=\"text\">\n" +
4685 " </div>\n" +
4686 "\n" +
4448 " <div class=\"col-sm-9 col-lg-10 form-inline\">\n" +
4449 " <select ng-model=\"applications_purge.selectedResource\" ng-change=\"applications_purge.getCommonKeys()\"\n" +
4450 " ng-options=\"r.resource_id as r.resource_name for r in applications_purge.applications\" class=\"form-control\"></select>\n" +
4687 4451 " </div>\n" +
4688 4452 " </div>\n" +
4453 "\n" +
4689 4454 " <div class=\"form-group\">\n" +
4455 " <label class=\"control-label col-sm-3 col-lg-2\">Namespace:</label>\n" +
4456 "\n" +
4457 " <div class=\"col-sm-9 col-lg-10\">\n" +
4458 " <input type=\"text\" name=\"namespace\" ng-model=\"applications_purge.namespace\"\n" +
4459 " placeholder=\"Namespace to filter on\" uib-typeahead=\"ns for ns in applications_purge.commonNamespaces\"\n" +
4460 " class=\"form-control\">\n" +
4461 " </div>\n" +
4462 " </div>\n" +
4690 4463 "\n" +
4464 " <div class=\"form-group\">\n" +
4691 4465 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4692 4466 "\n" +
4693 4467 " <div class=\"col-sm-8 col-lg-9 \">\n" +
4694 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Use this repo\">\n" +
4695 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4696 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4697 " <ul class=\"dropdown-menu\">\n" +
4698 " <li><a>No</a></li>\n" +
4699 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4700 " </ul>\n" +
4701 " </span>\n" +
4468 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Purge logs meeting the criteria\">\n" +
4702 4469 " </div>\n" +
4703 4470 " </div>\n" +
4704 " </form>\n" +
4705 "\n" +
4706 " <p class=\"m-t-1\">Remember you first need to\n" +
4707 " <strong>\n" +
4708 " <a data-ui-sref=\"user.profile.identities\">authorize your user account</a></strong>\n" +
4709 " with Bitbucket before we can send issues on your behalf.</p>\n" +
4710 "\n" +
4711 " <p>Every user will have to authorize AppEnlight to access Bitbucket to be able to post issues.</p>\n" +
4712 4471 "\n" +
4472 " </form>\n" +
4473 " </div>\n" +
4713 4474 " </div>\n" +
4714 4475 "</div>\n"
4715 4476 );
4716 4477
4717 4478
4718 $templateCache.put('templates/applications/integrations/campfire.html',
4719 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4479 $templateCache.put('templates/applications/applications_update.html',
4480 "<ng-include src=\"'templates/loader.html'\" ng-if=\"application.loading.application\"></ng-include>\n" +
4720 4481 "\n" +
4721 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4482 "<div ng-show=\"!application.loading.application\">\n" +
4483 "\n" +
4484 " <div class=\"panel panel-default\">\n" +
4722 4485 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4723 4486 " <div class=\"panel-body\">\n" +
4724 " <h1>Campfire Integration</h1>\n" +
4725 4487 "\n" +
4726 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4488 " <div class=\"row\" ng-show=\"application.resource.resource_id\">\n" +
4489 " <div class=\"col-sm-6\">\n" +
4727 4490 "\n" +
4728 " <div class=\"form-group\">\n" +
4491 " <uib-tabset>\n" +
4492 " <uib-tab>\n" +
4493 " <uib-tab-heading>\n" +
4494 " API keys\n" +
4495 " </uib-tab-heading>\n" +
4729 4496 "\n" +
4730 " <label class=\"control-label col-sm-3 col-lg-2\">Account name</label>\n" +
4731 " <div class=\"col-sm-8 col-lg-9\">\n" +
4732 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
4497 " <p><strong>PRIVATE API KEY:</strong></p>\n" +
4498 " <p>\n" +
4499 " <div class=\"well well-sm\">{{ application.resource.api_key }}</div>\n" +
4500 " </p>\n" +
4501 " <p><strong>PUBLIC API KEY</strong> (for javascript clients):</p>\n" +
4502 " <p>\n" +
4503 " <div class=\"well well-sm\">{{ application.resource.public_key }}</div>\n" +
4504 " </p>\n" +
4505 " <p><small>Your key will be used to identify to which application your data\n" +
4506 " belongs to please keep them private at all times.</small></p>\n" +
4733 4507 "\n" +
4734 " <div class=\"input-group\">\n" +
4735 " <div class=\"input-group-addon\">http://</div>\n" +
4736 " <input class=\"form-control\" ng-model=\"integration.config.account\" placeholder=\"account\">\n" +
4737 " <div class=\"input-group-addon\">.campfirenow.com</div>\n" +
4738 " </div>\n" +
4739 " </div>\n" +
4740 " </div>\n" +
4508 " </uib-tab>\n" +
4741 4509 "\n" +
4510 " <uib-tab>\n" +
4511 " <uib-tab-heading>\n" +
4512 " <span class=\"btn btn-danger btn-xs\"><span class=\"fa fa-exclamation-triangle\"></span></span> Regenerate API keys\n" +
4513 " </uib-tab-heading>\n" +
4514 " <p>Are you sure you want to regenerate API KEY for this application?</p>\n" +
4515 " <p>All client application keys will need to be updated.</p>\n" +
4516 " <form ng-submit=\"application.regenerateAPIKeys()\" name=\"application.regenerateAPIKeysForm\" class=\"form-inline\">\n" +
4517 " <data-form-errors errors=\"application.regenerateAPIKeysForm.ae_validation.password\"></data-form-errors>\n" +
4742 4518 " <div class=\"form-group\">\n" +
4743 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
4744 " <div class=\"col-sm-8 col-lg-9\">\n" +
4745 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
4746 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\">\n" +
4519 " <input type=\"password\" name=\"confirm\"\n" +
4520 " placeholder=\"Enter your password to proceed\" class=\"form-control\" ng-model=\"application.regenerateAPIKeysPassword\">\n" +
4521 " <input type=\"submit\" class=\"btn btn-danger\" value=\"Confirm\">\n" +
4747 4522 " </div>\n" +
4523 " </form>\n" +
4524 " </uib-tab>\n" +
4525 " </uib-tabset>\n" +
4748 4526 " </div>\n" +
4527 " <div class=\"col-sm-6 text-center\">\n" +
4528 " <h2 class=\"m-t-0\">How to connect your application?</h2>\n" +
4529 " <p>Visit our <a href=\"{{AeConfig.urls.docs}}\"><strong>developer documentation</strong></a> for step-by-step integration instructions.</p>\n" +
4530 " <div class=\"clearfix\"></div>\n" +
4531 " <p class=\"text-center\">\n" +
4532 " <a href=\"{{AeConfig.urls.docs}}\"><img src=\"/static/appenlight/images/logos/django_small.png\" alt=\"Django Logo\">\n" +
4533 " <img src=\"/static/appenlight/images/logos/pyramid_small.png\" alt=\"Pyramid Logo\">\n" +
4534 " <img src=\"/static/appenlight/images/logos/flask_small.png\" alt=\"Flask Logo\"></a>\n" +
4535 "\n" +
4536 " <a href=\"{{AeConfig.urls.docs}}\"><img src=\"/static/appenlight/images/logos/js_small.png\" alt=\"Javascript Logo\">\n" +
4537 " <img src=\"/static/appenlight/images/logos/nodejs.png\" alt=\"Node.js\"></a>\n" +
4538 " <img src=\"/static/appenlight/images/logos/ruby_small.png\" alt=\"Ruby Logo\">\n" +
4539 " <img src=\"/static/appenlight/images/logos/php_small.png\" alt=\"PHP Logo\">\n" +
4540 " </a>\n" +
4749 4541 "\n" +
4750 " <div class=\"form-group\">\n" +
4751 " <label class=\"control-label col-sm-3 col-lg-2\">Room ID list</label>\n" +
4752 " <div class=\"col-sm-8 col-lg-9\">\n" +
4753 " <data-form-errors errors=\"integration.integrationForm.ae_validation.rooms\"></data-form-errors>\n" +
4754 " <input class=\"form-control\" ng-model=\"integration.config.rooms\" placeholder=\"Room ID list\">\n" +
4755 " <p>\n" +
4756 " <small>Room ID list separated by comma</small>\n" +
4757 4542 " </p>\n" +
4758 4543 " </div>\n" +
4759 4544 " </div>\n" +
4760 " <div class=\"form-group\">\n" +
4761 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Campfire\">\n" +
4762 4545 "\n" +
4763 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4764 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4765 " <ul class=\"dropdown-menu\">\n" +
4766 " <li><a>No</a></li>\n" +
4767 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4768 " </ul>\n" +
4769 " </span>\n" +
4546 " <hr ng-show=\"application.resource.resource_id\">\n" +
4770 4547 "\n" +
4771 " <div class=\"btn-group\" uib-dropdown>\n" +
4772 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
4773 " Test integration <span class=\"caret\"></span>\n" +
4774 " </button>\n" +
4775 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
4776 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
4777 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
4778 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
4779 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
4780 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
4781 " </ul>\n" +
4782 " </div>\n" +
4548 " <form method=\"post\" class=\"form-horizontal\" name=\"application.BasicForm\" ng-submit=\"application.updateBasicForm()\" novalidate>\n" +
4549 " <div class=\"form-group\">\n" +
4550 " <data-form-errors errors=\"application.BasicForm.ae_validation.resource_name\"></data-form-errors>\n" +
4551 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4552 " Application name\n" +
4553 " <span class=\"required\">*</span>\n" +
4554 " </label>\n" +
4783 4555 "\n" +
4556 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4557 " <input class=\"form-control\" name=\"resource_name\" placeholder=\"Application Name\" type=\"text\" ng-model=\"application.resource.resource_name\">\n" +
4784 4558 " </div>\n" +
4785 4559 "\n" +
4786 " </form>\n" +
4787 4560 "\n" +
4788 4561 " </div>\n" +
4789 "</div>\n"
4790 );
4791
4792
4793 $templateCache.put('templates/applications/integrations/flowdock.html',
4794 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4795 "\n" +
4796 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4797 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4798 " <div class=\"panel-body\">\n" +
4799 "\n" +
4800 " <h1>Flowdock Integration</h1>\n" +
4801 "\n" +
4802 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4803 4562 "\n" +
4804 4563 " <div class=\"form-group\">\n" +
4805 "\n" +
4806 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
4807 "\n" +
4564 " <data-form-errors errors=\"application.BasicForm.ae_validation.domains\"></data-form-errors>\n" +
4565 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4566 " Domain names for CORS headers\n" +
4567 " </label>\n" +
4808 4568 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4809 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
4810 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\" type=\"text\">\n" +
4569 " <textarea class=\"form-control\" name=\"domains\" ng-model=\"application.resource.domains\"></textarea>\n" +
4570 " <p class=\"description\">Required for Javascript error tracking (one line one domain, skip http:// part)</p>\n" +
4811 4571 " </div>\n" +
4812 4572 "\n" +
4813 4573 "\n" +
4814 4574 " </div>\n" +
4815 "\n" +
4816 " <div class=\"form-group\">\n" +
4817 "\n" +
4818 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4819 "\n" +
4575 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
4576 " <data-form-errors errors=\"application.BasicForm.ae_validation.default_grouping\"></data-form-errors>\n" +
4577 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4578 " Default grouping for errors\n" +
4579 " </label>\n" +
4820 4580 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4581 " <select class=\"form-control\" name=\"default_grouping\" ng-model=\"application.resource.default_grouping\" ng-options=\"i[0] as i[1] for i in application.groupingOptions\"></select>\n" +
4582 " </div>\n" +
4821 4583 "\n" +
4822 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Flowdock\">\n" +
4584 " </div>\n" +
4585 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
4586 " <data-form-errors errors=\"application.BasicForm.ae_validation.error_report_threshold\"></data-form-errors>\n" +
4587 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4588 " Alert on error reports\n" +
4589 " <span class=\"required\">*</span>\n" +
4590 " </label>\n" +
4591 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4592 " <input class=\"form-control\" name=\"error_report_threshold\" type=\"text\" ng-model=\"application.resource.error_report_threshold\">\n" +
4593 " <p class=\"description\">Application requires to send at least this amount of error reports per minute to open alert</p>\n" +
4594 " </div>\n" +
4595 " </div>\n" +
4596 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
4597 " <data-form-errors errors=\"application.BasicForm.ae_validation.slow_report_threshold\"></data-form-errors>\n" +
4598 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4599 " Alert on slow reports\n" +
4600 " <span class=\"required\">*</span>\n" +
4601 " </label>\n" +
4823 4602 "\n" +
4824 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4825 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4826 " <ul class=\"dropdown-menu\">\n" +
4827 " <li><a>No</a></li>\n" +
4828 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4829 " </ul>\n" +
4830 " </span>\n" +
4831 " <div class=\"btn-group\" uib-dropdown>\n" +
4832 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
4833 " Test integration <span class=\"caret\"></span>\n" +
4834 " </button>\n" +
4835 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
4836 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
4837 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
4838 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
4839 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
4840 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
4841 " </ul>\n" +
4603 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4604 " <input class=\"form-control\" name=\"slow_report_threshold\" type=\"text\" ng-model=\"application.resource.slow_report_threshold\">\n" +
4605 " <p class=\"description\">Application requires to send at least this amount of slow reports per minute to open alert</p>\n" +
4606 " </div>\n" +
4842 4607 " </div>\n" +
4608 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
4609 " <data-form-errors errors=\"application.BasicForm.ae_validation.allow_permanent_storage\"></data-form-errors>\n" +
4610 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4611 " Permanent logs\n" +
4612 " </label>\n" +
4613 " <div class=\" col-sm-8 col-lg-9\">\n" +
4614 " <input class=\"form-control\" name=\"allow_permanent_storage\" type=\"checkbox\" ng-model=\"application.resource.allow_permanent_storage\">\n" +
4615 " <p class=\"description\">Allow permanent storage of logs in separate DB partitions (only administrator can enable this feature)</p>\n" +
4843 4616 " </div>\n" +
4844 4617 " </div>\n" +
4618 " <div class=\"form-group\">\n" +
4619 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4845 4620 "\n" +
4621 " </label>\n" +
4846 4622 "\n" +
4623 " <div class=\" col-sm-8 col-lg-9 \">\n" +
4624 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"{{application.resource.resource_id? 'Update' : 'Create'}} Application\">\n" +
4625 " </div>\n" +
4626 " </div>\n" +
4847 4627 " </form>\n" +
4848 "\n" +
4849 4628 " </div>\n" +
4850 "</div>\n"
4851 );
4852
4853
4854 $templateCache.put('templates/applications/integrations/github.html',
4855 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4629 " </div>\n" +
4856 4630 "\n" +
4857 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4858 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4631 " <div class=\"panel panel-default\" ng-show=\"application.resource.resource_id\">\n" +
4632 " <div class=\"panel-heading\">\n" +
4633 " <h3 class=\"panel-title\">Plugins</h3>\n" +
4634 " </div>\n" +
4859 4635 " <div class=\"panel-body\">\n" +
4860 4636 "\n" +
4861 " <h1>Github Integration</h1>\n" +
4862 "\n" +
4863 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4637 " <plugin-config resource=\"application.resource\"\n" +
4638 " section=\"'application.update'\"\n" +
4639 " ng-if=\"application.resource.resource_id\">\n" +
4640 " </plugin-config>\n" +
4864 4641 "\n" +
4642 " </div>\n" +
4643 " </div>\n" +
4865 4644 "\n" +
4866 " <div class=\"form-group\">\n" +
4867 "\n" +
4868 " <label class=\"control-label col-sm-3 col-lg-2\">Repository</label>\n" +
4869 "\n" +
4870 " <div class=\"col-sm-8 col-lg-9\">\n" +
4871 "\n" +
4872 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
4873 " <data-form-errors errors=\"integration.integrationForm.ae_validation.repo_name\"></data-form-errors>\n" +
4874 "\n" +
4875 " <div class=\"input-group\">\n" +
4876 " <div class=\"input-group-addon\">https://api.github.com/</div>\n" +
4877 " <input class=\"form-control\" ng-model=\"integration.config.user_name\" placeholder=\"user\" type=\"text\">\n" +
4878 " <div class=\"input-group-addon\">/</div>\n" +
4879 " <input class=\"form-control\" ng-model=\"integration.config.repo_name\" placeholder=\"repo_name\" type=\"text\">\n" +
4645 " <div class=\"panel panel-default m-t-1\" ng-show=\"application.resource.resource_id\">\n" +
4646 " <div class=\"panel-heading\">\n" +
4647 " <h3 class=\"panel-title\">API Testing</h3>\n" +
4880 4648 " </div>\n" +
4649 " <div class=\"panel-body\">\n" +
4650 " <p>Please be sure to add at least one <a data-ui-sref=\"user.alert_channels.email\"><strong>email alert channel</strong></a> for your account.</p>\n" +
4651 " <p>This will enable AppEnlight to send you notification emails about errors inside your application.</p>\n" +
4652 " <p><strong>After this is done you can use this CURL commands to test APIs:</strong></p>\n" +
4653 " <p>(Please note that the data like execution times is semi randomly generated)</p>\n" +
4654 " <uib-tabset>\n" +
4655 " <uib-tab>\n" +
4656 " <uib-tab-heading>\n" +
4657 " Log API\n" +
4658 " </uib-tab-heading>\n" +
4881 4659 "\n" +
4660 " <div class=\"codehilite\">\n" +
4661 " <pre class=\"m-a-0\">\n" +
4662 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/logs?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4663 " [\n" +
4664 " {\n" +
4665 " \"log_level\": \"WARNING\",\n" +
4666 " \"message\": \"OMG ValueError happened\",\n" +
4667 " \"namespace\": \"some.namespace.indicator\",\n" +
4668 " \"request_id\": \"SOME_UUID\",\n" +
4669 " \"permanent\": false,\n" +
4670 " \"primary_key\": \"random_key\",\n" +
4671 " \"server\": \"some.server.hostname\",\n" +
4672 " \"date\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4673 " \"tags\": [[\"tag1\",\"value\"], [\"tag2\", 5]]\n" +
4674 " },\n" +
4675 " {\n" +
4676 " \"log_level\": \"ERROR\",\n" +
4677 " \"message\": \"OMG ValueError happened2\",\n" +
4678 " \"namespace\": \"some.namespace.indicator\",\n" +
4679 " \"request_id\": \"SOME_UUID\",\n" +
4680 " \"permanent\": false,\n" +
4681 " \"server\": \"some.server.hostname\",\n" +
4682 " \"date\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\"\n" +
4683 " }\n" +
4684 " ]'\n" +
4685 " </pre>\n" +
4882 4686 " </div>\n" +
4883 " </div>\n" +
4884 "\n" +
4885 " <div class=\"form-group\">\n" +
4886 4687 "\n" +
4887 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4888 "\n" +
4889 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Use this repo\">\n" +
4688 " </uib-tab>\n" +
4890 4689 "\n" +
4891 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4892 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4893 " <ul class=\"dropdown-menu\">\n" +
4894 " <li><a>No</a></li>\n" +
4895 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4896 " </ul>\n" +
4897 " </span>\n" +
4690 " <uib-tab>\n" +
4691 " <uib-tab-heading>\n" +
4692 " Report API\n" +
4693 " </uib-tab-heading>\n" +
4898 4694 "\n" +
4695 " <div class=\"codehilite\">\n" +
4696 " <pre class=\"m-a-0\">\n" +
4697 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/reports?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4698 " [{\n" +
4699 " \"client\": \"your-client-name-python\",\n" +
4700 " \"language\": \"python\",\n" +
4701 " \"view_name\": \"views/foo:bar\",\n" +
4702 " \"server\": \"SERVERNAME/INSTANCENAME\",\n" +
4703 " \"priority\": 5,\n" +
4704 " \"error\": \"OMG ValueError happened\",\n" +
4705 " \"occurences\":1,\n" +
4706 " \"http_status\": 500,\n" +
4707 " \"tags\": [[\"tag1\",\"value\"], [\"tag2\", 5]],\n" +
4708 " \"username\": \"USER\",\n" +
4709 " \"url\": \"HTTP://SOMEURL\",\n" +
4710 " \"ip\": \"127.0.0.1\",\n" +
4711 " \"start_time\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4712 " \"end_time\": \"{{application.momentJs.utc().milliseconds(0).add(2, 'seconds').toISOString()}}\",\n" +
4713 " \"user_agent\": \"BROWSER_AGENT\",\n" +
4714 " \"extra\": [[\"message\",\"CUSTOM MESSAGE\"], [\"custom_value\", \"some payload\"]],\n" +
4715 " \"request_id\": \"SOME_UUID\",\n" +
4716 " \"request\": {\"REQUEST_METHOD\": \"GET\",\n" +
4717 " \"PATH_INFO\": \"/FOO/BAR\",\n" +
4718 " \"POST\": {\"FOO\":\"BAZ\",\"XXX\":\"YYY\"}\n" +
4719 " },\n" +
4720 " \"slow_calls\":[{\n" +
4721 " \"start\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4722 " \"end\": \"{{application.momentJs.utc().milliseconds(0).add(1, 'seconds').toISOString()}}\",\n" +
4723 " \"type\": \"sql\",\n" +
4724 " \"subtype\": \"postgresql\",\n" +
4725 " \"parameters\": [\"QPARAM1\",\"QPARAM2\",\"QPARAMX\"],\n" +
4726 " \"statement\": \"QUERY\"\n" +
4727 " }],\n" +
4728 " \"request_stats\": {\n" +
4729 " \"main\": 2.50779,\n" +
4730 " \"nosql\": 0.01008,\n" +
4731 " \"nosql_calls\": 17.0,\n" +
4732 " \"remote\": 0.0,\n" +
4733 " \"remote_calls\": 0.0,\n" +
4734 " \"sql\": 1,\n" +
4735 " \"sql_calls\": 1.0,\n" +
4736 " \"tmpl\": 0.0,\n" +
4737 " \"tmpl_calls\": 0.0,\n" +
4738 " \"custom\": 0.0,\n" +
4739 " \"custom_calls\": 0.0\n" +
4740 " },\n" +
4741 " \"traceback\": [\n" +
4742 " {\"cline\": \"return foo_bar_baz(1,2,3)\",\n" +
4743 " \"file\": \"somedir/somefile.py\",\n" +
4744 " \"fn\": \"somefunction\",\n" +
4745 " \"line\": 454,\n" +
4746 " \"vars\": [[\"a_list\",\n" +
4747 " [\"1\",2,\"4\",\"5\",6]],\n" +
4748 " [\"b\", {\"1\": \"2\", \"ccc\": \"ddd\", \"1\": \"a\"}],\n" +
4749 " [\"obj\", \"object object at 0x7f0030853dc0\"]]\n" +
4750 " },\n" +
4751 " {\"cline\": \"OMG ValueError happened\",\n" +
4752 " \"file\": \"\",\n" +
4753 " \"fn\": \"\",\n" +
4754 " \"line\": \"\",\n" +
4755 " \"vars\": []}\n" +
4756 " ]\n" +
4757 " }]'\n" +
4758 " </pre>\n" +
4899 4759 " </div>\n" +
4900 " </form>\n" +
4901 4760 "\n" +
4902 " <p class=\"m-t-1\">Remember you first need to\n" +
4903 " <strong>\n" +
4904 " <a data-ui-sref=\"user.profile.identities\">authorize your user account</a></strong>\n" +
4905 " with Github before we can send issues on your behalf.</p>\n" +
4761 " </uib-tab>\n" +
4906 4762 "\n" +
4907 " <p>Every user will have to authorize AppEnlight to access Github to be able to post issues.</p>\n" +
4763 " <uib-tab>\n" +
4908 4764 "\n" +
4909 " <div class=\"panel panel-warning\">\n" +
4910 " <div class=\"panel-heading\">Private repository access</div>\n" +
4911 " <div class=\"panel-body\">\n" +
4912 " <p>If you need access to private repositories <a data-ui-sref=\"user.profile.identities\">profile page</a> allows you to require token including private repository permissions.</p>\n" +
4765 " <uib-tab-heading>\n" +
4766 " Metrics API\n" +
4767 " </uib-tab-heading>\n" +
4913 4768 "\n" +
4914 " <p>Registration page OAuth does NOT give you token with private repository access permissions.</p>\n" +
4915 " </div>\n" +
4769 " <div class=\"codehilite\">\n" +
4770 " <pre class=\"m-a-0\">\n" +
4771 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/general_metrics?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4772 " [{\n" +
4773 " \"namespace\": \"some.monitor\",\n" +
4774 " \"timestamp\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4775 " \"server_name\": \"server.name\",\n" +
4776 " \"tags\": [[\"value1\", 15.7], [\"value2\", 26]]}]'\n" +
4777 " </pre>\n" +
4916 4778 " </div>\n" +
4917 4779 "\n" +
4918 " </div>\n" +
4919 "</div>\n"
4920 );
4921
4922
4923 $templateCache.put('templates/applications/integrations/hipchat.html',
4924 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4780 " </uib-tab>\n" +
4925 4781 "\n" +
4926 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4927 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4928 " <div class=\"panel-body\">\n" +
4782 " <uib-tab>\n" +
4929 4783 "\n" +
4930 " <h1>Hipchat Integration</h1>\n" +
4784 " <uib-tab-heading>\n" +
4785 " Request Stats API\n" +
4786 " </uib-tab-heading>\n" +
4931 4787 "\n" +
4932 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4788 " <div class=\"codehilite\">\n" +
4789 " <pre class=\"m-a-0\">\n" +
4790 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/request_stats?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4791 " [{\"server\": \"some.server.hostname\",\n" +
4792 " \"timestamp\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4793 " \"metrics\": [[\"dir/module:func\",\n" +
4794 " {\"custom\": 0.0,\n" +
4795 " \"custom_calls\": 0,\n" +
4796 " \"main\": 0.01664,\n" +
4797 " \"nosql\": 0.00061,\n" +
4798 " \"nosql_calls\": 23,\n" +
4799 " \"remote\": 0.0,\n" +
4800 " \"remote_calls\": 0,\n" +
4801 " \"requests\": 1,\n" +
4802 " \"sql\": 0.00105,\n" +
4803 " \"sql_calls\": 2,\n" +
4804 " \"tmpl\": 0.0,\n" +
4805 " \"tmpl_calls\": 0}],\n" +
4806 " [\"SomeView.function\",\n" +
4807 " {\"custom\": 0.0,\n" +
4808 " \"custom_calls\": 0,\n" +
4809 " \"main\": 0.647261,\n" +
4810 " \"nosql\": 0.306554,\n" +
4811 " \"nosql_calls\": 140,\n" +
4812 " \"remote\": 0.0,\n" +
4813 " \"remote_calls\": 0,\n" +
4814 " \"requests\": 28,\n" +
4815 " \"sql\": 0.0,\n" +
4816 " \"sql_calls\": 0,\n" +
4817 " \"tmpl\": 0.0,\n" +
4818 " \"tmpl_calls\": 0}]]\n" +
4819 " }]'\n" +
4820 " </pre>\n" +
4821 " </div>\n" +
4933 4822 "\n" +
4934 " <div class=\"form-group\">\n" +
4935 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
4823 " </uib-tab>\n" +
4824 "\n" +
4825 " </uib-tabset>\n" +
4936 4826 "\n" +
4937 " <div class=\"col-sm-8 col-lg-9\">\n" +
4938 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
4939 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\" type=\"text\">\n" +
4940 4827 " </div>\n" +
4941 4828 " </div>\n" +
4942 4829 "\n" +
4943 " <div class=\"form-group\">\n" +
4944 "\n" +
4945 " <label class=\"control-label col-sm-3 col-lg-2\">Room ID list</label>\n" +
4830 " <permissions-form resource=\"application.resource\" current-permissions=\"application.resource.current_permissions\"\n" +
4831 " possible-permissions=\"application.resource.possible_permissions\" ng-if=\"application.resource.resource_id\"></permissions-form>\n" +
4946 4832 "\n" +
4947 " <div class=\"col-sm-8 col-lg-9\">\n" +
4948 " <data-form-errors errors=\"integration.integrationForm.ae_validation.rooms\"></data-form-errors>\n" +
4949 " <input class=\"form-control\" ng-model=\"integration.config.rooms\" placeholder=\"Room ID list\" type=\"text\">\n" +
4833 " <div class=\"panel panel-info\" ng-show=\"application.resource.resource_id\">\n" +
4834 " <div class=\"panel-heading\">\n" +
4835 " <h3 class=\"panel-title\">Postprocessing</h3>\n" +
4836 " </div>\n" +
4837 " <div class=\"panel-body\">\n" +
4838 " <p>This section allows you influence the rating of report groups - if rule is matched once its not executed anymore</p>\n" +
4950 4839 "\n" +
4951 4840 " <p>\n" +
4952 " <small>Room ID list separated by comma</small>\n" +
4841 " <a class=\"btn btn-info\" ng-click=\"application.addRule()\"><span class=\"fa fa-plus-circle\"></span> Add rule</a>\n" +
4953 4842 " </p>\n" +
4954 " </div>\n" +
4955 4843 "\n" +
4844 " <post-process-action action=\"action\" resource=\"application.resource\" ng-repeat=\"action in application.resource.postprocessing_rules\"></post-process-action>\n" +
4845 " </div>\n" +
4956 4846 " </div>\n" +
4957 4847 "\n" +
4848 " <div class=\"panel panel-danger\" ng-show=\"application.resource.resource_id\">\n" +
4849 " <div class=\"panel-heading\">\n" +
4850 " <h3 class=\"panel-title\">Administration</h3>\n" +
4851 " </div>\n" +
4852 " <div class=\"panel-body\">\n" +
4853 " <h2>Transfer ownership</h2>\n" +
4854 " <p>Please note that by transfering ownership you WILL lose access to the application data and new owner needs to give you access permission</p>\n" +
4855 " <div class=\"confirmation_form\" ng-submit=\"application.transferApplication()\">\n" +
4856 " <form class=\"form-horizontal\" name=\"application.formTransfer\">\n" +
4958 4857 " <div class=\"form-group\">\n" +
4959 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4858 " <data-form-errors errors=\"application.formTransfer.ae_validation.password\"></data-form-errors>\n" +
4859 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4860 " Password\n" +
4861 " </label>\n" +
4960 4862 " <div class=\"col-sm-8 col-lg-9\">\n" +
4961 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Hipchat\">\n" +
4962 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4963 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4964 " <ul class=\"dropdown-menu\">\n" +
4965 " <li><a>No</a></li>\n" +
4966 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4967 " </ul>\n" +
4968 " </span>\n" +
4969 "\n" +
4970 " <div class=\"btn-group\" uib-dropdown>\n" +
4971 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
4972 " Test integration <span class=\"caret\"></span>\n" +
4863 " <input class=\"form-control\" name=\"password\" type=\"password\" ng-model=\"application.formTransferModel.password\">\n" +
4864 " </div>\n" +
4865 " </div>\n" +
4866 " <div class=\"form-group\">\n" +
4867 " <data-form-errors errors=\"application.formTransfer.ae_validation.user_name\"></data-form-errors>\n" +
4868 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4869 " New owners username\n" +
4870 " </label>\n" +
4871 " <div class=\"col-sm-8 col-lg-9\">\n" +
4872 " <input class=\"form-control\" name=\"user_name\" type=\"text\" ng-model=\"application.formTransferModel.user_name\">\n" +
4873 " </div>\n" +
4874 " </div>\n" +
4875 " <div class=\"form-group\">\n" +
4876 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4877 " </label>\n" +
4878 " <div class=\"col-sm-8 col-lg-9\">\n" +
4879 " <button class=\"btn btn-danger\">\n" +
4880 " <span class=\"fa fa-user-plus\"></span>\n" +
4881 " Transfer ownership of application\n" +
4973 4882 " </button>\n" +
4974 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
4975 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
4976 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
4977 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
4978 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
4979 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
4980 " </ul>\n" +
4981 4883 " </div>\n" +
4884 " </div>\n" +
4885 " </form>\n" +
4886 " </div>\n" +
4887 "\n" +
4888 " <hr/>\n" +
4982 4889 "\n" +
4890 " <h2>Remove application</h2>\n" +
4891 " <p><strong>This operation will wipe out all data from database - there is no undo.</strong></p>\n" +
4892 "\n" +
4893 " <div class=\"confirmation_form\">\n" +
4894 " <form class=\"form-horizontal\" name=\"application.formDelete\" ng-submit=\"application.deleteApplication()\">\n" +
4895 " <div class=\"form-group\">\n" +
4896 " <data-form-errors errors=\"application.formDelete.ae_validation.password\"></data-form-errors>\n" +
4897 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4898 " Password\n" +
4899 " </label>\n" +
4900 " <div class=\"col-sm-8 col-lg-9\">\n" +
4901 " <input class=\"form-control\" name=\"password\" type=\"password\" ng-model=\"application.formDeleteModel.password\">\n" +
4983 4902 " </div>\n" +
4984 4903 " </div>\n" +
4904 " <div class=\"form-group\">\n" +
4905 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4985 4906 "\n" +
4907 " </label>\n" +
4908 " <div class=\"col-sm-8 col-lg-9\">\n" +
4909 " <button class=\"btn btn-danger\">\n" +
4910 " <span class=\"fa fa-trash-o\"></span>\n" +
4911 " Delete my application\n" +
4912 " </button>\n" +
4913 " </div>\n" +
4914 " </div>\n" +
4986 4915 " </form>\n" +
4987 "\n" +
4916 " </div>\n" +
4917 " </div>\n" +
4988 4918 " </div>\n" +
4989 4919 "</div>\n"
4990 4920 );
4991 4921
4992 4922
4993 $templateCache.put('templates/applications/integrations/jira.html',
4994 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4923 $templateCache.put('templates/applications/breadcrumbs.html',
4924 "<ol class=\"breadcrumb\" ng-show=\"$state.includes('applications')\">\n" +
4925 " <li>Applications</li>\n" +
4926 " <li ng-show=\"$state.includes('applications.list')\" ng-class=\"{bold:$state.is('applications.list')}\">Owned applications</li>\n" +
4927 " <li ng-show=\"$state.includes('applications.update')\" ng-class=\"{bold:$state.is('applications.update')}\">Modify application</li>\n" +
4928 " <li ng-show=\"$state.includes('applications.integrations')\" ng-class=\"{bold:$state.includes('applications.integrations')}\">Integrations</li>\n" +
4929 " <li ng-show=\"$state.includes('applications.purge_logs')\" ng-class=\"{bold:$state.includes('applications.purge_logs')}\">Log Purging</li>\n" +
4930 "</ol>\n"
4931 );
4932
4933
4934 $templateCache.put('templates/applications/integrations.html',
4935 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application && $state.is('applications.integrations')\"></ng-include>\n" +
4995 4936 "\n" +
4996 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4937 "<ui-view>\n" +
4938 " <div class=\"panel panel-default\" ng-show=\"!integrations.loading.application\">\n" +
4997 4939 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4998 4940 " <div class=\"panel-body\">\n" +
4999 4941 "\n" +
5000 " <h1>Jira Integration</h1>\n" +
4942 " <a class=\"btn btn-default integration\"\n" +
4943 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'bitbucket'})\">\n" +
4944 " <span class=\"fa fa-fw fa-bitbucket fa-3x pull-left\"></span>\n" +
4945 " <strong>Bitbucket</strong>\n" +
5001 4946 "\n" +
5002 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4947 " <p>Send issues and reports to Bitbucket</p>\n" +
4948 " </a>\n" +
5003 4949 "\n" +
5004 " <div class=\"form-group\" id=\"row-host_name\">\n" +
4950 " <a class=\"btn btn-default integration\"\n" +
4951 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'campfire'})\">\n" +
4952 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4953 " <strong>Campfire</strong>\n" +
5005 4954 "\n" +
5006 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5007 " Server URL <span class=\"required\">*</span>\n" +
5008 " </label>\n" +
5009 " <div class=\"col-sm-8 col-lg-9\">\n" +
5010 " <data-form-errors errors=\"integration.integrationForm.ae_validation.host_name\"></data-form-errors>\n" +
5011 " <input class=\"form-control\" id=\"host_name\" name=\"host_name\" type=\"text\" ng-model=\"integration.config.host_name\">\n" +
4955 " <p>Receive reports and alerts in your Campfire rooms</p>\n" +
4956 " </a>\n" +
5012 4957 "\n" +
5013 " <p>\n" +
5014 " <small>https://servername.atlassian.net</small>\n" +
5015 " </p>\n" +
4958 " <a class=\"btn btn-default integration\"\n" +
4959 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'flowdock'})\">\n" +
4960 " <span class=\"fa fa-fw fa-envelope fa-3x pull-left\"></span>\n" +
4961 " <strong>Flowdock</strong>\n" +
5016 4962 "\n" +
5017 " </div>\n" +
5018 " </div>\n" +
5019 " <div class=\"form-group\" id=\"row-user_name\">\n" +
4963 " <p>Receive reports and alerts on your Flowdock team\n" +
4964 " inbox</p>\n" +
4965 " </a>\n" +
5020 4966 "\n" +
5021 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5022 " Username <span class=\"required\">*</span>\n" +
5023 " </label>\n" +
5024 " <div class=\"col-sm-8 col-lg-9\">\n" +
4967 " <a class=\"btn btn-default integration\"\n" +
4968 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'github'})\">\n" +
4969 " <span class=\"fa fa-fw fa-github fa-3x pull-left\"></span>\n" +
4970 " <strong>Github</strong>\n" +
5025 4971 "\n" +
5026 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
5027 " <input class=\"form-control\" id=\"user_name\" name=\"user_name\" type=\"text\" ng-model=\"integration.config.user_name\">\n" +
4972 " <p>Send issues and reports to Github</p>\n" +
4973 " </a>\n" +
5028 4974 "\n" +
5029 " <p>\n" +
5030 " <small>user@email.com</small>\n" +
5031 " </p>\n" +
4975 " <a class=\"btn btn-default integration\"\n" +
4976 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'hipchat'})\">\n" +
4977 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4978 " <strong>HipChat</strong>\n" +
4979 "\n" +
4980 " <p>Receive reports and alerts in your Hipchat chanels</p>\n" +
4981 " </a>\n" +
4982 "\n" +
4983 " <a class=\"btn btn-default integration\"\n" +
4984 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'jira'})\">\n" +
4985 " <span class=\"fa fa-fw fa-ticket fa-3x pull-left\"></span>\n" +
4986 " <strong>Jira</strong>\n" +
4987 "\n" +
4988 " <p>Send issues and reports to Jira</p>\n" +
4989 " </a>\n" +
4990 "\n" +
4991 " <a class=\"btn btn-default integration\"\n" +
4992 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'slack'})\">\n" +
4993 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4994 " <strong>Slack</strong>\n" +
4995 "\n" +
4996 " <p>Receive reports and alerts in your Slack chanels</p>\n" +
4997 " </a>\n" +
4998 "\n" +
4999 " <a class=\"btn btn-default integration\"\n" +
5000 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'webhooks'})\">\n" +
5001 " <span class=\"fa fa-fw fa-cloud-upload fa-3x pull-left\"></span>\n" +
5002 " <strong>Webhooks</strong>\n" +
5032 5003 "\n" +
5004 " <p>Notify third party API's of your reports and alerts</p>\n" +
5005 " </a>\n" +
5033 5006 " </div>\n" +
5034 5007 " </div>\n" +
5035 " <div class=\"form-group\" id=\"row-password\">\n" +
5008 "</ui-view>\n"
5009 );
5010
5011
5012 $templateCache.put('templates/applications/integrations/bitbucket.html',
5013 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
5014 "\n" +
5015 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
5016 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
5017 " <div class=\"panel-body\">\n" +
5018 "\n" +
5019 " <h1>Bitbucket Integration</h1>\n" +
5020 "\n" +
5021 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
5022 " <div class=\"form-group\">\n" +
5023 "\n" +
5024 " <label class=\"control-label col-sm-3 col-lg-2\">Repository</label>\n" +
5036 5025 "\n" +
5037 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5038 " Password <span class=\"required\">*</span>\n" +
5039 " </label>\n" +
5040 5026 " <div class=\"col-sm-8 col-lg-9\">\n" +
5041 " <data-form-errors errors=\"integration.integrationForm.ae_validation.password\"></data-form-errors>\n" +
5042 " <input class=\"form-control\" id=\"password\" name=\"password\" type=\"password\" ng-model=\"integration.config.password\">\n" +
5043 " </div>\n" +
5027 "\n" +
5028 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
5029 " <data-form-errors errors=\"integration.integrationForm.ae_validation.repo_name\"></data-form-errors>\n" +
5030 "\n" +
5031 " <div class=\"input-group\">\n" +
5032 " <div class=\"input-group-addon\">https://bitbucket.org/</div>\n" +
5033 " <input class=\"form-control\" ng-model=\"integration.config.user_name\" placeholder=\"user\" type=\"text\">\n" +
5034 " <div class=\"input-group-addon\">/</div>\n" +
5035 " <input class=\"form-control\" ng-model=\"integration.config.repo_name\" placeholder=\"repo_name\" type=\"text\">\n" +
5044 5036 " </div>\n" +
5045 " <div class=\"form-group\" id=\"row-project\">\n" +
5046 5037 "\n" +
5047 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5048 " Project key <span class=\"required\">*</span>\n" +
5049 " </label>\n" +
5050 " <div class=\"col-sm-8 col-lg-9\">\n" +
5051 " <data-form-errors errors=\"integration.integrationForm.ae_validation.project\"></data-form-errors>\n" +
5052 " <input class=\"form-control\" id=\"project\" name=\"project\" type=\"text\" ng-model=\"integration.config.project\">\n" +
5053 5038 " </div>\n" +
5054 5039 " </div>\n" +
5055 " <div class=\"form-group\" id=\"row-submit\">\n" +
5040 " <div class=\"form-group\">\n" +
5041 "\n" +
5056 5042 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
5057 " <div class=\"col-sm-8 col-lg-9\">\n" +
5058 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Setup Jira\">\n" +
5059 5043 "\n" +
5044 " <div class=\"col-sm-8 col-lg-9\">\n" +
5045 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Use this repo\">\n" +
5060 5046 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
5061 5047 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
5062 5048 " <ul class=\"dropdown-menu\">\n" +
@@ -5066,43 +5052,64 b' function kickstartAE(initialUserData) {'
5066 5052 " </span>\n" +
5067 5053 " </div>\n" +
5068 5054 " </div>\n" +
5069 "\n" +
5070 5055 " </form>\n" +
5071 5056 "\n" +
5057 " <p class=\"m-t-1\">Remember you first need to\n" +
5058 " <strong>\n" +
5059 " <a data-ui-sref=\"user.profile.identities\">authorize your user account</a></strong>\n" +
5060 " with Bitbucket before we can send issues on your behalf.</p>\n" +
5061 "\n" +
5062 " <p>Every user will have to authorize AppEnlight to access Bitbucket to be able to post issues.</p>\n" +
5072 5063 "\n" +
5073 5064 " </div>\n" +
5074 5065 "</div>\n"
5075 5066 );
5076 5067
5077 5068
5078 $templateCache.put('templates/applications/integrations/slack.html',
5069 $templateCache.put('templates/applications/integrations/campfire.html',
5079 5070 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
5080 5071 "\n" +
5081 5072 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
5082 5073 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
5083 5074 " <div class=\"panel-body\">\n" +
5084 "\n" +
5085 " <h1>Slack Integration</h1>\n" +
5075 " <h1>Campfire Integration</h1>\n" +
5086 5076 "\n" +
5087 5077 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
5088 5078 "\n" +
5089 5079 " <div class=\"form-group\">\n" +
5090 5080 "\n" +
5091 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5092 " API Token <span class=\"required\">*</span>\n" +
5093 " </label>\n" +
5081 " <label class=\"control-label col-sm-3 col-lg-2\">Account name</label>\n" +
5094 5082 " <div class=\"col-sm-8 col-lg-9\">\n" +
5095 " <data-form-errors errors=\"integration.integrationForm.ae_validation.webhook_url\"></data-form-errors>\n" +
5096 " <input class=\"form-control\" ng-model=\"integration.config.webhook_url\" placeholder=\"Webhook URL\" type=\"webhook_url\">\n" +
5083 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
5084 "\n" +
5085 " <div class=\"input-group\">\n" +
5086 " <div class=\"input-group-addon\">http://</div>\n" +
5087 " <input class=\"form-control\" ng-model=\"integration.config.account\" placeholder=\"account\">\n" +
5088 " <div class=\"input-group-addon\">.campfirenow.com</div>\n" +
5089 " </div>\n" +
5097 5090 " </div>\n" +
5098 5091 " </div>\n" +
5099 5092 "\n" +
5100 5093 " <div class=\"form-group\">\n" +
5094 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
5095 " <div class=\"col-sm-8 col-lg-9\">\n" +
5096 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
5097 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\">\n" +
5098 " </div>\n" +
5099 " </div>\n" +
5101 5100 "\n" +
5102 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
5101 " <div class=\"form-group\">\n" +
5102 " <label class=\"control-label col-sm-3 col-lg-2\">Room ID list</label>\n" +
5103 5103 " <div class=\"col-sm-8 col-lg-9\">\n" +
5104 " <input type=\"submit\" class=\"btn btn-primary\"\n" +
5105 " value=\"Connect to Slack\">\n" +
5104 " <data-form-errors errors=\"integration.integrationForm.ae_validation.rooms\"></data-form-errors>\n" +
5105 " <input class=\"form-control\" ng-model=\"integration.config.rooms\" placeholder=\"Room ID list\">\n" +
5106 " <p>\n" +
5107 " <small>Room ID list separated by comma</small>\n" +
5108 " </p>\n" +
5109 " </div>\n" +
5110 " </div>\n" +
5111 " <div class=\"form-group\">\n" +
5112 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Campfire\">\n" +
5106 5113 "\n" +
5107 5114 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
5108 5115 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
@@ -5113,7 +5120,7 b' function kickstartAE(initialUserData) {'
5113 5120 " </span>\n" +
5114 5121 "\n" +
5115 5122 " <div class=\"btn-group\" uib-dropdown>\n" +
5116 " <button type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
5123 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
5117 5124 " Test integration <span class=\"caret\"></span>\n" +
5118 5125 " </button>\n" +
5119 5126 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
@@ -5124,8 +5131,9 b' function kickstartAE(initialUserData) {'
5124 5131 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
5125 5132 " </ul>\n" +
5126 5133 " </div>\n" +
5134 "\n" +
5127 5135 " </div>\n" +
5128 " </div>\n" +
5136 "\n" +
5129 5137 " </form>\n" +
5130 5138 "\n" +
5131 5139 " </div>\n" +
@@ -5133,43 +5141,37 b' function kickstartAE(initialUserData) {'
5133 5141 );
5134 5142
5135 5143
5136 $templateCache.put('templates/applications/integrations/webhooks.html',
5144 $templateCache.put('templates/applications/integrations/flowdock.html',
5137 5145 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
5138 5146 "\n" +
5139 5147 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
5140 5148 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
5141 5149 " <div class=\"panel-body\">\n" +
5142 5150 "\n" +
5143 " <h1>Webhooks Integration</h1>\n" +
5151 " <h1>Flowdock Integration</h1>\n" +
5144 5152 "\n" +
5145 5153 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
5146 " <div class=\"form-group\" id=\"row-reports_webhook\">\n" +
5147 5154 "\n" +
5148 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5149 " Reports webhook <span class=\"required\">*</span>\n" +
5150 " </label>\n" +
5151 " <div class=\"col-sm-8 col-lg-9\">\n" +
5152 " <data-form-errors errors=\"integration.integrationForm.ae_validation.reports_webhook\"></data-form-errors>\n" +
5153 " <input class=\"form-control\" id=\"reports_webhook\" name=\"reports_webhook\" type=\"text\" ng-model=\"integration.config.reports_webhook\">\n" +
5154 " </div>\n" +
5155 " </div>\n" +
5156 " <div class=\"form-group\" id=\"row-alerts_webhook\">\n" +
5155 " <div class=\"form-group\">\n" +
5156 "\n" +
5157 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
5157 5158 "\n" +
5158 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5159 " Alerts webhook <span class=\"required\">*</span>\n" +
5160 " </label>\n" +
5161 5159 " <div class=\"col-sm-8 col-lg-9\">\n" +
5162 " <data-form-errors errors=\"integration.integrationForm.ae_validation.alerts_webhook\"></data-form-errors>\n" +
5163 " <input class=\"form-control StringField None\" id=\"alerts_webhook\" name=\"alerts_webhook\" type=\"text\" ng-model=\"integration.config.alerts_webhook\">\n" +
5160 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
5161 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\" type=\"text\">\n" +
5164 5162 " </div>\n" +
5165 5163 "\n" +
5166 5164 "\n" +
5167 5165 " </div>\n" +
5168 " <div class=\"form-group\" id=\"row-submit\">\n" +
5166 "\n" +
5167 " <div class=\"form-group\">\n" +
5169 5168 "\n" +
5170 5169 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
5170 "\n" +
5171 5171 " <div class=\"col-sm-8 col-lg-9\">\n" +
5172 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Setup webhooks\">\n" +
5172 "\n" +
5173 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Flowdock\">\n" +
5174 "\n" +
5173 5175 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
5174 5176 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
5175 5177 " <ul class=\"dropdown-menu\">\n" +
@@ -5177,409 +5179,406 b' function kickstartAE(initialUserData) {'
5177 5179 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
5178 5180 " </ul>\n" +
5179 5181 " </span>\n" +
5182 " <div class=\"btn-group\" uib-dropdown>\n" +
5183 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
5184 " Test integration <span class=\"caret\"></span>\n" +
5185 " </button>\n" +
5186 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
5187 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
5188 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
5189 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
5190 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
5191 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
5192 " </ul>\n" +
5180 5193 " </div>\n" +
5181 5194 " </div>\n" +
5182 " </form>\n" +
5183 5195 " </div>\n" +
5184 "</div>\n"
5185 );
5186
5187
5188 $templateCache.put('templates/applications/list.html',
5189 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications.loading.applications\"></ng-include>\n" +
5190 5196 "\n" +
5191 "<div class=\"panel panel-default\" ng-show=\"!applications.loading.applications\">\n" +
5192 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
5193 " <div class=\"panel-body\" ng-if=\"applications.applications.length === 0 \">\n" +
5194 5197 "\n" +
5195 " <p>You have to create a new application first.</p>\n" +
5198 " </form>\n" +
5196 5199 "\n" +
5197 5200 " </div>\n" +
5198 "\n" +
5199 " <table class=\"table table-striped\" ng-if=\"applications.applications.length > 0\">\n" +
5200 " <thead>\n" +
5201 " <tr>\n" +
5202 " <th class=\"resource_name\">Resource Name</th>\n" +
5203 " <th class=\"domains\">Domains</th>\n" +
5204 " <th class=\"options\">Options</th>\n" +
5205 " </tr>\n" +
5206 " </thead>\n" +
5207 " <tbody>\n" +
5208 " <tr class=\"r{{$index+1}}\" ng-repeat=\"application in applications.applications\">\n" +
5209 " <td>{{application.resource_name}}</td>\n" +
5210 " <td>{{application.domains}}</td>\n" +
5211 " <td class=\"options\">\n" +
5212 " <a class=\"btn btn-default\" data-ui-sref=\"applications.update({resourceId:application.resource_id})\" data-toggle=\"tooltip\" title=\"Update application\"><span class=\"fa fa-cog\"></span> Update</a>\n" +
5213 " <a class=\"btn btn-default\" data-ui-sref=\"applications.integrations({resourceId:application.resource_id})\" data-toggle=\"tooltip\" title=\"Manage Integrations\"><span class=\"fa fa-wrench\"></span> Integrations</a>\n" +
5214 " </td>\n" +
5215 " </tr>\n" +
5216 " </tbody>\n" +
5217 " </table>\n" +
5218 "\n" +
5219 5201 "</div>\n"
5220 5202 );
5221 5203
5222 5204
5223 $templateCache.put('templates/applications/parent_view.html',
5224 "<div class=\"row application-management\">\n" +
5225 " <div class=\"col-sm-3\" id=\"menu\">\n" +
5226 " <div ng-include=\"'templates/user/menu.html'\"></div>\n" +
5227 " </div>\n" +
5205 $templateCache.put('templates/applications/integrations/github.html',
5206 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
5228 5207 "\n" +
5229 " <div class=\"col-sm-9\" ui-view></div>\n" +
5208 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
5209 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
5210 " <div class=\"panel-body\">\n" +
5230 5211 "\n" +
5231 "</div>\n"
5232 );
5233
5234
5235 $templateCache.put('templates/dashboard.html',
5236 "<style type=\"text/css\">\n" +
5237 " #metrics_chart .c3-line {\n" +
5238 " stroke-width: 0px;\n" +
5239 " }\n" +
5212 " <h1>Github Integration</h1>\n" +
5240 5213 "\n" +
5241 " #metrics_chart .c3-area {\n" +
5242 " stroke-width: 0;\n" +
5243 " opacity: 0.75;\n" +
5244 " }\n" +
5214 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
5245 5215 "\n" +
5246 5216 "\n" +
5247 "</style>\n" +
5217 " <div class=\"form-group\">\n" +
5248 5218 "\n" +
5249 "<div class=\"row\">\n" +
5250 " <div class=\"col-sm-12 dashboard\" id=\"content\">\n" +
5251 " <div ng-if=\"!index.stateHolder.AeUser.applications.length\">\n" +
5219 " <label class=\"control-label col-sm-3 col-lg-2\">Repository</label>\n" +
5252 5220 "\n" +
5253 " <div ng-include=\"'templates/quickstart.html'\"></div>\n" +
5221 " <div class=\"col-sm-8 col-lg-9\">\n" +
5222 "\n" +
5223 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
5224 " <data-form-errors errors=\"integration.integrationForm.ae_validation.repo_name\"></data-form-errors>\n" +
5254 5225 "\n" +
5226 " <div class=\"input-group\">\n" +
5227 " <div class=\"input-group-addon\">https://api.github.com/</div>\n" +
5228 " <input class=\"form-control\" ng-model=\"integration.config.user_name\" placeholder=\"user\" type=\"text\">\n" +
5229 " <div class=\"input-group-addon\">/</div>\n" +
5230 " <input class=\"form-control\" ng-model=\"integration.config.repo_name\" placeholder=\"repo_name\" type=\"text\">\n" +
5255 5231 " </div>\n" +
5256 5232 "\n" +
5257 " <div ng-if=\"index.stateHolder.AeUser.applications.length\">\n" +
5233 " </div>\n" +
5234 " </div>\n" +
5258 5235 "\n" +
5259 " <div class=\"row\">\n" +
5260 " <div class=\"col-sm-6\">\n" +
5261 " <div class=\"panel panel-default\">\n" +
5262 " <div class=\"panel-body\">\n" +
5263 " <form class=\"graph-type form-inline\">\n" +
5264 " <select ng-model=\"index.resource\" ng-options=\"r.resource_id as r.resource_name for r in index.stateHolder.AeUser.applications\" ng-change=\"index.updateSearchParams()\"\n" +
5265 " class=\"SelectField form-control input-sm slim-input\"></select>\n" +
5236 " <div class=\"form-group\">\n" +
5266 5237 "\n" +
5267 " <select class=\"SelectField form-control input-sm slim-input\" ng-model=\"index.timeSpan\"\n" +
5268 " ng-options=\"i as i.label for i in index.timeOptions | objectToOrderedArray:'minutes'\" ng-change=\"index.updateSearchParams()\"\n" +
5269 " class=\"SelectField\"></select>\n" +
5238 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
5270 5239 "\n" +
5240 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Use this repo\">\n" +
5241 "\n" +
5242 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
5243 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
5244 " <ul class=\"dropdown-menu\">\n" +
5245 " <li><a>No</a></li>\n" +
5246 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
5247 " </ul>\n" +
5248 " </span>\n" +
5271 5249 "\n" +
5272 " <div class=\"btn-group\">\n" +
5273 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
5274 " uib-btn-radio=\"'requests_graphs'\" data-uib-tooltip=\"Requests per second\">\n" +
5275 " <span class=\"fa fa-line-chart\"></span>\n" +
5276 " </button>\n" +
5277 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
5278 " uib-btn-radio=\"'response_graphs'\" data-uib-tooltip=\"Average response time\">\n" +
5279 " <span class=\"fa fa-random\"></span>\n" +
5280 " </button>\n" +
5281 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
5282 " uib-btn-radio=\"'metrics_graphs'\" data-uib-tooltip=\"Time spent per request\">\n" +
5283 " <span class=\"fa fa-bar-chart-o\"></span>\n" +
5284 " </button>\n" +
5285 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
5286 " uib-btn-radio=\"'report_graphs'\" data-uib-tooltip=\"Errors\">\n" +
5287 " <span class=\"fa fa-exclamation-triangle\"></span>\n" +
5288 " </button>\n" +
5289 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
5290 " uib-btn-radio=\"'slow_report_graphs'\" data-uib-tooltip=\"Slow reports\">\n" +
5291 " <span class=\"fa fa-clock-o\"></span>\n" +
5292 " </button>\n" +
5293 5250 " </div>\n" +
5294 5251 " </form>\n" +
5295 " <div class=\"clearfix\"></div>\n" +
5296 5252 "\n" +
5297 " <p ng-if=\"index.loading.series != false\" class=\"text-center\">\n" +
5298 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
5299 " </p>\n" +
5253 " <p class=\"m-t-1\">Remember you first need to\n" +
5254 " <strong>\n" +
5255 " <a data-ui-sref=\"user.profile.identities\">authorize your user account</a></strong>\n" +
5256 " with Github before we can send issues on your behalf.</p>\n" +
5300 5257 "\n" +
5301 " <div ng-if=\"index.loading.series == false\">\n" +
5302 " <div ng-if=\"index.graphType.selected == 'requests_graphs'\">\n" +
5303 " <c3chart data-domid=\"reponse_chart\" data-data=\"index.requestsChartData\" data-config=\"index.requestsChartConfig\" update=\"true\">\n" +
5304 " </c3chart>\n" +
5258 " <p>Every user will have to authorize AppEnlight to access Github to be able to post issues.</p>\n" +
5259 "\n" +
5260 " <div class=\"panel panel-warning\">\n" +
5261 " <div class=\"panel-heading\">Private repository access</div>\n" +
5262 " <div class=\"panel-body\">\n" +
5263 " <p>If you need access to private repositories <a data-ui-sref=\"user.profile.identities\">profile page</a> allows you to require token including private repository permissions.</p>\n" +
5264 "\n" +
5265 " <p>Registration page OAuth does NOT give you token with private repository access permissions.</p>\n" +
5266 " </div>\n" +
5305 5267 " </div>\n" +
5306 5268 "\n" +
5307 " <div ng-if=\"index.graphType.selected == 'response_graphs'\">\n" +
5308 " <c3chart data-domid=\"reponse_chart\" data-data=\"index.responseChartData\" data-config=\"index.responseChartConfig\" update=\"true\">\n" +
5309 " </c3chart>\n" +
5310 5269 " </div>\n" +
5270 "</div>\n"
5271 );
5272
5273
5274 $templateCache.put('templates/applications/integrations/hipchat.html',
5275 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
5311 5276 "\n" +
5312 " <div ng-if=\"index.graphType.selected == 'metrics_graphs'\">\n" +
5313 " <c3chart data-domid=\"metrics_chart\" data-data=\"index.metricsChartData\" data-config=\"index.metricsChartConfig\" update=\"true\">\n" +
5314 " </c3chart>\n" +
5277 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
5278 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
5279 " <div class=\"panel-body\">\n" +
5280 "\n" +
5281 " <h1>Hipchat Integration</h1>\n" +
5282 "\n" +
5283 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
5284 "\n" +
5285 " <div class=\"form-group\">\n" +
5286 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
5287 "\n" +
5288 " <div class=\"col-sm-8 col-lg-9\">\n" +
5289 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
5290 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\" type=\"text\">\n" +
5315 5291 " </div>\n" +
5316 " <div ng-if=\"index.graphType.selected == 'report_graphs'\">\n" +
5317 " <c3chart data-domid=\"reports_chart\" data-data=\"index.reportChartData\" data-config=\"index.reportChartConfig\" update=\"true\">\n" +
5318 " </c3chart>\n" +
5319 5292 " </div>\n" +
5320 5293 "\n" +
5321 " <div ng-if=\"index.graphType.selected == 'slow_report_graphs'\">\n" +
5322 " <c3chart data-domid=\"slow_reports_chart\" data-data=\"index.reportSlowChartData\" data-config=\"index.reportSlowChartConfig\" update=\"true\">\n" +
5323 " </c3chart>\n" +
5324 " </div>\n" +
5294 " <div class=\"form-group\">\n" +
5325 5295 "\n" +
5326 " <p ng-if=\"index.graphType.selected == 'requests_graphs'\" class=\"text-center\">\n" +
5327 " <small>Average requests per second from all servers</small>\n" +
5328 " </p>\n" +
5296 " <label class=\"control-label col-sm-3 col-lg-2\">Room ID list</label>\n" +
5329 5297 "\n" +
5330 " <p ng-if=\"index.graphType.selected == 'response_graphs'\" class=\"text-center\">\n" +
5331 " <small>Average response time from all servers</small>\n" +
5332 " </p>\n" +
5298 " <div class=\"col-sm-8 col-lg-9\">\n" +
5299 " <data-form-errors errors=\"integration.integrationForm.ae_validation.rooms\"></data-form-errors>\n" +
5300 " <input class=\"form-control\" ng-model=\"integration.config.rooms\" placeholder=\"Room ID list\" type=\"text\">\n" +
5333 5301 "\n" +
5334 " <p ng-if=\"index.graphType.selected == 'metrics_graphs'\" class=\"text-center\">\n" +
5335 " <small>Aggregated average time spent per request - broken to layers</small>\n" +
5302 " <p>\n" +
5303 " <small>Room ID list separated by comma</small>\n" +
5336 5304 " </p>\n" +
5305 " </div>\n" +
5337 5306 "\n" +
5338 " <p ng-if=\"index.graphType.selected == 'report_graphs'\" class=\"text-center\">\n" +
5339 " <small>Aggregated reports sent by your application</small>\n" +
5340 " </p>\n" +
5307 " </div>\n" +
5341 5308 "\n" +
5342 " <p ng-if=\"index.graphType.selected == 'slow_report_graphs'\" class=\"text-center\">\n" +
5343 " <small>Aggregated slow reports sent by your application</small>\n" +
5344 " </p>\n" +
5309 " <div class=\"form-group\">\n" +
5310 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
5311 " <div class=\"col-sm-8 col-lg-9\">\n" +
5312 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Hipchat\">\n" +
5313 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
5314 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
5315 " <ul class=\"dropdown-menu\">\n" +
5316 " <li><a>No</a></li>\n" +
5317 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
5318 " </ul>\n" +
5319 " </span>\n" +
5320 "\n" +
5321 " <div class=\"btn-group\" uib-dropdown>\n" +
5322 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
5323 " Test integration <span class=\"caret\"></span>\n" +
5324 " </button>\n" +
5325 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
5326 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
5327 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
5328 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
5329 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
5330 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
5331 " </ul>\n" +
5345 5332 " </div>\n" +
5333 "\n" +
5346 5334 " </div>\n" +
5347 5335 " </div>\n" +
5336 "\n" +
5337 " </form>\n" +
5338 "\n" +
5348 5339 " </div>\n" +
5340 "</div>\n"
5341 );
5342
5343
5344 $templateCache.put('templates/applications/integrations/jira.html',
5345 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
5349 5346 "\n" +
5347 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
5348 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
5349 " <div class=\"panel-body\">\n" +
5350 5350 "\n" +
5351 " <div class=\"col-sm-6\">\n" +
5351 " <h1>Jira Integration</h1>\n" +
5352 5352 "\n" +
5353 " <div id=\"server-container\">\n" +
5353 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
5354 5354 "\n" +
5355 " <div ng-if=\"index.loading.apdex==false\" class=\"text-center m-b-1\">\n" +
5355 " <div class=\"form-group\" id=\"row-host_name\">\n" +
5356 5356 "\n" +
5357 " <a data-ui-sref=\"report.list({resource:index.resource, start_date:index.startDateFilter})\" class=\"combined-stat text-center\" id=\"error-rate\">\n" +
5358 " <small>Exceptions</small>\n" +
5359 " <br/>\n" +
5360 " <strong>{{ index.exceptions|numberToThousands}}</strong>\n" +
5361 " <span class=\"fa fa-chevron-right\"></span>\n" +
5362 " </a><!--\n" +
5363 "\n" +
5364 " --><a data-ui-sref=\"report.list_slow({resource:index.resource, min_duration:4, start_date:index.startDateFilter})\" class=\"combined-stat text-center\" id=\"frustrating-requests\" data-uib-tooltip=\"Requests over 4s\">\n" +
5365 " <small>Frustrating req.</small>\n" +
5366 " <br/>\n" +
5367 " <strong>{{index.frustratingRequests|numberToThousands}}</strong>\n" +
5368 " <span class=\"fa fa-chevron-right\"></span>\n" +
5369 " </a><!--\n" +
5357 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5358 " Server URL <span class=\"required\">*</span>\n" +
5359 " </label>\n" +
5360 " <div class=\"col-sm-8 col-lg-9\">\n" +
5361 " <data-form-errors errors=\"integration.integrationForm.ae_validation.host_name\"></data-form-errors>\n" +
5362 " <input class=\"form-control\" id=\"host_name\" name=\"host_name\" type=\"text\" ng-model=\"integration.config.host_name\">\n" +
5370 5363 "\n" +
5371 " --><a data-ui-sref=\"report.list_slow({resource:index.resource, min_duration:1, max_duration:4, start_date:index.startDateFilter})\" class=\"combined-stat text-center\" id=\"tolerated-requests\"\n" +
5372 " data-uib-tooltip=\"Requests under 4s\">\n" +
5373 " <small>Tolerated req.</small>\n" +
5374 " <br/>\n" +
5375 " <strong>{{index.toleratedRequests|numberToThousands}}</strong>\n" +
5376 " <span class=\"fa fa-chevron-right\"></span>\n" +
5377 " </a><!--\n" +
5364 " <p>\n" +
5365 " <small>https://servername.atlassian.net</small>\n" +
5366 " </p>\n" +
5378 5367 "\n" +
5379 " --><a class=\"combined-stat text-center\" id=\"satisfying-requests\" data-uib-tooltip=\"Requests under 1s\">\n" +
5380 " <small>Satisfying req.</small>\n" +
5381 " <br/>\n" +
5382 " <strong>{{index.satisfyingRequests|numberToThousands}}</strong>\n" +
5383 " </a><!--\n" +
5368 " </div>\n" +
5369 " </div>\n" +
5370 " <div class=\"form-group\" id=\"row-user_name\">\n" +
5384 5371 "\n" +
5385 " --><a data-ui-sref=\"uptime({resource:index.resource})\" class=\"combined-stat text-center\" id=\"uptime-stats\" data-uib-tooltip=\"Uptime\">\n" +
5386 " <small>Uptime</small>\n" +
5387 " <br/>\n" +
5388 " <strong>{{index.uptimeStats}}%</strong>\n" +
5389 " <span class=\"fa fa-chevron-right\"></span>\n" +
5390 " </a>\n" +
5372 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5373 " Username <span class=\"required\">*</span>\n" +
5374 " </label>\n" +
5375 " <div class=\"col-sm-8 col-lg-9\">\n" +
5391 5376 "\n" +
5392 " <div class=\"clearfix\"></div>\n" +
5393 " </div>\n" +
5377 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
5378 " <input class=\"form-control\" id=\"user_name\" name=\"user_name\" type=\"text\" ng-model=\"integration.config.user_name\">\n" +
5394 5379 "\n" +
5395 " <div id=\"apdex-rate\" class=\"m-b-1 panel panel-default\">\n" +
5396 " <table class=\"servers table table-striped\">\n" +
5397 " <thead>\n" +
5398 " <tr>\n" +
5399 " <th></th>\n" +
5400 " <th>Server</th>\n" +
5401 " <th>Apdex\n" +
5402 " <span class=\"fa fa-question-circle\"\n" +
5403 " data-uib-tooltip=\"Application Performance Index - measures viewer satisfaction based on response times and error rates\"></span>\n" +
5404 " </th>\n" +
5405 " <th>rpm</th>\n" +
5406 " <th>avg. response</th>\n" +
5407 " </tr>\n" +
5408 " </thead>\n" +
5409 " <tbody>\n" +
5410 " <tr ng-if=\"index.loading.apdex!=false\" class=\"text-center\">\n" +
5411 " <td colspan=\"5\"><span class=\"fa fa-cog fa-spin fa-5x loader\"></span></td>\n" +
5412 " </tr>\n" +
5413 " <tr ng-repeat=\"server in index.apdexStats\" class=\"{{ server | apdexValue }}\"\n" +
5414 " ng-if=\"index.loading.apdex==false\">\n" +
5415 " <td><span class=\"fa fa-hdd-o\"></span></td>\n" +
5416 " <td>\n" +
5417 " <small><strong>{{ server.name }}</strong></small>\n" +
5418 " </td>\n" +
5419 " <td class=\"apdex\">\n" +
5420 " <small><strong>{{ server.apdex }} %</strong></small>\n" +
5421 " </td>\n" +
5422 " <td>\n" +
5423 " <small><strong>{{ server.rpm }}rpm</strong></small>\n" +
5424 " </td>\n" +
5425 " <td>\n" +
5426 " <small><strong>{{ server.avg_response_time }}s</strong></small>\n" +
5427 " </td>\n" +
5428 " </tr>\n" +
5429 " </tbody>\n" +
5430 " </table>\n" +
5380 " <p>\n" +
5381 " <small>user@email.com</small>\n" +
5382 " </p>\n" +
5431 5383 "\n" +
5432 5384 " </div>\n" +
5433 5385 " </div>\n" +
5386 " <div class=\"form-group\" id=\"row-password\">\n" +
5434 5387 "\n" +
5388 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5389 " Password <span class=\"required\">*</span>\n" +
5390 " </label>\n" +
5391 " <div class=\"col-sm-8 col-lg-9\">\n" +
5392 " <data-form-errors errors=\"integration.integrationForm.ae_validation.password\"></data-form-errors>\n" +
5393 " <input class=\"form-control\" id=\"password\" name=\"password\" type=\"password\" ng-model=\"integration.config.password\">\n" +
5435 5394 " </div>\n" +
5436 "\n" +
5437 "\n" +
5438 5395 " </div>\n" +
5396 " <div class=\"form-group\" id=\"row-project\">\n" +
5439 5397 "\n" +
5440 " <div class=\"row\">\n" +
5441 " <div class=\"col-sm-6\">\n" +
5442 "\n" +
5443 " <div class=\"panel panel-default\">\n" +
5444 " <div class=\"panel-heading position-relative\">\n" +
5445 " <h3 class=\"panel-title\"><span class=\"fa fa-exclamation-triangle\"></span> Newest errors (real-time)\n" +
5446 " </h3>\n" +
5447 " <a tooltip-append-to-body=\"true\" data-uib-tooltip=\"Play/Pause stream\" class=\"btn btn-primary btn-sm pause_stream\" ng-model=\"index.stream.paused\" uib-btn-checkbox>\n" +
5448 " <span class=\"fa {{stream.paused ? 'fa-play' : 'fa-pause'}}\"></span>\n" +
5449 " </a>\n" +
5450 " <a tooltip-append-to-body=\"true\" data-uib-tooltip=\"Limit reports to current application\" class=\"btn btn-primary btn-sm limit_stream\" ng-model=\"index.stream.filtered\" uib-btn-checkbox>\n" +
5451 " <span class=\"fa fa-lock\"></span>\n" +
5452 " </a>\n" +
5453 "\n" +
5454 "\n" +
5398 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5399 " Project key <span class=\"required\">*</span>\n" +
5400 " </label>\n" +
5401 " <div class=\"col-sm-8 col-lg-9\">\n" +
5402 " <data-form-errors errors=\"integration.integrationForm.ae_validation.project\"></data-form-errors>\n" +
5403 " <input class=\"form-control\" id=\"project\" name=\"project\" type=\"text\" ng-model=\"integration.config.project\">\n" +
5455 5404 " </div>\n" +
5456 " <div class=\"panel-body\">\n" +
5457 "\n" +
5458 " <p ng-if=\"index.stream.reports.length === 0\">No new reports</p>\n" +
5459 "\n" +
5460 " <div small-report-list reports=\"index.stream.reports\" applications=\"index.applications\"></div>\n" +
5461 5405 " </div>\n" +
5406 " <div class=\"form-group\" id=\"row-submit\">\n" +
5407 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
5408 " <div class=\"col-sm-8 col-lg-9\">\n" +
5409 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Setup Jira\">\n" +
5410 "\n" +
5411 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
5412 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
5413 " <ul class=\"dropdown-menu\">\n" +
5414 " <li><a>No</a></li>\n" +
5415 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
5416 " </ul>\n" +
5417 " </span>\n" +
5462 5418 " </div>\n" +
5463 5419 " </div>\n" +
5464 5420 "\n" +
5465 " <div class=\"col-sm-6\">\n" +
5421 " </form>\n" +
5466 5422 "\n" +
5467 " <div class=\"panel panel-default\">\n" +
5468 " <div class=\"panel-heading\">\n" +
5469 " <h3 class=\"panel-title\"><span class=\"fa fa-sort-amount-desc\"></span> Request breakdown over {{ index.timeSpan.label }}</h3>\n" +
5470 " </div>\n" +
5471 " <div class=\"panel-body\" id=\"view-breakdown-container\">\n" +
5472 " <p ng-if=\"index.loading.requestsBreakdown!=false\" class=\"text-center\">\n" +
5473 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
5474 " </p>\n" +
5475 5423 "\n" +
5476 " <div class=\"report-list\">\n" +
5477 " <div ng-if=\"index.loading.requestsBreakdown==false\" ng-repeat=\"view in index.requestsBreakdown\">\n" +
5478 " <div class=\"view-info\">\n" +
5479 " <div class=\"view-name\">\n" +
5480 " <div class=\"bar\" style=\"width: {{view.percentage}}%\">\n" +
5481 5424 " </div>\n" +
5482 " </div>\n" +
5483 " <strong ng-if=\"view.latest_details.length\">\n" +
5484 " <a data-ui-sref=\"report.list_slow({view_name:view.view_name})\">{{view.view_name}}</a></strong>\n" +
5485 " <strong ng-if=\"!view.latest_details.length\">{{view.view_name}}</strong>\n" +
5425 "</div>\n"
5426 );
5427
5428
5429 $templateCache.put('templates/applications/integrations/slack.html',
5430 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
5486 5431 "\n" +
5487 " <div class=\"stats\">\n" +
5488 " <small>\n" +
5489 " avg. response <strong>{{view.avg_response}}s</strong> in\n" +
5490 " <span class=\"requests\"\n" +
5491 " data-uib-tooltip=\"Requests\"><strong>{{view.requests|numberToThousands}}</strong> requests</span>\n" +
5432 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
5433 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
5434 " <div class=\"panel-body\">\n" +
5492 5435 "\n" +
5493 " <span ng-if=\"view.latest_details\">\n" +
5494 " &nbsp;&nbsp; Latest reports:\n" +
5495 " <a ng-repeat=\"d in view.latest_details\" target=\"_blank\" ui-sref=\"report.view_detail({groupId:d.group_id, reportId:d.report_id})\"> <strong>{{$index+1}}</strong></a>\n" +
5496 " </span>\n" +
5497 " </small>\n" +
5498 " </div>\n" +
5436 " <h1>Slack Integration</h1>\n" +
5499 5437 "\n" +
5500 " </div>\n" +
5438 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
5439 "\n" +
5440 " <div class=\"form-group\">\n" +
5501 5441 "\n" +
5442 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5443 " API Token <span class=\"required\">*</span>\n" +
5444 " </label>\n" +
5445 " <div class=\"col-sm-8 col-lg-9\">\n" +
5446 " <data-form-errors errors=\"integration.integrationForm.ae_validation.webhook_url\"></data-form-errors>\n" +
5447 " <input class=\"form-control\" ng-model=\"integration.config.webhook_url\" placeholder=\"Webhook URL\" type=\"webhook_url\">\n" +
5502 5448 " </div>\n" +
5503 5449 " </div>\n" +
5504 5450 "\n" +
5451 " <div class=\"form-group\">\n" +
5452 "\n" +
5453 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
5454 " <div class=\"col-sm-8 col-lg-9\">\n" +
5455 " <input type=\"submit\" class=\"btn btn-primary\"\n" +
5456 " value=\"Connect to Slack\">\n" +
5457 "\n" +
5458 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
5459 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
5460 " <ul class=\"dropdown-menu\">\n" +
5461 " <li><a>No</a></li>\n" +
5462 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
5463 " </ul>\n" +
5464 " </span>\n" +
5505 5465 "\n" +
5466 " <div class=\"btn-group\" uib-dropdown>\n" +
5467 " <button type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
5468 " Test integration <span class=\"caret\"></span>\n" +
5469 " </button>\n" +
5470 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
5471 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
5472 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
5473 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
5474 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
5475 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
5476 " </ul>\n" +
5506 5477 " </div>\n" +
5507 5478 " </div>\n" +
5508 "\n" +
5509 5479 " </div>\n" +
5480 " </form>\n" +
5510 5481 "\n" +
5511 5482 " </div>\n" +
5483 "</div>\n"
5484 );
5485
5486
5487 $templateCache.put('templates/applications/integrations/webhooks.html',
5488 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
5512 5489 "\n" +
5513 " <div class=\"row\">\n" +
5514 " <div class=\"col-sm-6\">\n" +
5515 "\n" +
5516 " <div class=\"panel panel-default\">\n" +
5517 " <div class=\"panel-heading\">\n" +
5518 " <h3 class=\"panel-title\">\n" +
5519 " <span class=\"fa fa-exclamation-triangle\"></span> Report groups trending over {{ index.timeSpan.label }}\n" +
5520 " </h3>\n" +
5521 " </div>\n" +
5490 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
5491 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
5522 5492 " <div class=\"panel-body\">\n" +
5523 " <p ng-if=\"index.loading.reports != false\" class=\"text-center\">\n" +
5524 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
5525 " </p>\n" +
5526 5493 "\n" +
5527 " <p ng-if=\"index.trendingReports.length == 0 && index.loading.reports == false\">\n" +
5528 " No reports found\n" +
5529 " </p>\n" +
5494 " <h1>Webhooks Integration</h1>\n" +
5495 "\n" +
5496 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
5497 " <div class=\"form-group\" id=\"row-reports_webhook\">\n" +
5530 5498 "\n" +
5531 " <div small-report-group-list groups=\"index.trendingReports\" applications=\"index.applications\" ng-if=\"index.loading.reports==false\"></div>\n" +
5499 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5500 " Reports webhook <span class=\"required\">*</span>\n" +
5501 " </label>\n" +
5502 " <div class=\"col-sm-8 col-lg-9\">\n" +
5503 " <data-form-errors errors=\"integration.integrationForm.ae_validation.reports_webhook\"></data-form-errors>\n" +
5504 " <input class=\"form-control\" id=\"reports_webhook\" name=\"reports_webhook\" type=\"text\" ng-model=\"integration.config.reports_webhook\">\n" +
5532 5505 " </div>\n" +
5533 5506 " </div>\n" +
5507 " <div class=\"form-group\" id=\"row-alerts_webhook\">\n" +
5534 5508 "\n" +
5509 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
5510 " Alerts webhook <span class=\"required\">*</span>\n" +
5511 " </label>\n" +
5512 " <div class=\"col-sm-8 col-lg-9\">\n" +
5513 " <data-form-errors errors=\"integration.integrationForm.ae_validation.alerts_webhook\"></data-form-errors>\n" +
5514 " <input class=\"form-control StringField None\" id=\"alerts_webhook\" name=\"alerts_webhook\" type=\"text\" ng-model=\"integration.config.alerts_webhook\">\n" +
5535 5515 " </div>\n" +
5536 5516 "\n" +
5537 " <div class=\"col-sm-6\">\n" +
5538 "\n" +
5539 5517 "\n" +
5540 " <div class=\"panel panel-default\">\n" +
5541 " <div class=\"panel-heading\">\n" +
5542 " <h3 class=\"panel-title\">\n" +
5543 " Most common slow calls over {{ index.timeSpan.label }}\n" +
5544 " </h3>\n" +
5545 5518 " </div>\n" +
5546 " <div class=\"panel-body\">\n" +
5519 " <div class=\"form-group\" id=\"row-submit\">\n" +
5547 5520 "\n" +
5548 " <div ng-if=\"index.loading.slowCalls!=false\" class=\"text-center\">\n" +
5549 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
5521 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
5522 " <div class=\"col-sm-8 col-lg-9\">\n" +
5523 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Setup webhooks\">\n" +
5524 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
5525 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
5526 " <ul class=\"dropdown-menu\">\n" +
5527 " <li><a>No</a></li>\n" +
5528 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
5529 " </ul>\n" +
5530 " </span>\n" +
5550 5531 " </div>\n" +
5551 "\n" +
5552 " <table id=\"slow-statements\" ng-if=\"index.loading.slowCalls==false\">\n" +
5553 " <tbody>\n" +
5554 " <tr ng-repeat=\"call in index.slowCalls\">\n" +
5555 " <td class=\"occurences\">\n" +
5556 " <span class=\"occurences\" data-uib-tooltip=\"Occurences\">{{call.occurences|numberToThousands}}</span>\n" +
5557 " </td>\n" +
5558 " <td class=\"ellipsis\">\n" +
5559 " <small title=\"{{call.statement}}\" class=\"statement\">{{call.statement}}</small>\n" +
5560 " <br/>\n" +
5561 " <span class=\"type\">{{call.statement_type}}</span>\n" +
5562 " <span class=\"subtype\">{{call.statement_subtype}}</span>\n" +
5563 " <span class=\"duration\" data-uib-tooltip=\"Average duration\">{{call.total_duration/call.occurences|round:2}}s</span>\n" +
5564 " <span class=\"report-list\">\n" +
5565 " Latest reports:\n" +
5566 " <a ng-repeat=\"d in call.latest_details\" target=\"_blank\" ui-sref=\"report.view_detail({groupId:d.group_id, reportId:d.report_id})\"> <strong>{{$index+1}}</strong> </a>\n" +
5567 " </span>\n" +
5532 " </div>\n" +
5533 " </form>\n" +
5534 " </div>\n" +
5535 "</div>\n"
5536 );
5537
5538
5539 $templateCache.put('templates/applications/list.html',
5540 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications.loading.applications\"></ng-include>\n" +
5541 "\n" +
5542 "<div class=\"panel panel-default\" ng-show=\"!applications.loading.applications\">\n" +
5543 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
5544 " <div class=\"panel-body\" ng-if=\"applications.applications.length === 0 \">\n" +
5545 "\n" +
5546 " <p>You have to create a new application first.</p>\n" +
5547 "\n" +
5548 " </div>\n" +
5549 "\n" +
5550 " <table class=\"table table-striped\" ng-if=\"applications.applications.length > 0\">\n" +
5551 " <thead>\n" +
5552 " <tr>\n" +
5553 " <th class=\"resource_name\">Resource Name</th>\n" +
5554 " <th class=\"domains\">Domains</th>\n" +
5555 " <th class=\"options\">Options</th>\n" +
5556 " </tr>\n" +
5557 " </thead>\n" +
5558 " <tbody>\n" +
5559 " <tr class=\"r{{$index+1}}\" ng-repeat=\"application in applications.applications\">\n" +
5560 " <td>{{application.resource_name}}</td>\n" +
5561 " <td>{{application.domains}}</td>\n" +
5562 " <td class=\"options\">\n" +
5563 " <a class=\"btn btn-default\" data-ui-sref=\"applications.update({resourceId:application.resource_id})\" data-toggle=\"tooltip\" title=\"Update application\"><span class=\"fa fa-cog\"></span> Update</a>\n" +
5564 " <a class=\"btn btn-default\" data-ui-sref=\"applications.integrations({resourceId:application.resource_id})\" data-toggle=\"tooltip\" title=\"Manage Integrations\"><span class=\"fa fa-wrench\"></span> Integrations</a>\n" +
5568 5565 " </td>\n" +
5569 5566 " </tr>\n" +
5570 5567 " </tbody>\n" +
5571 5568 " </table>\n" +
5572 5569 "\n" +
5573 "\n" +
5574 " </div>\n" +
5570 "</div>\n"
5571 );
5572
5573
5574 $templateCache.put('templates/applications/parent_view.html',
5575 "<div class=\"row application-management\">\n" +
5576 " <div class=\"col-sm-3\" id=\"menu\">\n" +
5577 " <div ng-include=\"'templates/user/menu.html'\"></div>\n" +
5575 5578 " </div>\n" +
5576 5579 "\n" +
5580 " <div class=\"col-sm-9\" ui-view></div>\n" +
5577 5581 "\n" +
5578 " </div>\n" +
5579 "\n" +
5580 " </div>\n" +
5581 " </div>\n" +
5582 " </div>\n" +
5583 5582 "</div>\n"
5584 5583 );
5585 5584
@@ -7329,436 +7328,653 b' function ChannelstreamController($rootScope, stateHolder, userSelfPropertyResour'
7329 7328 // # services, and proprietary license terms, please see
7330 7329 // # https://rhodecode.com/licenses/
7331 7330
7332 var aeconfig = angular.module('appenlight.config', []);
7333 aeconfig.factory('AeConfig', function () {
7334 var obj = {};
7335 obj.flashMessages = decodeEncodedJSON(window.AE.flash_messages);
7336 obj.timeOptions = decodeEncodedJSON(window.AE.timeOptions);
7337 obj.plugins = decodeEncodedJSON(window.AE.plugins);
7338 obj.topNav = decodeEncodedJSON(window.AE.topNav);
7339 obj.ws_url = window.AE.ws_url;
7340 obj.urls = window.AE.urls;
7341 // set keys on values because we wont be able to retrieve them everywhere
7342 for (var key in obj.timeOptions) {
7343 obj.timeOptions[key]['key'] = key;
7344 }
7345 console.info('config', obj);
7346 return obj;
7347 });
7348
7349 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7350 // #
7351 // # This program is free software: you can redistribute it and/or modify
7352 // # it under the terms of the GNU Affero General Public License, version 3
7353 // # (only), as published by the Free Software Foundation.
7354 // #
7355 // # This program is distributed in the hope that it will be useful,
7356 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7357 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7358 // # GNU General Public License for more details.
7359 // #
7360 // # You should have received a copy of the GNU Affero General Public License
7361 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7362 // #
7363 // # This program is dual-licensed. If you wish to learn more about the
7364 // # AppEnlight Enterprise Edition, including its added features, Support
7365 // # services, and proprietary license terms, please see
7366 // # https://rhodecode.com/licenses/
7367
7368 angular.module('appenlight.controllers').controller('AdminApplicationsListController', AdminApplicationsListController);
7369
7370 AdminApplicationsListController.$inject = ['applicationsResource'];
7371
7372 function AdminApplicationsListController(applicationsResource) {
7373
7374 var vm = this;
7375 vm.loading = {applications: true};
7376
7377 vm.applications = applicationsResource.query({
7378 root_list: true,
7379 resource_type: 'application'
7380 }, function (data) {
7381 vm.loading = {applications: false};
7331 angular.module('appenlight.components.indexDashboardView', [])
7332 .component('indexDashboardView', {
7333 templateUrl: 'components/views/index-dashboard/index-dashboard.html',
7334 controller: IndexDashboardController
7382 7335 });
7383 };
7384
7385 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7386 // #
7387 // # This program is free software: you can redistribute it and/or modify
7388 // # it under the terms of the GNU Affero General Public License, version 3
7389 // # (only), as published by the Free Software Foundation.
7390 // #
7391 // # This program is distributed in the hope that it will be useful,
7392 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7393 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7394 // # GNU General Public License for more details.
7395 // #
7396 // # You should have received a copy of the GNU Affero General Public License
7397 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7398 // #
7399 // # This program is dual-licensed. If you wish to learn more about the
7400 // # AppEnlight Enterprise Edition, including its added features, Support
7401 // # services, and proprietary license terms, please see
7402 // # https://rhodecode.com/licenses/
7403
7404 angular.module('appenlight.controllers').controller('ConfigsListController', ConfigsListController);
7405 7336
7406 ConfigsListController.$inject = ['configsResource', 'configsNoIdResource'];
7337 IndexDashboardController.$inject = ['$rootScope', '$scope', '$location','$cookies', '$interval', 'stateHolder', 'applicationsPropertyResource', 'AeConfig'];
7407 7338
7408 function ConfigsListController(configsResource, configsNoIdResource) {
7339 function IndexDashboardController($rootScope, $scope, $location, $cookies, $interval, stateHolder, applicationsPropertyResource, AeConfig) {
7409 7340 var vm = this;
7410 vm.loading = {config: true};
7411
7412 var filters = [
7413 'template_footer_html:global',
7414 'list_groups_to_non_admins:global',
7415 'per_application_reports_rate_limit:global',
7416 'per_application_logs_rate_limit:global',
7417 'per_application_metrics_rate_limit:global',
7418 ];
7419
7420 vm.configs = {};
7421
7422 vm.configList = configsResource.query({filter: filters},
7423 function (data) {
7424 vm.loading = {config: false};
7425 _.each(data, function (item) {
7426 if (vm.configs[item.section] === undefined) {
7427 vm.configs[item.section] = {};
7341 stateHolder.section = 'dashboard';
7342 vm.timeOptions = {};
7343 var allowed = ['1h', '4h', '12h', '24h', '1w', '2w', '1M'];
7344 _.each(allowed, function (key) {
7345 if (allowed.indexOf(key) !== -1) {
7346 vm.timeOptions[key] = AeConfig.timeOptions[key];
7428 7347 }
7429 vm.configs[item.section][item.key] = item;
7430 });
7431 });
7432
7433 vm.save = function () {
7434 vm.loading.config = true;
7435 _.each(vm.configList, function (item) {
7436 item.$save();
7437 7348 });
7438 vm.loading.config = false;
7439 };
7349 vm.stateHolder = stateHolder;
7350 vm.urls = AeConfig.urls;
7351 vm.applications = stateHolder.AeUser.applications_map;
7352 vm.show_dashboard = false;
7353 vm.resource = null;
7354 vm.graphType = {selected: null};
7355 vm.timeSpan = vm.timeOptions['1h'];
7356 vm.trendingReports = [];
7357 vm.exceptions = 0;
7358 vm.satisfyingRequests = 0;
7359 vm.toleratedRequests = 0;
7360 vm.frustratingRequests = 0;
7361 vm.uptimeStats = 0;
7362 vm.apdexStats = [];
7363 vm.seriesRequestsData = [];
7364 vm.seriesMetricsData = [];
7365 vm.seriesSlowData = [];
7366 vm.slowCalls = [];
7367 vm.slowURIS = [];
7440 7368
7369 vm.reportChartConfig = {
7370 data: {
7371 json: [],
7372 xFormat: '%Y-%m-%dT%H:%M:%S'
7373 },
7374 color: {
7375 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
7376 },
7377 axis: {
7378 x: {
7379 type: 'timeseries',
7380 tick: {
7381 culling: {
7382 max: 6 // the number of tick texts will be adjusted to less than this value
7383 },
7384 format: '%Y-%m-%d %H:%M'
7385 }
7386 },
7387 y: {
7388 tick: {
7389 count: 5,
7390 format: d3.format('.2s')
7391 }
7392 }
7393 },
7394 subchart: {
7395 show: true,
7396 size: {
7397 height: 20
7398 }
7399 },
7400 size: {
7401 height: 250
7402 },
7403 zoom: {
7404 rescale: true
7405 },
7406 grid: {
7407 x: {
7408 show: true
7409 },
7410 y: {
7411 show: true
7412 }
7413 },
7414 tooltip: {
7415 format: {
7416 title: function (d) {
7417 return '' + d;
7418 },
7419 value: function (v) {
7420 return v
7421 }
7422 }
7423 }
7441 7424 };
7425 vm.reportChartData = {};
7442 7426
7443 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7444 // #
7445 // # This program is free software: you can redistribute it and/or modify
7446 // # it under the terms of the GNU Affero General Public License, version 3
7447 // # (only), as published by the Free Software Foundation.
7448 // #
7449 // # This program is distributed in the hope that it will be useful,
7450 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7451 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7452 // # GNU General Public License for more details.
7453 // #
7454 // # You should have received a copy of the GNU Affero General Public License
7455 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7456 // #
7457 // # This program is dual-licensed. If you wish to learn more about the
7458 // # AppEnlight Enterprise Edition, including its added features, Support
7459 // # services, and proprietary license terms, please see
7460 // # https://rhodecode.com/licenses/
7461
7462 angular.module('appenlight.controllers').controller('AdminGroupsCreateController', AdminGroupsCreateController);
7463
7464 AdminGroupsCreateController.$inject = ['$state', 'groupsResource', 'groupsPropertyResource', 'sectionViewResource', 'AeConfig'];
7465
7466 function AdminGroupsCreateController($state, groupsResource, groupsPropertyResource, sectionViewResource, AeConfig) {
7467
7468 var vm = this;
7469 vm.loading = {
7470 group: false,
7471 resource_permissions: false,
7472 users: false
7473 };
7474
7475 vm.form = {
7476 autocompleteUser: '',
7427 vm.reportSlowChartConfig = {
7428 data: {
7429 json: [],
7430 xFormat: '%Y-%m-%dT%H:%M:%S'
7431 },
7432 color: {
7433 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
7434 },
7435 axis: {
7436 x: {
7437 type: 'timeseries',
7438 tick: {
7439 culling: {
7440 max: 6 // the number of tick texts will be adjusted to less than this value
7441 },
7442 format: '%Y-%m-%d %H:%M'
7477 7443 }
7478
7479
7480 if (typeof $state.params.groupId !== 'undefined') {
7481 vm.loading.group = true;
7482 var groupId = $state.params.groupId;
7483 vm.group = groupsResource.get({groupId: groupId}, function (data) {
7484 vm.loading.group = false;
7485 });
7486
7487 vm.resource_permissions = groupsPropertyResource.query(
7488 {groupId: groupId, key: 'resource_permissions'}, function (data) {
7489 vm.loading.resource_permissions = false;
7490 var tmpObj = {
7491 'group': {
7492 'application': {},
7493 'dashboard': {}
7444 },
7445 y: {
7446 tick: {
7447 count: 5,
7448 format: d3.format('.2s')
7494 7449 }
7495 };
7496 _.each(data, function (item) {
7497
7498 var section = tmpObj[item.type][item.resource_type];
7499 if (typeof section[item.resource_id] == 'undefined') {
7500 section[item.resource_id] = {
7501 self: item,
7502 permissions: []
7503 7450 }
7451 },
7452 subchart: {
7453 show: true,
7454 size: {
7455 height: 20
7504 7456 }
7505 section[item.resource_id].permissions.push(item.perm_name);
7506
7507 });
7508 vm.resourcePermissions = tmpObj;
7509 });
7510
7511 vm.users = groupsPropertyResource.query(
7512 {groupId: groupId, key: 'users'}, function (data) {
7513 vm.loading.users = false;
7514 }, function () {
7515 vm.loading.users = false;
7516 });
7517
7457 },
7458 size: {
7459 height: 250
7460 },
7461 zoom: {
7462 rescale: true
7463 },
7464 grid: {
7465 x: {
7466 show: true
7467 },
7468 y: {
7469 show: true
7470 }
7471 },
7472 tooltip: {
7473 format: {
7474 title: function (d) {
7475 return '' + d;
7476 },
7477 value: function (v) {
7478 return v
7518 7479 }
7519 else {
7520 var groupId = null;
7521 7480 }
7522
7523 var formResponse = function (response) {
7524 if (response.status === 422) {
7525 setServerValidation(vm.groupForm, response.data);
7526 7481 }
7527 vm.loading.group = false;
7528 7482 };
7483 vm.reportSlowChartData = {};
7529 7484
7530 vm.createGroup = function () {
7531 vm.loading.group = true;
7532 if (groupId) {
7533 groupsResource.update({groupId: vm.group.id}, vm.group, function (data) {
7534 setServerValidation(vm.groupForm);
7535 vm.loading.group = false;
7536 }, formResponse);
7485 vm.metricsChartConfig = {
7486 data: {
7487 json: [],
7488 xFormat: '%Y-%m-%dT%H:%M:%S',
7489 keys: {
7490 x: 'x',
7491 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
7492 },
7493 names: {
7494 main: 'View/Application logic',
7495 sql: 'Relational database queries',
7496 nosql: 'NoSql datastore calls',
7497 tmpl: 'Template rendering',
7498 custom: 'Custom timed calls',
7499 remote: 'Requests to remote resources'
7500 },
7501 type: 'area',
7502 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
7503 order: null
7504 },
7505 color: {
7506 pattern: ['#6baed6', '#c7e9c0', '#fd8d3c', '#d6616b', '#ffcc00', '#c6dbef']
7507 },
7508 axis: {
7509 x: {
7510 type: 'timeseries',
7511 tick: {
7512 culling: {
7513 max: 6 // the number of tick texts will be adjusted to less than this value
7514 },
7515 format: '%Y-%m-%d %H:%M'
7537 7516 }
7538 else {
7539 groupsResource.save(vm.group, function (data) {
7540 $state.go('admin.group.update', {groupId: data.id});
7541 }, formResponse);
7517 },
7518 y: {
7519 tick: {
7520 count: 5,
7521 format: d3.format('.2f')
7522 }
7523 }
7524 },
7525 point: {
7526 show: false
7527 },
7528 subchart: {
7529 show: true,
7530 size: {
7531 height: 20
7532 }
7533 },
7534 size: {
7535 height: 350
7536 },
7537 zoom: {
7538 rescale: true
7539 },
7540 grid: {
7541 x: {
7542 show: true
7543 },
7544 y: {
7545 show: true
7546 }
7547 },
7548 tooltip: {
7549 format: {
7550 title: function (d) {
7551 return '' + d;
7552 },
7553 value: function (v) {
7554 return v
7542 7555 }
7543 };
7544
7545 vm.removeUser = function (user) {
7546 groupsPropertyResource.delete(
7547 {groupId: groupId, key: 'users', user_name: user.user_name},
7548 function (data) {
7549 vm.loading.users = false;
7550 vm.users = _.filter(vm.users, function (item) {
7551 return item != user;
7552 });
7553 }, function () {
7554 vm.loading.users = false;
7555 });
7556 };
7557
7558 vm.addUser = function () {
7559 groupsPropertyResource.save(
7560 {groupId: groupId, key: 'users'},
7561 {user_name: vm.form.autocompleteUser},
7562 function (data) {
7563 vm.loading.users = false;
7564 vm.users.push(data);
7565 vm.form.autocompleteUser = '';
7566 }, function () {
7567 vm.loading.users = false;
7568 });
7569 7556 }
7570
7571 vm.searchUsers = function (searchPhrase) {
7572
7573 return sectionViewResource.query({
7574 section: 'users_section',
7575 view: 'search_users',
7576 'user_name': searchPhrase
7577 }).$promise.then(function (data) {
7578 return _.map(data, function (item) {
7579 return item.user;
7580 });
7581 });
7582 7557 }
7583 7558 };
7559 vm.metricsChartData = {};
7584 7560
7585 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7586 // #
7587 // # This program is free software: you can redistribute it and/or modify
7588 // # it under the terms of the GNU Affero General Public License, version 3
7589 // # (only), as published by the Free Software Foundation.
7590 // #
7591 // # This program is distributed in the hope that it will be useful,
7592 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7593 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7594 // # GNU General Public License for more details.
7595 // #
7596 // # You should have received a copy of the GNU Affero General Public License
7597 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7598 // #
7599 // # This program is dual-licensed. If you wish to learn more about the
7600 // # AppEnlight Enterprise Edition, including its added features, Support
7601 // # services, and proprietary license terms, please see
7602 // # https://rhodecode.com/licenses/
7603
7604 angular.module('appenlight.controllers').controller('AdminGroupsController', AdminGroupsController);
7605
7606 AdminGroupsController.$inject = ['groupsResource'];
7607
7608 function AdminGroupsController(groupsResource) {
7609
7610 var vm = this;
7611 vm.loading = {groups: true};
7612
7613 vm.groups = groupsResource.query({}, function (data) {
7614 vm.loading = {groups: false};
7615 vm.activeUsers = _.reduce(vm.groups, function(memo, val){
7616 if (val.status == 1){
7617 return memo + 1;
7561 vm.responseChartConfig = {
7562 data: {
7563 json: [],
7564 xFormat: '%Y-%m-%dT%H:%M:%S'
7565 },
7566 color: {
7567 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
7568 },
7569 axis: {
7570 x: {
7571 type: 'timeseries',
7572 tick: {
7573 culling: {
7574 max: 6 // the number of tick texts will be adjusted to less than this value
7575 },
7576 format: '%Y-%m-%d %H:%M'
7618 7577 }
7619 return memo;
7620 }, 0);
7621
7622 });
7623
7624
7625 vm.removeGroup = function (group) {
7626 groupsResource.remove({groupId: group.id}, function (data, responseHeaders) {
7627
7628 if (data) {
7629 var index = vm.groups.indexOf(group);
7630 if (index !== -1) {
7631 vm.groups.splice(index, 1);
7632 vm.activeGroups -= 1;
7578 },
7579 y: {
7580 tick: {
7581 count: 5,
7582 format: d3.format('.2f')
7583 }
7584 }
7585 },
7586 point: {
7587 show: false
7588 },
7589 subchart: {
7590 show: true,
7591 size: {
7592 height: 20
7593 }
7594 },
7595 size: {
7596 height: 350
7597 },
7598 zoom: {
7599 rescale: true
7600 },
7601 grid: {
7602 x: {
7603 show: true
7604 },
7605 y: {
7606 show: true
7607 }
7608 },
7609 tooltip: {
7610 format: {
7611 title: function (d) {
7612 return '' + d;
7613 },
7614 value: function (v) {
7615 return v
7633 7616 }
7634 7617 }
7635 });
7636 7618 }
7637 7619 };
7620 vm.responseChartData = {};
7638 7621
7639 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7640 // #
7641 // # This program is free software: you can redistribute it and/or modify
7642 // # it under the terms of the GNU Affero General Public License, version 3
7643 // # (only), as published by the Free Software Foundation.
7644 // #
7645 // # This program is distributed in the hope that it will be useful,
7646 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7647 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7648 // # GNU General Public License for more details.
7649 // #
7650 // # You should have received a copy of the GNU Affero General Public License
7651 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7652 // #
7653 // # This program is dual-licensed. If you wish to learn more about the
7654 // # AppEnlight Enterprise Edition, including its added features, Support
7655 // # services, and proprietary license terms, please see
7656 // # https://rhodecode.com/licenses/
7622 vm.requestsChartConfig = {
7623 data: {
7624 json: [],
7625 xFormat: '%Y-%m-%dT%H:%M:%S'
7626 },
7627 color: {
7628 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
7629 },
7630 axis: {
7631 x: {
7632 type: 'timeseries',
7633 tick: {
7634 culling: {
7635 max: 6 // the number of tick texts will be adjusted to less than this value
7636 },
7637 format: '%Y-%m-%d %H:%M'
7638 }
7639 },
7640 y: {
7641 tick: {
7642 count: 5,
7643 format: d3.format('.2f')
7644 }
7645 }
7646 },
7647 point: {
7648 show: false
7649 },
7650 subchart: {
7651 show: true,
7652 size: {
7653 height: 20
7654 }
7655 },
7656 size: {
7657 height: 350
7658 },
7659 zoom: {
7660 rescale: true
7661 },
7662 grid: {
7663 x: {
7664 show: true
7665 },
7666 y: {
7667 show: true
7668 }
7669 },
7670 tooltip: {
7671 format: {
7672 title: function (d) {
7673 return '' + d;
7674 },
7675 value: function (v) {
7676 return v
7677 }
7678 }
7679 }
7680 };
7681 vm.requestsChartData = {};
7657 7682
7658 angular.module('appenlight.controllers').controller('AdminPartitionsController', AdminPartitionsController);
7683 vm.loading = {
7684 'apdex': true,
7685 'reports': true,
7686 'graphs': true,
7687 'slowCalls': true,
7688 'slowURIS': true,
7689 'requestsBreakdown': true,
7690 'series': true
7691 };
7692 vm.stream = {paused: false, filtered: false, messages: [], reports: []};
7659 7693
7660 AdminPartitionsController.$inject = ['sectionViewResource'];
7694 $rootScope.$on('channelstream-message.front_dashboard.new_topic', function(event, message){
7695 var ws_report = message.message.report;
7696 if (ws_report.http_status != 500) {
7697 return
7698 }
7699 if (vm.stream.paused == true) {
7700 return
7701 }
7702 if (vm.stream.filtered && ws_report.resource_id != vm.resource) {
7703 return
7704 }
7705 var should_insert = true;
7706 _.each(vm.stream.reports, function (report) {
7707 if (report.report_id == ws_report.report_id) {
7708 report.occurences = ws_report.occurences;
7709 should_insert = false;
7710 }
7711 });
7712 if (should_insert) {
7713 if (vm.stream.reports.length > 7) {
7714 vm.stream.reports.pop();
7715 }
7716 vm.stream.reports.unshift(ws_report);
7717 }
7718 });
7661 7719
7662 function AdminPartitionsController(sectionViewResource) {
7663 var vm = this;
7664 vm.permanentPartitions = [];
7665 vm.dailyPartitions = [];
7666 vm.loading = {partitions: true};
7667 vm.dailyChecked = false;
7668 vm.permChecked = false;
7669 vm.dailyConfirm = '';
7670 vm.permConfirm = '';
7720 vm.determineStartState = function () {
7721 if (stateHolder.AeUser.applications.length) {
7722 vm.resource = Number($location.search().resource);
7671 7723
7724 if (!vm.resource){
7725 var cookieResource = $cookies.getObject('resource');
7672 7726
7673 vm.loadPartitions = function (data) {
7674 var permanentPartitions = vm.transformPartitionList(
7675 data.permanent_partitions);
7676 var dailyPartitions = vm.transformPartitionList(
7677 data.daily_partitions);
7678 vm.permanentPartitions = permanentPartitions;
7679 vm.dailyPartitions = dailyPartitions;
7680 vm.loading = {partitions: false};
7681 };
7682 7727
7683 vm.setCheckedList = function (scope) {
7684 var toTest = null;
7685 if (scope === 'dailyPartitions'){
7686 toTest = 'dailyChecked';
7728 if (cookieResource) {
7729 vm.resource = cookieResource;
7687 7730 }
7688 7731 else{
7689 toTest = 'permChecked';
7732 vm.resource = stateHolder.AeUser.applications[0].resource_id;
7733 }
7734 }
7690 7735 }
7691 7736
7692 if (vm[toTest]) {
7693 var val = true;
7737 var timespan = $location.search().timespan;
7738
7739 if(_.has(vm.timeOptions, timespan)){
7740 vm.timeSpan = vm.timeOptions[timespan];
7694 7741 }
7695 7742 else{
7696 var val = false;
7743 vm.timeSpan = vm.timeOptions['1h'];
7697 7744 }
7698 7745
7699 _.each(vm[scope], function (item) {
7700 _.each(item[1].pg, function (index) {
7701 index.checked = val;
7702 });
7703 _.each(item[1].elasticsearch, function (index) {
7704 index.checked = val;
7705 });
7706 });
7746 var graphType = $location.search().graphtype;
7747 if(!graphType){
7748 vm.graphType = {selected: 'metrics_graphs'};
7707 7749 }
7750 else{
7751 vm.graphType = {selected: graphType};
7752 }
7753 vm.updateSearchParams();
7754 };
7708 7755
7756 vm.updateSearchParams = function () {
7757 $location.search('resource', vm.resource);
7758 $location.search('timespan', vm.timeSpan.key);
7759 $location.search('graphtype', vm.graphType.selected);
7760 stateHolder.resource = vm.resource;
7709 7761
7710 vm.transformPartitionList = function (inputList) {
7711 var outputList = [];
7712
7713 _.each(inputList, function (item) {
7714 var time = [item[0], {
7715 elasticsearch: [],
7716 pg: []
7717 }]
7718 _.each(item[1].pg, function (index) {
7719 time[1].pg.push({name: index, checked: false})
7720 });
7721 _.each(item[1].elasticsearch, function (index) {
7722 time[1].elasticsearch.push({
7723 name: index,
7724 checked: false
7725 })
7726 });
7727 outputList.push(time);
7728 });
7729 return outputList;
7762 if (vm.resource){
7763 $cookies.putObject('resource', vm.resource,
7764 {expires:new Date(3000, 1, 1)});
7765 }
7766 vm.refreshData();
7730 7767 };
7731 7768
7732 sectionViewResource.get({section:'admin_section', view: 'partitions'},
7733 vm.loadPartitions);
7769 vm.refreshData = function () {
7770 vm.fetchApdexStats();
7771 vm.fetchTrendingReports();
7772 vm.fetchMetrics();
7773 vm.fetchRequestsBreakdown();
7774 vm.fetchSlowCalls();
7775 };
7734 7776
7735 vm.partitionsDelete = function (partitionType) {
7736 var es_indices = [];
7737 var pg_indices = [];
7738 _.each(vm[partitionType], function (item) {
7739 _.each(item[1].pg, function (index) {
7740 if (index.checked) {
7741 pg_indices.push(index.name)
7777 vm.changedTimeSpan = function(){
7778 vm.startDateFilter = timeSpanToStartDate(vm.timeSpan.key);
7779 vm.refreshData();
7780 };
7781
7782 vm.intervalId = $interval(function () {
7783 if (_.contains(['30m', "1h"], vm.timeSpan.key)) {
7784 // don't do anything if window is unfocused
7785 if(document.hidden === true){
7786 return ;
7787 }
7788 vm.refreshData();
7789 }
7790 }, 60000);
7791
7792 vm.fetchApdexStats = function () {
7793 vm.loading.apdex = true;
7794 vm.apdexStats = applicationsPropertyResource.query({
7795 'key': 'apdex_stats',
7796 'resourceId': vm.resource,
7797 "start_date": timeSpanToStartDate(vm.timeSpan.key)
7798 },
7799 function (data) {
7800 vm.loading.apdex = false;
7801
7802 vm.exceptions = _.reduce(data, function (memo, row) {
7803 return memo + row.errors;
7804 }, 0);
7805 vm.satisfyingRequests = _.reduce(data, function (memo, row) {
7806 return memo + row.satisfying_requests;
7807 }, 0);
7808 vm.toleratedRequests = _.reduce(data, function (memo, row) {
7809 return memo + row.tolerated_requests;
7810 }, 0);
7811 vm.frustratingRequests = _.reduce(data, function (memo, row) {
7812 return memo + row.frustrating_requests;
7813 }, 0);
7814 if (data.length) {
7815 vm.uptimeStats = data[0].uptime;
7816 }
7817
7818 },
7819 function () {
7820 vm.loading.apdex = false;
7821 }
7822 );
7823 }
7824
7825 vm.fetchMetrics = function () {
7826 vm.loading.series = true;
7827 applicationsPropertyResource.query({
7828 'resourceId': vm.resource,
7829 'key': vm.graphType.selected,
7830 "start_date": timeSpanToStartDate(vm.timeSpan.key)
7831 }, function (data) {
7832 if (vm.graphType.selected == 'metrics_graphs') {
7833 vm.metricsChartData = {
7834 json: data,
7835 xFormat: '%Y-%m-%dT%H:%M:%S',
7836 keys: {
7837 x: 'x',
7838 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
7839 },
7840 names: {
7841 main: 'View/Application logic',
7842 sql: 'Relational database queries',
7843 nosql: 'NoSql datastore calls',
7844 tmpl: 'Template rendering',
7845 custom: 'Custom timed calls',
7846 remote: 'Requests to remote resources'
7847 },
7848 type: 'area',
7849 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
7850 order: null
7851 };
7852 }
7853 else if (vm.graphType.selected == 'report_graphs') {
7854 vm.reportChartData = {
7855 json: data,
7856 xFormat: '%Y-%m-%dT%H:%M:%S',
7857 keys: {
7858 x: 'x',
7859 value: ["not_found", "report"]
7860 },
7861 names: {
7862 report: 'Errors',
7863 not_found: '404\'s requests'
7864 },
7865 type: 'bar'
7866 };
7867 }
7868 else if (vm.graphType.selected == 'slow_report_graphs') {
7869 vm.reportSlowChartData = {
7870 json: data,
7871 xFormat: '%Y-%m-%dT%H:%M:%S',
7872 keys: {
7873 x: 'x',
7874 value: ["slow_report"]
7875 },
7876 names: {
7877 slow_report: 'Slow reports'
7878 },
7879 type: 'bar'
7880 };
7881 }
7882 else if (vm.graphType.selected == 'response_graphs') {
7883 vm.responseChartData = {
7884 json: data,
7885 xFormat: '%Y-%m-%dT%H:%M:%S',
7886 keys: {
7887 x: 'x',
7888 value: ["today", "days_ago_2", "days_ago_7"]
7889 },
7890 names: {
7891 today: 'Today',
7892 "days_ago_2": '2 days ago',
7893 "days_ago_7": '7 days ago'
7894 }
7895 };
7896 }
7897 else if (vm.graphType.selected == 'requests_graphs') {
7898 vm.requestsChartData = {
7899 json: data,
7900 xFormat: '%Y-%m-%dT%H:%M:%S',
7901 keys: {
7902 x: 'x',
7903 value: ["requests"]
7904 },
7905 names: {
7906 requests: 'Requests/s'
7907 }
7908 };
7742 7909 }
7910 vm.loading.series = false;
7911 }, function(){
7912 vm.loading.series = false;
7743 7913 });
7744 _.each(item[1].elasticsearch, function (index) {
7745 if (index.checked) {
7746 es_indices.push(index.name)
7747 7914 }
7915
7916 vm.fetchSlowCalls = function () {
7917 vm.loading.slowCalls = true;
7918 applicationsPropertyResource.query({
7919 'resourceId': vm.resource,
7920 "start_date": timeSpanToStartDate(vm.timeSpan.key),
7921 'key': 'slow_calls'
7922 }, function (data) {
7923 vm.slowCalls = data;
7924 vm.loading.slowCalls = false;
7925 }, function () {
7926 vm.loading.slowCalls = false;
7748 7927 });
7928 }
7929
7930 vm.fetchRequestsBreakdown = function () {
7931 vm.loading.requestsBreakdown = true;
7932 applicationsPropertyResource.query({
7933 'resourceId': vm.resource,
7934 "start_date": timeSpanToStartDate(vm.timeSpan.key),
7935 'key': 'requests_breakdown'
7936 }, function (data) {
7937 vm.requestsBreakdown = data;
7938 vm.loading.requestsBreakdown = false;
7939 }, function () {
7940 vm.loading.requestsBreakdown = false;
7749 7941 });
7942 }
7750 7943
7944 vm.fetchTrendingReports = function () {
7751 7945
7752 vm.loading = {partitions: true};
7753 sectionViewResource.save({section:'admin_section',
7754 view: 'partitions_remove'}, {
7755 es_indices: es_indices,
7756 pg_indices: pg_indices,
7757 confirm: 'CONFIRM'
7758 }, vm.loadPartitions);
7946 if (vm.graphType.selected == 'slow_report_graphs') {
7947 var report_type = 'slow';
7948 }
7949 else {
7950 var report_type = 'error';
7951 }
7759 7952
7953 vm.loading.reports = true;
7954 vm.trendingReports = applicationsPropertyResource.query({
7955 'key': 'trending_reports',
7956 'resourceId': vm.resource,
7957 "start_date": timeSpanToStartDate(vm.timeSpan.key),
7958 "report_type": report_type
7959 },
7960 function () {
7961 vm.loading.reports = false;
7962 },
7963 function () {
7964 vm.loading.reports = false;
7760 7965 }
7966 );
7967 };
7968
7969 $scope.$on('$destroy',function(){
7970 $interval.cancel(vm.intervalId);
7971 });
7761 7972
7973 if (stateHolder.AeUser.applications.length){
7974 vm.show_dashboard = true;
7975 vm.determineStartState();
7976 vm.refreshData();
7977 }
7762 7978 }
7763 7979
7764 7980 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
@@ -7780,29 +7996,56 b' function AdminPartitionsController(sectionViewResource) {'
7780 7996 // # services, and proprietary license terms, please see
7781 7997 // # https://rhodecode.com/licenses/
7782 7998
7783 angular.module('appenlight.controllers').controller('AdminSystemController', AdminSystemController);
7784
7785 AdminSystemController.$inject = ['sectionViewResource'];
7786
7787 function AdminSystemController(sectionViewResource) {
7788 var vm = this;
7789 vm.tables = [];
7790 vm.loading = {system: true};
7791 sectionViewResource.get({
7792 section: 'admin_section',
7793 view: 'system'
7794 }, null, function (data) {
7795 vm.DBtables = data.db_tables;
7796 vm.ESIndices = data.es_indices;
7797 vm.queueStats = data.queue_stats;
7798 vm.systemLoad = data.system_load;
7799 vm.packages = data.packages;
7800 vm.processInfo = data.process_info;
7801 vm.disks = data.disks;
7802 vm.memory = data.memory;
7803 vm.selfInfo = data.self_info;
7999 var aeconfig = angular.module('appenlight.config', []);
8000 aeconfig.factory('AeConfig', function () {
8001 var obj = {};
8002 obj.flashMessages = decodeEncodedJSON(window.AE.flash_messages);
8003 obj.timeOptions = decodeEncodedJSON(window.AE.timeOptions);
8004 obj.plugins = decodeEncodedJSON(window.AE.plugins);
8005 obj.topNav = decodeEncodedJSON(window.AE.topNav);
8006 obj.ws_url = window.AE.ws_url;
8007 obj.urls = window.AE.urls;
8008 // set keys on values because we wont be able to retrieve them everywhere
8009 for (var key in obj.timeOptions) {
8010 obj.timeOptions[key]['key'] = key;
8011 }
8012 console.info('config', obj);
8013 return obj;
8014 });
7804 8015
7805 vm.loading.system = false;
8016 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8017 // #
8018 // # This program is free software: you can redistribute it and/or modify
8019 // # it under the terms of the GNU Affero General Public License, version 3
8020 // # (only), as published by the Free Software Foundation.
8021 // #
8022 // # This program is distributed in the hope that it will be useful,
8023 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8024 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8025 // # GNU General Public License for more details.
8026 // #
8027 // # You should have received a copy of the GNU Affero General Public License
8028 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8029 // #
8030 // # This program is dual-licensed. If you wish to learn more about the
8031 // # AppEnlight Enterprise Edition, including its added features, Support
8032 // # services, and proprietary license terms, please see
8033 // # https://rhodecode.com/licenses/
8034
8035 angular.module('appenlight.controllers').controller('AdminApplicationsListController', AdminApplicationsListController);
8036
8037 AdminApplicationsListController.$inject = ['applicationsResource'];
8038
8039 function AdminApplicationsListController(applicationsResource) {
8040
8041 var vm = this;
8042 vm.loading = {applications: true};
8043
8044 vm.applications = applicationsResource.query({
8045 root_list: true,
8046 resource_type: 'application'
8047 }, function (data) {
8048 vm.loading = {applications: false};
7806 8049 });
7807 8050 };
7808 8051
@@ -7825,35 +8068,93 b' function AdminSystemController(sectionViewResource) {'
7825 8068 // # services, and proprietary license terms, please see
7826 8069 // # https://rhodecode.com/licenses/
7827 8070
7828 angular.module('appenlight.controllers').controller('AdminUsersCreateController', AdminUsersCreateController);
7829
7830 AdminUsersCreateController.$inject = ['$state', 'usersResource', 'usersPropertyResource', 'sectionViewResource', 'AeConfig'];
8071 angular.module('appenlight.controllers').controller('ConfigsListController', ConfigsListController);
7831 8072
7832 function AdminUsersCreateController($state, usersResource, usersPropertyResource, sectionViewResource, AeConfig) {
8073 ConfigsListController.$inject = ['configsResource', 'configsNoIdResource'];
7833 8074
8075 function ConfigsListController(configsResource, configsNoIdResource) {
7834 8076 var vm = this;
7835 vm.loading = {user: false};
8077 vm.loading = {config: true};
7836 8078
8079 var filters = [
8080 'template_footer_html:global',
8081 'list_groups_to_non_admins:global',
8082 'per_application_reports_rate_limit:global',
8083 'per_application_logs_rate_limit:global',
8084 'per_application_metrics_rate_limit:global',
8085 ];
7837 8086
7838 if (typeof $state.params.userId !== 'undefined') {
7839 vm.loading.user = true;
7840 var userId = $state.params.userId;
7841 vm.user = usersResource.get({userId: userId}, function (data) {
7842 vm.loading.user = false;
7843 // cast to true for angular checkbox
7844 if (vm.user.status === 1) {
7845 vm.user.status = true;
8087 vm.configs = {};
8088
8089 vm.configList = configsResource.query({filter: filters},
8090 function (data) {
8091 vm.loading = {config: false};
8092 _.each(data, function (item) {
8093 if (vm.configs[item.section] === undefined) {
8094 vm.configs[item.section] = {};
7846 8095 }
8096 vm.configs[item.section][item.key] = item;
8097 });
7847 8098 });
7848 8099
7849 vm.resource_permissions = usersPropertyResource.query(
7850 {userId: userId, key: 'resource_permissions'}, function (data) {
8100 vm.save = function () {
8101 vm.loading.config = true;
8102 _.each(vm.configList, function (item) {
8103 item.$save();
8104 });
8105 vm.loading.config = false;
8106 };
8107
8108 };
8109
8110 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8111 // #
8112 // # This program is free software: you can redistribute it and/or modify
8113 // # it under the terms of the GNU Affero General Public License, version 3
8114 // # (only), as published by the Free Software Foundation.
8115 // #
8116 // # This program is distributed in the hope that it will be useful,
8117 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8118 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8119 // # GNU General Public License for more details.
8120 // #
8121 // # You should have received a copy of the GNU Affero General Public License
8122 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8123 // #
8124 // # This program is dual-licensed. If you wish to learn more about the
8125 // # AppEnlight Enterprise Edition, including its added features, Support
8126 // # services, and proprietary license terms, please see
8127 // # https://rhodecode.com/licenses/
8128
8129 angular.module('appenlight.controllers').controller('AdminGroupsCreateController', AdminGroupsCreateController);
8130
8131 AdminGroupsCreateController.$inject = ['$state', 'groupsResource', 'groupsPropertyResource', 'sectionViewResource', 'AeConfig'];
8132
8133 function AdminGroupsCreateController($state, groupsResource, groupsPropertyResource, sectionViewResource, AeConfig) {
8134
8135 var vm = this;
8136 vm.loading = {
8137 group: false,
8138 resource_permissions: false,
8139 users: false
8140 };
8141
8142 vm.form = {
8143 autocompleteUser: '',
8144 }
8145
8146
8147 if (typeof $state.params.groupId !== 'undefined') {
8148 vm.loading.group = true;
8149 var groupId = $state.params.groupId;
8150 vm.group = groupsResource.get({groupId: groupId}, function (data) {
8151 vm.loading.group = false;
8152 });
8153
8154 vm.resource_permissions = groupsPropertyResource.query(
8155 {groupId: groupId, key: 'resource_permissions'}, function (data) {
7851 8156 vm.loading.resource_permissions = false;
7852 8157 var tmpObj = {
7853 'user': {
7854 'application': {},
7855 'dashboard': {}
7856 },
7857 8158 'group': {
7858 8159 'application': {},
7859 8160 'dashboard': {}
@@ -7874,56 +8175,77 b' function AdminUsersCreateController($state, usersResource, usersPropertyResource'
7874 8175 vm.resourcePermissions = tmpObj;
7875 8176 });
7876 8177
8178 vm.users = groupsPropertyResource.query(
8179 {groupId: groupId, key: 'users'}, function (data) {
8180 vm.loading.users = false;
8181 }, function () {
8182 vm.loading.users = false;
8183 });
8184
7877 8185 }
7878 8186 else {
7879 var userId = null;
7880 vm.user = {
7881 status: true
7882 }
8187 var groupId = null;
7883 8188 }
7884 8189
7885 8190 var formResponse = function (response) {
7886 if (response.status == 422) {
7887 setServerValidation(vm.profileForm, response.data);
7888 }
7889 vm.loading.user = false;
8191 if (response.status === 422) {
8192 setServerValidation(vm.groupForm, response.data);
7890 8193 }
8194 vm.loading.group = false;
8195 };
7891 8196
7892 vm.createUser = function () {
7893 vm.loading.user = true;
7894
7895 if (userId) {
7896 usersResource.update({userId: vm.user.id}, vm.user, function (data) {
7897 setServerValidation(vm.profileForm);
7898 vm.loading.user = false;
8197 vm.createGroup = function () {
8198 vm.loading.group = true;
8199 if (groupId) {
8200 groupsResource.update({groupId: vm.group.id}, vm.group, function (data) {
8201 setServerValidation(vm.groupForm);
8202 vm.loading.group = false;
7899 8203 }, formResponse);
7900 8204 }
7901 8205 else {
7902 usersResource.save(vm.user, function (data) {
7903 $state.go('admin.user.update', {userId: data.id});
8206 groupsResource.save(vm.group, function (data) {
8207 $state.go('admin.group.update', {groupId: data.id});
7904 8208 }, formResponse);
7905 8209 }
7906 }
7907
7908 vm.generatePassword = function () {
7909 var length = 8;
7910 var charset = "abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
7911 vm.gen_pass = "";
7912 for (var i = 0, n = charset.length; i < length; ++i) {
7913 vm.gen_pass += charset.charAt(Math.floor(Math.random() * n));
7914 }
7915 vm.user.user_password = '' + vm.gen_pass;
8210 };
7916 8211
7917 }
8212 vm.removeUser = function (user) {
8213 groupsPropertyResource.delete(
8214 {groupId: groupId, key: 'users', user_name: user.user_name},
8215 function (data) {
8216 vm.loading.users = false;
8217 vm.users = _.filter(vm.users, function (item) {
8218 return item != user;
8219 });
8220 }, function () {
8221 vm.loading.users = false;
8222 });
8223 };
7918 8224
7919 vm.reloginUser = function () {
7920 sectionViewResource.get({
7921 section: 'admin_section', view: 'relogin_user',
7922 user_id: vm.user.id
8225 vm.addUser = function () {
8226 groupsPropertyResource.save(
8227 {groupId: groupId, key: 'users'},
8228 {user_name: vm.form.autocompleteUser},
8229 function (data) {
8230 vm.loading.users = false;
8231 vm.users.push(data);
8232 vm.form.autocompleteUser = '';
7923 8233 }, function () {
7924 window.location = AeConfig.urls.baseUrl;
8234 vm.loading.users = false;
7925 8235 });
8236 }
7926 8237
8238 vm.searchUsers = function (searchPhrase) {
8239
8240 return sectionViewResource.query({
8241 section: 'users_section',
8242 view: 'search_users',
8243 'user_name': searchPhrase
8244 }).$promise.then(function (data) {
8245 return _.map(data, function (item) {
8246 return item.user;
8247 });
8248 });
7927 8249 }
7928 8250 };
7929 8251
@@ -7946,20 +8268,20 b' function AdminUsersCreateController($state, usersResource, usersPropertyResource'
7946 8268 // # services, and proprietary license terms, please see
7947 8269 // # https://rhodecode.com/licenses/
7948 8270
7949 angular.module('appenlight.controllers').controller('AdminUsersController', AdminUsersController);
8271 angular.module('appenlight.controllers').controller('AdminGroupsController', AdminGroupsController);
7950 8272
7951 AdminUsersController.$inject = ['usersResource'];
8273 AdminGroupsController.$inject = ['groupsResource'];
7952 8274
7953 function AdminUsersController(usersResource) {
8275 function AdminGroupsController(groupsResource) {
7954 8276
7955 8277 var vm = this;
7956 vm.loading = {users: true};
8278 vm.loading = {groups: true};
7957 8279
7958 vm.users = usersResource.query({}, function (data) {
7959 vm.loading = {users: false};
7960 vm.activeUsers = _.reduce(vm.users, function(memo, val){
7961 if (val.status == 1){
7962 return memo + 1;
8280 vm.groups = groupsResource.query({}, function (data) {
8281 vm.loading = {groups: false};
8282 vm.activeUsers = _.reduce(vm.groups, function(memo, val){
8283 if (val.status == 1){
8284 return memo + 1;
7963 8285 }
7964 8286 return memo;
7965 8287 }, 0);
@@ -7967,14 +8289,14 b' function AdminUsersController(usersResource) {'
7967 8289 });
7968 8290
7969 8291
7970 vm.removeUser = function (user) {
7971 usersResource.remove({userId: user.id}, function (data, responseHeaders) {
8292 vm.removeGroup = function (group) {
8293 groupsResource.remove({groupId: group.id}, function (data, responseHeaders) {
7972 8294
7973 8295 if (data) {
7974 var index = vm.users.indexOf(user);
8296 var index = vm.groups.indexOf(group);
7975 8297 if (index !== -1) {
7976 vm.users.splice(index, 1);
7977 vm.activeUsers -= 1;
8298 vm.groups.splice(index, 1);
8299 vm.activeGroups -= 1;
7978 8300 }
7979 8301 }
7980 8302 });
@@ -8000,154 +8322,108 b' function AdminUsersController(usersResource) {'
8000 8322 // # services, and proprietary license terms, please see
8001 8323 // # https://rhodecode.com/licenses/
8002 8324
8003 angular.module('appenlight.controllers')
8004 .controller('ApplicationsUpdateController', ApplicationsUpdateController)
8005
8006 ApplicationsUpdateController.$inject = ['$state', 'applicationsNoIdResource', 'applicationsResource', 'applicationsPropertyResource', 'stateHolder'];
8325 angular.module('appenlight.controllers').controller('AdminPartitionsController', AdminPartitionsController);
8007 8326
8008 function ApplicationsUpdateController($state, applicationsNoIdResource, applicationsResource, applicationsPropertyResource, stateHolder) {
8009 'use strict';
8327 AdminPartitionsController.$inject = ['sectionViewResource'];
8010 8328
8329 function AdminPartitionsController(sectionViewResource) {
8011 8330 var vm = this;
8012 vm.loading = {application: false};
8013
8014 vm.groupingOptions = [
8015 ['url_type', 'Error Type + location'],
8016 ['url_traceback', 'Traceback + location'],
8017 ['traceback_server', 'Traceback + Server'],
8018 ];
8019
8020 var resourceId = $state.params.resourceId;
8021
8022
8023 var options = {};
8024
8025 vm.momentJs = moment;
8026
8027 vm.formTransferModel = {password:''};
8331 vm.permanentPartitions = [];
8332 vm.dailyPartitions = [];
8333 vm.loading = {partitions: true};
8334 vm.dailyChecked = false;
8335 vm.permChecked = false;
8336 vm.dailyConfirm = '';
8337 vm.permConfirm = '';
8028 8338
8029 // set initial data
8030 8339
8031 if (resourceId === 'new') {
8032 vm.resource = {
8033 resource_id: null,
8034 slow_report_threshold: 10,
8035 error_report_threshold: 10,
8036 allow_permanent_storage: true,
8037 default_grouping: vm.groupingOptions[1][0]
8340 vm.loadPartitions = function (data) {
8341 var permanentPartitions = vm.transformPartitionList(
8342 data.permanent_partitions);
8343 var dailyPartitions = vm.transformPartitionList(
8344 data.daily_partitions);
8345 vm.permanentPartitions = permanentPartitions;
8346 vm.dailyPartitions = dailyPartitions;
8347 vm.loading = {partitions: false};
8038 8348 };
8349
8350 vm.setCheckedList = function (scope) {
8351 var toTest = null;
8352 if (scope === 'dailyPartitions'){
8353 toTest = 'dailyChecked';
8039 8354 }
8040 8355 else{
8041 vm.loading.application = true;
8042 vm.resource = applicationsResource.get({
8043 'resourceId': resourceId
8044 }, function (data) {
8045 vm.loading.application = false;
8046 });
8047 }
8048
8049
8050 vm.updateBasicForm = function () {
8051 vm.loading.application = true;
8052 if (vm.resource.resource_id === null) {
8053 applicationsNoIdResource.save(null, vm.resource, function (data) {
8054 stateHolder.AeUser.addApplication(data);
8055 $state.go('applications.update', {resourceId: data.resource_id});
8056 setServerValidation(vm.BasicForm);
8057 }, function (response) {
8058 if (response.status == 422) {
8059 setServerValidation(vm.BasicForm, response.data);
8356 toTest = 'permChecked';
8060 8357 }
8061 vm.loading.application = false;
8062 8358
8063 });
8359 if (vm[toTest]) {
8360 var val = true;
8064 8361 }
8065 8362 else {
8066 applicationsResource.update({resourceId: vm.resource.resource_id},
8067 vm.resource, function (data) {
8068 vm.resource = data;
8069 vm.loading.application = false;
8070 setServerValidation(vm.BasicForm);
8071 }, function (response) {
8072 if (response.status == 422) {
8073 setServerValidation(vm.BasicForm, response.data);
8363 var val = false;
8074 8364 }
8075 vm.loading.application = false;
8365
8366 _.each(vm[scope], function (item) {
8367 _.each(item[1].pg, function (index) {
8368 index.checked = val;
8369 });
8370 _.each(item[1].elasticsearch, function (index) {
8371 index.checked = val;
8372 });
8076 8373 });
8077 8374 }
8078 };
8079
8080 vm.addRule = function () {
8081 8375
8082 applicationsPropertyResource.save({
8083 resourceId: vm.resource.resource_id,
8084 key: 'postprocessing_rules'
8085 }, null,
8086 function (data) {
8087 vm.resource.postprocessing_rules.push(data);
8088 }
8089 );
8090 };
8091 8376
8092 vm.regenerateAPIKeys = function(){
8093 vm.loading.application = true;
8094 applicationsPropertyResource.save({
8095 resourceId: vm.resource.resource_id,
8096 key: 'api_key'
8097 }, {password: vm.regenerateAPIKeysPassword},
8098 function (data) {
8099 vm.resource = data;
8100 vm.loading.application = false;
8101 vm.regenerateAPIKeysPassword = '';
8102 setServerValidation(vm.regenerateAPIKeysForm);
8103 },
8104 function (response) {
8105 if (response.status == 422) {
8106 setServerValidation(vm.regenerateAPIKeysForm, response.data);
8377 vm.transformPartitionList = function (inputList) {
8378 var outputList = [];
8107 8379
8108 }
8109 vm.loading.application = false;
8110 }
8111 )
8380 _.each(inputList, function (item) {
8381 var time = [item[0], {
8382 elasticsearch: [],
8383 pg: []
8384 }]
8385 _.each(item[1].pg, function (index) {
8386 time[1].pg.push({name: index, checked: false})
8387 });
8388 _.each(item[1].elasticsearch, function (index) {
8389 time[1].elasticsearch.push({
8390 name: index,
8391 checked: false
8392 })
8393 });
8394 outputList.push(time);
8395 });
8396 return outputList;
8112 8397 };
8113 8398
8114 vm.deleteApplication = function(){
8115 vm.loading.application = true;
8116 applicationsPropertyResource.update({
8117 resourceId: vm.resource.resource_id,
8118 key: 'delete_resource'
8119 }, vm.formDeleteModel,
8120 function (data) {
8121 stateHolder.AeUser.removeApplicationById(vm.resource.resource_id);
8122 $state.go('applications.list');
8123 },
8124 function (response) {
8125 if (response.status == 422) {
8126 setServerValidation(vm.formDelete, response.data);
8399 sectionViewResource.get({section:'admin_section', view: 'partitions'},
8400 vm.loadPartitions);
8127 8401
8402 vm.partitionsDelete = function (partitionType) {
8403 var es_indices = [];
8404 var pg_indices = [];
8405 _.each(vm[partitionType], function (item) {
8406 _.each(item[1].pg, function (index) {
8407 if (index.checked) {
8408 pg_indices.push(index.name)
8128 8409 }
8129 vm.loading.application = false;
8410 });
8411 _.each(item[1].elasticsearch, function (index) {
8412 if (index.checked) {
8413 es_indices.push(index.name)
8130 8414 }
8131 );
8132 };
8415 });
8416 });
8133 8417
8134 vm.transferApplication = function(){
8135 vm.loading.application = true;
8136 applicationsPropertyResource.update({
8137 resourceId: vm.resource.resource_id,
8138 key: 'owner'
8139 }, vm.formTransferModel,
8140 function (data) {
8141 $state.go('applications.list');
8142 },
8143 function (response) {
8144 if (response.status == 422) {
8145 setServerValidation(vm.formTransfer, response.data);
8146 8418
8147 }
8148 vm.loading.application = false;
8149 }
8150 )
8419 vm.loading = {partitions: true};
8420 sectionViewResource.save({section:'admin_section',
8421 view: 'partitions_remove'}, {
8422 es_indices: es_indices,
8423 pg_indices: pg_indices,
8424 confirm: 'CONFIRM'
8425 }, vm.loadPartitions);
8426
8151 8427 }
8152 8428
8153 8429 }
@@ -8171,108 +8447,31 b' function ApplicationsUpdateController($state, applicationsNoIdResource, applicat'
8171 8447 // # services, and proprietary license terms, please see
8172 8448 // # https://rhodecode.com/licenses/
8173 8449
8174 angular.module('appenlight.controllers')
8175 .controller('IntegrationController', IntegrationController)
8176
8177 IntegrationController.$inject = ['$state', 'integrationResource'];
8450 angular.module('appenlight.controllers').controller('AdminSystemController', AdminSystemController);
8178 8451
8179 function IntegrationController($state, integrationResource) {
8452 AdminSystemController.$inject = ['sectionViewResource'];
8180 8453
8454 function AdminSystemController(sectionViewResource) {
8181 8455 var vm = this;
8182 vm.loading = {integration: true};
8183 vm.config = integrationResource.get(
8184 {
8185 integration: $state.params.integration,
8186 action: 'setup',
8187 resourceId: $state.params.resourceId
8188 }, function (data) {
8189 vm.loading.integration = false;
8456 vm.tables = [];
8457 vm.loading = {system: true};
8458 sectionViewResource.get({
8459 section: 'admin_section',
8460 view: 'system'
8461 }, null, function (data) {
8462 vm.DBtables = data.db_tables;
8463 vm.ESIndices = data.es_indices;
8464 vm.queueStats = data.queue_stats;
8465 vm.systemLoad = data.system_load;
8466 vm.packages = data.packages;
8467 vm.processInfo = data.process_info;
8468 vm.disks = data.disks;
8469 vm.memory = data.memory;
8470 vm.selfInfo = data.self_info;
8471
8472 vm.loading.system = false;
8190 8473 });
8191
8192 vm.configureIntegration = function () {
8193 console.info('configureIntegration');
8194 vm.loading.integration = true;
8195 integrationResource.save(
8196 {
8197 integration: $state.params.integration,
8198 action: 'setup',
8199 resourceId: $state.params.resourceId
8200 }, vm.config, function (data) {
8201 vm.loading.integration = false;
8202 setServerValidation(vm.integrationForm);
8203 }, function (response) {
8204 if (response.status == 422) {
8205 setServerValidation(vm.integrationForm, response.data);
8206 }
8207 vm.loading.integration = false;
8208 });
8209 };
8210
8211 vm.removeIntegration = function () {
8212 console.info('removeIntegration');
8213 integrationResource.remove({
8214 integration: $state.params.integration,
8215 resourceId: $state.params.resourceId,
8216 action: 'delete'
8217 },
8218 function () {
8219 $state.go('applications.integrations',
8220 {resourceId: $state.params.resourceId});
8221 }
8222 );
8223 }
8224
8225 vm.testIntegration = function(to_test){
8226 console.info('testIntegration', to_test);
8227 vm.loading.integration = true;
8228 integrationResource.save(
8229 {
8230 integration: $state.params.integration,
8231 action: 'test_'+ to_test,
8232 resourceId: $state.params.resourceId
8233 }, vm.config, function (data) {
8234 vm.loading.integration = false;
8235 }, function (response) {
8236 vm.loading.integration = false;
8237 });
8238 }
8239
8240
8241 }
8242
8243 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8244 // #
8245 // # This program is free software: you can redistribute it and/or modify
8246 // # it under the terms of the GNU Affero General Public License, version 3
8247 // # (only), as published by the Free Software Foundation.
8248 // #
8249 // # This program is distributed in the hope that it will be useful,
8250 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8251 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8252 // # GNU General Public License for more details.
8253 // #
8254 // # You should have received a copy of the GNU Affero General Public License
8255 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8256 // #
8257 // # This program is dual-licensed. If you wish to learn more about the
8258 // # AppEnlight Enterprise Edition, including its added features, Support
8259 // # services, and proprietary license terms, please see
8260 // # https://rhodecode.com/licenses/
8261
8262 angular.module('appenlight.controllers')
8263 .controller('IntegrationsListController', IntegrationsListController)
8264
8265 IntegrationsListController.$inject = ['$state', 'applicationsResource'];
8266
8267 function IntegrationsListController($state, applicationsResource) {
8268
8269 var vm = this;
8270 vm.loading = {application: true};
8271 vm.resource = applicationsResource.get({resourceId: $state.params.resourceId}, function (data) {
8272 vm.loading.application = false;
8273 $state.current.data.resource = vm.resource;
8274 });
8275 }
8474 };
8276 8475
8277 8476 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8278 8477 // #
@@ -8293,789 +8492,592 b' function IntegrationsListController($state, applicationsResource) {'
8293 8492 // # services, and proprietary license terms, please see
8294 8493 // # https://rhodecode.com/licenses/
8295 8494
8296 angular.module('appenlight.controllers')
8297 .controller('ApplicationsListController', ApplicationsListController)
8298
8299 ApplicationsListController.$inject = ['applicationsResource'];
8300
8301 function ApplicationsListController(applicationsResource) {
8302
8303 var vm = this;
8304 vm.loading = {applications: true};
8305 vm.applications = applicationsResource.query(null, function(){
8306 vm.loading.applications = false;
8307 });
8308 }
8309
8310 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8311 // #
8312 // # This program is free software: you can redistribute it and/or modify
8313 // # it under the terms of the GNU Affero General Public License, version 3
8314 // # (only), as published by the Free Software Foundation.
8315 // #
8316 // # This program is distributed in the hope that it will be useful,
8317 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8318 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8319 // # GNU General Public License for more details.
8320 // #
8321 // # You should have received a copy of the GNU Affero General Public License
8322 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8323 // #
8324 // # This program is dual-licensed. If you wish to learn more about the
8325 // # AppEnlight Enterprise Edition, including its added features, Support
8326 // # services, and proprietary license terms, please see
8327 // # https://rhodecode.com/licenses/
8328
8329 angular.module('appenlight.controllers')
8330 .controller('ApplicationsPurgeLogsController', ApplicationsPurgeLogsController)
8331
8332 ApplicationsPurgeLogsController.$inject = ['applicationsResource', 'sectionViewResource', 'logsNoIdResource'];
8333
8334 function ApplicationsPurgeLogsController(applicationsResource, sectionViewResource, logsNoIdResource) {
8335
8336 var vm = this;
8337 vm.loading = {applications: true};
8338
8339 vm.namespace = null;
8340 vm.selectedResource = null;
8341 vm.commonNamespaces = [];
8342
8343 vm.applications = applicationsResource.query({'type':'update_reports'}, function () {
8344 vm.loading.applications = false;
8345 vm.selectedResource = vm.applications[0].resource_id;
8346 vm.getCommonKeys();
8347 });
8348
8349 /**
8350 * Fetches most commonly used tags in logs
8351 */
8352 vm.getCommonKeys = function () {
8353 sectionViewResource.get({
8354 section: 'logs_section',
8355 view: 'common_tags',
8356 resource: vm.selectedResource
8357 }, function (data) {
8358 vm.commonNamespaces = data['namespaces']
8359 });
8360 };
8361
8362 vm.purgeLogs = function () {
8363 vm.loading.applications = true;
8364 logsNoIdResource.delete({resource:vm.selectedResource,
8365 namespace: vm.namespace}, function(){
8366 vm.loading.applications = false;
8367 });
8368 }
8369 }
8370
8371 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8372 // #
8373 // # This program is free software: you can redistribute it and/or modify
8374 // # it under the terms of the GNU Affero General Public License, version 3
8375 // # (only), as published by the Free Software Foundation.
8376 // #
8377 // # This program is distributed in the hope that it will be useful,
8378 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8379 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8380 // # GNU General Public License for more details.
8381 // #
8382 // # You should have received a copy of the GNU Affero General Public License
8383 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8384 // #
8385 // # This program is dual-licensed. If you wish to learn more about the
8386 // # AppEnlight Enterprise Edition, including its added features, Support
8387 // # services, and proprietary license terms, please see
8388 // # https://rhodecode.com/licenses/
8495 angular.module('appenlight.controllers').controller('AdminUsersCreateController', AdminUsersCreateController);
8389 8496
8390 angular.module('appenlight.controllers').controller('EventsController', EventsController);
8497 AdminUsersCreateController.$inject = ['$state', 'usersResource', 'usersPropertyResource', 'sectionViewResource', 'AeConfig'];
8391 8498
8392 EventsController.$inject = ['eventsNoIdResource', 'eventsResource'];
8499 function AdminUsersCreateController($state, usersResource, usersPropertyResource, sectionViewResource, AeConfig) {
8393 8500
8394 function EventsController(eventsNoIdResource, eventsResource) {
8395 console.info('EventsController');
8396 8501 var vm = this;
8502 vm.loading = {user: false};
8397 8503
8398 vm.loading = {events: true};
8399
8400 vm.events = eventsNoIdResource.query(
8401 {key: 'events'},
8402 function (data) {
8403 vm.loading.events = false;
8404 });
8405
8406
8407 vm.closeEvent = function (event) {
8408
8409 eventsResource.update({eventId: event.id}, {status: 0}, function (data) {
8410 event.status = 0;
8411 });
8412 }
8413
8414 }
8415
8416 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8417 // #
8418 // # This program is free software: you can redistribute it and/or modify
8419 // # it under the terms of the GNU Affero General Public License, version 3
8420 // # (only), as published by the Free Software Foundation.
8421 // #
8422 // # This program is distributed in the hope that it will be useful,
8423 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8424 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8425 // # GNU General Public License for more details.
8426 // #
8427 // # You should have received a copy of the GNU Affero General Public License
8428 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8429 // #
8430 // # This program is dual-licensed. If you wish to learn more about the
8431 // # AppEnlight Enterprise Edition, including its added features, Support
8432 // # services, and proprietary license terms, please see
8433 // # https://rhodecode.com/licenses/
8434
8435 angular.module('appenlight.controllers')
8436 .controller('IndexDashboardController', IndexDashboardController);
8437
8438 IndexDashboardController.$inject = ['$rootScope', '$scope', '$location','$cookies', '$interval', 'stateHolder', 'applicationsPropertyResource', 'AeConfig'];
8439 8504
8440 function IndexDashboardController($rootScope, $scope, $location, $cookies, $interval, stateHolder, applicationsPropertyResource, AeConfig) {
8441 var vm = this;
8442 stateHolder.section = 'dashboard';
8443 vm.timeOptions = {};
8444 var allowed = ['1h', '4h', '12h', '24h', '1w', '2w', '1M'];
8445 _.each(allowed, function (key) {
8446 if (allowed.indexOf(key) !== -1) {
8447 vm.timeOptions[key] = AeConfig.timeOptions[key];
8505 if (typeof $state.params.userId !== 'undefined') {
8506 vm.loading.user = true;
8507 var userId = $state.params.userId;
8508 vm.user = usersResource.get({userId: userId}, function (data) {
8509 vm.loading.user = false;
8510 // cast to true for angular checkbox
8511 if (vm.user.status === 1) {
8512 vm.user.status = true;
8448 8513 }
8449 8514 });
8450 vm.stateHolder = stateHolder;
8451 vm.urls = AeConfig.urls;
8452 vm.applications = stateHolder.AeUser.applications_map;
8453 vm.show_dashboard = false;
8454 vm.resource = null;
8455 vm.graphType = {selected: null};
8456 vm.timeSpan = vm.timeOptions['1h'];
8457 vm.trendingReports = [];
8458 vm.exceptions = 0;
8459 vm.satisfyingRequests = 0;
8460 vm.toleratedRequests = 0;
8461 vm.frustratingRequests = 0;
8462 vm.uptimeStats = 0;
8463 vm.apdexStats = [];
8464 vm.seriesRequestsData = [];
8465 vm.seriesMetricsData = [];
8466 vm.seriesSlowData = [];
8467 vm.slowCalls = [];
8468 vm.slowURIS = [];
8469
8470 vm.reportChartConfig = {
8471 data: {
8472 json: [],
8473 xFormat: '%Y-%m-%dT%H:%M:%S'
8474 },
8475 color: {
8476 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
8477 },
8478 axis: {
8479 x: {
8480 type: 'timeseries',
8481 tick: {
8482 culling: {
8483 max: 6 // the number of tick texts will be adjusted to less than this value
8484 },
8485 format: '%Y-%m-%d %H:%M'
8486 }
8487 },
8488 y: {
8489 tick: {
8490 count: 5,
8491 format: d3.format('.2s')
8492 }
8493 }
8494 },
8495 subchart: {
8496 show: true,
8497 size: {
8498 height: 20
8499 }
8500 },
8501 size: {
8502 height: 250
8503 },
8504 zoom: {
8505 rescale: true
8506 },
8507 grid: {
8508 x: {
8509 show: true
8510 },
8511 y: {
8512 show: true
8513 }
8514 },
8515 tooltip: {
8516 format: {
8517 title: function (d) {
8518 return '' + d;
8519 },
8520 value: function (v) {
8521 return v
8522 }
8523 }
8524 }
8525 };
8526 vm.reportChartData = {};
8527
8528 vm.reportSlowChartConfig = {
8529 data: {
8530 json: [],
8531 xFormat: '%Y-%m-%dT%H:%M:%S'
8532 },
8533 color: {
8534 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
8535 },
8536 axis: {
8537 x: {
8538 type: 'timeseries',
8539 tick: {
8540 culling: {
8541 max: 6 // the number of tick texts will be adjusted to less than this value
8542 },
8543 format: '%Y-%m-%d %H:%M'
8544 }
8545 },
8546 y: {
8547 tick: {
8548 count: 5,
8549 format: d3.format('.2s')
8550 }
8551 }
8552 },
8553 subchart: {
8554 show: true,
8555 size: {
8556 height: 20
8557 }
8558 },
8559 size: {
8560 height: 250
8561 },
8562 zoom: {
8563 rescale: true
8564 },
8565 grid: {
8566 x: {
8567 show: true
8568 },
8569 y: {
8570 show: true
8571 }
8572 },
8573 tooltip: {
8574 format: {
8575 title: function (d) {
8576 return '' + d;
8577 },
8578 value: function (v) {
8579 return v
8580 }
8581 }
8582 }
8583 };
8584 vm.reportSlowChartData = {};
8585
8586 vm.metricsChartConfig = {
8587 data: {
8588 json: [],
8589 xFormat: '%Y-%m-%dT%H:%M:%S',
8590 keys: {
8591 x: 'x',
8592 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
8593 },
8594 names: {
8595 main: 'View/Application logic',
8596 sql: 'Relational database queries',
8597 nosql: 'NoSql datastore calls',
8598 tmpl: 'Template rendering',
8599 custom: 'Custom timed calls',
8600 remote: 'Requests to remote resources'
8601 },
8602 type: 'area',
8603 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
8604 order: null
8605 },
8606 color: {
8607 pattern: ['#6baed6', '#c7e9c0', '#fd8d3c', '#d6616b', '#ffcc00', '#c6dbef']
8608 },
8609 axis: {
8610 x: {
8611 type: 'timeseries',
8612 tick: {
8613 culling: {
8614 max: 6 // the number of tick texts will be adjusted to less than this value
8615 },
8616 format: '%Y-%m-%d %H:%M'
8617 }
8618 },
8619 y: {
8620 tick: {
8621 count: 5,
8622 format: d3.format('.2f')
8623 }
8624 }
8625 },
8626 point: {
8627 show: false
8628 },
8629 subchart: {
8630 show: true,
8631 size: {
8632 height: 20
8633 }
8634 },
8635 size: {
8636 height: 350
8637 },
8638 zoom: {
8639 rescale: true
8640 },
8641 grid: {
8642 x: {
8643 show: true
8644 },
8645 y: {
8646 show: true
8647 }
8648 },
8649 tooltip: {
8650 format: {
8651 title: function (d) {
8652 return '' + d;
8653 },
8654 value: function (v) {
8655 return v
8656 }
8657 }
8658 }
8659 };
8660 vm.metricsChartData = {};
8661 8515
8662 vm.responseChartConfig = {
8663 data: {
8664 json: [],
8665 xFormat: '%Y-%m-%dT%H:%M:%S'
8666 },
8667 color: {
8668 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
8669 },
8670 axis: {
8671 x: {
8672 type: 'timeseries',
8673 tick: {
8674 culling: {
8675 max: 6 // the number of tick texts will be adjusted to less than this value
8676 },
8677 format: '%Y-%m-%d %H:%M'
8678 }
8679 },
8680 y: {
8681 tick: {
8682 count: 5,
8683 format: d3.format('.2f')
8684 }
8685 }
8686 },
8687 point: {
8688 show: false
8689 },
8690 subchart: {
8691 show: true,
8692 size: {
8693 height: 20
8694 }
8695 },
8696 size: {
8697 height: 350
8698 },
8699 zoom: {
8700 rescale: true
8701 },
8702 grid: {
8703 x: {
8704 show: true
8705 },
8706 y: {
8707 show: true
8708 }
8709 },
8710 tooltip: {
8711 format: {
8712 title: function (d) {
8713 return '' + d;
8516 vm.resource_permissions = usersPropertyResource.query(
8517 {userId: userId, key: 'resource_permissions'}, function (data) {
8518 vm.loading.resource_permissions = false;
8519 var tmpObj = {
8520 'user': {
8521 'application': {},
8522 'dashboard': {}
8714 8523 },
8715 value: function (v) {
8716 return v
8524 'group': {
8525 'application': {},
8526 'dashboard': {}
8717 8527 }
8528 };
8529 _.each(data, function (item) {
8530
8531 var section = tmpObj[item.type][item.resource_type];
8532 if (typeof section[item.resource_id] == 'undefined'){
8533 section[item.resource_id] = {
8534 self:item,
8535 permissions: []
8718 8536 }
8719 8537 }
8720 };
8721 vm.responseChartData = {};
8538 section[item.resource_id].permissions.push(item.perm_name);
8539
8540 });
8541 vm.resourcePermissions = tmpObj;
8542 });
8722 8543
8723 vm.requestsChartConfig = {
8724 data: {
8725 json: [],
8726 xFormat: '%Y-%m-%dT%H:%M:%S'
8727 },
8728 color: {
8729 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
8730 },
8731 axis: {
8732 x: {
8733 type: 'timeseries',
8734 tick: {
8735 culling: {
8736 max: 6 // the number of tick texts will be adjusted to less than this value
8737 },
8738 format: '%Y-%m-%d %H:%M'
8739 8544 }
8740 },
8741 y: {
8742 tick: {
8743 count: 5,
8744 format: d3.format('.2f')
8545 else {
8546 var userId = null;
8547 vm.user = {
8548 status: true
8745 8549 }
8746 8550 }
8747 },
8748 point: {
8749 show: false
8750 },
8751 subchart: {
8752 show: true,
8753 size: {
8754 height: 20
8551
8552 var formResponse = function (response) {
8553 if (response.status == 422) {
8554 setServerValidation(vm.profileForm, response.data);
8755 8555 }
8756 },
8757 size: {
8758 height: 350
8759 },
8760 zoom: {
8761 rescale: true
8762 },
8763 grid: {
8764 x: {
8765 show: true
8766 },
8767 y: {
8768 show: true
8556 vm.loading.user = false;
8769 8557 }
8770 },
8771 tooltip: {
8772 format: {
8773 title: function (d) {
8774 return '' + d;
8775 },
8776 value: function (v) {
8777 return v
8558
8559 vm.createUser = function () {
8560 vm.loading.user = true;
8561
8562 if (userId) {
8563 usersResource.update({userId: vm.user.id}, vm.user, function (data) {
8564 setServerValidation(vm.profileForm);
8565 vm.loading.user = false;
8566 }, formResponse);
8778 8567 }
8568 else {
8569 usersResource.save(vm.user, function (data) {
8570 $state.go('admin.user.update', {userId: data.id});
8571 }, formResponse);
8779 8572 }
8780 8573 }
8781 };
8782 vm.requestsChartData = {};
8783
8784 vm.loading = {
8785 'apdex': true,
8786 'reports': true,
8787 'graphs': true,
8788 'slowCalls': true,
8789 'slowURIS': true,
8790 'requestsBreakdown': true,
8791 'series': true
8792 };
8793 vm.stream = {paused: false, filtered: false, messages: [], reports: []};
8794 8574
8795 $rootScope.$on('channelstream-message.front_dashboard.new_topic', function(event, message){
8796 var ws_report = message.message.report;
8797 if (ws_report.http_status != 500) {
8798 return
8575 vm.generatePassword = function () {
8576 var length = 8;
8577 var charset = "abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
8578 vm.gen_pass = "";
8579 for (var i = 0, n = charset.length; i < length; ++i) {
8580 vm.gen_pass += charset.charAt(Math.floor(Math.random() * n));
8799 8581 }
8800 if (vm.stream.paused == true) {
8801 return
8582 vm.user.user_password = '' + vm.gen_pass;
8583
8802 8584 }
8803 if (vm.stream.filtered && ws_report.resource_id != vm.resource) {
8804 return
8585
8586 vm.reloginUser = function () {
8587 sectionViewResource.get({
8588 section: 'admin_section', view: 'relogin_user',
8589 user_id: vm.user.id
8590 }, function () {
8591 window.location = AeConfig.urls.baseUrl;
8592 });
8593
8805 8594 }
8806 var should_insert = true;
8807 _.each(vm.stream.reports, function (report) {
8808 if (report.report_id == ws_report.report_id) {
8809 report.occurences = ws_report.occurences;
8810 should_insert = false;
8595 };
8596
8597 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8598 // #
8599 // # This program is free software: you can redistribute it and/or modify
8600 // # it under the terms of the GNU Affero General Public License, version 3
8601 // # (only), as published by the Free Software Foundation.
8602 // #
8603 // # This program is distributed in the hope that it will be useful,
8604 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8605 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8606 // # GNU General Public License for more details.
8607 // #
8608 // # You should have received a copy of the GNU Affero General Public License
8609 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8610 // #
8611 // # This program is dual-licensed. If you wish to learn more about the
8612 // # AppEnlight Enterprise Edition, including its added features, Support
8613 // # services, and proprietary license terms, please see
8614 // # https://rhodecode.com/licenses/
8615
8616 angular.module('appenlight.controllers').controller('AdminUsersController', AdminUsersController);
8617
8618 AdminUsersController.$inject = ['usersResource'];
8619
8620 function AdminUsersController(usersResource) {
8621
8622 var vm = this;
8623 vm.loading = {users: true};
8624
8625 vm.users = usersResource.query({}, function (data) {
8626 vm.loading = {users: false};
8627 vm.activeUsers = _.reduce(vm.users, function(memo, val){
8628 if (val.status == 1){
8629 return memo + 1;
8811 8630 }
8631 return memo;
8632 }, 0);
8633
8812 8634 });
8813 if (should_insert) {
8814 if (vm.stream.reports.length > 7) {
8815 vm.stream.reports.pop();
8635
8636
8637 vm.removeUser = function (user) {
8638 usersResource.remove({userId: user.id}, function (data, responseHeaders) {
8639
8640 if (data) {
8641 var index = vm.users.indexOf(user);
8642 if (index !== -1) {
8643 vm.users.splice(index, 1);
8644 vm.activeUsers -= 1;
8816 8645 }
8817 vm.stream.reports.unshift(ws_report);
8818 8646 }
8819 8647 });
8648 }
8649 };
8820 8650
8821 vm.determineStartState = function () {
8822 if (stateHolder.AeUser.applications.length) {
8823 vm.resource = Number($location.search().resource);
8651 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8652 // #
8653 // # This program is free software: you can redistribute it and/or modify
8654 // # it under the terms of the GNU Affero General Public License, version 3
8655 // # (only), as published by the Free Software Foundation.
8656 // #
8657 // # This program is distributed in the hope that it will be useful,
8658 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8659 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8660 // # GNU General Public License for more details.
8661 // #
8662 // # You should have received a copy of the GNU Affero General Public License
8663 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8664 // #
8665 // # This program is dual-licensed. If you wish to learn more about the
8666 // # AppEnlight Enterprise Edition, including its added features, Support
8667 // # services, and proprietary license terms, please see
8668 // # https://rhodecode.com/licenses/
8824 8669
8825 if (!vm.resource){
8826 var cookieResource = $cookies.getObject('resource');
8670 angular.module('appenlight.controllers')
8671 .controller('ApplicationsUpdateController', ApplicationsUpdateController)
8672
8673 ApplicationsUpdateController.$inject = ['$state', 'applicationsNoIdResource', 'applicationsResource', 'applicationsPropertyResource', 'stateHolder'];
8827 8674
8675 function ApplicationsUpdateController($state, applicationsNoIdResource, applicationsResource, applicationsPropertyResource, stateHolder) {
8676 'use strict';
8828 8677
8829 if (cookieResource) {
8830 vm.resource = cookieResource;
8678 var vm = this;
8679 vm.loading = {application: false};
8680
8681 vm.groupingOptions = [
8682 ['url_type', 'Error Type + location'],
8683 ['url_traceback', 'Traceback + location'],
8684 ['traceback_server', 'Traceback + Server'],
8685 ];
8686
8687 var resourceId = $state.params.resourceId;
8688
8689
8690 var options = {};
8691
8692 vm.momentJs = moment;
8693
8694 vm.formTransferModel = {password:''};
8695
8696 // set initial data
8697
8698 if (resourceId === 'new') {
8699 vm.resource = {
8700 resource_id: null,
8701 slow_report_threshold: 10,
8702 error_report_threshold: 10,
8703 allow_permanent_storage: true,
8704 default_grouping: vm.groupingOptions[1][0]
8705 };
8831 8706 }
8832 8707 else {
8833 vm.resource = stateHolder.AeUser.applications[0].resource_id;
8834 }
8835 }
8708 vm.loading.application = true;
8709 vm.resource = applicationsResource.get({
8710 'resourceId': resourceId
8711 }, function (data) {
8712 vm.loading.application = false;
8713 });
8836 8714 }
8837 8715
8838 var timespan = $location.search().timespan;
8839 8716
8840 if(_.has(vm.timeOptions, timespan)){
8841 vm.timeSpan = vm.timeOptions[timespan];
8842 }
8843 else{
8844 vm.timeSpan = vm.timeOptions['1h'];
8717 vm.updateBasicForm = function () {
8718 vm.loading.application = true;
8719 if (vm.resource.resource_id === null) {
8720 applicationsNoIdResource.save(null, vm.resource, function (data) {
8721 stateHolder.AeUser.addApplication(data);
8722 $state.go('applications.update', {resourceId: data.resource_id});
8723 setServerValidation(vm.BasicForm);
8724 }, function (response) {
8725 if (response.status == 422) {
8726 setServerValidation(vm.BasicForm, response.data);
8845 8727 }
8728 vm.loading.application = false;
8846 8729
8847 var graphType = $location.search().graphtype;
8848 if(!graphType){
8849 vm.graphType = {selected: 'metrics_graphs'};
8730 });
8850 8731 }
8851 8732 else {
8852 vm.graphType = {selected: graphType};
8733 applicationsResource.update({resourceId: vm.resource.resource_id},
8734 vm.resource, function (data) {
8735 vm.resource = data;
8736 vm.loading.application = false;
8737 setServerValidation(vm.BasicForm);
8738 }, function (response) {
8739 if (response.status == 422) {
8740 setServerValidation(vm.BasicForm, response.data);
8741 }
8742 vm.loading.application = false;
8743 });
8853 8744 }
8854 vm.updateSearchParams();
8855 8745 };
8856 8746
8857 vm.updateSearchParams = function () {
8858 $location.search('resource', vm.resource);
8859 $location.search('timespan', vm.timeSpan.key);
8860 $location.search('graphtype', vm.graphType.selected);
8861 stateHolder.resource = vm.resource;
8747 vm.addRule = function () {
8862 8748
8863 if (vm.resource){
8864 $cookies.putObject('resource', vm.resource,
8865 {expires:new Date(3000, 1, 1)});
8749 applicationsPropertyResource.save({
8750 resourceId: vm.resource.resource_id,
8751 key: 'postprocessing_rules'
8752 }, null,
8753 function (data) {
8754 vm.resource.postprocessing_rules.push(data);
8866 8755 }
8867 vm.refreshData();
8868 };
8869
8870 vm.refreshData = function () {
8871 vm.fetchApdexStats();
8872 vm.fetchTrendingReports();
8873 vm.fetchMetrics();
8874 vm.fetchRequestsBreakdown();
8875 vm.fetchSlowCalls();
8756 );
8876 8757 };
8877 8758
8878 vm.changedTimeSpan = function(){
8879 vm.startDateFilter = timeSpanToStartDate(vm.timeSpan.key);
8880 vm.refreshData();
8881 };
8759 vm.regenerateAPIKeys = function(){
8760 vm.loading.application = true;
8761 applicationsPropertyResource.save({
8762 resourceId: vm.resource.resource_id,
8763 key: 'api_key'
8764 }, {password: vm.regenerateAPIKeysPassword},
8765 function (data) {
8766 vm.resource = data;
8767 vm.loading.application = false;
8768 vm.regenerateAPIKeysPassword = '';
8769 setServerValidation(vm.regenerateAPIKeysForm);
8770 },
8771 function (response) {
8772 if (response.status == 422) {
8773 setServerValidation(vm.regenerateAPIKeysForm, response.data);
8882 8774
8883 vm.intervalId = $interval(function () {
8884 if (_.contains(['30m', "1h"], vm.timeSpan.key)) {
8885 // don't do anything if window is unfocused
8886 if(document.hidden === true){
8887 return ;
8888 8775 }
8889 vm.refreshData();
8776 vm.loading.application = false;
8890 8777 }
8891 }, 60000);
8778 )
8779 };
8892 8780
8893 vm.fetchApdexStats = function () {
8894 vm.loading.apdex = true;
8895 vm.apdexStats = applicationsPropertyResource.query({
8896 'key': 'apdex_stats',
8897 'resourceId': vm.resource,
8898 "start_date": timeSpanToStartDate(vm.timeSpan.key)
8899 },
8781 vm.deleteApplication = function(){
8782 vm.loading.application = true;
8783 applicationsPropertyResource.update({
8784 resourceId: vm.resource.resource_id,
8785 key: 'delete_resource'
8786 }, vm.formDeleteModel,
8900 8787 function (data) {
8901 vm.loading.apdex = false;
8788 stateHolder.AeUser.removeApplicationById(vm.resource.resource_id);
8789 $state.go('applications.list');
8790 },
8791 function (response) {
8792 if (response.status == 422) {
8793 setServerValidation(vm.formDelete, response.data);
8902 8794
8903 vm.exceptions = _.reduce(data, function (memo, row) {
8904 return memo + row.errors;
8905 }, 0);
8906 vm.satisfyingRequests = _.reduce(data, function (memo, row) {
8907 return memo + row.satisfying_requests;
8908 }, 0);
8909 vm.toleratedRequests = _.reduce(data, function (memo, row) {
8910 return memo + row.tolerated_requests;
8911 }, 0);
8912 vm.frustratingRequests = _.reduce(data, function (memo, row) {
8913 return memo + row.frustrating_requests;
8914 }, 0);
8915 if (data.length) {
8916 vm.uptimeStats = data[0].uptime;
8917 8795 }
8918
8919 },
8920 function () {
8921 vm.loading.apdex = false;
8796 vm.loading.application = false;
8922 8797 }
8923 8798 );
8924 }
8799 };
8925 8800
8926 vm.fetchMetrics = function () {
8927 vm.loading.series = true;
8928 applicationsPropertyResource.query({
8929 'resourceId': vm.resource,
8930 'key': vm.graphType.selected,
8931 "start_date": timeSpanToStartDate(vm.timeSpan.key)
8932 }, function (data) {
8933 if (vm.graphType.selected == 'metrics_graphs') {
8934 vm.metricsChartData = {
8935 json: data,
8936 xFormat: '%Y-%m-%dT%H:%M:%S',
8937 keys: {
8938 x: 'x',
8939 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
8940 },
8941 names: {
8942 main: 'View/Application logic',
8943 sql: 'Relational database queries',
8944 nosql: 'NoSql datastore calls',
8945 tmpl: 'Template rendering',
8946 custom: 'Custom timed calls',
8947 remote: 'Requests to remote resources'
8801 vm.transferApplication = function(){
8802 vm.loading.application = true;
8803 applicationsPropertyResource.update({
8804 resourceId: vm.resource.resource_id,
8805 key: 'owner'
8806 }, vm.formTransferModel,
8807 function (data) {
8808 $state.go('applications.list');
8948 8809 },
8949 type: 'area',
8950 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
8951 order: null
8952 };
8810 function (response) {
8811 if (response.status == 422) {
8812 setServerValidation(vm.formTransfer, response.data);
8813
8953 8814 }
8954 else if (vm.graphType.selected == 'report_graphs') {
8955 vm.reportChartData = {
8956 json: data,
8957 xFormat: '%Y-%m-%dT%H:%M:%S',
8958 keys: {
8959 x: 'x',
8960 value: ["not_found", "report"]
8961 },
8962 names: {
8963 report: 'Errors',
8964 not_found: '404\'s requests'
8965 },
8966 type: 'bar'
8967 };
8815 vm.loading.application = false;
8968 8816 }
8969 else if (vm.graphType.selected == 'slow_report_graphs') {
8970 vm.reportSlowChartData = {
8971 json: data,
8972 xFormat: '%Y-%m-%dT%H:%M:%S',
8973 keys: {
8974 x: 'x',
8975 value: ["slow_report"]
8976 },
8977 names: {
8978 slow_report: 'Slow reports'
8979 },
8980 type: 'bar'
8981 };
8817 )
8982 8818 }
8983 else if (vm.graphType.selected == 'response_graphs') {
8984 vm.responseChartData = {
8985 json: data,
8986 xFormat: '%Y-%m-%dT%H:%M:%S',
8987 keys: {
8988 x: 'x',
8989 value: ["today", "days_ago_2", "days_ago_7"]
8990 },
8991 names: {
8992 today: 'Today',
8993 "days_ago_2": '2 days ago',
8994 "days_ago_7": '7 days ago'
8819
8820 }
8821
8822 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8823 // #
8824 // # This program is free software: you can redistribute it and/or modify
8825 // # it under the terms of the GNU Affero General Public License, version 3
8826 // # (only), as published by the Free Software Foundation.
8827 // #
8828 // # This program is distributed in the hope that it will be useful,
8829 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8830 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8831 // # GNU General Public License for more details.
8832 // #
8833 // # You should have received a copy of the GNU Affero General Public License
8834 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8835 // #
8836 // # This program is dual-licensed. If you wish to learn more about the
8837 // # AppEnlight Enterprise Edition, including its added features, Support
8838 // # services, and proprietary license terms, please see
8839 // # https://rhodecode.com/licenses/
8840
8841 angular.module('appenlight.controllers')
8842 .controller('IntegrationController', IntegrationController)
8843
8844 IntegrationController.$inject = ['$state', 'integrationResource'];
8845
8846 function IntegrationController($state, integrationResource) {
8847
8848 var vm = this;
8849 vm.loading = {integration: true};
8850 vm.config = integrationResource.get(
8851 {
8852 integration: $state.params.integration,
8853 action: 'setup',
8854 resourceId: $state.params.resourceId
8855 }, function (data) {
8856 vm.loading.integration = false;
8857 });
8858
8859 vm.configureIntegration = function () {
8860 console.info('configureIntegration');
8861 vm.loading.integration = true;
8862 integrationResource.save(
8863 {
8864 integration: $state.params.integration,
8865 action: 'setup',
8866 resourceId: $state.params.resourceId
8867 }, vm.config, function (data) {
8868 vm.loading.integration = false;
8869 setServerValidation(vm.integrationForm);
8870 }, function (response) {
8871 if (response.status == 422) {
8872 setServerValidation(vm.integrationForm, response.data);
8995 8873 }
8874 vm.loading.integration = false;
8875 });
8996 8876 };
8997 }
8998 else if (vm.graphType.selected == 'requests_graphs') {
8999 vm.requestsChartData = {
9000 json: data,
9001 xFormat: '%Y-%m-%dT%H:%M:%S',
9002 keys: {
9003 x: 'x',
9004 value: ["requests"]
8877
8878 vm.removeIntegration = function () {
8879 console.info('removeIntegration');
8880 integrationResource.remove({
8881 integration: $state.params.integration,
8882 resourceId: $state.params.resourceId,
8883 action: 'delete'
9005 8884 },
9006 names: {
9007 requests: 'Requests/s'
8885 function () {
8886 $state.go('applications.integrations',
8887 {resourceId: $state.params.resourceId});
9008 8888 }
9009 };
8889 );
9010 8890 }
9011 vm.loading.series = false;
9012 }, function(){
9013 vm.loading.series = false;
8891
8892 vm.testIntegration = function(to_test){
8893 console.info('testIntegration', to_test);
8894 vm.loading.integration = true;
8895 integrationResource.save(
8896 {
8897 integration: $state.params.integration,
8898 action: 'test_'+ to_test,
8899 resourceId: $state.params.resourceId
8900 }, vm.config, function (data) {
8901 vm.loading.integration = false;
8902 }, function (response) {
8903 vm.loading.integration = false;
9014 8904 });
9015 8905 }
9016 8906
9017 vm.fetchSlowCalls = function () {
9018 vm.loading.slowCalls = true;
9019 applicationsPropertyResource.query({
9020 'resourceId': vm.resource,
9021 "start_date": timeSpanToStartDate(vm.timeSpan.key),
9022 'key': 'slow_calls'
9023 }, function (data) {
9024 vm.slowCalls = data;
9025 vm.loading.slowCalls = false;
9026 }, function () {
9027 vm.loading.slowCalls = false;
8907
8908 }
8909
8910 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8911 // #
8912 // # This program is free software: you can redistribute it and/or modify
8913 // # it under the terms of the GNU Affero General Public License, version 3
8914 // # (only), as published by the Free Software Foundation.
8915 // #
8916 // # This program is distributed in the hope that it will be useful,
8917 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8918 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8919 // # GNU General Public License for more details.
8920 // #
8921 // # You should have received a copy of the GNU Affero General Public License
8922 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8923 // #
8924 // # This program is dual-licensed. If you wish to learn more about the
8925 // # AppEnlight Enterprise Edition, including its added features, Support
8926 // # services, and proprietary license terms, please see
8927 // # https://rhodecode.com/licenses/
8928
8929 angular.module('appenlight.controllers')
8930 .controller('IntegrationsListController', IntegrationsListController)
8931
8932 IntegrationsListController.$inject = ['$state', 'applicationsResource'];
8933
8934 function IntegrationsListController($state, applicationsResource) {
8935
8936 var vm = this;
8937 vm.loading = {application: true};
8938 vm.resource = applicationsResource.get({resourceId: $state.params.resourceId}, function (data) {
8939 vm.loading.application = false;
8940 $state.current.data.resource = vm.resource;
9028 8941 });
9029 8942 }
9030 8943
9031 vm.fetchRequestsBreakdown = function () {
9032 vm.loading.requestsBreakdown = true;
9033 applicationsPropertyResource.query({
9034 'resourceId': vm.resource,
9035 "start_date": timeSpanToStartDate(vm.timeSpan.key),
9036 'key': 'requests_breakdown'
9037 }, function (data) {
9038 vm.requestsBreakdown = data;
9039 vm.loading.requestsBreakdown = false;
9040 }, function () {
9041 vm.loading.requestsBreakdown = false;
8944 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8945 // #
8946 // # This program is free software: you can redistribute it and/or modify
8947 // # it under the terms of the GNU Affero General Public License, version 3
8948 // # (only), as published by the Free Software Foundation.
8949 // #
8950 // # This program is distributed in the hope that it will be useful,
8951 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8952 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8953 // # GNU General Public License for more details.
8954 // #
8955 // # You should have received a copy of the GNU Affero General Public License
8956 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8957 // #
8958 // # This program is dual-licensed. If you wish to learn more about the
8959 // # AppEnlight Enterprise Edition, including its added features, Support
8960 // # services, and proprietary license terms, please see
8961 // # https://rhodecode.com/licenses/
8962
8963 angular.module('appenlight.controllers')
8964 .controller('ApplicationsListController', ApplicationsListController)
8965
8966 ApplicationsListController.$inject = ['applicationsResource'];
8967
8968 function ApplicationsListController(applicationsResource) {
8969
8970 var vm = this;
8971 vm.loading = {applications: true};
8972 vm.applications = applicationsResource.query(null, function(){
8973 vm.loading.applications = false;
9042 8974 });
9043 8975 }
9044 8976
9045 vm.fetchTrendingReports = function () {
8977 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8978 // #
8979 // # This program is free software: you can redistribute it and/or modify
8980 // # it under the terms of the GNU Affero General Public License, version 3
8981 // # (only), as published by the Free Software Foundation.
8982 // #
8983 // # This program is distributed in the hope that it will be useful,
8984 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8985 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8986 // # GNU General Public License for more details.
8987 // #
8988 // # You should have received a copy of the GNU Affero General Public License
8989 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8990 // #
8991 // # This program is dual-licensed. If you wish to learn more about the
8992 // # AppEnlight Enterprise Edition, including its added features, Support
8993 // # services, and proprietary license terms, please see
8994 // # https://rhodecode.com/licenses/
9046 8995
9047 if (vm.graphType.selected == 'slow_report_graphs') {
9048 var report_type = 'slow';
8996 angular.module('appenlight.controllers')
8997 .controller('ApplicationsPurgeLogsController', ApplicationsPurgeLogsController)
8998
8999 ApplicationsPurgeLogsController.$inject = ['applicationsResource', 'sectionViewResource', 'logsNoIdResource'];
9000
9001 function ApplicationsPurgeLogsController(applicationsResource, sectionViewResource, logsNoIdResource) {
9002
9003 var vm = this;
9004 vm.loading = {applications: true};
9005
9006 vm.namespace = null;
9007 vm.selectedResource = null;
9008 vm.commonNamespaces = [];
9009
9010 vm.applications = applicationsResource.query({'type':'update_reports'}, function () {
9011 vm.loading.applications = false;
9012 vm.selectedResource = vm.applications[0].resource_id;
9013 vm.getCommonKeys();
9014 });
9015
9016 /**
9017 * Fetches most commonly used tags in logs
9018 */
9019 vm.getCommonKeys = function () {
9020 sectionViewResource.get({
9021 section: 'logs_section',
9022 view: 'common_tags',
9023 resource: vm.selectedResource
9024 }, function (data) {
9025 vm.commonNamespaces = data['namespaces']
9026 });
9027 };
9028
9029 vm.purgeLogs = function () {
9030 vm.loading.applications = true;
9031 logsNoIdResource.delete({resource:vm.selectedResource,
9032 namespace: vm.namespace}, function(){
9033 vm.loading.applications = false;
9034 });
9049 9035 }
9050 else {
9051 var report_type = 'error';
9052 9036 }
9053 9037
9054 vm.loading.reports = true;
9055 vm.trendingReports = applicationsPropertyResource.query({
9056 'key': 'trending_reports',
9057 'resourceId': vm.resource,
9058 "start_date": timeSpanToStartDate(vm.timeSpan.key),
9059 "report_type": report_type
9060 },
9061 function () {
9062 vm.loading.reports = false;
9063 },
9064 function () {
9065 vm.loading.reports = false;
9066 }
9067 );
9068 };
9038 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9039 // #
9040 // # This program is free software: you can redistribute it and/or modify
9041 // # it under the terms of the GNU Affero General Public License, version 3
9042 // # (only), as published by the Free Software Foundation.
9043 // #
9044 // # This program is distributed in the hope that it will be useful,
9045 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9046 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9047 // # GNU General Public License for more details.
9048 // #
9049 // # You should have received a copy of the GNU Affero General Public License
9050 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9051 // #
9052 // # This program is dual-licensed. If you wish to learn more about the
9053 // # AppEnlight Enterprise Edition, including its added features, Support
9054 // # services, and proprietary license terms, please see
9055 // # https://rhodecode.com/licenses/
9069 9056
9070 $scope.$on('$destroy',function(){
9071 $interval.cancel(vm.intervalId);
9057 angular.module('appenlight.controllers').controller('EventsController', EventsController);
9058
9059 EventsController.$inject = ['eventsNoIdResource', 'eventsResource'];
9060
9061 function EventsController(eventsNoIdResource, eventsResource) {
9062 console.info('EventsController');
9063 var vm = this;
9064
9065 vm.loading = {events: true};
9066
9067 vm.events = eventsNoIdResource.query(
9068 {key: 'events'},
9069 function (data) {
9070 vm.loading.events = false;
9072 9071 });
9073 9072
9074 if (stateHolder.AeUser.applications.length){
9075 vm.show_dashboard = true;
9076 vm.determineStartState();
9077 vm.refreshData();
9073
9074 vm.closeEvent = function (event) {
9075
9076 eventsResource.update({eventId: event.id}, {status: 0}, function (data) {
9077 event.status = 0;
9078 });
9078 9079 }
9080
9079 9081 }
9080 9082
9081 9083 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
@@ -12361,8 +12363,7 b" angular.module('appenlight').config(['$stateProvider', '$urlRouterProvider', fun"
12361 12363
12362 12364 $stateProvider.state('front_dashboard', {
12363 12365 url: '/ui',
12364 templateUrl: 'templates/dashboard.html',
12365 controller: 'IndexDashboardController as index'
12366 component: 'indexDashboardView'
12366 12367 });
12367 12368
12368 12369 $stateProvider.state('report', {
@@ -42,7 +42,8 b" angular.module('appenlight.controllers', ["
42 42 angular.module('appenlight.components', [
43 43 'appenlight.components.channelstream',
44 44 'appenlight.components.appenlightApp',
45 'appenlight.components.appenlightHeader'
45 'appenlight.components.appenlightHeader',
46 'appenlight.components.indexDashboardView'
46 47 ]);
47 48 angular.module('appenlight.directives', [
48 49 'appenlight.directives.c3chart',
@@ -7,51 +7,49 b''
7 7 stroke-width: 0;
8 8 opacity: 0.75;
9 9 }
10
11
12 10 </style>
13 11
14 12 <div class="row">
15 13 <div class="col-sm-12 dashboard" id="content">
16 <div ng-if="!index.stateHolder.AeUser.applications.length">
14 <div ng-if="!$ctrl.stateHolder.AeUser.applications.length">
17 15
18 16 <div ng-include="'templates/quickstart.html'"></div>
19 17
20 18 </div>
21 19
22 <div ng-if="index.stateHolder.AeUser.applications.length">
20 <div ng-if="$ctrl.stateHolder.AeUser.applications.length">
23 21
24 22 <div class="row">
25 23 <div class="col-sm-6">
26 24 <div class="panel panel-default">
27 25 <div class="panel-body">
28 26 <form class="graph-type form-inline">
29 <select ng-model="index.resource" ng-options="r.resource_id as r.resource_name for r in index.stateHolder.AeUser.applications" ng-change="index.updateSearchParams()"
27 <select ng-model="$ctrl.resource" ng-options="r.resource_id as r.resource_name for r in $ctrl.stateHolder.AeUser.applications" ng-change="$ctrl.updateSearchParams()"
30 28 class="SelectField form-control input-sm slim-input"></select>
31 29
32 <select class="SelectField form-control input-sm slim-input" ng-model="index.timeSpan"
33 ng-options="i as i.label for i in index.timeOptions | objectToOrderedArray:'minutes'" ng-change="index.updateSearchParams()"
30 <select class="SelectField form-control input-sm slim-input" ng-model="$ctrl.timeSpan"
31 ng-options="i as i.label for i in $ctrl.timeOptions | objectToOrderedArray:'minutes'" ng-change="$ctrl.updateSearchParams()"
34 32 class="SelectField"></select>
35 33
36 34
37 35 <div class="btn-group">
38 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
36 <button type="button" class="btn btn-primary btn-sm" ng-model="$ctrl.graphType.selected" ng-change="$ctrl.updateSearchParams()"
39 37 uib-btn-radio="'requests_graphs'" data-uib-tooltip="Requests per second">
40 38 <span class="fa fa-line-chart"></span>
41 39 </button>
42 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
40 <button type="button" class="btn btn-primary btn-sm" ng-model="$ctrl.graphType.selected" ng-change="$ctrl.updateSearchParams()"
43 41 uib-btn-radio="'response_graphs'" data-uib-tooltip="Average response time">
44 42 <span class="fa fa-random"></span>
45 43 </button>
46 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
44 <button type="button" class="btn btn-primary btn-sm" ng-model="$ctrl.graphType.selected" ng-change="$ctrl.updateSearchParams()"
47 45 uib-btn-radio="'metrics_graphs'" data-uib-tooltip="Time spent per request">
48 46 <span class="fa fa-bar-chart-o"></span>
49 47 </button>
50 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
48 <button type="button" class="btn btn-primary btn-sm" ng-model="$ctrl.graphType.selected" ng-change="$ctrl.updateSearchParams()"
51 49 uib-btn-radio="'report_graphs'" data-uib-tooltip="Errors">
52 50 <span class="fa fa-exclamation-triangle"></span>
53 51 </button>
54 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
52 <button type="button" class="btn btn-primary btn-sm" ng-model="$ctrl.graphType.selected" ng-change="$ctrl.updateSearchParams()"
55 53 uib-btn-radio="'slow_report_graphs'" data-uib-tooltip="Slow reports">
56 54 <span class="fa fa-clock-o"></span>
57 55 </button>
@@ -59,52 +57,52 b''
59 57 </form>
60 58 <div class="clearfix"></div>
61 59
62 <p ng-if="index.loading.series != false" class="text-center">
60 <p ng-if="$ctrl.loading.series != false" class="text-center">
63 61 <span class="fa fa-cog fa-spin fa-5x loader"></span>
64 62 </p>
65 63
66 <div ng-if="index.loading.series == false">
67 <div ng-if="index.graphType.selected == 'requests_graphs'">
68 <c3chart data-domid="reponse_chart" data-data="index.requestsChartData" data-config="index.requestsChartConfig" update="true">
64 <div ng-if="$ctrl.loading.series == false">
65 <div ng-if="$ctrl.graphType.selected == 'requests_graphs'">
66 <c3chart data-domid="reponse_chart" data-data="$ctrl.requestsChartData" data-config="$ctrl.requestsChartConfig" update="true">
69 67 </c3chart>
70 68 </div>
71 69
72 <div ng-if="index.graphType.selected == 'response_graphs'">
73 <c3chart data-domid="reponse_chart" data-data="index.responseChartData" data-config="index.responseChartConfig" update="true">
70 <div ng-if="$ctrl.graphType.selected == 'response_graphs'">
71 <c3chart data-domid="reponse_chart" data-data="$ctrl.responseChartData" data-config="$ctrl.responseChartConfig" update="true">
74 72 </c3chart>
75 73 </div>
76 74
77 <div ng-if="index.graphType.selected == 'metrics_graphs'">
78 <c3chart data-domid="metrics_chart" data-data="index.metricsChartData" data-config="index.metricsChartConfig" update="true">
75 <div ng-if="$ctrl.graphType.selected == 'metrics_graphs'">
76 <c3chart data-domid="metrics_chart" data-data="$ctrl.metricsChartData" data-config="$ctrl.metricsChartConfig" update="true">
79 77 </c3chart>
80 78 </div>
81 <div ng-if="index.graphType.selected == 'report_graphs'">
82 <c3chart data-domid="reports_chart" data-data="index.reportChartData" data-config="index.reportChartConfig" update="true">
79 <div ng-if="$ctrl.graphType.selected == 'report_graphs'">
80 <c3chart data-domid="reports_chart" data-data="$ctrl.reportChartData" data-config="$ctrl.reportChartConfig" update="true">
83 81 </c3chart>
84 82 </div>
85 83
86 <div ng-if="index.graphType.selected == 'slow_report_graphs'">
87 <c3chart data-domid="slow_reports_chart" data-data="index.reportSlowChartData" data-config="index.reportSlowChartConfig" update="true">
84 <div ng-if="$ctrl.graphType.selected == 'slow_report_graphs'">
85 <c3chart data-domid="slow_reports_chart" data-data="$ctrl.reportSlowChartData" data-config="$ctrl.reportSlowChartConfig" update="true">
88 86 </c3chart>
89 87 </div>
90 88
91 <p ng-if="index.graphType.selected == 'requests_graphs'" class="text-center">
89 <p ng-if="$ctrl.graphType.selected == 'requests_graphs'" class="text-center">
92 90 <small>Average requests per second from all servers</small>
93 91 </p>
94 92
95 <p ng-if="index.graphType.selected == 'response_graphs'" class="text-center">
93 <p ng-if="$ctrl.graphType.selected == 'response_graphs'" class="text-center">
96 94 <small>Average response time from all servers</small>
97 95 </p>
98 96
99 <p ng-if="index.graphType.selected == 'metrics_graphs'" class="text-center">
97 <p ng-if="$ctrl.graphType.selected == 'metrics_graphs'" class="text-center">
100 98 <small>Aggregated average time spent per request - broken to layers</small>
101 99 </p>
102 100
103 <p ng-if="index.graphType.selected == 'report_graphs'" class="text-center">
101 <p ng-if="$ctrl.graphType.selected == 'report_graphs'" class="text-center">
104 102 <small>Aggregated reports sent by your application</small>
105 103 </p>
106 104
107 <p ng-if="index.graphType.selected == 'slow_report_graphs'" class="text-center">
105 <p ng-if="$ctrl.graphType.selected == 'slow_report_graphs'" class="text-center">
108 106 <small>Aggregated slow reports sent by your application</small>
109 107 </p>
110 108 </div>
@@ -117,40 +115,40 b''
117 115
118 116 <div id="server-container">
119 117
120 <div ng-if="index.loading.apdex==false" class="text-center m-b-1">
118 <div ng-if="$ctrl.loading.apdex==false" class="text-center m-b-1">
121 119
122 <a data-ui-sref="report.list({resource:index.resource, start_date:index.startDateFilter})" class="combined-stat text-center" id="error-rate">
120 <a data-ui-sref="report.list({resource:$ctrl.resource, start_date:$ctrl.startDateFilter})" class="combined-stat text-center" id="error-rate">
123 121 <small>Exceptions</small>
124 122 <br/>
125 <strong>{{ index.exceptions|numberToThousands}}</strong>
123 <strong>{{ $ctrl.exceptions|numberToThousands}}</strong>
126 124 <span class="fa fa-chevron-right"></span>
127 125 </a><!--
128 126
129 --><a data-ui-sref="report.list_slow({resource:index.resource, min_duration:4, start_date:index.startDateFilter})" class="combined-stat text-center" id="frustrating-requests" data-uib-tooltip="Requests over 4s">
127 --><a data-ui-sref="report.list_slow({resource:$ctrl.resource, min_duration:4, start_date:$ctrl.startDateFilter})" class="combined-stat text-center" id="frustrating-requests" data-uib-tooltip="Requests over 4s">
130 128 <small>Frustrating req.</small>
131 129 <br/>
132 <strong>{{index.frustratingRequests|numberToThousands}}</strong>
130 <strong>{{$ctrl.frustratingRequests|numberToThousands}}</strong>
133 131 <span class="fa fa-chevron-right"></span>
134 132 </a><!--
135 133
136 --><a data-ui-sref="report.list_slow({resource:index.resource, min_duration:1, max_duration:4, start_date:index.startDateFilter})" class="combined-stat text-center" id="tolerated-requests"
134 --><a data-ui-sref="report.list_slow({resource:$ctrl.resource, min_duration:1, max_duration:4, start_date:$ctrl.startDateFilter})" class="combined-stat text-center" id="tolerated-requests"
137 135 data-uib-tooltip="Requests under 4s">
138 136 <small>Tolerated req.</small>
139 137 <br/>
140 <strong>{{index.toleratedRequests|numberToThousands}}</strong>
138 <strong>{{$ctrl.toleratedRequests|numberToThousands}}</strong>
141 139 <span class="fa fa-chevron-right"></span>
142 140 </a><!--
143 141
144 142 --><a class="combined-stat text-center" id="satisfying-requests" data-uib-tooltip="Requests under 1s">
145 143 <small>Satisfying req.</small>
146 144 <br/>
147 <strong>{{index.satisfyingRequests|numberToThousands}}</strong>
145 <strong>{{$ctrl.satisfyingRequests|numberToThousands}}</strong>
148 146 </a><!--
149 147
150 --><a data-ui-sref="uptime({resource:index.resource})" class="combined-stat text-center" id="uptime-stats" data-uib-tooltip="Uptime">
148 --><a data-ui-sref="uptime({resource:$ctrl.resource})" class="combined-stat text-center" id="uptime-stats" data-uib-tooltip="Uptime">
151 149 <small>Uptime</small>
152 150 <br/>
153 <strong>{{index.uptimeStats}}%</strong>
151 <strong>{{$ctrl.uptimeStats}}%</strong>
154 152 <span class="fa fa-chevron-right"></span>
155 153 </a>
156 154
@@ -172,11 +170,11 b''
172 170 </tr>
173 171 </thead>
174 172 <tbody>
175 <tr ng-if="index.loading.apdex!=false" class="text-center">
173 <tr ng-if="$ctrl.loading.apdex!=false" class="text-center">
176 174 <td colspan="5"><span class="fa fa-cog fa-spin fa-5x loader"></span></td>
177 175 </tr>
178 <tr ng-repeat="server in index.apdexStats" class="{{ server | apdexValue }}"
179 ng-if="index.loading.apdex==false">
176 <tr ng-repeat="server in $ctrl.apdexStats" class="{{ server | apdexValue }}"
177 ng-if="$ctrl.loading.apdex==false">
180 178 <td><span class="fa fa-hdd-o"></span></td>
181 179 <td>
182 180 <small><strong>{{ server.name }}</strong></small>
@@ -209,10 +207,10 b''
209 207 <div class="panel-heading position-relative">
210 208 <h3 class="panel-title"><span class="fa fa-exclamation-triangle"></span> Newest errors (real-time)
211 209 </h3>
212 <a tooltip-append-to-body="true" data-uib-tooltip="Play/Pause stream" class="btn btn-primary btn-sm pause_stream" ng-model="index.stream.paused" uib-btn-checkbox>
210 <a tooltip-append-to-body="true" data-uib-tooltip="Play/Pause stream" class="btn btn-primary btn-sm pause_stream" ng-model="$ctrl.stream.paused" uib-btn-checkbox>
213 211 <span class="fa {{stream.paused ? 'fa-play' : 'fa-pause'}}"></span>
214 212 </a>
215 <a tooltip-append-to-body="true" data-uib-tooltip="Limit reports to current application" class="btn btn-primary btn-sm limit_stream" ng-model="index.stream.filtered" uib-btn-checkbox>
213 <a tooltip-append-to-body="true" data-uib-tooltip="Limit reports to current application" class="btn btn-primary btn-sm limit_stream" ng-model="$ctrl.stream.filtered" uib-btn-checkbox>
216 214 <span class="fa fa-lock"></span>
217 215 </a>
218 216
@@ -220,9 +218,9 b''
220 218 </div>
221 219 <div class="panel-body">
222 220
223 <p ng-if="index.stream.reports.length === 0">No new reports</p>
221 <p ng-if="$ctrl.stream.reports.length === 0">No new reports</p>
224 222
225 <div small-report-list reports="index.stream.reports" applications="index.applications"></div>
223 <div small-report-list reports="$ctrl.stream.reports" applications="$ctrl.applications"></div>
226 224 </div>
227 225 </div>
228 226 </div>
@@ -231,15 +229,15 b''
231 229
232 230 <div class="panel panel-default">
233 231 <div class="panel-heading">
234 <h3 class="panel-title"><span class="fa fa-sort-amount-desc"></span> Request breakdown over {{ index.timeSpan.label }}</h3>
232 <h3 class="panel-title"><span class="fa fa-sort-amount-desc"></span> Request breakdown over {{ $ctrl.timeSpan.label }}</h3>
235 233 </div>
236 234 <div class="panel-body" id="view-breakdown-container">
237 <p ng-if="index.loading.requestsBreakdown!=false" class="text-center">
235 <p ng-if="$ctrl.loading.requestsBreakdown!=false" class="text-center">
238 236 <span class="fa fa-cog fa-spin fa-5x loader"></span>
239 237 </p>
240 238
241 239 <div class="report-list">
242 <div ng-if="index.loading.requestsBreakdown==false" ng-repeat="view in index.requestsBreakdown">
240 <div ng-if="$ctrl.loading.requestsBreakdown==false" ng-repeat="view in $ctrl.requestsBreakdown">
243 241 <div class="view-info">
244 242 <div class="view-name">
245 243 <div class="bar" style="width: {{view.percentage}}%">
@@ -281,19 +279,19 b''
281 279 <div class="panel panel-default">
282 280 <div class="panel-heading">
283 281 <h3 class="panel-title">
284 <span class="fa fa-exclamation-triangle"></span> Report groups trending over {{ index.timeSpan.label }}
282 <span class="fa fa-exclamation-triangle"></span> Report groups trending over {{ $ctrl.timeSpan.label }}
285 283 </h3>
286 284 </div>
287 285 <div class="panel-body">
288 <p ng-if="index.loading.reports != false" class="text-center">
286 <p ng-if="$ctrl.loading.reports != false" class="text-center">
289 287 <span class="fa fa-cog fa-spin fa-5x loader"></span>
290 288 </p>
291 289
292 <p ng-if="index.trendingReports.length == 0 && index.loading.reports == false">
290 <p ng-if="$ctrl.trendingReports.length == 0 && $ctrl.loading.reports == false">
293 291 No reports found
294 292 </p>
295 293
296 <div small-report-group-list groups="index.trendingReports" applications="index.applications" ng-if="index.loading.reports==false"></div>
294 <div small-report-group-list groups="$ctrl.trendingReports" applications="$ctrl.applications" ng-if="$ctrl.loading.reports==false"></div>
297 295 </div>
298 296 </div>
299 297
@@ -305,18 +303,18 b''
305 303 <div class="panel panel-default">
306 304 <div class="panel-heading">
307 305 <h3 class="panel-title">
308 Most common slow calls over {{ index.timeSpan.label }}
306 Most common slow calls over {{ $ctrl.timeSpan.label }}
309 307 </h3>
310 308 </div>
311 309 <div class="panel-body">
312 310
313 <div ng-if="index.loading.slowCalls!=false" class="text-center">
311 <div ng-if="$ctrl.loading.slowCalls!=false" class="text-center">
314 312 <span class="fa fa-cog fa-spin fa-5x loader"></span>
315 313 </div>
316 314
317 <table id="slow-statements" ng-if="index.loading.slowCalls==false">
315 <table id="slow-statements" ng-if="$ctrl.loading.slowCalls==false">
318 316 <tbody>
319 <tr ng-repeat="call in index.slowCalls">
317 <tr ng-repeat="call in $ctrl.slowCalls">
320 318 <td class="occurences">
321 319 <span class="occurences" data-uib-tooltip="Occurences">{{call.occurences|numberToThousands}}</span>
322 320 </td>
@@ -17,8 +17,11 b''
17 17 // # services, and proprietary license terms, please see
18 18 // # https://rhodecode.com/licenses/
19 19
20 angular.module('appenlight.controllers')
21 .controller('IndexDashboardController', IndexDashboardController);
20 angular.module('appenlight.components.indexDashboardView', [])
21 .component('indexDashboardView', {
22 templateUrl: 'components/views/index-dashboard/index-dashboard.html',
23 controller: IndexDashboardController
24 });
22 25
23 26 IndexDashboardController.$inject = ['$rootScope', '$scope', '$location','$cookies', '$interval', 'stateHolder', 'applicationsPropertyResource', 'AeConfig'];
24 27
@@ -29,8 +29,7 b" angular.module('appenlight').config(['$stateProvider', '$urlRouterProvider', fun"
29 29
30 30 $stateProvider.state('front_dashboard', {
31 31 url: '/ui',
32 templateUrl: 'templates/dashboard.html',
33 controller: 'IndexDashboardController as index'
32 component: 'indexDashboardView'
34 33 });
35 34
36 35 $stateProvider.state('report', {
General Comments 0
You need to be logged in to leave comments. Login now