eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject eagle git commit: [EAGLE-929] UI Policy definition stream group use group name
Date Fri, 24 Feb 2017 08:03:26 GMT
Repository: eagle
Updated Branches:
  refs/heads/master 086d11e1d -> a42f7891c


[EAGLE-929] UI Policy definition stream group use group name

Use group name instead of app name by stream group

Author: zombieJ <smith3816@gmail.com>

Closes #843 from zombieJ/EAGLE-929.


Project: http://git-wip-us.apache.org/repos/asf/eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/eagle/commit/a42f7891
Tree: http://git-wip-us.apache.org/repos/asf/eagle/tree/a42f7891
Diff: http://git-wip-us.apache.org/repos/asf/eagle/diff/a42f7891

Branch: refs/heads/master
Commit: a42f7891c90e654a6a74283f1eaedddd531ad39d
Parents: 086d11e
Author: zombieJ <smith3816@gmail.com>
Authored: Fri Feb 24 16:03:17 2017 +0800
Committer: zombieJ <smith3816@gmail.com>
Committed: Fri Feb 24 16:03:17 2017 +0800

----------------------------------------------------------------------
 .../partials/alert/policyEdit/advancedMode.html | 16 +++++++-------
 .../app/dev/public/js/ctrls/alertEditCtrl.js    | 22 ++++++++++----------
 2 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/a42f7891/eagle-server/src/main/webapp/app/dev/partials/alert/policyEdit/advancedMode.html
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/partials/alert/policyEdit/advancedMode.html
b/eagle-server/src/main/webapp/app/dev/partials/alert/policyEdit/advancedMode.html
index a2c09f1..f1952ec 100644
--- a/eagle-server/src/main/webapp/app/dev/partials/alert/policyEdit/advancedMode.html
+++ b/eagle-server/src/main/webapp/app/dev/partials/alert/policyEdit/advancedMode.html
@@ -52,22 +52,22 @@
 						<span class="fa fa-search"></span>
 					</div>
 
-					<p ng-hide="getSearchApplication()" class="text-warning">No stream match</p>
-					<div ng-show="getSearchApplication()">
-						<div ng-repeat="(app, streams) in getSearchApplication() track by app" class="policy-app-list">
-							<a data-toggle="collapse" href="[data-id='SP_{{app}}']">
+					<p ng-hide="getSearchStreamGroups()" class="text-warning">No stream match</p>
+					<div ng-show="getSearchStreamGroups()">
+						<div ng-repeat="(group, streams) in getSearchStreamGroups() track by group" class="policy-app-list">
+							<a data-toggle="collapse" href="[data-id='SP_{{group}}']">
 								<strong class="text-break">
 									<span class="fa" ng-class="searchType === 'site' ? 'fa-server' : 'fa-cube'"></span>
-									{{app}}
+									{{group}}
 								</strong>
 							</a>
-							<ul data-id="SP_{{app}}" class="collapse list-unstyled">
+							<ul data-id="SP_{{group}}" class="collapse in list-unstyled">
 								<li ng-repeat="stream in streams track by stream.streamId">
-									<a data-toggle="collapse" href="[data-id='SP_{{app}}_{{stream.streamId}}']" 
class="text-break">
+									<a data-toggle="collapse" href="[data-id='SP_{{group}}_{{stream.streamId}}']"
 class="text-break">
 										<span class="fa fa-{{isInputStreamSelected(stream.streamId) ? 'check-square'
: 'square'}}"></span>
 										{{stream.streamId}}
 									</a>
-									<ul data-id="SP_{{app}}_{{stream.streamId}}" class="collapse">
+									<ul data-id="SP_{{group}}_{{stream.streamId}}" class="collapse">
 										<li ng-repeat="column in stream.columns track by $index">
 											<span class="text-primary">[{{column.type}}]</span>
 											{{column.name}}

http://git-wip-us.apache.org/repos/asf/eagle/blob/a42f7891/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertEditCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertEditCtrl.js b/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertEditCtrl.js
index b32a87f..9e60b51 100644
--- a/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertEditCtrl.js
+++ b/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertEditCtrl.js
@@ -81,10 +81,10 @@
 
 		var cacheSiteId;
 		var cacheSearchSourceKey;
-		var searchApplications;
+		var searchStreamGroups;
 
 		$scope.searchSourceKey = "";
-		$scope.applications = {};
+		$scope.streamGroups = {};
 		$scope.newPolicy = !$scope.policy.name;
 		$scope.autoPolicyDescription = $scope.newPolicy && !$scope.policy.description;
 
@@ -104,7 +104,7 @@
 		// ==============================================================
 		// =                        Input Stream                        =
 		// ==============================================================
-		$scope.getSearchApplication = function() {
+		$scope.getSearchStreamGroups = function() {
 			var siteId = $scope.policy.siteId;
 
 			if(cacheSearchSourceKey !== $scope.searchSourceKey.toUpperCase() || cacheSiteId !== siteId)
{
@@ -114,10 +114,9 @@
 					cacheSearchSourceKey = $scope.searchSourceKey.toUpperCase();
 					cacheSiteId = siteId;
 
-					searchApplications = {};
-					$.each($scope.applications, function (appName, streams) {
+					searchStreamGroups = {};
+					$.each($scope.streamGroups, function (groupName, streams) {
 						$.each(streams, function (i, stream) {
-							var groupName = stream.dataSource;
 							if(
 								stream.siteId === siteId && (
 									groupName.toUpperCase().indexOf(cacheSearchSourceKey) >= 0 ||
@@ -125,7 +124,7 @@
 								)
 							) {
 								match = true;
-								var group = searchApplications[groupName] = searchApplications[groupName] || [];
+								var group = searchStreamGroups[groupName] = searchStreamGroups[groupName] || [];
 								group.push(stream);
 							}
 						});
@@ -133,20 +132,21 @@
 				}
 
 				if(!match) {
-					searchApplications = null;
+					searchStreamGroups = null;
 				}
 			}
-			return searchApplications;
+			return searchStreamGroups;
 		};
 
 		$scope.streams = {};
 		$scope.streamList = Entity.queryMetadata("streams");
 		$scope.streamList._then(function () {
-			$scope.applications = {};
+			$scope.streamGroups = {};
 			cacheSearchSourceKey = null;
 
 			$.each($scope.streamList, function (i, stream) {
-				var list = $scope.applications[stream.dataSource] = $scope.applications[stream.dataSource]
|| [];
+				var streamGroup = stream.group || 'Global';
+				var list = $scope.streamGroups[streamGroup] = $scope.streamGroups[streamGroup] || [];
 				list.push(stream);
 				$scope.streams[stream.streamId] = stream;
 			});


Mime
View raw message