Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3579E200BD8 for ; Wed, 7 Dec 2016 11:03:53 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 33FD5160B0A; Wed, 7 Dec 2016 10:03:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 58572160AFD for ; Wed, 7 Dec 2016 11:03:52 +0100 (CET) Received: (qmail 74139 invoked by uid 500); 7 Dec 2016 10:03:51 -0000 Mailing-List: contact commits-help@eagle.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@eagle.incubator.apache.org Delivered-To: mailing list commits@eagle.incubator.apache.org Received: (qmail 74130 invoked by uid 99); 7 Dec 2016 10:03:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2016 10:03:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 19DBB1A5F0E for ; Wed, 7 Dec 2016 10:03:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.219 X-Spam-Level: X-Spam-Status: No, score=-2.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, URIBL_BLACK=4] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id tCE0pDadX-xL for ; Wed, 7 Dec 2016 10:03:49 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id CFD995F5F8 for ; Wed, 7 Dec 2016 10:03:48 +0000 (UTC) Received: (qmail 74114 invoked by uid 99); 7 Dec 2016 10:03:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2016 10:03:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 54C3CDFF56; Wed, 7 Dec 2016 10:03:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hao@apache.org To: commits@eagle.incubator.apache.org Message-Id: <5b41af4d073642df9bc7ce8d17b2034f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-eagle git commit: [EAGLE-830] update policy display info Date: Wed, 7 Dec 2016 10:03:48 +0000 (UTC) archived-at: Wed, 07 Dec 2016 10:03:53 -0000 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 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 Authored: Wed Dec 7 18:03:26 2016 +0800 Committer: Hao Chen 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 @@
  • {{stream}} +
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 @@ - Name + Name + Input Streams Description Action @@ -42,6 +43,13 @@ {{item.name}} + +
    +
  • + {{stream}} +
  • +
+ {{item.description}}
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: $("
").html(JSON.stringify(dataSource, null, "\t")),
+				size: "large"
+			});
+		};
+
 		$scope.alertList = CompatibleEntity.query("LIST", {
 			query: "AlertService",
 			condition: {policyId: $wrapState.param.name},