From 501a9768ef7184f96712cab26634c4ba3814fb7f Mon Sep 17 00:00:00 2001 From: denz Date: Thu, 27 Aug 2015 14:22:12 +0900 Subject: [PATCH 1/5] Support firefox. --- .../configuration/alarm/alarm-group-member.directive.js | 4 ++-- .../configuration/alarm/alarm-pinpoint-user.directive.js | 6 +++--- .../features/configuration/alarm/alarm-rule.directive.js | 6 +++--- .../configuration/alarm/alarm-user-group.directive.js | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/web/src/main/webapp/features/configuration/alarm/alarm-group-member.directive.js b/web/src/main/webapp/features/configuration/alarm/alarm-group-member.directive.js index 47fbaf30b..1ebb99edd 100644 --- a/web/src/main/webapp/features/configuration/alarm/alarm-group-member.directive.js +++ b/web/src/main/webapp/features/configuration/alarm/alarm-group-member.directive.js @@ -40,8 +40,8 @@ var $elUL = $element.find(".some-list-content ul"); $elUL.on("click", function($event) { - var tagName = $event.toElement.tagName.toLowerCase(); - var $target = $($event.toElement); + var $target = $( $event.toElement || $event.target ); + var tagName = $target.get(0).tagName.toLowerCase(); var $li = $target.parents("li"); if ( tagName == "button" ) { diff --git a/web/src/main/webapp/features/configuration/alarm/alarm-pinpoint-user.directive.js b/web/src/main/webapp/features/configuration/alarm/alarm-pinpoint-user.directive.js index 752dc55bb..27e084b82 100644 --- a/web/src/main/webapp/features/configuration/alarm/alarm-pinpoint-user.directive.js +++ b/web/src/main/webapp/features/configuration/alarm/alarm-pinpoint-user.directive.js @@ -45,8 +45,8 @@ var $elUL = $element.find(".some-list-content ul"); $elUL.on("click", function( $event ) { - var tagName = $event.toElement.tagName.toLowerCase(); - var $target = $($event.toElement); + var $target = $( $event.toElement || $event.target ); + var tagName = $target.get(0).tagName.toLowerCase(); var $li = $target.parents("li"); if ( tagName == "button" ) { @@ -206,7 +206,7 @@ if ( isRemoving == true ) return; isCreate = false; - var $el = $( $event.toElement ).parents("li"); + var $el = $( $event.toElement || $event.target ).parents("li"); var oUser = searchUser( $alarmUtilService.extractID( $el ) ); $elEditGuide.html( "Update pinpoint user data." ); diff --git a/web/src/main/webapp/features/configuration/alarm/alarm-rule.directive.js b/web/src/main/webapp/features/configuration/alarm/alarm-rule.directive.js index 268c82989..19783d883 100644 --- a/web/src/main/webapp/features/configuration/alarm/alarm-rule.directive.js +++ b/web/src/main/webapp/features/configuration/alarm/alarm-rule.directive.js @@ -48,8 +48,8 @@ var $elTbody = $element.find(".some-list-content .wrapper tbody"); $elTbody.on("click", function($event) { - var tagName = $event.toElement.tagName.toLowerCase(); - var $target = $($event.toElement); + var $target = $( $event.toElement || $event.target ); + var tagName = $target.get(0).tagName.toLowerCase(); var $tr = $target.parents("tr"); if ( tagName == "button" ) { @@ -281,7 +281,7 @@ if ( isRemoving == true ) return; isCreate = false; - var $el = $( $event.toElement ).parents("tr"); + var $el = $( $event.toElement || $event.target ).parents("tr"); var ruleID = $alarmUtilService.extractID( $el ); var oRule = searchRule( ruleID ); diff --git a/web/src/main/webapp/features/configuration/alarm/alarm-user-group.directive.js b/web/src/main/webapp/features/configuration/alarm/alarm-user-group.directive.js index 577444336..12ed611f9 100644 --- a/web/src/main/webapp/features/configuration/alarm/alarm-user-group.directive.js +++ b/web/src/main/webapp/features/configuration/alarm/alarm-user-group.directive.js @@ -51,8 +51,8 @@ var $elUL = $element.find(".some-list-content ul"); $elUL.on("click", function($event) { - var tagName = $event.toElement.tagName.toLowerCase(); - var $target = $($event.toElement); + var $target = $( $event.toElement || $event.target ); + var tagName = $target.get(0).tagName.toLowerCase(); var $li = $target.parents("li"); if ( tagName == "button" ) { @@ -188,7 +188,7 @@ if ( isRemoving == true ) return; isCreate = false; - var $el = $( $event.toElement ).parents("li"); + var $el = $( $event.toElement || $event.target ).parents("li"); var userGroupNumber = $alarmUtilService.extractID( $el ); var userGroupID = $el.find("span.contents").html(); From 53e400ad29e33d022bbd505b189c45f94aabf661 Mon Sep 17 00:00:00 2001 From: denz Date: Fri, 28 Aug 2015 18:07:48 +0900 Subject: [PATCH 2/5] Create analytics service of angular. --- .../services/alarm-broadcast.service.js | 2 +- .../common/services/analytics.service.js | 112 +++++++++++++ .../agent-chart-group.directive.js | 9 +- .../alarm/alarm-group-member.directive.js | 57 +++---- .../alarm/alarm-pinpoint-user.directive.js | 155 +++++++----------- .../alarm/alarm-rule.directive.js | 74 ++++----- .../alarm/alarm-user-group.directive.js | 82 ++++----- .../alarm/alarmPinpointUser.html | 34 ++-- .../configuration/configuration.controller.js | 12 +- .../general/general.controller.js | 5 +- .../loadChart/load-chart.directive.js | 4 +- .../features/navbar/navbar.directive.js | 18 +- .../node-info-details.directive.js | 6 +- .../response-time-chart.directive.js | 6 +- .../scatter/jquery.BigScatterChart.js | 10 +- .../features/scatter/scatter.directive.js | 6 +- .../features/serverMap/jquery.ServerMap2.js | 10 +- .../serverMap/server-map.directive.js | 26 +-- .../timeSlider/time-slider.directive.js | 4 +- .../features/timeline/timeline.directive.js | 6 +- .../transaction-table.directive.js | 6 +- web/src/main/webapp/index.html | 1 + .../filteredMap/filtered-map.controller.js | 6 +- .../pages/inspector/inspector.controller.js | 6 +- .../main/webapp/pages/main/main.controller.js | 6 +- .../scatter-full-screen-mode.controller.js | 6 +- .../transaction-detail.controller.js | 14 +- .../transaction-list.controller.js | 6 +- .../transaction-view.controller.js | 6 +- web/src/main/webapp/scripts/app.js | 14 +- web/src/main/webapp/styles/configuration.css | 7 +- 31 files changed, 402 insertions(+), 314 deletions(-) create mode 100644 web/src/main/webapp/common/services/analytics.service.js diff --git a/web/src/main/webapp/common/services/alarm-broadcast.service.js b/web/src/main/webapp/common/services/alarm-broadcast.service.js index 99b0aa1f7..d1e1300ab 100644 --- a/web/src/main/webapp/common/services/alarm-broadcast.service.js +++ b/web/src/main/webapp/common/services/alarm-broadcast.service.js @@ -13,7 +13,7 @@ var self = this; // from userGroup this.sendInit = function( userGroupID ) { - $rootScope.$broadcast( "alarmPinpointUser.configuration.load" ); + //$rootScope.$broadcast( "alarmPinpointUser.configuration.load" ); self.sendReloadWithUserGroupID( userGroupID ); }; // from userGroup diff --git a/web/src/main/webapp/common/services/analytics.service.js b/web/src/main/webapp/common/services/analytics.service.js new file mode 100644 index 000000000..f6b506d0a --- /dev/null +++ b/web/src/main/webapp/common/services/analytics.service.js @@ -0,0 +1,112 @@ +(function($) { + 'use strict'; + + /** + * (en) AnalyticsService + * @ko AnalyticsService + * @group Service + * @name AnalyticsService + * @class + */ + + pinpointApp.service('AnalyticsService', [ '$rootScope', 'globalConfig', function ($rootScope, globalConfig) { + if ( typeof ga !== "undefined" ) { + this.send = function( category, name, label, count, options ) { + if ( globalConfig.sendAllowed == false ) return; + if ( arguments.length == 1 ) { + ga( 'send', 'pageview', arguments[0] ); + } else { + ga( 'send', 'event', category, name, label, count, options ); + } + }; + } else if ( typeof wcs !== "undefined" ) { + this.send = function( category, name, label ) { + if ( globalConfig.sendAllowed == false ) return; + if ( arguments.length == 1 ) return; + if ( typeof label !== "undefined" || typeof label !== "null" ) { + name = name + "_" + label; + } + wcs.event( category, name ); + }; + } + + this.CONST = {}; + this.CONST.MAIN = "Main"; + this.CONST.CONTEXT = "Context"; + this.CONST.CALLSTACK = "CallStack"; + this.CONST.MIXEDVIEW = "MixedView"; + + this.CONST.CLK_APPLICATION = "ClickApplication"; + this.CONST.CLK_TIME = "ClickTime"; + this.CONST.CLK_SEARCH_NODE = "ClickSearchNode"; + this.CONST.CLK_CLEAR_SEARCH = "ClickClearSearch"; + this.CONST.CLK_NODE = "ClickNode"; + this.CONST.CLK_LINK = "ClickLink"; + this.CONST.CLK_UPDATE_TIME = "ClickUpdateTime"; + this.CONST.CLK_HELP = "ClickHelp"; + this.CONST.CLK_SCATTER_SETTING = "ClickScatterSetting"; + this.CONST.CLK_DOWNLOAD_SCATTER = "ClickDownloadScatter"; + this.CONST.CLK_RESPONSE_GRAPH = "ClickResponseGraph"; + this.CONST.CLK_LOAD_GRAPH = "ClickLoadGraph"; + this.CONST.CLK_SHOW_GRAPH = "ClickShowGraph"; + this.CONST.CLK_FILTER_TRANSACTION = "ClickFilterTransaction"; + this.CONST.CLK_FILTER_TRANSACTION_WIZARD = "ClickFilterTransactionWizard"; + this.CONST.CLK_MORE = "ClickMore"; + this.CONST.CLK_DISTRIBUTED_CALL_FLOW = "ClickDistributedCallFlow"; + this.CONST.CLK_SERVER_MAP = "ClickServerMap"; + this.CONST.CLK_RPC_TIMELINE = "ClickRPCTimeline"; + this.CONST.CLK_CALL = "ClickCall"; + this.CONST.CLK_TRANSACTION = "ClickTransaction"; + this.CONST.CLK_HEAP = "ClickHeap"; + this.CONST.CLK_PERM_GEN = "ClickPermGen"; + this.CONST.CLK_CPU_LOAD = "ClickCpuLoad"; + this.CONST.CLK_REFRESH = "ClickRefresh"; + this.CONST.CLK_CALLEE_RANGE = "ClickCalleeRange"; + this.CONST.CLK_CALLER_RANGE = "ClickCallerRange"; + + this.CONST.CLK_CONFIGURATION = "ClickConfiguration"; + this.CONST.CLK_GENERAL = "ClickConfigurationGeneral"; + this.CONST.CLK_ALARM = "ClickConfigurationAlarm"; + this.CONST.CLK_HELP = "ClickConfigurationHelp"; + this.CONST.CLK_ALARM_CREATE_USER_GROUP = "ClickAlarmCreateUserGroup"; + this.CONST.CLK_ALARM_REFRESH_USER_GROUP = "ClickAlarmRefreshUserGroup"; + this.CONST.CLK_ALARM_FILTER_USER_GROUP = "ClickAlarmFilterUserGroup"; + this.CONST.CLK_ALARM_ADD_USER = "ClickAlarmAddUser"; + this.CONST.CLK_ALARM_REFRESH_USER = "ClickAlarmRefreshUser"; + this.CONST.CLK_ALARM_FILTER_USER = "ClickAlarmFilterUser"; + this.CONST.CLK_ALARM_CREATE_PINPOINT_USER = "ClickAlarmCreatePinpointUser"; + this.CONST.CLK_ALARM_REFRESH_PINPOINT_USER = "ClickAlarmRefreshPinpointUser"; + this.CONST.CLK_ALARM_FILTER_PINPOINT_USER = "ClickAlarmFilterPinpointUser"; + this.CONST.CLK_ALARM_CREATE_RULE = "ClickAlarmCreateUserGroup"; + this.CONST.CLK_ALARM_REFRESH_RULE = "ClickAlarmRefreshUserGroup"; + this.CONST.CLK_ALARM_FILTER_RULE = "ClickAlarmFilterUserGroup"; + + + this.CONST.TG_DATE = "ToggleDate"; + this.CONST.TG_UPDATE_ON = "ToggleUpdateOn"; + this.CONST.TG_NODE_VIEW = "ToggleNodeView"; + this.CONST.TG_SCATTER_SUCCESS = "ToggleScatterSuccess"; + this.CONST.TG_SCATTER_FAILED = "ToggleScatterFailed"; + this.CONST.TG_MERGE_TYPE = "ToggleMergeType"; + this.CONST.TG_CALL_COUNT = "ToggleCallCount"; + this.CONST.TG_TPS = "ToggleTPS"; + this.CONST.TG_ROUTING = "ToggleRouting"; + this.CONST.TG_CURVE = "ToggleCurve"; + + this.CONST.ST_ = "Sort"; + + this.CONST.ASCENDING = "ascending"; + this.CONST.DESCENDING = "descending"; + + this.CONST.ON = "on"; + this.CONST.OFF = "off"; + + this.CONST.MAIN_PAGE = "/main.page"; + this.CONST.FILTEREDMAP_PAGE = "/filteredMap.page"; + this.CONST.INSPECTOR_PAGE = "/inspector.page"; + this.CONST.SCATTER_FULL_SCREEN_PAGE = "/scatterFullScreen.page"; + this.CONST.TRANSACTION_DETAIL_PAGE = "/transactionDetail.page"; + this.CONST.TRANSACTION_LIST_PAGE = "/transactionList.page"; + this.CONST.TRANSACTION_VIEW_PAGE = "/transactionView.page"; + }]); +})(jQuery); \ No newline at end of file diff --git a/web/src/main/webapp/features/agentChartGroup/agent-chart-group.directive.js b/web/src/main/webapp/features/agentChartGroup/agent-chart-group.directive.js index b25b8288d..d213723b7 100644 --- a/web/src/main/webapp/features/agentChartGroup/agent-chart-group.directive.js +++ b/web/src/main/webapp/features/agentChartGroup/agent-chart-group.directive.js @@ -14,7 +14,8 @@ POINTS_AVG: 3 }); - pinpointApp.directive('agentChartGroupDirective', [ 'agentChartGroupConfig', '$timeout', 'AgentDaoService', function (cfg, $timeout, AgentDaoService) { + pinpointApp.directive('agentChartGroupDirective', [ 'agentChartGroupConfig', '$timeout', 'AgentDaoService', 'AnalyticsService', + function (cfg, $timeout, AgentDaoService, analyticsService) { return { restrict: 'EA', replace: true, @@ -62,7 +63,7 @@ activate: function (event, ui) { var activatedTabText = ui.newTab.text(); if (activatedTabText == 'Heap') { - $at($at.MIXEDVIEW, $at.CLK_HEAP); + analyticsService.send(analyticsService.CONST.MIXEDVIEW, analyticsService.CONST.CLK_HEAP); if (htChartCache.Heap === false) { showHeapChart(htLastAgentStat); } else { @@ -70,7 +71,7 @@ } return; } else if (activatedTabText == 'PermGen') { - $at($at.MIXEDVIEW, $at.CLK_PERM_GEN); + analyticsService.send(analyticsService.CONST.MIXEDVIEW, analyticsService.CONST.CLK_PERM_GEN); if (htChartCache.PermGen === false) { showPermGenChart(htLastAgentStat); } else { @@ -78,7 +79,7 @@ } return; } else if (activatedTabText == 'CpuLoad') { - $at($at.MIXEDVIEW, $at.CLK_CPU_LOAD); + analyticsService.send(analyticsService.CONST.MIXEDVIEW, analyticsService.CONST.CLK_CPU_LOAD); if (htChartCache.CpuLoad === false) { showCpuLoadChart(htLastAgentStat); } else { diff --git a/web/src/main/webapp/features/configuration/alarm/alarm-group-member.directive.js b/web/src/main/webapp/features/configuration/alarm/alarm-group-member.directive.js index 1ebb99edd..a380d42dd 100644 --- a/web/src/main/webapp/features/configuration/alarm/alarm-group-member.directive.js +++ b/web/src/main/webapp/features/configuration/alarm/alarm-group-member.directive.js @@ -7,17 +7,14 @@ * @name alarmGroupMemberDirective * @class */ - pinpointApp.directive('alarmGroupMemberDirective', [ '$rootScope', '$timeout', 'helpContentTemplate', 'helpContentService', 'AlarmUtilService', 'AlarmBroadcastService', - function ($rootScope, $timeout, helpContentTemplate, helpContentService, $alarmUtilService, $alarmBroadcastService) { + pinpointApp.directive('alarmGroupMemberDirective', [ '$rootScope', '$timeout', 'helpContentTemplate', 'helpContentService', 'AlarmUtilService', 'AlarmBroadcastService', 'AnalyticsService', + function ($rootScope, $timeout, helpContentTemplate, helpContentService, alarmUtilService, alarmBroadcastService, analyticsService) { return { restrict: 'EA', replace: true, templateUrl: 'features/configuration/alarm/alarmGroupMember.html', scope: true, link: function (scope, element) { - //@TODO - //통계 추가할 것. - //$at($at.FILTEREDMAP_PAGE); var $element = $(element); var $elWrapper = $element.find(".wrapper"); @@ -62,8 +59,8 @@ } }); function removeConfirm( $el ) { - $alarmUtilService.showLoading( $elLoading, false ); - removeMember( $alarmUtilService.extractID( $el ) ); + alarmUtilService.showLoading( $elLoading, false ); + removeMember( alarmUtilService.extractID( $el ) ); } function removeCancel( $el ) { $el.find("span.right").remove().end().find("span.remove").show().end().removeClass("remove"); @@ -109,12 +106,12 @@ removeCancel( $(this) ); }); } - $alarmUtilService.unsetFilterBackground( $elWrapper ); + alarmUtilService.unsetFilterBackground( $elWrapper ); $elFilterInput.val(""); } function addMember( oUser ) { - $alarmUtilService.sendCRUD( "addMemberInGroup", { "userGroupId": currentUserGroupID, "memberId": oUser.userId }, function( resultData ) { + alarmUtilService.sendCRUD( "addMemberInGroup", { "userGroupId": currentUserGroupID, "memberId": oUser.userId }, function( resultData ) { // @TODO // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. scope.groupMemberList.push({ @@ -123,31 +120,31 @@ "name": oUser.name, "department": oUser.department }); - $alarmUtilService.setTotal( $elTotal, groupMemberList.length ); - $alarmUtilService.hide( $elLoading ); - $alarmBroadcastService.sendCallbackAddedUser( true ); + alarmUtilService.setTotal( $elTotal, groupMemberList.length ); + alarmUtilService.hide( $elLoading ); + alarmBroadcastService.sendCallbackAddedUser( true ); }, function( errorData ) {}, $elAlert ); } function removeMember( memberID ) { - $alarmUtilService.sendCRUD( "removeMemberInGroup", { "userGroupId": currentUserGroupID, "memberId": memberID }, function( resultData ) { + alarmUtilService.sendCRUD( "removeMemberInGroup", { "userGroupId": currentUserGroupID, "memberId": memberID }, function( resultData ) { // @TODO // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. scope.$apply(function() { removeFromList( memberID ); }); - $alarmUtilService.setTotal( $elTotal, groupMemberList.length ); - $alarmUtilService.hide( $elLoading ); + alarmUtilService.setTotal( $elTotal, groupMemberList.length ); + alarmUtilService.hide( $elLoading ); isRemoving = false; }, function( errorData ) {}, $elAlert ); } function loadList() { - $alarmUtilService.sendCRUD( "getGroupMemberListInGroup", { "userGroupId": currentUserGroupID }, function( resultData ) { + alarmUtilService.sendCRUD( "getGroupMemberListInGroup", { "userGroupId": currentUserGroupID }, function( resultData ) { // @TODO // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. isLoadedGroupMemberList = true; groupMemberList = scope.groupMemberList = resultData; - $alarmUtilService.setTotal( $elTotal, groupMemberList.length ); - $alarmUtilService.hide( $elLoading ); + alarmUtilService.setTotal( $elTotal, groupMemberList.length ); + alarmUtilService.hide( $elLoading ); }, function( errorData ) {}, $elAlert ); }; function hasUser( userID ) { @@ -157,9 +154,9 @@ scope.prefix = "alarmGroupMember_"; scope.onRefresh = function() { if ( isRemoving == true ) return; - $at( $at.MAIN, $at.CLK_ALARM_REFRESH_USER ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_REFRESH_USER ); $elFilterInput.val(""); - $alarmUtilService.showLoading( $elLoading, false ); + alarmUtilService.showLoading( $elLoading, false ); loadList(); }; scope.onInputFilter = function($event) { @@ -179,15 +176,15 @@ if ( isRemoving == true ) return; var query = $.trim( $elFilterInput.val() ); if ( query.length != 0 && query.length < 3 ) { - $alarmUtilService.showLoading( $elLoading, false ); - $alarmUtilService.showAlert( $elAlert, "You must enter at least three characters."); + alarmUtilService.showLoading( $elLoading, false ); + alarmUtilService.showAlert( $elAlert, "You must enter at least three characters."); return; } - $at( $at.MAIN, $at.CLK_ALARM_FILTER_USER ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_FILTER_USER ); if ( query == "" ) { if ( scope.groupMemberList.length != groupMemberList.length ) { scope.groupMemberList = groupMemberList; - $alarmUtilService.unsetFilterBackground( $elWrapper ); + alarmUtilService.unsetFilterBackground( $elWrapper ); } $elFilterEmpty.addClass("disabled"); } else { @@ -199,7 +196,7 @@ } } scope.groupMemberList = newFilterGroupMember; - $alarmUtilService.setFilterBackground( $elWrapper ); + alarmUtilService.setFilterBackground( $elWrapper ); } }; scope.onFilterEmpty = function() { @@ -209,7 +206,7 @@ scope.onFilterGroup(); }; scope.onCloseAlert = function() { - $alarmUtilService.closeAlert( $elAlert, $elLoading ); + alarmUtilService.closeAlert( $elAlert, $elLoading ); }; scope.$on("alarmGroupMember.configuration.load", function( event, userGroupID ) { currentUserGroupID = userGroupID; @@ -221,14 +218,14 @@ groupMemberList = scope.groupMemberList = []; }); scope.$on("alarmGroupMember.configuration.addUser", function( event, oUser ) { - $alarmUtilService.showLoading( $elLoading, false ); + alarmUtilService.showLoading( $elLoading, false ); if ( hasUser( oUser.userId ) == false ) { - $at( $at.MAIN, $at.CLK_ALARM_ADD_USER ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_ADD_USER ); reset(); addMember( oUser ); } else { - $alarmUtilService.showAlert( $elAlert, "Exist a same user in the lists.", true ); - $alarmBroadcastService.sendCallbackAddedUser( true ); + alarmUtilService.showAlert( $elAlert, "Exist a same user in the lists.", true ); + alarmBroadcastService.sendCallbackAddedUser( true ); } }); scope.$on("alarmGroupMember.configuration.updateUser", function( event, oUser ) { diff --git a/web/src/main/webapp/features/configuration/alarm/alarm-pinpoint-user.directive.js b/web/src/main/webapp/features/configuration/alarm/alarm-pinpoint-user.directive.js index 27e084b82..b2d799851 100644 --- a/web/src/main/webapp/features/configuration/alarm/alarm-pinpoint-user.directive.js +++ b/web/src/main/webapp/features/configuration/alarm/alarm-pinpoint-user.directive.js @@ -8,22 +8,23 @@ * @class */ - pinpointApp.directive('alarmPinpointUserDirective', [ '$rootScope', '$timeout', 'helpContentTemplate', 'helpContentService', 'AlarmUtilService', 'AlarmBroadcastService', - function ($rootScope, helpContentTemplate, $timeout, helpContentService, $alarmUtilService, $alarmBroadcastService) { + pinpointApp.directive('alarmPinpointUserDirective', [ '$rootScope', '$timeout', 'helpContentTemplate', 'helpContentService', 'AlarmUtilService', 'AlarmBroadcastService', 'AnalyticsService', 'globalConfig', + function ($rootScope, helpContentTemplate, $timeout, helpContentService, alarmUtilService, alarmBroadcastService, analyticsService, globalConfig) { return { restrict: 'EA', replace: true, templateUrl: 'features/configuration/alarm/alarmPinpointUser.html', scope: true, link: function (scope, element) { - var $element = $(element); + var $elCreatBtn = $element.find(".some-list-header button"); var $elWrapper = $element.find(".wrapper"); + var $elEmpty = $element.find(".empty-list"); var $elTotal = $element.find(".total"); var $elLoading = $element.find(".some-loading"); var $elAlert = $element.find(".some-alert"); - var $elFilterInput = $element.find("div.filter-input input"); - var $elFilterEmpty = $element.find("div.filter-input button.trash"); + var $elSearchType = $element.find("select"); + var $elSearchInput = $element.find("div.filter-input input"); var $elEdit = $element.find(".some-edit-content"); var $elEditInputUserID = $elEdit.find("input[name=userID]"); var $elEditInputName = $elEdit.find("input[name=name]"); @@ -78,16 +79,16 @@ function reset() { scope.onCancelEdit(); - $alarmUtilService.unsetFilterBackground( $elWrapper ); - $elFilterInput.val(""); + alarmUtilService.unsetFilterBackground( $elWrapper ); + $elSearchInput.val(""); } function moveUser( $el ) { - $alarmUtilService.showLoading( $elLoading, false ); - $alarmBroadcastService.sendUserAdd( searchUser( $alarmUtilService.extractID( $el ) ) ); + alarmUtilService.showLoading( $elLoading, false ); + alarmBroadcastService.sendUserAdd( searchUser( alarmUtilService.extractID( $el ) ) ); } function removeConfirm( $el ) { - $alarmUtilService.showLoading( $elLoading, false ); - removeUser( $alarmUtilService.extractID( $el ) ); + alarmUtilService.showLoading( $elLoading, false ); + removeUser( alarmUtilService.extractID( $el ) ); } function removeCancel( $el ) { $el @@ -117,12 +118,11 @@ "phoneNumber": userPhone, "email": userEmail }; - $alarmUtilService.sendCRUD( "createPinpointUser", oNewUser, function( resultData ) { - // @TODO - // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. - pinpointUserList.push(oNewUser); - $alarmUtilService.setTotal( $elTotal, pinpointUserList.length ); - $alarmUtilService.hide( $elLoading, $elEdit ); + alarmUtilService.sendCRUD( "createPinpointUser", oNewUser, function( resultData ) { + alarmUtilService.hide( $elLoading, $elEdit ); + $elSearchType.val( "userName" ); + $elSearchInput.val( userName ); + scope.onSearch(); }, function(errorData) {}, $elAlert ); } function updateUser( userID, userName, userDepartment, userPhone, userEmail ) { @@ -133,7 +133,7 @@ "phoneNumber": userPhone, "email": userEmail }; - $alarmUtilService.sendCRUD( "updatePinpointUser", oUpdateUser, function( resultData ) { + alarmUtilService.sendCRUD( "updatePinpointUser", oUpdateUser, function( resultData ) { for( var i = 0 ; i < pinpointUserList.length ; i++ ) { if ( pinpointUserList[i].userId == userID ) { pinpointUserList[i].name = userName; @@ -142,12 +142,12 @@ pinpointUserList[i].email = userEmail; } } - $alarmUtilService.hide( $elLoading, $elEdit ); - $alarmBroadcastService.sendUserUpdated( oUpdateUser ); + alarmUtilService.hide( $elLoading, $elEdit ); + alarmBroadcastService.sendUserUpdated( oUpdateUser ); }, function( errorData ) {}, $elAlert ); } function removeUser( userID ) { - $alarmUtilService.sendCRUD( "removePinpointUser", { "userId": userID }, function( resultData ) { + alarmUtilService.sendCRUD( "removePinpointUser", { "userId": userID }, function( resultData ) { scope.$apply(function() { for( var i = 0 ; i < pinpointUserList.length ; i++ ) { if ( pinpointUserList[i].userId == userID ) { @@ -156,20 +156,17 @@ } } }); - $alarmUtilService.setTotal( $elTotal, pinpointUserList.length ); - $alarmUtilService.hide( $elLoading ); + alarmUtilService.setTotal( $elTotal, pinpointUserList.length ); + alarmUtilService.hide( $elLoading ); isRemoving = false; - $alarmBroadcastService.sendUserRemoved( userID ); + alarmBroadcastService.sendUserRemoved( userID ); }, function( errorData ) {}, $elAlert ); } - function loadList( isFirst ) { - $alarmUtilService.sendCRUD( "getPinpointUserList", {}, function( resultData ) { - // @TODO - // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. - isLoadedPinpointUserList = true; + function loadList( oParam ) { + alarmUtilService.sendCRUD( "getPinpointUserList", oParam || {}, function( resultData ) { pinpointUserList = scope.pinpointUserList = resultData; - $alarmUtilService.setTotal( $elTotal, pinpointUserList.length ); - $alarmUtilService.hide( $elLoading ); + alarmUtilService.setTotal( $elTotal, pinpointUserList.length ); + alarmUtilService.hide( $elLoading ); }, function( errorData ) {}, $elAlert ); }; function validateEmail( email ) { @@ -181,13 +178,7 @@ return reg.test(phone); } - scope.onRefresh = function() { - if ( isRemoving == true ) return; - $at( $at.MAIN, $at.CLK_ALARM_REFRESH_PINPOINT_USER ); - reset(); - $alarmUtilService.showLoading( $elLoading, false ); - loadList( false ); - }; + scope.isAllowedCreate = globalConfig.createUserAllowed; scope.onCreate = function() { if ( isRemoving == true ) return; @@ -199,7 +190,7 @@ $elEditInputDepartment.val(""); $elEditInputPhone.val(""); $elEditInputEmail.val(""); - $alarmUtilService.show( $elEdit ); + alarmUtilService.show( $elEdit ); $elEditInputUserID.focus(); }; scope.onUpdate = function($event) { @@ -207,7 +198,7 @@ isCreate = false; var $el = $( $event.toElement || $event.target ).parents("li"); - var oUser = searchUser( $alarmUtilService.extractID( $el ) ); + var oUser = searchUser( alarmUtilService.extractID( $el ) ); $elEditGuide.html( "Update pinpoint user data." ); $elEditInputUserID.prop("disabled", "disabled"); @@ -216,54 +207,31 @@ $elEditInputDepartment.val( oUser.department ); $elEditInputPhone.val( oUser.phoneNumber ); $elEditInputEmail.val( oUser.email ); - $alarmUtilService.show( $elEdit ); + alarmUtilService.show( $elEdit ); $elEditInputName.focus().select(); }; - scope.onInputFilter = function($event) { + scope.onInputSearch = function($event) { if ( isRemoving == true ) return; if ( $event.keyCode == 13 ) { // Enter - scope.onFilterGroup(); + scope.onSearch(); return; } - if ($.trim( $elFilterInput.val() ).length >= 3 ) { - $elFilterEmpty.removeClass("disabled"); - } else { - $elFilterEmpty.addClass("disabled"); - } }; - scope.onFilterGroup = function() { + scope.onSearch = function() { if ( isRemoving == true ) return; - var query = $.trim( $elFilterInput.val() ); + var searchType = $elSearchType.val(); + var query = $.trim( $elSearchInput.val() ); if ( query.length != 0 && query.length < 3 ) { - $alarmUtilService.showLoading( $elLoading, false ); - $alarmUtilService.showAlert( $elAlert, "You must enter at least three characters."); + alarmUtilService.showLoading( $elLoading, false ); + alarmUtilService.showAlert( $elAlert, "You must enter at least three characters."); return; } - $at( $at.MAIN, $at.CLK_ALARM_FILTER_PINPOINT_USER ); - if ( query == "" ) { - if ( scope.pinpointUserList.length != pinpointUserList.length ) { - scope.pinpointUserList = pinpointUserList; - $alarmUtilService.unsetFilterBackground( $elWrapper ); - } - $elFilterEmpty.addClass("disabled"); - } else { - var newFilterUserGroup = []; - var length = pinpointUserList.length; - for( var i = 0 ; i < pinpointUserList.length ; i++ ) { - if ( pinpointUserList[i].name.indexOf( query ) != -1 || pinpointUserList[i].department.indexOf( query ) != -1 ) { - newFilterUserGroup.push( pinpointUserList[i] ); - } - } - scope.pinpointUserList = newFilterUserGroup; - $alarmUtilService.setFilterBackground( $elWrapper ); - } - }; - scope.onFilterEmpty = function() { - if ( isRemoving == true ) return; - if ( $.trim( $elFilterInput.val() ) == "" ) return; - $elFilterInput.val(""); - scope.onFilterGroup(); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_FILTER_PINPOINT_USER ); + alarmUtilService.showLoading( $elLoading, false ); + var oParam = {}; + oParam[searchType] = query; + loadList( oParam ); }; scope.onInputEdit = function($event) { if ( $event.keyCode == 13 ) { // Enter @@ -274,7 +242,7 @@ } }; scope.onCancelEdit = function() { - $alarmUtilService.hide( $elEdit ); + alarmUtilService.hide( $elEdit ); }; scope.onApplyEdit = function() { var userID = $.trim( $elEditInputUserID.val() ); @@ -284,45 +252,42 @@ var userEmail = $.trim( $elEditInputEmail.val() ); if ( userID == "" || userName == "" ) { - $alarmUtilService.showLoading( $elLoading, true ); - $alarmUtilService.showAlert( $elAlert, "You must input user id and user name."); + alarmUtilService.showLoading( $elLoading, true ); + alarmUtilService.showAlert( $elAlert, "You must input user id and user name."); return; } - // TODO phone - 체크 - // TODO email 포맷 체크 - - $alarmUtilService.showLoading( $elLoading, true ); - if ( $alarmUtilService.hasDuplicateItem( pinpointUserList, function( pinpointUser ) { + alarmUtilService.showLoading( $elLoading, true ); + if ( alarmUtilService.hasDuplicateItem( pinpointUserList, function( pinpointUser ) { return pinpointUser.userId == userID; }) && isCreate == true) { - $alarmUtilService.showAlert( $elAlert, "Exist a same user id in the lists." ); + alarmUtilService.showAlert( $elAlert, "Exist a same user id in the lists." ); return; } if ( validatePhone( userPhone ) == false ) { - $alarmUtilService.showAlert( $elAlert, "You can only input numbers." ); + alarmUtilService.showAlert( $elAlert, "You can only input numbers." ); return; } if ( validateEmail( userEmail ) == false ) { - $alarmUtilService.showAlert( $elAlert, "Invalid email format." ); + alarmUtilService.showAlert( $elAlert, "Invalid email format." ); return; } if ( isCreate ) { - $at( $at.MAIN, $at.CLK_ALARM_CREATE_PINPOINT_USER ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_CREATE_PINPOINT_USER ); createUser( userID, userName, userDepartment, userPhone, userEmail ); } else { updateUser( userID, userName, userDepartment, userPhone, userEmail ); } }; scope.onCloseAlert = function() { - $alarmUtilService.closeAlert( $elAlert, $elLoading ); + alarmUtilService.closeAlert( $elAlert, $elLoading ); }; - scope.$on("alarmPinpointUser.configuration.load", function() { - if ( isLoadedPinpointUserList === false ) { - loadList( true ); - } - }); +// scope.$on("alarmPinpointUser.configuration.load", function() { +// if ( isLoadedPinpointUserList === false ) { +// loadList( true ); +// } +// }); scope.$on("alarmPinpointUser.configuration.addUserCallback", function( event ) { - $alarmUtilService.hide( $elLoading ); + alarmUtilService.hide( $elLoading ); }); } }; diff --git a/web/src/main/webapp/features/configuration/alarm/alarm-rule.directive.js b/web/src/main/webapp/features/configuration/alarm/alarm-rule.directive.js index 19783d883..50e7f5d88 100644 --- a/web/src/main/webapp/features/configuration/alarm/alarm-rule.directive.js +++ b/web/src/main/webapp/features/configuration/alarm/alarm-rule.directive.js @@ -8,8 +8,8 @@ * @class */ - pinpointApp.directive('alarmRuleDirective', [ '$rootScope', '$document', '$timeout', 'helpContentTemplate', 'helpContentService', 'AlarmUtilService', - function ($rootScope, $document, $timeout, helpContentTemplate, helpContentService, $alarmUtilService) { + pinpointApp.directive('alarmRuleDirective', [ '$rootScope', '$document', '$timeout', 'helpContentTemplate', 'helpContentService', 'AlarmUtilService', 'AnalyticsService', + function ($rootScope, $document, $timeout, helpContentTemplate, helpContentService, alarmUtilService, analyticsService) { return { restrict: 'EA', replace: true, @@ -89,13 +89,13 @@ }); } scope.onCancelEdit(); - $alarmUtilService.unsetFilterBackground( $elWrapper ); + alarmUtilService.unsetFilterBackground( $elWrapper ); $elFilterInputApplication.val(""); $elFilterInputRule.val(""); } function removeConfirm( $el ) { - $alarmUtilService.showLoading( $elLoading, false ); - removeUser( $alarmUtilService.extractID( $el ) ); + alarmUtilService.showLoading( $elLoading, false ); + removeUser( alarmUtilService.extractID( $el ) ); } function removeCancel( $el ) { $el.removeClass("remove") @@ -133,7 +133,6 @@ return m; } }).on("change", function (e) { - $at( $at.MAIN, $at.CLK_APPLICATION ); }); $elEditSelectRules.select2({ searchInputPlaceholder: "Input your rule name.", @@ -145,7 +144,6 @@ return m; } }).on("change", function (e) { - $at( $at.MAIN, $at.CLK_APPLICATION ); }); } function searchRule( ruleID ) { @@ -170,16 +168,16 @@ "emailSend": email, "notes": notes }; - $alarmUtilService.sendCRUD( "createRule", oNewRule, function( resultData ) { + alarmUtilService.sendCRUD( "createRule", oNewRule, function( resultData ) { // @TODO // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. oNewRule.ruleId = resultData.ruleId; ruleList.push(oNewRule); - $alarmUtilService.setTotal( $elTotal, ruleList.length ); + alarmUtilService.setTotal( $elTotal, ruleList.length ); $timeout(function() { initPopover(); }); - $alarmUtilService.hide( $elLoading, $elEdit ); + alarmUtilService.hide( $elLoading, $elEdit ); }, function( errorData ) {}, $elAlert ); } function updateRule( ruleID, application, serviceType, rule, threshold, sms, email, notes ) { @@ -194,7 +192,7 @@ "emailSend": email, "notes": notes }; - $alarmUtilService.sendCRUD( "updateRule", oUpdateRule, function( resultData ) { + alarmUtilService.sendCRUD( "updateRule", oUpdateRule, function( resultData ) { // @TODO // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. for( var i = 0 ; i < ruleList.length ; i++ ) { @@ -208,14 +206,14 @@ ruleList[i].notes = notes; } } - $alarmUtilService.hide( $elLoading, $elEdit ); + alarmUtilService.hide( $elLoading, $elEdit ); $timeout(function() { initPopover(); }); }, function( errorData ) {}, $elAlert ); } function removeUser( ruleID ) { - $alarmUtilService.sendCRUD( "removeRule", { "ruleId": ruleID }, function( resultData ) { + alarmUtilService.sendCRUD( "removeRule", { "ruleId": ruleID }, function( resultData ) { scope.$apply(function() { for( var i = 0 ; i < ruleList.length ; i++ ) { if ( ruleList[i].ruleId == ruleID ) { @@ -224,19 +222,19 @@ } } }); - $alarmUtilService.setTotal( $elTotal, ruleList.length ); - $alarmUtilService.hide( $elLoading ); + alarmUtilService.setTotal( $elTotal, ruleList.length ); + alarmUtilService.hide( $elLoading ); isRemoving = false; }, function( errorData ) {}, $elAlert ); } function loadList( isFirst ) { - $alarmUtilService.sendCRUD( "getRuleList", { "userGroupId": currentUserGroupID }, function( resultData ) { + alarmUtilService.sendCRUD( "getRuleList", { "userGroupId": currentUserGroupID }, function( resultData ) { // @TODO // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. isLoadedRuleList = true; ruleList = scope.ruleList = resultData; - $alarmUtilService.setTotal( $elTotal, ruleList.length ); - $alarmUtilService.hide( $elLoading ); + alarmUtilService.setTotal( $elTotal, ruleList.length ); + alarmUtilService.hide( $elLoading ); $timeout(function() { initPopover(); }); @@ -245,7 +243,7 @@ function loadRuleSet() { if ( scope.ruleSets.length > 1 ) return; - $alarmUtilService.sendCRUD( "getRuleSet", {}, function( resultData ) { + alarmUtilService.sendCRUD( "getRuleSet", {}, function( resultData ) { // @TODO // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. for( var i = 0 ; i < resultData.length ; i++ ) { @@ -259,9 +257,9 @@ scope.ruleSets = [ {"text": ""} ]; scope.onRefresh = function() { if ( isRemoving == true ) return; - $at( $at.MAIN, $at.CLK_ALARM_REFRESH_RULE ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_REFRESH_RULE ); reset(); - $alarmUtilService.showLoading( $elLoading, false ); + alarmUtilService.showLoading( $elLoading, false ); loadList( false ); }; scope.onCreate = function() { @@ -275,14 +273,14 @@ $elEditCheckboxSMS.prop("checked", ""); $elEditCheckboxEmail.prop("checked", ""); $elEditTextareaNotes.val(""); - $alarmUtilService.show( $elEdit ); + alarmUtilService.show( $elEdit ); }; scope.onUpdate = function($event) { if ( isRemoving == true ) return; isCreate = false; var $el = $( $event.toElement || $event.target ).parents("tr"); - var ruleID = $alarmUtilService.extractID( $el ); + var ruleID = alarmUtilService.extractID( $el ); var oRule = searchRule( ruleID ); $elEditGuide.html( "Update rule data." ); @@ -293,7 +291,7 @@ $elEditCheckboxEmail.prop("checked", oRule.emailSend); $elEditTextareaNotes.val( oRule.notes ); - $alarmUtilService.show( $elEdit ); + alarmUtilService.show( $elEdit ); }; scope.onInputFilter = function($event) { if ( isRemoving == true ) return; @@ -314,15 +312,15 @@ var queryRule = $.trim( $elFilterInputRule.val() ); if ( (queryApplication.length != 0 && queryApplication.length < 3) || (queryRule.length != 0 && queryRule.length < 3) ) { - $alarmUtilService.showLoading( $elLoading, false ); - $alarmUtilService.showAlert( $elAlert, "You must enter at least three characters."); + alarmUtilService.showLoading( $elLoading, false ); + alarmUtilService.showAlert( $elAlert, "You must enter at least three characters."); return; } - $at( $at.MAIN, $at.CLK_ALARM_FILTER_RULE ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_FILTER_RULE ); if ( queryApplication == "" && queryRule == "" ) { if ( scope.ruleList.length != ruleList.length ) { scope.ruleList = ruleList; - $alarmUtilService.unsetFilterBackground( $elWrapper ); + alarmUtilService.unsetFilterBackground( $elWrapper ); } $elFilterEmpty.addClass("disabled"); } else { @@ -344,7 +342,7 @@ } } scope.ruleList = newFilterRules; - $alarmUtilService.setFilterBackground( $elWrapper ); + alarmUtilService.setFilterBackground( $elWrapper ); } }; scope.onFilterEmpty = function() { @@ -361,7 +359,7 @@ } }; scope.onCancelEdit = function() { - $alarmUtilService.hide( $elEdit ); + alarmUtilService.hide( $elEdit ); }; scope.onApplyEdit = function() { var applicationNServiceType = $elEditSelectApplication.select2("val").split("@"); @@ -372,27 +370,27 @@ var notes = $elEditTextareaNotes.val(); if ( applicationNServiceType[0] == "" || ruleID == "" ) { - $alarmUtilService.showLoading( $elLoading, true ); - $alarmUtilService.showAlert( $elAlert, "Select application name and rule."); + alarmUtilService.showLoading( $elLoading, true ); + alarmUtilService.showAlert( $elAlert, "Select application name and rule."); return; } - $alarmUtilService.showLoading( $elLoading, true ); - if ( $alarmUtilService.hasDuplicateItem( ruleList, function( rule ) { + alarmUtilService.showLoading( $elLoading, true ); + if ( alarmUtilService.hasDuplicateItem( ruleList, function( rule ) { return rule.applicationId == applicationNServiceType[0] && rule.checkerName == ruleID; }) && isCreate == true) { - $alarmUtilService.showAlert( $elAlert, "Exist a same rule set in the lists" ); + alarmUtilService.showAlert( $elAlert, "Exist a same rule set in the lists" ); return; } if ( isCreate ) { - $at( $at.MAIN, $at.CLK_ALARM_CREATE_RULE ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_CREATE_RULE ); createRule( applicationNServiceType[0], applicationNServiceType[1], ruleID, threshold, sms, email, notes ); } else { - updateRule( $alarmUtilService.extractID( $elEditSelectApplication.parent() ), applicationNServiceType[0], applicationNServiceType[1], ruleID, threshold, sms, email, notes ); + updateRule( alarmUtilService.extractID( $elEditSelectApplication.parent() ), applicationNServiceType[0], applicationNServiceType[1], ruleID, threshold, sms, email, notes ); } }; scope.onCloseAlert = function() { - $alarmUtilService.closeAlert( $elAlert, $elLoading ); + alarmUtilService.closeAlert( $elAlert, $elLoading ); }; scope.$on("alarmRule.configuration.load", function( event, userGroupID ) { currentUserGroupID = userGroupID; diff --git a/web/src/main/webapp/features/configuration/alarm/alarm-user-group.directive.js b/web/src/main/webapp/features/configuration/alarm/alarm-user-group.directive.js index 12ed611f9..a098406eb 100644 --- a/web/src/main/webapp/features/configuration/alarm/alarm-user-group.directive.js +++ b/web/src/main/webapp/features/configuration/alarm/alarm-user-group.directive.js @@ -8,8 +8,8 @@ * @class */ - pinpointApp.directive('alarmUserGroupDirective', [ '$rootScope', '$timeout', 'helpContentTemplate', 'helpContentService', 'AlarmUtilService', 'AlarmBroadcastService', - function ($rootScope, $timeout, helpContentTemplate, helpContentService, $alarmUtilService, $alarmBroadcastService) { + pinpointApp.directive('alarmUserGroupDirective', [ '$rootScope', '$timeout', 'helpContentTemplate', 'helpContentService', 'AlarmUtilService', 'AlarmBroadcastService', 'AnalyticsService', + function ($rootScope, $timeout, helpContentTemplate, helpContentService, alarmUtilService, alarmBroadcastService, analyticsService) { return { restrict: 'EA', replace: true, @@ -81,13 +81,13 @@ } }); function reset() { - $alarmUtilService.unsetFilterBackground( $elWrapper ); + alarmUtilService.unsetFilterBackground( $elWrapper ); $elFilterInput.val(""); } function removeConfirm( $el ) { - $alarmUtilService.showLoading( $elLoading, false ); - removeGroup( $alarmUtilService.extractID( $el ), $el.find("span.contents").html() ); + alarmUtilService.showLoading( $elLoading, false ); + removeGroup( alarmUtilService.extractID( $el ), $el.find("span.contents").html() ); } function removeCancel( $el ) { $el.find("span.right").remove().end().find("span.remove").show().end().removeClass("remove"); @@ -95,28 +95,28 @@ } function selectGroup( $el ) { if ( isRemoving == true ) return; - addSelectClass( $alarmUtilService.extractID( $el ) ); - $alarmBroadcastService.sendReloadWithUserGroupID( $el.find("span.contents").html() ); + addSelectClass( alarmUtilService.extractID( $el ) ); + alarmBroadcastService.sendReloadWithUserGroupID( $el.find("span.contents").html() ); } function createGroup( name ) { - $alarmUtilService.sendCRUD( "createUserGroup", { "id": name }, function( resultData ) { + alarmUtilService.sendCRUD( "createUserGroup", { "id": name }, function( resultData ) { // @TODO // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. userGroupList.push({ number: resultData.number, id: name }); - $alarmBroadcastService.sendInit( resultData.number ); + alarmBroadcastService.sendInit( resultData.number ); $timeout(function() { addSelectClass( resultData.number ); }); - $alarmUtilService.setTotal( $elTotal, userGroupList.length ); - $alarmUtilService.hide( $elLoading, $elEdit ); + alarmUtilService.setTotal( $elTotal, userGroupList.length ); + alarmUtilService.hide( $elLoading, $elEdit ); }, function( errorData ) {}, $elAlert ); } function updateGroup( number, name ) { - $alarmUtilService.sendCRUD( "updateUserGroup", { "number": number, "id": name }, function( resultData ) { + alarmUtilService.sendCRUD( "updateUserGroup", { "number": number, "id": name }, function( resultData ) { // @TODO // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. for( var i = 0 ; i < userGroupList.length ; i++ ) { @@ -124,11 +124,11 @@ userGroupList[i].id = name; } } - $alarmUtilService.hide( $elLoading, $elEdit ); + alarmUtilService.hide( $elLoading, $elEdit ); }, function( errorData ) {}, $elAlert ); } function removeGroup( number, name ) { - $alarmUtilService.sendCRUD( "removeUserGroup", { "id": name }, function( resultData ) { + alarmUtilService.sendCRUD( "removeUserGroup", { "id": name }, function( resultData ) { scope.$apply(function() { for( var i = 0 ; i < userGroupList.length ; i++ ) { if ( userGroupList[i].number == number ) { @@ -140,26 +140,26 @@ $timeout(function() { addSelectClass( userGroupList[0].number ); }); - $alarmBroadcastService.sendReloadWithUserGroupID( userGroupList[0].id ); + alarmBroadcastService.sendReloadWithUserGroupID( userGroupList[0].id ); } else { - $alarmBroadcastService.sendSelectionEmpty(); + alarmBroadcastService.sendSelectionEmpty(); } }); - $alarmUtilService.setTotal( $elTotal, userGroupList.length ); - $alarmUtilService.hide( $elLoading ); + alarmUtilService.setTotal( $elTotal, userGroupList.length ); + alarmUtilService.hide( $elLoading ); isRemoving = false; }, function( errorData ) {}, $elAlert ); } function loadGroupList( isFirst ) { - $alarmUtilService.sendCRUD( "getUserGroupList", {}, function( resultData ) { + alarmUtilService.sendCRUD( "getUserGroupList", {}, function( resultData ) { // @TODO // 많이 쓰는 놈 기준 3개를 뽑아 내야 함. isLoadedUserGroupList = true; userGroupList = scope.userGroupList = resultData; - $alarmUtilService.setTotal( $elTotal, userGroupList.length ); - $alarmUtilService.hide( $elLoading ); + alarmUtilService.setTotal( $elTotal, userGroupList.length ); + alarmUtilService.hide( $elLoading ); if ( isFirst ) { - $alarmBroadcastService.sendInit( userGroupList[0].id ); + alarmBroadcastService.sendInit( userGroupList[0].id ); selectedGroupNumber = userGroupList[0].number; } $timeout(function() { @@ -170,9 +170,9 @@ }; scope.onRefresh = function() { if ( isRemoving == true ) return; - $at( $at.MAIN, $at.CLK_ALARM_REFRESH_USER_GROUP ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_REFRESH_USER_GROUP ); reset(); - $alarmUtilService.showLoading( $elLoading, false ); + alarmUtilService.showLoading( $elLoading, false ); loadGroupList( false ); }; scope.onCreate = function() { @@ -181,7 +181,7 @@ isCreate = true; $elEditGuide.html( "Create new alarm group" ); $elEditInput.val(""); - $alarmUtilService.show( $elEdit ); + alarmUtilService.show( $elEdit ); $elEditInput.focus(); }; scope.onUpdate = function($event) { @@ -189,12 +189,12 @@ isCreate = false; var $el = $( $event.toElement || $event.target ).parents("li"); - var userGroupNumber = $alarmUtilService.extractID( $el ); + var userGroupNumber = alarmUtilService.extractID( $el ); var userGroupID = $el.find("span.contents").html(); $elEditGuide.html( "Input new name of \"" + userGroupID + "\"." ); $elEditInput.val( userGroupID ).prop("id", "updateUserGroup_" + userGroupNumber); - $alarmUtilService.show( $elEdit ); + alarmUtilService.show( $elEdit ); $elEditInput.focus().select(); }; scope.onInputFilter = function($event) { @@ -214,15 +214,15 @@ if ( isRemoving == true ) return; var query = $.trim( $elFilterInput.val() ); if ( query.length != 0 && query.length < 3 ) { - $alarmUtilService.showLoading( $elLoading, false ); - $alarmUtilService.showAlert( $elAlert, "You must enter at least three characters."); + alarmUtilService.showLoading( $elLoading, false ); + alarmUtilService.showAlert( $elAlert, "You must enter at least three characters."); return; } - $at( $at.MAIN, $at.CLK_ALARM_FILTER_USER_GROUP ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_FILTER_USER_GROUP ); if ( query == "" ) { if ( scope.userGroupList.length != userGroupList.length ) { scope.userGroupList = userGroupList; - $alarmUtilService.unsetFilterBackground( $elWrapper ); + alarmUtilService.unsetFilterBackground( $elWrapper ); } $elFilterEmpty.addClass("disabled"); } else { @@ -234,7 +234,7 @@ } } scope.userGroupList = newFilterUserGroup; - $alarmUtilService.setFilterBackground( $elWrapper ); + alarmUtilService.setFilterBackground( $elWrapper ); } }; scope.onFilterEmpty = function() { @@ -252,32 +252,32 @@ } }; scope.onCancelEdit = function() { - $alarmUtilService.hide( $elEdit ); + alarmUtilService.hide( $elEdit ); }; scope.onApplyEdit = function() { var groupName = $.trim( $elEditInput.val() ); if ( groupName == "" ) { - $alarmUtilService.showLoading( $elLoading, true ); - $alarmUtilService.showAlert( $elAlert, "Input group id."); + alarmUtilService.showLoading( $elLoading, true ); + alarmUtilService.showAlert( $elAlert, "Input group id."); return; } - $alarmUtilService.showLoading( $elLoading, true ); - if ( $alarmUtilService.hasDuplicateItem( userGroupList, function( userGroup ) { + alarmUtilService.showLoading( $elLoading, true ); + if ( alarmUtilService.hasDuplicateItem( userGroupList, function( userGroup ) { return userGroup.id == groupName; }) && isCreate == true ) { - $alarmUtilService.showAlert( $elAlert, "Exist a same group name in the lists." ); + alarmUtilService.showAlert( $elAlert, "Exist a same group name in the lists." ); return; } if ( isCreate ) { - $at( $at.MAIN, $at.CLK_ALARM_CREATE_USER_GROUP ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_CREATE_USER_GROUP ); createGroup( groupName ); } else { - updateGroup( $alarmUtilService.extractID( $elEditInput ), groupName ); + updateGroup( alarmUtilService.extractID( $elEditInput ), groupName ); } }; scope.onCloseAlert = function() { - $alarmUtilService.closeAlert( $elAlert, $elLoading ); + alarmUtilService.closeAlert( $elAlert, $elLoading ); }; scope.$on("alarmUserGroup.configuration.show", function() { if ( isLoadedUserGroupList === false ) { diff --git a/web/src/main/webapp/features/configuration/alarm/alarmPinpointUser.html b/web/src/main/webapp/features/configuration/alarm/alarmPinpointUser.html index 5393ec5d6..287958f94 100644 --- a/web/src/main/webapp/features/configuration/alarm/alarmPinpointUser.html +++ b/web/src/main/webapp/features/configuration/alarm/alarmPinpointUser.html @@ -1,23 +1,27 @@
- Pinpoint User - +
-
    -
  • - - - {{"("+pinpointUser.department + ")" + pinpointUser.name}} - x -
  • - -
+
+
    +
  • + + + {{"("+pinpointUser.department + ")" + pinpointUser.name}} + x +
  • +
+
Search Pinpoint User
+
- - - + + +
@@ -34,7 +38,7 @@
-
+
diff --git a/web/src/main/webapp/features/configuration/configuration.controller.js b/web/src/main/webapp/features/configuration/configuration.controller.js index e9d7da093..168482df7 100644 --- a/web/src/main/webapp/features/configuration/configuration.controller.js +++ b/web/src/main/webapp/features/configuration/configuration.controller.js @@ -15,8 +15,8 @@ } }); - pinpointApp.controller('ConfigurationCtrl', [ '$scope','$element', 'ConfigurationConfig', - function ($scope, $element, $constant) { + pinpointApp.controller('ConfigurationCtrl', [ '$scope','$element', 'ConfigurationConfig', 'AnalyticsService', + function ($scope, $element, $constant, analyticsService) { var $elBody = $element.find(".modal-body"); $scope.descriptionOfCurrentTab = "Set your option"; @@ -42,26 +42,26 @@ $scope.currentTab = tab; switch( tab ) { case $constant.menu.GENERAL: - $at( $at.MAIN, $at.CLK_GENERAL ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_GENERAL ); $elBody.css("background-color", "#e9eaed"); $scope.descriptionOfCurrentTab = "Set your option"; $scope.$broadcast( "general.configuration.show"); break; case $constant.menu.ALARM: - $at( $at.MAIN, $at.CLK_ALARM ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM ); $elBody.css("background-color", "#e9eaed"); $scope.descriptionOfCurrentTab = "Set your alarm rules"; $scope.$broadcast( "alarmUserGroup.configuration.show"); break; case $constant.menu.HELP: - $at( $at.MAIN, $at.CLK_HELP ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_HELP ); $elBody.css("background-color", "#FFF"); $scope.descriptionOfCurrentTab = ""; break; } } $scope.$on("configuration.show", function() { - $at( $at.MAIN, $at.CLK_CONFIGURATION ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_CONFIGURATION ); $element.modal('show'); }); diff --git a/web/src/main/webapp/features/configuration/general/general.controller.js b/web/src/main/webapp/features/configuration/general/general.controller.js index 0497ff8cb..0a2a85934 100644 --- a/web/src/main/webapp/features/configuration/general/general.controller.js +++ b/web/src/main/webapp/features/configuration/general/general.controller.js @@ -16,11 +16,8 @@ pinpointApp.controller('GeneralCtrl', [ '$scope','$element', 'GeneralConfig', function ($scope, $element, $constant) { - //@TODO - //통계 추가할 것. - //$at($at.FILTEREDMAP_PAGE); $scope.$on("general.configuration.show", function() { - console.log( "general show"); + }); } ]); diff --git a/web/src/main/webapp/features/loadChart/load-chart.directive.js b/web/src/main/webapp/features/loadChart/load-chart.directive.js index e4d0016f2..1f8ed6c3e 100644 --- a/web/src/main/webapp/features/loadChart/load-chart.directive.js +++ b/web/src/main/webapp/features/loadChart/load-chart.directive.js @@ -12,7 +12,7 @@ // myColors: ["#c9e7a5", "#bbcdf0", "#fce0b5", "#f69124", "#f53034"] }); - pinpointApp.directive('loadChartDirective', ['loadChartDirectiveConfig', '$timeout', function (cfg, $timeout) { + pinpointApp.directive('loadChartDirective', ['loadChartDirectiveConfig', '$timeout', 'AnalyticsService', function (cfg, $timeout, analyticsService) { return { template: '
', replace: true, @@ -169,7 +169,7 @@ } oChart = AmCharts.makeChart(id, options); oChart.addListener("clickGraph", function(e) { - $at($at.MAIN, $at.CLK_LOAD_GRAPH); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_LOAD_GRAPH); }); }); }; diff --git a/web/src/main/webapp/features/navbar/navbar.directive.js b/web/src/main/webapp/features/navbar/navbar.directive.js index 1ced0e498..30eadf918 100644 --- a/web/src/main/webapp/features/navbar/navbar.directive.js +++ b/web/src/main/webapp/features/navbar/navbar.directive.js @@ -13,8 +13,8 @@ periodTypePrefix: '.navbar.periodType' }); - pinpointApp.directive('navbarDirective', [ 'cfg', '$rootScope', '$http','$document', '$timeout', '$window', 'webStorage', 'helpContentTemplate', 'helpContentService', - function (cfg, $rootScope, $http, $document, $timeout, $window, webStorage, helpContentTemplate, helpContentService) { + pinpointApp.directive('navbarDirective', [ 'cfg', '$rootScope', '$http','$document', '$timeout', '$window', 'webStorage', 'helpContentTemplate', 'helpContentService', 'AnalyticsService', + function (cfg, $rootScope, $http, $document, $timeout, $window, webStorage, helpContentTemplate, helpContentService, analyticsService) { return { restrict: 'EA', replace: true, @@ -389,7 +389,7 @@ return m; } }).on("change", function (e) { - $at( $at.MAIN, $at.CLK_APPLICATION ); + analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_APPLICATION ); scope.application = e.val; scope.$digest(); broadcast(); @@ -442,7 +442,7 @@ * @param readablePeriod */ scope.setPeriod = function (readablePeriod) { - $at($at.MAIN, $at.CLK_TIME, readablePeriod); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_TIME, readablePeriod); scope.periodDelay = true; scope.readablePeriod = readablePeriod; scope.autoUpdate = false; @@ -515,13 +515,13 @@ * @param time */ scope.setAutoUpdateTime = function (time) { - $at($at.MAIN, $at.CLK_UPDATE_TIME, time + "s"); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_UPDATE_TIME, time + "s"); scope.timeCountDown = time; scope.timeLeft = time; }; scope.setNodeRange = function(range) { - $at($at.MAIN, $at.CLK_CALLEE_RANGE, range); - $at($at.MAIN, $at.CLK_CALLER_RANGE, range); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_CALLEE_RANGE, range); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_CALLER_RANGE, range); scope.range = range; setRangeToStorage(scope.application, range); broadcast(); @@ -550,7 +550,7 @@ * @param type */ scope.togglePeriod = function (type) { - $at($at.MAIN, $at.TG_DATE, type); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.TG_DATE, type); scope.periodType = type; scope.autoUpdate = false; }; @@ -564,7 +564,7 @@ */ scope.$watch('autoUpdate', function (newVal, oldVal) { if (newVal) { - $at($at.MAIN, $at.TG_UPDATE_ON); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.TG_UPDATE_ON); $timeout(startUpdate, 1000); } else { resetTimeLeft(); diff --git a/web/src/main/webapp/features/nodeInfoDetails/node-info-details.directive.js b/web/src/main/webapp/features/nodeInfoDetails/node-info-details.directive.js index 587126638..a5226a8b7 100644 --- a/web/src/main/webapp/features/nodeInfoDetails/node-info-details.directive.js +++ b/web/src/main/webapp/features/nodeInfoDetails/node-info-details.directive.js @@ -13,8 +13,8 @@ maxTimeToShowLoadAsDefaultForUnknown: 60 * 60 * 12 // 12h }); - pinpointApp.directive('nodeInfoDetailsDirective', [ 'nodeInfoDetailsDirectiveConfig', '$filter', '$timeout', 'isVisibleService', '$window', 'helpContentTemplate', 'helpContentService', - function (cfg, $filter, $timeout, isVisibleService, $window, helpContentTemplate, helpContentService) { + pinpointApp.directive('nodeInfoDetailsDirective', [ 'nodeInfoDetailsDirectiveConfig', '$filter', '$timeout', 'isVisibleService', '$window', 'helpContentTemplate', 'helpContentService', 'AnalyticsService', + function (cfg, $filter, $timeout, isVisibleService, $window, helpContentTemplate, helpContentService, analyticsService) { return { restrict: 'EA', replace: true, @@ -261,7 +261,7 @@ * @param applicationName */ scope.renderNodeAgentCharts = function (applicationName) { - $at($at.MAIN, $at.CLK_SHOW_GRAPH); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_SHOW_GRAPH); if (angular.isDefined(htAgentChartRendered[applicationName])) return; htAgentChartRendered[applicationName] = true; renderResponseSummary(null, applicationName, htLastNode.agentHistogram[applicationName], '100%', '150px'); diff --git a/web/src/main/webapp/features/responseTimeChart/response-time-chart.directive.js b/web/src/main/webapp/features/responseTimeChart/response-time-chart.directive.js index 77815bb57..ee2db6230 100644 --- a/web/src/main/webapp/features/responseTimeChart/response-time-chart.directive.js +++ b/web/src/main/webapp/features/responseTimeChart/response-time-chart.directive.js @@ -11,8 +11,8 @@ myColors: ["#2ca02c", "#3c81fa", "#f8c731", "#f69124", "#f53034"] }); - pinpointApp.directive('responseTimeChartDirective', ['responseTimeChartDirectiveConfig', '$timeout', - function (cfg, $timeout) { + pinpointApp.directive('responseTimeChartDirective', ['responseTimeChartDirectiveConfig', '$timeout', 'AnalyticsService', + function (cfg, $timeout, analyticsService) { return { template: '
', replace: true, @@ -98,7 +98,7 @@ // $at($at.MAIN, $at.CLK_RESPONSE_GRAPH); // }); oChart.addListener('clickGraphItem', function(event) { - $at($at.MAIN, $at.CLK_RESPONSE_GRAPH); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_RESPONSE_GRAPH); if ( event.item.category == "Error" ) { scope.$emit('responseTimeChartDirective.errorClicked' ); } diff --git a/web/src/main/webapp/features/scatter/jquery.BigScatterChart.js b/web/src/main/webapp/features/scatter/jquery.BigScatterChart.js index 529faea58..fbb476b24 100644 --- a/web/src/main/webapp/features/scatter/jquery.BigScatterChart.js +++ b/web/src/main/webapp/features/scatter/jquery.BigScatterChart.js @@ -16,7 +16,7 @@ var BigScatterChart = $.Class({ * @param {Object} option option object * @param {Service} helpContentService angularjs service object */ - $init: function (htOption, helpContentTemplate, helpContentService, webStorage) { + $init: function (htOption, helpContentTemplate, helpContentService, webStorage, analyticsService) { this.option({ 'sContainerId': '', 'sPrefix': 'bigscatterchart-', @@ -551,7 +551,7 @@ var BigScatterChart = $.Class({ sYMax = sPrefix + 'ymax'; var fConfigToggle = function (e) { - $at($at.MAIN, $at.CLK_SCATTER_SETTING); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_SCATTER_SETTING); self._welConfigBg.toggle(); self._welConfigLayer.toggle(); $('#' + sYMin).val(self.option('nYMin')); @@ -625,7 +625,7 @@ var BigScatterChart = $.Class({ // download var fDownloadToggle = function (e) { - $at($at.MAIN, $at.CLK_DOWNLOAD_SCATTER); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_DOWNLOAD_SCATTER); var sImageUrl = self.getChartAsPNG(); // document.location.href = sImageUrl.replace("image/png", "image/octet-stream"); $(this).attr({ @@ -689,9 +689,9 @@ var BigScatterChart = $.Class({ _.each(this._htwelTypeLi, function (welTypeLi, sKey) { welTypeLi.click(function (e) { if ( sKey === "Success" ) { - $at($at.MAIN, $at.TG_SCATTER_SUCCESS, welTypeLi.hasClass('unchecked') ? $at.ON : $at.OFF ); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.TG_SCATTER_SUCCESS, welTypeLi.hasClass('unchecked') ? analyticsService.CONST.ON : analyticsService.CONST.OFF ); } else { - $at($at.MAIN, $at.TG_SCATTER_FAILED, welTypeLi.hasClass('unchecked') ? $at.ON : $at.OFF ); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.TG_SCATTER_FAILED, welTypeLi.hasClass('unchecked') ? analyticsService.CONST.ON : analyticsService.CONST.OFF ); } e.preventDefault(); diff --git a/web/src/main/webapp/features/scatter/scatter.directive.js b/web/src/main/webapp/features/scatter/scatter.directive.js index 8baced506..3cc7b0261 100644 --- a/web/src/main/webapp/features/scatter/scatter.directive.js +++ b/web/src/main/webapp/features/scatter/scatter.directive.js @@ -67,8 +67,8 @@ // FIXME made global to allow access from the child window. Refactor later. //var selectdTracesBox = {}; - pinpointApp.directive('scatterDirective', ['scatterDirectiveConfig', '$rootScope', '$timeout', 'webStorage', 'TransactionDaoService', '$window', 'helpContentTemplate', 'helpContentService', - function (cfg, $rootScope, $timeout, webStorage, oTransactionDaoService, $window, helpContentTemplate, helpContentService) { + pinpointApp.directive('scatterDirective', ['scatterDirectiveConfig', '$rootScope', '$timeout', 'webStorage', 'TransactionDaoService', '$window', 'helpContentTemplate', 'helpContentService', 'AnalyticsService', + function (cfg, $rootScope, $timeout, webStorage, oTransactionDaoService, $window, helpContentTemplate, helpContentService, analyticsService) { return { template: '
', restrict: 'EA', @@ -234,7 +234,7 @@ }; var oScatterChart = null; - oScatterChart = new BigScatterChart(options, helpContentTemplate, helpContentService, webStorage); + oScatterChart = new BigScatterChart(options, helpContentTemplate, helpContentService, webStorage, analyticsService); $timeout(function () { if (angular.isUndefined(scatterData)) { oScatterChart.drawWithDataSource(getDataSource(title, start, end, filter)); diff --git a/web/src/main/webapp/features/serverMap/jquery.ServerMap2.js b/web/src/main/webapp/features/serverMap/jquery.ServerMap2.js index c0e4b8306..cc0228502 100644 --- a/web/src/main/webapp/features/serverMap/jquery.ServerMap2.js +++ b/web/src/main/webapp/features/serverMap/jquery.ServerMap2.js @@ -20,7 +20,7 @@ * @method ServerMap#$init * @param {object} */ - $init: function (htOption, $location) { + $init: function (htOption, $location, analyticsService) { this._query = ""; this.option({ "sContainerId": '', @@ -595,7 +595,7 @@ margin: 2, visible : false, click: function(e, o) { - $at($at.MAIN, $at.TG_NODE_VIEW); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.TG_NODE_VIEW); e.bubbles = false; var isCollapse = o.part.data.isCollapse; self._oDiagram.model.setDataProperty( o.part.data, "isCollapse", !isCollapse ); @@ -1240,7 +1240,7 @@ var node = obj.part, fOnNodeSubGroupClicked = this.option('fOnNodeSubGroupClicked'); if (_.isFunction(fOnNodeSubGroupClicked)) { - $at($at.MAIN, $at.CLK_NODE); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_NODE); fOnNodeSubGroupClicked.call(this, e, node, unknownKey, fromName); } }, @@ -1257,7 +1257,7 @@ htData = node.data, fOnNodeClicked = this.option('fOnNodeClicked'); if (_.isFunction(fOnNodeClicked)) { - $at($at.MAIN, $at.CLK_NODE); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_NODE); fOnNodeClicked.call(this, e, htData, unknownKey, query); } }, @@ -1305,7 +1305,7 @@ htData = link.data, fOnLinkClicked = this.option('fOnLinkClicked'); if (_.isFunction(fOnLinkClicked)) { - $at($at.MAIN, $at.CLK_LINK); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_LINK); htData.fromNode = obj.fromNode.part.data; htData.toNode = obj.toNode.part.data; fOnLinkClicked.call(this, e, htData); diff --git a/web/src/main/webapp/features/serverMap/server-map.directive.js b/web/src/main/webapp/features/serverMap/server-map.directive.js index d13854e70..73747d55a 100644 --- a/web/src/main/webapp/features/serverMap/server-map.directive.js +++ b/web/src/main/webapp/features/serverMap/server-map.directive.js @@ -41,8 +41,8 @@ } }); - pinpointApp.directive('serverMapDirective', [ 'serverMapDirectiveConfig', 'ServerMapDaoService', 'AlertsService', 'ProgressBarService', 'SidebarTitleVoService', '$filter', 'ServerMapFilterVoService', 'filteredMapUtilService', '$base64', 'ServerMapHintVoService', '$timeout', '$location', '$window', 'helpContentTemplate', 'helpContentService', - function (cfg, ServerMapDaoService, AlertsService, ProgressBarService, SidebarTitleVoService, $filter, ServerMapFilterVoService, filteredMapUtilService, $base64, ServerMapHintVoService, $timeout, $location, $window, helpContentTemplate, helpContentService) { + pinpointApp.directive('serverMapDirective', [ 'serverMapDirectiveConfig', 'ServerMapDaoService', 'AlertsService', 'ProgressBarService', 'SidebarTitleVoService', '$filter', 'ServerMapFilterVoService', 'filteredMapUtilService', '$base64', 'ServerMapHintVoService', '$timeout', '$location', '$window', 'helpContentTemplate', 'helpContentService', 'AnalyticsService', + function (cfg, ServerMapDaoService, AlertsService, ProgressBarService, SidebarTitleVoService, $filter, ServerMapFilterVoService, filteredMapUtilService, $base64, ServerMapHintVoService, $timeout, $location, $window, helpContentTemplate, helpContentService, analyticsService) { return { restrict: 'EA', replace: true, @@ -443,7 +443,7 @@ oProgressBarService.setLoading(100); if (oServerMap === null) { - oServerMap = new ServerMap(options, $location); + oServerMap = new ServerMap(options, $location, analyticsService); } else { oServerMap.option(options); } @@ -562,7 +562,7 @@ * passing transaction list */ scope.passingTransactionList = function () { - $at($at.CONTEXT, $at.CLK_FILTER_TRANSACTION); + analyticsService.send(analyticsService.CONST.CONTEXT, analyticsService.CONST.CLK_FILTER_TRANSACTION); var oServerMapFilterVoService = new ServerMapFilterVoService(); oServerMapFilterVoService .setMainApplication(htLastLink.filterApplicationName) @@ -585,7 +585,7 @@ * open filter wizard */ scope.openFilterWizard = function () { - $at($at.CONTEXT, $at.CLK_FILTER_TRANSACTION_WIZARD); + analyticsService.send(analyticsService.CONST.CONTEXT, analyticsService.CONST.CLK_FILTER_TRANSACTION_WIZARD); openFilterWizard(); }; @@ -663,7 +663,7 @@ * toggle merge group */ scope.toggleMergeGroup = function ( mergeType ) { - $at($at.CONTEXT, $at.TG_MERGE_TYPE, mergeType); + analyticsService.send(analyticsService.CONST.CONTEXT, analyticsService.CONST.TG_MERGE_TYPE, mergeType); scope.mergeStatus[ mergeType ] = !scope.mergeStatus[ mergeType ]; //scope.mergeUnknowns = (scope.mergeUnknowns) ? false : true; serverMapCallback(htLastQuery, ServerMapDaoService.extractDataFromApplicationMapData(htLastMapData.applicationMapData), scope.linkRouting, scope.linkCurve); @@ -676,11 +676,11 @@ */ scope.toggleLinkLableTextType = function (type) { if ( type === "tps" ) { - $at($at.CONTEXT, $at.TG_TPS); + analyticsService.send(analyticsService.CONST.CONTEXT, analyticsService.CONST.TG_TPS); scope.totalRequestCount = false; scope.tps = true; } else { - $at($at.CONTEXT, $at.TG_CALL_COUNT); + analyticsService.send(analyticsService.CONST.CONTEXT, analyticsService.CONST.TG_CALL_COUNT); scope.totalRequestCount = true; scope.tps = false; } @@ -696,7 +696,7 @@ * @param type */ scope.toggleLinkRouting = function (type) { - $at($at.CONTEXT, $at.TG_ROUTING, type); + analyticsService.send(analyticsService.CONST.CONTEXT, analyticsService.CONST.TG_ROUTING, type); scope.linkRouting = cfg.options.htLinkType.sRouting = type; serverMapCallback(htLastQuery, htLastMergedMapData, scope.linkRouting, scope.linkCurve); reset(); @@ -707,7 +707,7 @@ * @param type */ scope.toggleLinkCurve = function (type) { - $at($at.CONTEXT, $at.TG_CURVE, type); + analyticsService.send(analyticsService.CONST.CONTEXT, analyticsService.CONST.TG_CURVE, type); scope.linkCurve = cfg.options.htLinkType.sCurve = type; serverMapCallback(htLastQuery, htLastMergedMapData, scope.linkRouting, scope.linkCurve); reset(); @@ -717,7 +717,7 @@ * refresh */ scope.refresh = function () { - $at($at.CONTEXT, $at.CLK_REFRESH); + analyticsService.send(analyticsService.CONST.CONTEXT, analyticsService.CONST.CLK_REFRESH); if (oServerMap) { oServerMap.refresh(); @@ -790,14 +790,14 @@ } scope.searchNode = function() { if (oServerMap && scope.searchNodeQuery !== "" ) { - $at($at.MAIN, $at.CLK_SEARCH_NODE); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_SEARCH_NODE); scope.searchNodeIndex = 0; scope.searchNodeList = oServerMap.searchNode( scope.searchNodeQuery ); jQuery(element).find(".search-result").show().find(".count").html("Result : " + scope.searchNodeList.length); } }; scope.clearSearchNode = function() { - $at($at.MAIN, $at.CLK_CLEAR_SEARCH); + analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_CLEAR_SEARCH); oServerMap.clearQuery(); scope.searchNodeIndex = 0; scope.searchNodeQuery = ""; diff --git a/web/src/main/webapp/features/timeSlider/time-slider.directive.js b/web/src/main/webapp/features/timeSlider/time-slider.directive.js index c6e3d873b..40a6dd550 100644 --- a/web/src/main/webapp/features/timeSlider/time-slider.directive.js +++ b/web/src/main/webapp/features/timeSlider/time-slider.directive.js @@ -11,7 +11,7 @@ scaleCount: 10 }); - pinpointApp.directive('timeSliderDirective', [ 'timeSliderDirectiveConfig', '$timeout', function (cfg, $timeout) { + pinpointApp.directive('timeSliderDirective', [ 'timeSliderDirectiveConfig', '$timeout', 'AnalyticsService', function (cfg, $timeout, analyticsService) { return { restrict: 'EA', replace: true, @@ -127,7 +127,7 @@ * scope more */ scope.more = function () { - $at($at.CALLSTACK, $at.CLK_MORE); + analyticsService.send(analyticsService.CONST.CALLSTACK, analyticsService.CONST.CLK_MORE); scope.$emit('timeSliderDirective.moreClicked', scope.oTimeSliderVoService); }; diff --git a/web/src/main/webapp/features/timeline/timeline.directive.js b/web/src/main/webapp/features/timeline/timeline.directive.js index d8285508d..dd824865c 100644 --- a/web/src/main/webapp/features/timeline/timeline.directive.js +++ b/web/src/main/webapp/features/timeline/timeline.directive.js @@ -7,7 +7,7 @@ * @name timelineDirective * @class */ - pinpointApp.directive('timelineDirective', function () { + pinpointApp.directive('timelineDirective', ['AnalyticsService', function (analyticsService) { return { restrict: 'EA', replace: true, @@ -101,7 +101,7 @@ }; $(element).on("click", ".clickable-bar", function() { - $at($at.CALLSTACK, $at.CLK_CALL); + analyticsService.send(analyticsService.CONST.CALLSTACK, analyticsService.CONST.CLK_CALL); scope.$emit( "transactionDetail.selectDistributedCallFlowRow", scope.newCallStacks[parseInt($(this).parent().attr("data-index"))][6] ); }); $(element).on("mouseenter", ".timeline-bar-frame", function(event) { @@ -163,5 +163,5 @@ } } }; - }); + }]); })(jQuery); \ No newline at end of file diff --git a/web/src/main/webapp/features/transactionTable/transaction-table.directive.js b/web/src/main/webapp/features/transactionTable/transaction-table.directive.js index c919e74dc..70096fc1e 100644 --- a/web/src/main/webapp/features/transactionTable/transaction-table.directive.js +++ b/web/src/main/webapp/features/transactionTable/transaction-table.directive.js @@ -7,7 +7,7 @@ * @name transactionTableDirective * @class */ - pinpointApp.directive('transactionTableDirective', ['$window', 'helpContentTemplate', 'helpContentService', function ($window, helpContentTemplate, helpContentService) { + pinpointApp.directive('transactionTableDirective', ['$window', 'helpContentTemplate', 'helpContentService', 'AnalyticsService', function ($window, helpContentTemplate, helpContentService, analyticsService) { return { restrict: 'EA', replace: true, @@ -63,7 +63,7 @@ * @param transaction */ scope.traceByApplication = function (transaction) { - $at($at.CALLSTACK, $at.CLK_TRANSACTION); + analyticsService.send(analyticsService.CONST.CALLSTACK, analyticsService.CONST.CLK_TRANSACTION); scope.currentTransaction = transaction; scope.$emit('transactionTableDirective.applicationSelected', transaction); }; @@ -95,7 +95,7 @@ } else { scope.transactionReverse = false; } - $at($at.CALLSTACK, $at.ST_ + orderKey.charAt(0).toUpperCase() + orderKey.substring(1), scope.transactionReverse ? $at.DESCENDING : $at.ASCENDING ); + analyticsService.send(analyticsService.CONST.CALLSTACK, analyticsService.CONST.ST_ + orderKey.charAt(0).toUpperCase() + orderKey.substring(1), scope.transactionReverse ? analyticsService.CONST.DESCENDING : analyticsService.CONST.ASCENDING ); scope.transactionOrderBy = orderKey; }; diff --git a/web/src/main/webapp/index.html b/web/src/main/webapp/index.html index f40a6ce40..caeac7f6e 100644 --- a/web/src/main/webapp/index.html +++ b/web/src/main/webapp/index.html @@ -415,6 +415,7 @@ + diff --git a/web/src/main/webapp/pages/filteredMap/filtered-map.controller.js b/web/src/main/webapp/pages/filteredMap/filtered-map.controller.js index e2d9e9899..b69e897bd 100644 --- a/web/src/main/webapp/pages/filteredMap/filtered-map.controller.js +++ b/web/src/main/webapp/pages/filteredMap/filtered-map.controller.js @@ -7,9 +7,9 @@ * @name FilteredMapCtrl * @class */ - pinpointApp.controller('FilteredMapCtrl', [ 'filterConfig', '$scope', '$routeParams', '$timeout', 'TimeSliderVoService', 'NavbarVoService', '$window', 'SidebarTitleVoService', 'filteredMapUtilService', '$rootElement', - function (cfg, $scope, $routeParams, $timeout, TimeSliderVoService, NavbarVoService, $window, SidebarTitleVoService, filteredMapUtilService, $rootElement) { - $at($at.FILTEREDMAP_PAGE); + pinpointApp.controller('FilteredMapCtrl', [ 'filterConfig', '$scope', '$routeParams', '$timeout', 'TimeSliderVoService', 'NavbarVoService', '$window', 'SidebarTitleVoService', 'filteredMapUtilService', '$rootElement', 'AnalyticsService', + function (cfg, $scope, $routeParams, $timeout, TimeSliderVoService, NavbarVoService, $window, SidebarTitleVoService, filteredMapUtilService, $rootElement, analyticsService) { + analyticsService.send(analyticsService.CONST.FILTEREDMAP_PAGE); // define private variables var oNavbarVoService, oTimeSliderVoService, bNodeSelected, bNoData, reloadOnlyForNode, reloadOnlyForLink; diff --git a/web/src/main/webapp/pages/inspector/inspector.controller.js b/web/src/main/webapp/pages/inspector/inspector.controller.js index f6dec79be..ea6693a89 100644 --- a/web/src/main/webapp/pages/inspector/inspector.controller.js +++ b/web/src/main/webapp/pages/inspector/inspector.controller.js @@ -7,9 +7,9 @@ * @name InspectorCtrl * @class */ - pinpointApp.controller('InspectorCtrl', [ '$scope', '$timeout', '$routeParams', 'locationService', 'NavbarVoService', - function ($scope, $timeout, $routeParams, locationService, NavbarVoService) { - $at($at.INSPECTOR_PAGE); + pinpointApp.controller('InspectorCtrl', [ '$scope', '$timeout', '$routeParams', 'locationService', 'NavbarVoService', 'AnalyticsService', + function ($scope, $timeout, $routeParams, locationService, NavbarVoService, analyticsService) { + analyticsService.send(analyticsService.CONST.INSPECTOR_PAGE); // define private variables var oNavbarVoService, oAgent; diff --git a/web/src/main/webapp/pages/main/main.controller.js b/web/src/main/webapp/pages/main/main.controller.js index 179e99827..81027dbcb 100644 --- a/web/src/main/webapp/pages/main/main.controller.js +++ b/web/src/main/webapp/pages/main/main.controller.js @@ -7,9 +7,9 @@ * @name MainCtrl * @class */ - pinpointApp.controller('MainCtrl', [ 'filterConfig', '$scope', '$timeout', '$routeParams', 'locationService', 'NavbarVoService', '$window', 'SidebarTitleVoService', 'filteredMapUtilService', '$rootElement', - function (cfg, $scope, $timeout, $routeParams, locationService, NavbarVoService, $window, SidebarTitleVoService, filteredMapUtilService, $rootElement) { - $at($at.MAIN_PAGE); + pinpointApp.controller('MainCtrl', [ 'filterConfig', '$scope', '$timeout', '$routeParams', 'locationService', 'NavbarVoService', '$window', 'SidebarTitleVoService', 'filteredMapUtilService', '$rootElement', 'AnalyticsService', + function (cfg, $scope, $timeout, $routeParams, locationService, NavbarVoService, $window, SidebarTitleVoService, filteredMapUtilService, $rootElement, analyticsService) { + analyticsService.send(analyticsService.CONST.MAIN_PAGE); // define private variables var oNavbarVoService, bNodeSelected, bNoData; diff --git a/web/src/main/webapp/pages/scatterFullScreenMode/scatter-full-screen-mode.controller.js b/web/src/main/webapp/pages/scatterFullScreenMode/scatter-full-screen-mode.controller.js index ed0c9f3b5..f034bb61b 100644 --- a/web/src/main/webapp/pages/scatterFullScreenMode/scatter-full-screen-mode.controller.js +++ b/web/src/main/webapp/pages/scatterFullScreenMode/scatter-full-screen-mode.controller.js @@ -7,9 +7,9 @@ * @name ScatterFullScreenModeCtrl * @class */ - pinpointApp.controller('ScatterFullScreenModeCtrl', [ '$scope', '$rootScope', '$routeParams', '$timeout', 'NavbarVoService', - function ($scope, $rootScope, $routeParams, $timeout, NavbarVoService) { - $at($at.SCATTER_FULL_SCREEN_PAGE); + pinpointApp.controller('ScatterFullScreenModeCtrl', [ '$scope', '$rootScope', '$routeParams', '$timeout', 'NavbarVoService', 'AnalyticsService', + function ($scope, $rootScope, $routeParams, $timeout, NavbarVoService, analyticsService) { + analyticsService.send(analyticsService.CONST.SCATTER_FULL_SCREEN_PAGE); // define private variables var oNavbarVoService; diff --git a/web/src/main/webapp/pages/transactionDetail/transaction-detail.controller.js b/web/src/main/webapp/pages/transactionDetail/transaction-detail.controller.js index cfe1ac05f..f37f08a4e 100644 --- a/web/src/main/webapp/pages/transactionDetail/transaction-detail.controller.js +++ b/web/src/main/webapp/pages/transactionDetail/transaction-detail.controller.js @@ -11,9 +11,9 @@ applicationUrl: '/transactionInfo.pinpoint' }); - pinpointApp.controller('TransactionDetailCtrl', ['TransactionDetailConfig', '$scope', '$rootScope', '$routeParams', '$timeout', '$rootElement', 'AlertsService', 'ProgressBarService', 'TransactionDaoService', '$window', '$location', 'helpContentTemplate', 'helpContentService', - function (cfg, $scope, $rootScope, $routeParams, $timeout, $rootElement, AlertsService, ProgressBarService, TransactionDaoService, $window, $location, helpContentTemplate, helpContentService) { - $at($at.TRANSACTION_DETAIL_PAGE); + pinpointApp.controller('TransactionDetailCtrl', ['TransactionDetailConfig', '$scope', '$rootScope', '$routeParams', '$timeout', '$rootElement', 'AlertsService', 'ProgressBarService', 'TransactionDaoService', '$window', '$location', 'helpContentTemplate', 'helpContentService', 'AnalyticsService', + function (cfg, $scope, $rootScope, $routeParams, $timeout, $rootElement, AlertsService, ProgressBarService, TransactionDaoService, $window, $location, helpContentTemplate, helpContentService, analyticsService) { + analyticsService.send(analyticsService.CONST.TRANSACTION_DETAIL_PAGE); // define private variables var oAlertService, oProgressBarService, bShowCallStacksOnce, bIsFirstTimelineView = true; @@ -145,7 +145,7 @@ $window.open('/#/transactionView/' + $scope.transactionDetail.agentId + '/' + $scope.transactionDetail.transactionId + '/' + $scope.transactionDetail.callStackStart); }; $scope.$on("transactionDetail.selectDistributedCallFlowRow", function( event, rowId ) { - $at($at.CALLSTACK, $at.CLK_DISTRIBUTED_CALL_FLOW); + analyticsService.send(analyticsService.CONST.CALLSTACK, analyticsService.CONST.CLK_DISTRIBUTED_CALL_FLOW); $("#traceTabs li:nth-child(1) a").trigger("click"); $scope.$broadcast('distributedCallFlowDirective.selectRow.forTransactionDetail', rowId); }); @@ -173,7 +173,7 @@ $('#traceTabs li a[data-toggle="tab"]').on('shown.bs.tab', function(e) { if ( e.target.href.indexOf( "#CallStacks") != -1 ) { - $at($at.CALLSTACK, $at.CLK_DISTRIBUTED_CALL_FLOW); + analyticsService.send(analyticsService.CONST.CALLSTACK, analyticsService.CONST.CLK_DISTRIBUTED_CALL_FLOW); // $("#traceTabs li:nth-child(5)").show(); } }); @@ -182,13 +182,13 @@ e.preventDefault(); }); $("#traceTabs li:nth-child(2) a").bind("click", function (e) { - $at($at.CALLSTACK, $at.CLK_SERVER_MAP); + analyticsService.send(analyticsService.CONST.CALLSTACK, analyticsService.CONST.CLK_SERVER_MAP); initSearchVar(); $scope.$broadcast('serverMapDirective.initializeWithMapData', $scope.transactionDetail); }); var testCount = 0; $("#traceTabs li:nth-child(3) a").bind("click", function (e) { - $at($at.CALLSTACK, $at.CLK_RPC_TIMELINE); + analyticsService.send(analyticsService.CONST.CALLSTACK, analyticsService.CONST.CLK_RPC_TIMELINE); initSearchVar(); if (bIsFirstTimelineView){ $scope.$broadcast('timelineDirective.initialize', $scope.transactionDetail); diff --git a/web/src/main/webapp/pages/transactionList/transaction-list.controller.js b/web/src/main/webapp/pages/transactionList/transaction-list.controller.js index 0847632e9..a11640972 100644 --- a/web/src/main/webapp/pages/transactionList/transaction-list.controller.js +++ b/web/src/main/webapp/pages/transactionList/transaction-list.controller.js @@ -18,9 +18,9 @@ } }); - pinpointApp.controller('TransactionListCtrl', ['TransactionListConfig', '$scope', '$routeParams', '$rootScope', '$timeout', '$window', '$http', 'webStorage', 'TimeSliderVoService', 'TransactionDaoService', - function (cfg, $scope, $routeParams, $rootScope, $timeout, $window, $http, webStorage, TimeSliderVoService, oTransactionDaoService) { - $at($at.TRANSACTION_LIST_PAGE); + pinpointApp.controller('TransactionListCtrl', ['TransactionListConfig', '$scope', '$routeParams', '$rootScope', '$timeout', '$window', '$http', 'webStorage', 'TimeSliderVoService', 'TransactionDaoService', 'AnalyticsService', + function (cfg, $scope, $routeParams, $rootScope, $timeout, $window, $http, webStorage, TimeSliderVoService, oTransactionDaoService, analyticsService) { + analyticsService.send(analyticsService.CONST.TRANSACTION_LIST_PAGE); // define private variables var nFetchCount, nLastFetchedIndex, htTransactionInfo, htTransactionData, oTimeSliderVoService; diff --git a/web/src/main/webapp/pages/transactionView/transaction-view.controller.js b/web/src/main/webapp/pages/transactionView/transaction-view.controller.js index 17bf2421c..4f9f2907f 100644 --- a/web/src/main/webapp/pages/transactionView/transaction-view.controller.js +++ b/web/src/main/webapp/pages/transactionView/transaction-view.controller.js @@ -11,9 +11,9 @@ applicationUrl: '/transactionInfo.pinpoint' }); - pinpointApp.controller('TransactionViewCtrl', [ 'TransactionViewConfig', '$scope', '$rootScope', '$rootElement', 'AlertsService', 'ProgressBarService', '$timeout', '$routeParams', 'TransactionDaoService', 'AgentDaoService', - function (cfg, $scope, $rootScope, $rootElement, AlertsService, ProgressBarService, $timeout, $routeParams, TransactionDaoService, AgentDaoService) { - $at($at.TRANSACTION_VIEW_PAGE); + pinpointApp.controller('TransactionViewCtrl', [ 'TransactionViewConfig', '$scope', '$rootScope', '$rootElement', 'AlertsService', 'ProgressBarService', '$timeout', '$routeParams', 'TransactionDaoService', 'AgentDaoService', 'AnalyticsService', + function (cfg, $scope, $rootScope, $rootElement, AlertsService, ProgressBarService, $timeout, $routeParams, TransactionDaoService, AgentDaoService, analyticsService) { + analyticsService.send(analyticsService.CONST.TRANSACTION_VIEW_PAGE); // define private variables var oAlertService, oProgressBarService; diff --git a/web/src/main/webapp/scripts/app.js b/web/src/main/webapp/scripts/app.js index 0b15fcb42..57cff3b2a 100644 --- a/web/src/main/webapp/scripts/app.js +++ b/web/src/main/webapp/scripts/app.js @@ -51,14 +51,22 @@ pinpointApp.config(['$routeProvider', '$locationProvider', '$modalProvider', fun angular.extend($modalProvider.defaults, { animation: 'am-flip-x' }); - // Completely disable SCE. For demonstration purposes only! // Do not use in new projects. // $sceProvider.enabled(false); }]); -pinpointApp.run([ '$rootScope', '$timeout', '$modal', '$location', '$cookies', '$interval', - function ($rootScope, $timeout, $modal, $location, $cookies, $interval) { +pinpointApp.value("globalConfig", { + "sendAllowed": true, + "createUserAllowed": true +}); + +pinpointApp.run([ '$rootScope', '$timeout', '$modal', '$location', '$cookies', '$interval', '$http', 'globalConfig', + function ($rootScope, $timeout, $modal, $location, $cookies, $interval, $http, globalConfig) { + $http.get('/configuration.pinpoint').then(function(result) { + globalConfig.sendAllowed = result.data.sendUsage; + globalConfig.createUserAllowed = result.data.createUserAllowed || true; + }, function(error) {}); if (!isCanvasSupported()) { $timeout(function () { $('#supported-browsers').modal(); diff --git a/web/src/main/webapp/styles/configuration.css b/web/src/main/webapp/styles/configuration.css index 4a031e39e..46fb62fbb 100644 --- a/web/src/main/webapp/styles/configuration.css +++ b/web/src/main/webapp/styles/configuration.css @@ -201,7 +201,12 @@ background-color: #EFABAB; color: #000; } - +#pinpoint-configuration .some-list-content .wrapper .empty-list { + text-align: center; + margin-top: 50%; + color: #AAA; + font-size: 22px; +} #pinpoint-configuration .some-list-content.move-some-where li span { margin-left: 4px; } From f1ea3a1305af515b6cffa0f0bc502a8b15df5b5c Mon Sep 17 00:00:00 2001 From: denz Date: Mon, 31 Aug 2015 15:24:00 +0900 Subject: [PATCH 3/5] Bug fix. remove event-analytics.js ( replace to analytics.service.js ) --- .../common/services/alarm-util.service.js | 4 +- .../agentInfo/agent-info.directive.js | 16 ++- .../features/agentInfo/agentInfoMain.html | 6 +- .../scatter/jquery.BigScatterChart.js | 9 +- .../features/serverMap/jquery.ServerMap2.js | 9 +- web/src/main/webapp/index.html | 3 +- web/src/main/webapp/scripts/app.js | 2 +- .../webapp/scripts/extra/event-analytics.js | 109 ------------------ 8 files changed, 31 insertions(+), 127 deletions(-) delete mode 100644 web/src/main/webapp/scripts/extra/event-analytics.js diff --git a/web/src/main/webapp/common/services/alarm-util.service.js b/web/src/main/webapp/common/services/alarm-util.service.js index a71c28e63..07a832bb3 100644 --- a/web/src/main/webapp/common/services/alarm-util.service.js +++ b/web/src/main/webapp/common/services/alarm-util.service.js @@ -34,8 +34,8 @@ }; this.sendCRUD = function( funcName, data, successCallback, failCallback, $elAlert ) { $ajaxService[funcName]( data, function( resultData ) { - if ( resultData.errorCode ) { - self.showAlert( $elAlert, resultData.errorMessage ); + if ( resultData.errorCode || resultData.status ) { + self.showAlert( $elAlert, resultData.errorMessage || resultData.statusText ); failCallback( resultData ); } else { successCallback( resultData ); diff --git a/web/src/main/webapp/features/agentInfo/agent-info.directive.js b/web/src/main/webapp/features/agentInfo/agent-info.directive.js index e94c32d60..43b0d850d 100644 --- a/web/src/main/webapp/features/agentInfo/agent-info.directive.js +++ b/web/src/main/webapp/features/agentInfo/agent-info.directive.js @@ -180,7 +180,21 @@ scope.$broadcast('cpuLoadChartDirective.showCursorAt.forCpuLoad', event.index); } } - + + scope.openDetail = function() { + $('#serverMetaDataDiv').modal({}); + }; + scope.hasDuplicate = function( libName, index ) { + var len = scope.currentServiceInfo.serviceLibs.length; + var bHas = false; + for( var i = 0 ; i < len ; i++ ) { + if ( scope.currentServiceInfo.serviceLibs[i] == libName && i != index ) { + bHas = true; + break; + } + } + return bHas ? "color:red" : ""; + }; /** * scope event on jvmMemoryChartDirective.cursorChanged.forHeap */ diff --git a/web/src/main/webapp/features/agentInfo/agentInfoMain.html b/web/src/main/webapp/features/agentInfo/agentInfoMain.html index eba6ca966..0458a2bca 100644 --- a/web/src/main/webapp/features/agentInfo/agentInfoMain.html +++ b/web/src/main/webapp/features/agentInfo/agentInfoMain.html @@ -43,9 +43,7 @@ {{info.serviceType}}  ({{info.serverMetaData.serverInfo}})  - + End Status @@ -124,7 +122,7 @@
    -
  • {{serviceLib}}
  • +
  • {{serviceLib}}
diff --git a/web/src/main/webapp/features/scatter/jquery.BigScatterChart.js b/web/src/main/webapp/features/scatter/jquery.BigScatterChart.js index fbb476b24..93064da23 100644 --- a/web/src/main/webapp/features/scatter/jquery.BigScatterChart.js +++ b/web/src/main/webapp/features/scatter/jquery.BigScatterChart.js @@ -17,6 +17,7 @@ var BigScatterChart = $.Class({ * @param {Service} helpContentService angularjs service object */ $init: function (htOption, helpContentTemplate, helpContentService, webStorage, analyticsService) { + this.analyticsService = analyticsService; this.option({ 'sContainerId': '', 'sPrefix': 'bigscatterchart-', @@ -551,7 +552,7 @@ var BigScatterChart = $.Class({ sYMax = sPrefix + 'ymax'; var fConfigToggle = function (e) { - analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_SCATTER_SETTING); + self.analyticsService.send(self.analyticsService.CONST.MAIN, self.analyticsService.CONST.CLK_SCATTER_SETTING); self._welConfigBg.toggle(); self._welConfigLayer.toggle(); $('#' + sYMin).val(self.option('nYMin')); @@ -625,7 +626,7 @@ var BigScatterChart = $.Class({ // download var fDownloadToggle = function (e) { - analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_DOWNLOAD_SCATTER); + self.analyticsService.send(self.analyticsService.CONST.MAIN, self.analyticsService.CONST.CLK_DOWNLOAD_SCATTER); var sImageUrl = self.getChartAsPNG(); // document.location.href = sImageUrl.replace("image/png", "image/octet-stream"); $(this).attr({ @@ -689,9 +690,9 @@ var BigScatterChart = $.Class({ _.each(this._htwelTypeLi, function (welTypeLi, sKey) { welTypeLi.click(function (e) { if ( sKey === "Success" ) { - analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.TG_SCATTER_SUCCESS, welTypeLi.hasClass('unchecked') ? analyticsService.CONST.ON : analyticsService.CONST.OFF ); + self.analyticsService.send(self.analyticsService.CONST.MAIN, self.analyticsService.CONST.TG_SCATTER_SUCCESS, welTypeLi.hasClass('unchecked') ? self.analyticsService.CONST.ON : self.analyticsService.CONST.OFF ); } else { - analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.TG_SCATTER_FAILED, welTypeLi.hasClass('unchecked') ? analyticsService.CONST.ON : analyticsService.CONST.OFF ); + self.analyticsService.send(self.analyticsService.CONST.MAIN, self.analyticsService.CONST.TG_SCATTER_FAILED, welTypeLi.hasClass('unchecked') ? self.analyticsService.CONST.ON : self.analyticsService.CONST.OFF ); } e.preventDefault(); diff --git a/web/src/main/webapp/features/serverMap/jquery.ServerMap2.js b/web/src/main/webapp/features/serverMap/jquery.ServerMap2.js index cc0228502..84d9c1f3c 100644 --- a/web/src/main/webapp/features/serverMap/jquery.ServerMap2.js +++ b/web/src/main/webapp/features/serverMap/jquery.ServerMap2.js @@ -21,6 +21,7 @@ * @param {object} */ $init: function (htOption, $location, analyticsService) { + this.analyticsService = analyticsService; this._query = ""; this.option({ "sContainerId": '', @@ -595,7 +596,7 @@ margin: 2, visible : false, click: function(e, o) { - analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.TG_NODE_VIEW); + self.analyticsService.send(self.analyticsService.CONST.MAIN, self.analyticsService.CONST.TG_NODE_VIEW); e.bubbles = false; var isCollapse = o.part.data.isCollapse; self._oDiagram.model.setDataProperty( o.part.data, "isCollapse", !isCollapse ); @@ -1240,7 +1241,7 @@ var node = obj.part, fOnNodeSubGroupClicked = this.option('fOnNodeSubGroupClicked'); if (_.isFunction(fOnNodeSubGroupClicked)) { - analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_NODE); + this.analyticsService.send(this.analyticsService.CONST.MAIN, this.analyticsService.CONST.CLK_NODE); fOnNodeSubGroupClicked.call(this, e, node, unknownKey, fromName); } }, @@ -1257,7 +1258,7 @@ htData = node.data, fOnNodeClicked = this.option('fOnNodeClicked'); if (_.isFunction(fOnNodeClicked)) { - analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_NODE); + this.analyticsService.send(this.analyticsService.CONST.MAIN, this.analyticsService.CONST.CLK_NODE); fOnNodeClicked.call(this, e, htData, unknownKey, query); } }, @@ -1305,7 +1306,7 @@ htData = link.data, fOnLinkClicked = this.option('fOnLinkClicked'); if (_.isFunction(fOnLinkClicked)) { - analyticsService.send(analyticsService.CONST.MAIN, analyticsService.CONST.CLK_LINK); + this.analyticsService.send(this.analyticsService.CONST.MAIN, this.analyticsService.CONST.CLK_LINK); htData.fromNode = obj.fromNode.part.data; htData.toNode = obj.toNode.part.data; fOnLinkClicked.call(this, e, htData); diff --git a/web/src/main/webapp/index.html b/web/src/main/webapp/index.html index caeac7f6e..3fc5acbcd 100644 --- a/web/src/main/webapp/index.html +++ b/web/src/main/webapp/index.html @@ -117,7 +117,6 @@ - @@ -410,7 +409,7 @@ - + diff --git a/web/src/main/webapp/scripts/app.js b/web/src/main/webapp/scripts/app.js index 57cff3b2a..28a78642b 100644 --- a/web/src/main/webapp/scripts/app.js +++ b/web/src/main/webapp/scripts/app.js @@ -65,7 +65,7 @@ pinpointApp.run([ '$rootScope', '$timeout', '$modal', '$location', '$cookies', ' function ($rootScope, $timeout, $modal, $location, $cookies, $interval, $http, globalConfig) { $http.get('/configuration.pinpoint').then(function(result) { globalConfig.sendAllowed = result.data.sendUsage; - globalConfig.createUserAllowed = result.data.createUserAllowed || true; + globalConfig.createUserAllowed = result.data.editUserInfo || true; }, function(error) {}); if (!isCanvasSupported()) { $timeout(function () { diff --git a/web/src/main/webapp/scripts/extra/event-analytics.js b/web/src/main/webapp/scripts/extra/event-analytics.js deleted file mode 100644 index 48651926d..000000000 --- a/web/src/main/webapp/scripts/extra/event-analytics.js +++ /dev/null @@ -1,109 +0,0 @@ -(function( global, $ ) { - var bSendAllowed = true; - var $at = function() {}; - if ( typeof ga !== "undefined" && bSendAllowed === true ) { - $at = function( category, name, label, count, options ) { - if ( arguments.length == 1 ) { - ga( 'send', 'pageview', arguments[0] ); - } else { - ga( 'send', 'event', category, name, label, count, options ); - } - }; - } else if ( typeof wcs !== "undefined" ) { - $at = function( category, name, label ) { - if ( arguments.length == 1 ) return; - if ( typeof label !== "undefined" || typeof label !== "null" ) { - name = name + "_" + label; - } - wcs.event( category, name ); - }; - } - $at.MAIN = "Main"; - $at.CONTEXT = "Context"; - $at.CALLSTACK = "CallStack"; - $at.MIXEDVIEW = "MixedView"; - - $at.CLK_APPLICATION = "ClickApplication"; - $at.CLK_TIME = "ClickTime"; - $at.CLK_SEARCH_NODE = "ClickSearchNode"; - $at.CLK_CLEAR_SEARCH = "ClickClearSearch"; - $at.CLK_NODE = "ClickNode"; - $at.CLK_LINK = "ClickLink"; - $at.CLK_UPDATE_TIME = "ClickUpdateTime"; - $at.CLK_HELP = "ClickHelp"; - $at.CLK_SCATTER_SETTING = "ClickScatterSetting"; - $at.CLK_DOWNLOAD_SCATTER = "ClickDownloadScatter"; - $at.CLK_RESPONSE_GRAPH = "ClickResponseGraph"; - $at.CLK_LOAD_GRAPH = "ClickLoadGraph"; - $at.CLK_SHOW_GRAPH = "ClickShowGraph"; - $at.CLK_FILTER_TRANSACTION = "ClickFilterTransaction"; - $at.CLK_FILTER_TRANSACTION_WIZARD = "ClickFilterTransactionWizard"; - $at.CLK_MORE = "ClickMore"; - $at.CLK_DISTRIBUTED_CALL_FLOW = "ClickDistributedCallFlow"; - $at.CLK_SERVER_MAP = "ClickServerMap"; - $at.CLK_RPC_TIMELINE = "ClickRPCTimeline"; - $at.CLK_CALL = "ClickCall"; - $at.CLK_TRANSACTION = "ClickTransaction"; - $at.CLK_HEAP = "ClickHeap"; - $at.CLK_PERM_GEN = "ClickPermGen"; - $at.CLK_CPU_LOAD = "ClickCpuLoad"; - $at.CLK_REFRESH = "ClickRefresh"; - $at.CLK_CALLEE_RANGE = "ClickCalleeRange"; - $at.CLK_CALLER_RANGE = "ClickCallerRange"; - - $at.CLK_CONFIGURATION = "ClickConfiguration"; - $at.CLK_GENERAL = "ClickConfigurationGeneral"; - $at.CLK_ALARM = "ClickConfigurationAlarm"; - $at.CLK_HELP = "ClickConfigurationHelp"; - $at.CLK_ALARM_CREATE_USER_GROUP = "ClickAlarmCreateUserGroup"; - $at.CLK_ALARM_REFRESH_USER_GROUP = "ClickAlarmRefreshUserGroup"; - $at.CLK_ALARM_FILTER_USER_GROUP = "ClickAlarmFilterUserGroup"; - $at.CLK_ALARM_ADD_USER = "ClickAlarmAddUser"; - $at.CLK_ALARM_REFRESH_USER = "ClickAlarmRefreshUser"; - $at.CLK_ALARM_FILTER_USER = "ClickAlarmFilterUser"; - $at.CLK_ALARM_CREATE_PINPOINT_USER = "ClickAlarmCreatePinpointUser"; - $at.CLK_ALARM_REFRESH_PINPOINT_USER = "ClickAlarmRefreshPinpointUser"; - $at.CLK_ALARM_FILTER_PINPOINT_USER = "ClickAlarmFilterPinpointUser"; - $at.CLK_ALARM_CREATE_RULE = "ClickAlarmCreateUserGroup"; - $at.CLK_ALARM_REFRESH_RULE = "ClickAlarmRefreshUserGroup"; - $at.CLK_ALARM_FILTER_RULE = "ClickAlarmFilterUserGroup"; - - - $at.TG_DATE = "ToggleDate"; - $at.TG_UPDATE_ON = "ToggleUpdateOn"; - $at.TG_NODE_VIEW = "ToggleNodeView"; - $at.TG_SCATTER_SUCCESS = "ToggleScatterSuccess"; - $at.TG_SCATTER_FAILED = "ToggleScatterFailed"; - $at.TG_MERGE_TYPE = "ToggleMergeType"; - $at.TG_CALL_COUNT = "ToggleCallCount"; - $at.TG_TPS = "ToggleTPS"; - $at.TG_ROUTING = "ToggleRouting"; - $at.TG_CURVE = "ToggleCurve"; - - $at.ST_ = "Sort"; - - $at.ASCENDING = "ascending"; - $at.DESCENDING = "descending"; - - $at.ON = "on"; - $at.OFF = "off"; - - $at.MAIN_PAGE = "/main.page"; - $at.FILTEREDMAP_PAGE = "/filteredMap.page"; - $at.INSPECTOR_PAGE = "/inspector.page"; - $at.SCATTER_FULL_SCREEN_PAGE = "/scatterFullScreen.page"; - $at.TRANSACTION_DETAIL_PAGE = "/transactionDetail.page"; - $at.TRANSACTION_LIST_PAGE = "/transactionList.page"; - $at.TRANSACTION_VIEW_PAGE = "/transactionView.page"; - - - global.$at = $at; - - $.ajax({ - url: "/configuration.pinpoint" - }).done(function( result ) { - bSendAllowed = result.sendUsage; - }).fail(function() { - - }); -})(window, jQuery); \ No newline at end of file From 0e35af7dc4d1682e73c1324b3da4046526d73417 Mon Sep 17 00:00:00 2001 From: Jongho Moon Date: Mon, 31 Aug 2015 15:57:34 +0900 Subject: [PATCH 4/5] Renamed class --- ...eRetransformer.java => DefaultDynamicTransformerRegistry.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename profiler/src/main/java/com/navercorp/pinpoint/profiler/{DefaultClassFileRetransformer.java => DefaultDynamicTransformerRegistry.java} (100%) diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/DefaultClassFileRetransformer.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/DefaultDynamicTransformerRegistry.java similarity index 100% rename from profiler/src/main/java/com/navercorp/pinpoint/profiler/DefaultClassFileRetransformer.java rename to profiler/src/main/java/com/navercorp/pinpoint/profiler/DefaultDynamicTransformerRegistry.java From 68f08cb2c25a6b25826710bbc0892900b236cd3b Mon Sep 17 00:00:00 2001 From: Jongho Moon Date: Mon, 31 Aug 2015 15:58:08 +0900 Subject: [PATCH 5/5] Use ConcurrentHashMap instead of MapMaker --- .../ClassFileTransformerDispatcher.java | 2 +- .../DefaultDynamicTransformerRegistry.java | 32 +++++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/ClassFileTransformerDispatcher.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/ClassFileTransformerDispatcher.java index e2003a0e5..f5a8e6056 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/ClassFileTransformerDispatcher.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/ClassFileTransformerDispatcher.java @@ -67,7 +67,7 @@ public class ClassFileTransformerDispatcher implements ClassFileTransformer, Dyn this.agent = agent; this.byteCodeInstrumentor = byteCodeInstrumentor; - this.dynamicTransformerRegistry = new DefaultClassFileRetransformer(); + this.dynamicTransformerRegistry = new DefaultDynamicTransformerRegistry(); this.profilerConfig = agent.getProfilerConfig(); this.modifierRegistry = createModifierRegistry(pluginContexts); this.skipFilter = new DefaultClassFileFilter(agentClassLoader); diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/DefaultDynamicTransformerRegistry.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/DefaultDynamicTransformerRegistry.java index e26ba1008..e3c3d7107 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/DefaultDynamicTransformerRegistry.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/DefaultDynamicTransformerRegistry.java @@ -17,36 +17,34 @@ package com.navercorp.pinpoint.profiler; import java.lang.instrument.ClassFileTransformer; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.navercorp.pinpoint.profiler.util.Maps; - -public class DefaultClassFileRetransformer implements DynamicTrnasformerRegistry { +public class DefaultDynamicTransformerRegistry implements DynamicTrnasformerRegistry { private final Logger logger = LoggerFactory.getLogger(this.getClass()); - - private final ConcurrentMap transformerMap = Maps.newWeakConcurrentMap(); + private final ConcurrentMap transformerMap = new ConcurrentHashMap(); @Override public void onRetransformRequest(Class target, final ClassFileTransformer transformer) { - if (logger.isInfoEnabled()) { - logger.info("addRetransformEvent class:{}", target.getName()); - } - add(target.getClassLoader(), target.getName(), transformer); + + if (logger.isInfoEnabled()) { + logger.info("added retransformer classLoader: {}, class: {}, registry size: {}", target.getClassLoader(), target.getName(), transformerMap.size()); + } } @Override public void onTransformRequest(ClassLoader classLoader, String targetClassName, ClassFileTransformer transformer) { - if (logger.isInfoEnabled()) { - logger.info("addDynamicTransformer classLoader:{] className:{}", classLoader, targetClassName); - } - add(classLoader, targetClassName, transformer); + + if (logger.isInfoEnabled()) { + logger.info("added dynamic transformer classLoader: {}, className: {}, registry size: {}", classLoader, targetClassName, transformerMap.size()); + } } private void add(ClassLoader classLoader, String targetClassName, ClassFileTransformer transformer) { @@ -63,7 +61,13 @@ public class DefaultClassFileRetransformer implements DynamicTrnasformerRegistry return null; } - return transformerMap.remove(new TransformerKey(classLoader, targetClassName)); + ClassFileTransformer transformer = transformerMap.remove(new TransformerKey(classLoader, targetClassName)); + + if (logger.isDebugEnabled()) { + logger.info("removed dynamic transformer classLoader: {}, className: {}, registry size: {}", classLoader, targetClassName, transformerMap.size()); + } + + return transformer; } private static final class TransformerKey {