Skip to content

Commit

Permalink
Merge pull request #1706 from denzelsN/master
Browse files Browse the repository at this point in the history
update alarm ui and ux of configuration
  • Loading branch information
denzelsN committed Apr 22, 2016
2 parents 122b2db + 2a37166 commit a07712d
Show file tree
Hide file tree
Showing 20 changed files with 2,236 additions and 2,070 deletions.
4 changes: 2 additions & 2 deletions web/src/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ module.exports = function (grunt) {
'common/services/server-map-hint-vo.service.js',
'common/services/is-visible.service.js',
'common/services/user-locales.service.js',
'common/help/help-content-en.js',
'common/help/help-content-ko.js',
//'common/help/help-content-en.js',
//'common/help/help-content-ko.js',
'common/help/help-content-template.js',
'common/services/help-content.service.js',
'common/services/analytics.service.js',
Expand Down
2 changes: 1 addition & 1 deletion web/src/main/webapp/common/help/help-content-ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
var oHelp = {
configuration: {
general: {
warning: "(설정 정보는 브라우저 캐쉬에 저장합니다. 서버 측 저장은 추후 지원 할 예정입니다.)",
warning: "* 설정 정보는 브라우저 캐쉬에 저장합니다. 서버 측 저장은 추후 지원 할 예정입니다.",
empty: "등록된 목록이 없습니다."
},
alarmRules: {
Expand Down
35 changes: 24 additions & 11 deletions web/src/main/webapp/common/services/alarm-broadcast.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,30 @@
* @class
*/

pinpointApp.service('AlarmBroadcastService', [ '$rootScope', function ($rootScope) {
pinpointApp.service("AlarmBroadcastService", [ "$rootScope", "globalConfig", function ( $rootScope, globalConfig ) {
var self = this;
// from userGroup
this.sendInit = function( userGroupID, willBeAddedUser ) {
self.sendReloadWithUserGroupID( userGroupID, willBeAddedUser );
};
this.sendLoadPinpointUser = function( userDepartment ) {
$rootScope.$broadcast( "alarmPinpointUser.configuration.load", userDepartment );
this.sendInit = function( userGroupId ) {
self.sendReloadWithUserGroupID( userGroupId, globalConfig.userId ? {
userId: globalConfig.userId,
name: globalConfig.userName,
department: globalConfig.userDepartment
} : {} );
};
this.sendLoadPinpointUser = function() {
// if ( globalConfig.userId ) {
$rootScope.$broadcast("alarmPinpointUser.configuration.load", globalConfig.userDepartment );
// }
};
// from userGroup
this.sendReloadWithUserGroupID = function( userGroupID, willBeAddedUser ) {
$rootScope.$broadcast( "alarmGroupMember.configuration.load", userGroupID, willBeAddedUser );
$rootScope.$broadcast( "alarmRule.configuration.load", userGroupID );
this.sendReloadWithUserGroupID = function( userGroupId, willBeAddedUser ) {
$rootScope.$broadcast( "alarmGroupMember.configuration.load", userGroupId, willBeAddedUser );
$rootScope.$broadcast( "alarmRule.configuration.load", userGroupId );
};
// from userGroup
this.sendSelectionEmpty = function() {
$rootScope.$broadcast( "alarmGroupMember.configuration.selectNone" );
$rootScope.$broadcast( "alarmPinpointUser.configuration.selectNone" );
$rootScope.$broadcast( "alarmRule.configuration.selectNone" );
};
// groupMember -> pinpointUser
Expand All @@ -41,8 +48,14 @@
$rootScope.$broadcast( "alarmGroupMember.configuration.updateUser", oUser );
};
// pinpointUser - > groupMember
this.sendUserRemoved = function( userID ) {
$rootScope.$broadcast( "alarmGroupMember.configuration.removeUser", userID );
this.sendUserRemoved = function( userId ) {
$rootScope.$broadcast( "alarmGroupMember.configuration.removeUser", userId );
};
this.sendGroupMemberLoaded = function( oGroupMemberList ) {
$rootScope.$broadcast( "alarmPinpointUser.configuration.groupLoaded", oGroupMemberList );
};
this.sendGroupMemberRemoved = function( oGroupMemberList, userId ) {
$rootScope.$broadcast( "alarmPinpointUser.configuration.groupUserRemoved", oGroupMemberList, userId );
}
}]);
})(jQuery);
85 changes: 72 additions & 13 deletions web/src/main/webapp/common/services/alarm-util.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"hasNotEditClass": "has-not-edit"
});

pinpointApp.service('AlarmUtilService', [ 'AlarmUtilServiceConfig', 'AlarmAjaxService', function ($config, $ajaxService) {
pinpointApp.service( "AlarmUtilService", [ "AlarmUtilServiceConfig", "AlarmAjaxService", "globalConfig", function ( $config, $ajaxService, globalConfig ) {
var self = this;
this.show = function( $el ) {
$el.removeClass( $config.hideClass );
Expand All @@ -23,34 +23,93 @@
arguments[i].addClass( $config.hideClass );
}
};
this.showLoading = function( $elLoading, isEdit ) {
$elLoading[ isEdit ? "removeClass" : "addClass" ]( $config.hasNotEditClass );
$elLoading.removeClass( $config.hideClass );
};
// this.showLoading = function( $elLoading, isEdit ) {
// $elLoading[ isEdit ? "removeClass" : "addClass" ]( $config.hasNotEditClass );
// $elLoading.removeClass( $config.hideClass );
// };
this.showAlert = function( $elAlert, message ) {
$elAlert.find(".message").html( message ).end().removeClass( $config.hideClass ).animate({
height: 300
}, 500, function() {});
};
this.sendCRUD = function( funcName, data, successCallback, failCallback, $elAlert ) {
this.sendCRUD = function( funcName, data, successCallback, failCallback ) {
if ( ( angular.isUndefined( data ) || data === "" ) ) {
data = {
"userId" : ( globalConfig.userId || "" )
};
}

$ajaxService[funcName]( data, function( resultData ) {
if ( resultData.errorCode || resultData.status ) {
self.showAlert( $elAlert, resultData.errorMessage || resultData.statusText );
failCallback( resultData );
} else {
successCallback( resultData );
}
});
/*
switch( funcName ) {
case "getGroupMemberListInGroup":
successCallback([{
memberId: 1,
department: "Paas",
name: "정민우"
},{
memberId: 2,
department: "Paas",
name: "정현길"
}]);
break;
case "removeMemberInGroup":
successCallback();
break;
case "getUserGroupList":
successCallback([{
number: 1,
id: "pinpoint-monitor-group"
}, {
number: 2,
id: "pinpoint-dev-group"
}]);
break;
case "getPinpointUserList":
successCallback([{
userId: 1,
department: "PaaS",
name: "김성관"
},{
userId: 2,
department: "PaaS",
name: "문성호"
},{
userId: 3,
department: "PaaS",
name: "송효종"
},{
userId: 4,
department: "PaaS",
name: "정민우"
}]);
break;
case "createUserGroup":
successCallback({
id: data.id,
number: parseInt( Math.random() * 10000 )
});
break;
case "updateUserGroup":
successCallback();
break;
case "removeUserGroup":
successCallback();
break;
default:
break;
}
*/
};
this.setTotal = function( $elTotal, n ) {
$elTotal.html( "(" + n + ")");
};
this.setFilterBackground = function( $elWrapper ) {
$elWrapper.css("background-color", "#FFFFF1");
};
this.unsetFilterBackground = function( $elWrapper ) {
$elWrapper.css("background-color", "#FFF");
};
this.hasDuplicateItem = function( list, func ) {
var len = list.length;
var has = false;
Expand Down
14 changes: 7 additions & 7 deletions web/src/main/webapp/common/services/preference.service.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function() {
(function( $ ) {
'use strict';
/**
* (en)PreferenceService
Expand Down Expand Up @@ -44,9 +44,9 @@
var aFavoriteList = [];

loadPreference();

this.addFavorite = function( applicationName ) {
if ( aFavoriteList.length == cfg.cst.maxFavorite || aFavoriteList.indexOf( applicationName ) !== -1 ) {
if ( aFavoriteList.length === cfg.cst.maxFavorite || aFavoriteList.indexOf( applicationName ) !== -1 ) {
return;
}
aFavoriteList.push( applicationName );
Expand Down Expand Up @@ -87,7 +87,7 @@
};
this.getResponseTypeFormat = function() {
var o = {};
jQuery.each( cfg.cst.responseType, function( index, value ) {
$.each( cfg.cst.responseType, function( index, value ) {
o[value] = 0;
});
return o;
Expand Down Expand Up @@ -117,7 +117,7 @@
function loadPreference() {
// set value of webStorage or default
// and make getter and setter function
jQuery.each( cfg.list, function( index, value ) {
$.each( cfg.list, function( index, value ) {
var name = value.name;
oDefault[name] = webStorage.get( name ) || cfg.defaults[name];
switch( value.type ) {
Expand All @@ -134,8 +134,8 @@
oDefault[name] = v;
};
});
aFavoriteList = webStorage.get(cfg.names.favorite) || [];
aFavoriteList = JSON.parse( webStorage.get(cfg.names.favorite) || "[]" );
}

}]);
})();
})( jQuery );
Loading

0 comments on commit a07712d

Please # to comment.