You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by ha...@apache.org on 2016/12/07 10:03:48 UTC

incubator-eagle git commit: [EAGLE-830] update policy display info

Repository: incubator-eagle
Updated Branches:
  refs/heads/master dcf9e32f7 -> 3914e39dd


[EAGLE-830] update policy display info

* Policy detail support input stream detail
* Policy list display input stream

Author: zombieJ <sm...@gmail.com>

Closes #719 from zombieJ/EAGLE-830.


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

Branch: refs/heads/master
Commit: 3914e39ddce1bbadebdf56732e81701a6bdf5c70
Parents: dcf9e32
Author: zombieJ <sm...@gmail.com>
Authored: Wed Dec 7 18:03:26 2016 +0800
Committer: Hao Chen <ha...@apache.org>
Committed: Wed Dec 7 18:03:26 2016 +0800

----------------------------------------------------------------------
 .../app/dev/partials/alert/policyDetail.html    |  1 +
 .../app/dev/partials/alert/policyList.html      | 10 ++++-
 .../webapp/app/dev/public/js/ctrls/alertCtrl.js | 41 ++++++++++++++++++++
 3 files changed, 51 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/3914e39d/eagle-server/src/main/webapp/app/dev/partials/alert/policyDetail.html
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/partials/alert/policyDetail.html b/eagle-server/src/main/webapp/app/dev/partials/alert/policyDetail.html
index 7118c85..e21b91d 100644
--- a/eagle-server/src/main/webapp/app/dev/partials/alert/policyDetail.html
+++ b/eagle-server/src/main/webapp/app/dev/partials/alert/policyDetail.html
@@ -100,6 +100,7 @@
 							<ul class="no-margin">
 								<li ng-repeat="stream in policy.inputStreams track by $index">
 									{{stream}}
+									<a class="fa fa-plug" uib-tooltip="Click to view data source" ng-click="showDataSource(stream)"></a>
 								</li>
 							</ul>
 						</td>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/3914e39d/eagle-server/src/main/webapp/app/dev/partials/alert/policyList.html
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/partials/alert/policyList.html b/eagle-server/src/main/webapp/app/dev/partials/alert/policyList.html
index a52c51f..6502b19 100644
--- a/eagle-server/src/main/webapp/app/dev/partials/alert/policyList.html
+++ b/eagle-server/src/main/webapp/app/dev/partials/alert/policyList.html
@@ -29,7 +29,8 @@
 				<thead>
 					<tr>
 						<th sortpath="policyStatus" width="10"></th>
-						<th sortpath="name" width="20%">Name</th>
+						<th sortpath="name" width="10%">Name</th>
+						<th width="150">Input Streams</th>
 						<th>Description</th>
 						<th width="85">Action</th>
 					</tr>
@@ -42,6 +43,13 @@
 						<td>
 							<a ui-sref="policyDetail({name: item.name})">{{item.name}}</a>
 						</td>
+						<td>
+							<ul class="no-margin list-unstyled">
+								<li ng-repeat="stream in item.inputStreams track by $index">
+									{{stream}}
+								</li>
+							</ul>
+						</td>
 						<td>{{item.description}}</td>
 						<td class="text-center">
 							<div class="btn-group btn-group-xs">

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/3914e39d/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertCtrl.js b/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertCtrl.js
index 52f9796..02852f4 100644
--- a/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertCtrl.js
+++ b/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertCtrl.js
@@ -180,6 +180,47 @@
 		}
 		updatePolicy();
 
+		/*
+		 $scope.streamList = [];
+		 Entity.queryMetadata("streams")._then(function (res) {
+		 $scope.streamList = $.map(res.data, function (stream) {
+		 var application = Application.findProvider(stream.dataSource);
+		 return $.extend({application: application}, stream);
+		 });
+		 });
+
+		 $scope.dataSources = {};
+		 Entity.queryMetadata("datasources")._then(function(res) {
+		 $.each(res.data, function (i, dataSource) {
+		 $scope.dataSources[dataSource.name] = dataSource;
+		 });
+		 });
+		*/
+
+		var streams = {};
+		Entity.queryMetadata("datasources")._then(function(res) {
+			var dataSources = {};
+			$.each(res.data, function (i, dataSource) {
+				dataSources[dataSource.name] = dataSource;
+			});
+
+			Entity.queryMetadata("streams")._then(function (res) {
+				$.each(res.data, function (i, stream) {
+					streams[stream.streamId] = stream;
+					stream.dataSource = dataSources[stream.dataSource];
+				});
+			});
+		});
+
+		$scope.showDataSource = function (stream) {
+			var dataSource = streams[stream].dataSource;
+			$.dialog({
+				title: dataSource.name,
+				content: $("<pre class='text-break'>").html(JSON.stringify(dataSource, null, "\t")),
+				size: "large"
+			});
+		};
+
 		$scope.alertList = CompatibleEntity.query("LIST", {
 			query: "AlertService",
 			condition: {policyId: $wrapState.param.name},