eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject incubator-eagle git commit: [EAGLE-239] UI Fix alert detail context
Date Fri, 15 Apr 2016 11:54:30 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master 1ea33dcc8 -> ed270c9e3


[EAGLE-239] UI Fix alert detail context

Alert entity use alertContext directly instead of alertContext.properties. Which sync update
with UI.

Author: jiljiang <jiljiang@ebay.com>

Closes #145 from zombieJ/fixAlert.


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

Branch: refs/heads/master
Commit: ed270c9e38f0316ecb9a2b6bcba5d1169d81ba2f
Parents: 1ea33dc
Author: jiljiang <jiljiang@ebay.com>
Authored: Fri Apr 15 19:54:15 2016 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Fri Apr 15 19:54:15 2016 +0800

----------------------------------------------------------------------
 .../main/webapp/app/public/feature/common/controller.js |  6 +++---
 .../app/public/feature/common/page/alertDetail.html     | 12 +++++++++---
 .../app/public/feature/common/page/alertList.html       |  6 ++----
 3 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ed270c9e/eagle-webservice/src/main/webapp/app/public/feature/common/controller.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/common/controller.js b/eagle-webservice/src/main/webapp/app/public/feature/common/controller.js
index 6f27956..18df6f9 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/common/controller.js
+++ b/eagle-webservice/src/main/webapp/app/public/feature/common/controller.js
@@ -1086,7 +1086,6 @@
 			var _list = Entities.queryEntities("AlertService", {
 				site: Site.current().tags.site,
 				application: $scope.application.tags.application,
-				hostname: null,
 				_pageSize: MAX_PAGESIZE,
 				_duration: 1000 * 60 * 60 * 24 * 30,
 				__ETD: 1000 * 60 * 60 * 24
@@ -1131,7 +1130,7 @@
 		});
 	});
 
-	// ========================= Alert List =========================
+	// ======================== Alert Detail ========================
 	feature.controller('alertDetail', function(PageConfig, Site, $scope, $wrapState, Entities)
{
 		PageConfig.pageTitle = "Alert Detail";
 		PageConfig.lockSite = true;
@@ -1153,6 +1152,7 @@
 				});
 			} else {
 				$scope.alert = $scope.alertList[0];
+				$scope.alert.rawAlertContext = JSON.stringify($scope.alert.alertContext, null, "\t");
 				Site.current(Site.find($scope.alert.tags.site));
 				console.log($scope.alert);
 			}
@@ -1160,7 +1160,7 @@
 
 		// UI
 		$scope.getMessageTime = function(alert) {
-			var _time = common.getValueByPath(alert, "alertContext.properties.timestamp");
+			var _time = common.getValueByPath(alert, "alertContext.timestamp");
 			return Number(_time);
 		};
 	});

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ed270c9e/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertDetail.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertDetail.html
b/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertDetail.html
index 798ca84..309fac3 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertDetail.html
+++ b/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertDetail.html
@@ -34,9 +34,6 @@
 			<dl><dt>Alert Time</dt><dd>{{common.format.date(alert.timestamp)}}</dd></dl>
 			<dl><dt>Message Time</dt><dd>{{common.format.date(alert.alertContext.properties.timestamp)}}</dd></dl>
 		</div>
-		<!--div class="inline-group">
-			<dl><dt>Severity</dt><dd>{{alert.alertContext.properties.severity}}</dd></dl>
-		</div-->
 		<div class="inline-group">
 			<dl><dt>Stream Name</dt><dd>{{alert.tags.sourceStreams}}</dd></dl>
 		</div>
@@ -58,4 +55,13 @@
 	<div class="overlay" ng-hide="alertList._promise.$$state.status === 1;">
 		<i class="fa fa-refresh fa-spin"></i>
 	</div>
+
+	<div class="box-footer clearfix">
+		<a data-toggle="collapse" href="[data-id='rawAlertContext']">
+			Raw Alert Context
+		</a>
+		<div data-id="rawAlertContext" class="collapse">
+			<pre>{{alert.rawAlertContext}}</pre>
+		</div>
+	</div>
 </div>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ed270c9e/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertList.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertList.html
b/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertList.html
index 0395b8e..0415cc0 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertList.html
+++ b/eagle-webservice/src/main/webapp/app/public/feature/common/page/alertList.html
@@ -35,10 +35,9 @@
 						<th width="170" sortpath="timestamp">Alert Time</th>
 						<th width="170" sortpath="alertContext.properties.timestamp">Message Time</th>
 						<th width="105" sortpath="tags.application">Application</th>
-						<!--th width="70" sortpath="severity">Type</th-->
 						<th width="150" sortpath="tags.policyId">Policy Name</th>
 						<th width="60" sortpath="alertContext.properties.user">User</th>
-						<th width="150" sortpath="alertContext.properties.host">Host</th>
+						<th width="150" sortpath="tags.alertSource">Source</th>
 						<th sortpath="alertContext.properties.emailMessage">Description</th>
 						<th width="50"> </th>
 					</tr>
@@ -48,14 +47,13 @@
 						<td>{{common.format.date(item.timestamp)}}</td>
 						<td>{{common.format.date(item.alertContext.properties.timestamp)}}</td>
 						<td>{{item.tags.application}}</td>
-						<!--td>{{item.severity}}</td-->
 						<td class="text-nowrap">
 							<a class="fa fa-share-square-o" ng-show="item.tags.policyId"
 							href="#/common/policyDetail/?policy={{item.tags.policyId}}&site={{item.tags.site}}&executor={{item.tags.alertExecutorId}}">
</a>
 							{{item.tags.policyId}}
 						</td>
 						<td>{{item.alertContext.properties.user}}</td>
-						<td>{{item.alertContext.properties.host}}</td>
+						<td>{{item.tags.alertSource}}</td>
 						<td>{{item.alertContext.properties.alertMessage}}</td>
 						<td><a href="#/common/alertDetail/{{item.encodedRowkey}}">Detail</a></td>
 					</tr>


Mime
View raw message