mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-22 19:27:13 +10:00
Merge pull request #1164 from denzelsN/master
add user group search in alarm.
This commit is contained in:
@@ -37,8 +37,8 @@
|
||||
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 $elSearchInput = $element.find("div.filter-input input");
|
||||
var $elSearchEmpty = $element.find("div.filter-input button.trash");
|
||||
var $elEdit = $element.find(".some-edit-content");
|
||||
var $elEditInput = $elEdit.find("input");
|
||||
var $elEditGuide = $elEdit.find(".title-message");
|
||||
@@ -83,7 +83,7 @@
|
||||
});
|
||||
function reset() {
|
||||
alarmUtilService.unsetFilterBackground( $elWrapper );
|
||||
$elFilterInput.val("");
|
||||
$elSearchInput.val("");
|
||||
}
|
||||
|
||||
function removeConfirm( $el ) {
|
||||
@@ -161,8 +161,9 @@
|
||||
isRemoving = false;
|
||||
}, function( errorData ) {}, $elAlert );
|
||||
}
|
||||
function loadGroupList( isFirst ) {
|
||||
alarmUtilService.sendCRUD( "getUserGroupList", { "userId" : (globalConfig.userId || "") }, function( resultData ) {
|
||||
function loadGroupList( isFirst, sParam ) {
|
||||
alarmUtilService.sendCRUD( "getUserGroupList",
|
||||
angular.isUndefined(sParam) || sParam == "" ? { "userId" : (globalConfig.userId || "") } : { "userGroupId" : sParam }, function( resultData ) {
|
||||
// @TODO
|
||||
// 많이 쓰는 놈 기준 3개를 뽑아 내야 함.
|
||||
isLoadedUserGroupList = true;
|
||||
@@ -189,7 +190,7 @@
|
||||
analyticsService.send( analyticsService.CONST.MAIN, analyticsService.CONST.CLK_ALARM_REFRESH_USER_GROUP );
|
||||
reset();
|
||||
alarmUtilService.showLoading( $elLoading, false );
|
||||
loadGroupList( false );
|
||||
loadGroupList( false, $.trim( $elSearchInput.val() ) );
|
||||
};
|
||||
scope.onCreate = function() {
|
||||
if ( isRemoving == true ) return;
|
||||
@@ -213,51 +214,17 @@
|
||||
alarmUtilService.show( $elEdit );
|
||||
$elEditInput.focus().select();
|
||||
};
|
||||
scope.onInputFilter = function($event) {
|
||||
scope.onSearch = function() {
|
||||
if ( isRemoving == true ) return;
|
||||
|
||||
if ( $event.keyCode == 13 ) { // Enter
|
||||
scope.onFilterGroup();
|
||||
return;
|
||||
}
|
||||
if ($.trim( $elFilterInput.val() ).length >= 3 ) {
|
||||
$elFilterEmpty.removeClass("disabled");
|
||||
} else {
|
||||
$elFilterEmpty.addClass("disabled");
|
||||
}
|
||||
};
|
||||
scope.onFilterGroup = function() {
|
||||
if ( isRemoving == true ) return;
|
||||
var query = $.trim( $elFilterInput.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.");
|
||||
return;
|
||||
}
|
||||
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 );
|
||||
}
|
||||
$elFilterEmpty.addClass("disabled");
|
||||
} else {
|
||||
var newFilterUserGroup = [];
|
||||
var length = userGroupList.length;
|
||||
for( var i = 0 ; i < userGroupList.length ; i++ ) {
|
||||
if ( userGroupList[i].id.indexOf( query ) != -1 ) {
|
||||
newFilterUserGroup.push( userGroupList[i] );
|
||||
}
|
||||
}
|
||||
scope.userGroupList = newFilterUserGroup;
|
||||
alarmUtilService.setFilterBackground( $elWrapper );
|
||||
}
|
||||
};
|
||||
scope.onFilterEmpty = function() {
|
||||
if ( isRemoving == true ) return;
|
||||
if ( $.trim( $elFilterInput.val() ) == "" ) return;
|
||||
$elFilterInput.val("");
|
||||
scope.onFilterGroup();
|
||||
alarmUtilService.showLoading( $elLoading, false );
|
||||
loadGroupList( false, query );
|
||||
};
|
||||
scope.onInputEdit = function($event) {
|
||||
if ( $event.keyCode == 13 ) { // Enter
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<div class="filter-input">
|
||||
<input type="text" placeholder="Filter user group" ng-keydown="onInputFilter($event)"/>
|
||||
<button class="btn btn-primary disabled trash" ng-click="onFilterEmpty()"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button>
|
||||
<button class="btn btn-primary" ng-click="onFilterGroup()" style="margin-right:2px"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
|
||||
<input type="text" placeholder="Search user group"/>
|
||||
<button class="btn btn-primary" ng-click="onSearch()" style="margin-right:2px"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="some-edit-content hide-me">
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
{ "title": "Quick start guide", "link": "https://github.com/naver/pinpoint/blob/master/quickstart/README.md" },
|
||||
{ "title": "Technical Overview of Pinpoint", "link": "https://github.com/naver/pinpoint/wiki/Technical-Overview-Of-Pinpoint" },
|
||||
{ "title": "Using Pinpont with Docker", "link": "http://yous.be/2015/05/05/using-pinpoint-with-docker/" },
|
||||
{ "title": "Notes on Jetty Plugin for Pinpoint ", "link": "https://github.com/cijung/Docs/blob/master/JettyPluginNotes.md" }
|
||||
{ "title": "Notes on Jetty Plugin for Pinpoint ", "link": "https://github.com/cijung/Docs/blob/master/JettyPluginNotes.md" },
|
||||
{ "title": "About Alarm", "link": "https://github.com/naver/pinpoint/blob/master/doc/alarm.md#alarm" }
|
||||
];
|
||||
$scope.koHelpList = [
|
||||
{ "title": "Pinpoint 개발자가 작성한 Pinpoint 기술문서", "link": "http://helloworld.naver.com/helloworld/1194202" },
|
||||
@@ -21,7 +22,8 @@
|
||||
{ "title": "Pinpoint 사용 경험", "link": "http://www.barney.pe.kr/blog/category/development/page/2/" },
|
||||
{ "title": "설치 가이드 동영상 강좌 1", "link": "https://www.youtube.com/watch?v=hrvKaEaDEGs" },
|
||||
{ "title": "설치 가이드 동영상 강좌 2", "link": "https://www.youtube.com/watch?v=fliKPGHGXK4" },
|
||||
{ "title": "AWS Ubuntu 14.04 설치 가이드 ", "link": "http://lky1001.tistory.com/132" }
|
||||
{ "title": "AWS Ubuntu 14.04 설치 가이드 ", "link": "http://lky1001.tistory.com/132" },
|
||||
{ "title": "Alarm 가이드", "link": "https://github.com/naver/pinpoint/blob/master/doc/alarm.md#alarm-1" }
|
||||
];
|
||||
}
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user