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-608] UI update: metadata/policies/policy
Date Tue, 11 Oct 2016 04:02:42 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master 757f510a1 -> 6f9fb4eed


[EAGLE-608] UI update: metadata/policies/policy

metadata/policies/policy updated from array to entity. UI also need change.

Author: zombieJ <smith3816@gmail.com>

Closes #489 from zombieJ/EAGLE-608.


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

Branch: refs/heads/master
Commit: 6f9fb4eed47c7e4b4ff1b955861a4fdbf8cf296f
Parents: 757f510
Author: zombieJ <smith3816@gmail.com>
Authored: Tue Oct 11 12:02:32 2016 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Tue Oct 11 12:02:32 2016 +0800

----------------------------------------------------------------------
 .../app/dev/public/js/components/sortTable.js    |  7 +++++++
 .../webapp/app/dev/public/js/ctrls/alertCtrl.js  |  4 ++--
 .../app/dev/public/js/services/entitySrv.js      | 19 ++++++-------------
 .../webapp/app/dev/public/js/services/pageSrv.js |  4 ++--
 4 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6f9fb4ee/eagle-server/src/main/webapp/app/dev/public/js/components/sortTable.js
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/public/js/components/sortTable.js b/eagle-server/src/main/webapp/app/dev/public/js/components/sortTable.js
index 4143491..599d0eb 100644
--- a/eagle-server/src/main/webapp/app/dev/public/js/components/sortTable.js
+++ b/eagle-server/src/main/webapp/app/dev/public/js/components/sortTable.js
@@ -129,6 +129,13 @@
 				$scope.$watch($attrs.sortTable + ".length", function () {
 					cacheFilteredList = null;
 				});
+				$scope.$watch($attrs.sortTable + ".___SORT_TABLE___", function () {
+					var fullList = $scope.$parent[$attrs.sortTable];
+					if(fullList && !fullList.___SORT_TABLE___) {
+						fullList.___SORT_TABLE___ = +new Date;
+						cacheFilteredList = null;
+					}
+				});
 
 				function workMessage(event) {
 					var data = event.data;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6f9fb4ee/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 f2f8f96..b5eba07 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
@@ -84,13 +84,13 @@
 
 		$scope.startPolicy = function (policy) {
 			Entity
-				.put("metadata/policies/" + encodeURIComponent(policy.name) + "/status/ENABLED", {})
+				.post("metadata/policies/" + encodeURIComponent(policy.name) + "/status/ENABLED", {})
 				._then(updateList);
 		};
 
 		$scope.stopPolicy = function (policy) {
 			Entity
-				.put("metadata/policies/" + encodeURIComponent(policy.name) + "/status/DISABLED", {})
+				.post("metadata/policies/" + encodeURIComponent(policy.name) + "/status/DISABLED", {})
 				._then(updateList);
 		};
 	});

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6f9fb4ee/eagle-server/src/main/webapp/app/dev/public/js/services/entitySrv.js
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/public/js/services/entitySrv.js b/eagle-server/src/main/webapp/app/dev/public/js/services/entitySrv.js
index 029b05d..9dfba86 100644
--- a/eagle-server/src/main/webapp/app/dev/public/js/services/entitySrv.js
+++ b/eagle-server/src/main/webapp/app/dev/public/js/services/entitySrv.js
@@ -80,18 +80,6 @@
 			}));
 		};
 
-		Entity.put = function (url, entity) {
-			var list = [];
-			return wrapList(list, $http({
-				method: 'PUT',
-				url: _host + "/rest/" + url,
-				headers: {
-					"Content-Type": "application/json"
-				},
-				data: entity
-			}));
-		};
-
 		Entity.delete = function (url, uuid) {
 			var list = [];
 			return wrapList(list, $http({
@@ -133,8 +121,13 @@
 		Entity.queryMetadata = function (url) {
 			var metaList = Entity.query('metadata/' +  url);
 			metaList._then(function (res) {
+				var data = res.data;
+				if(!$.isArray(data)) {
+					data = [data];
+				}
+
 				metaList.splice(0);
-				Array.prototype.push.apply(metaList, res.data);
+				Array.prototype.push.apply(metaList, data);
 			});
 
 			return metaList;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6f9fb4ee/eagle-server/src/main/webapp/app/dev/public/js/services/pageSrv.js
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/public/js/services/pageSrv.js b/eagle-server/src/main/webapp/app/dev/public/js/services/pageSrv.js
index cd0e8b4..732f820 100644
--- a/eagle-server/src/main/webapp/app/dev/public/js/services/pageSrv.js
+++ b/eagle-server/src/main/webapp/app/dev/public/js/services/pageSrv.js
@@ -43,10 +43,10 @@
 	// ============================================================
 	var defaultPortalList = [
 		{name: "Home", icon: "home", path: "#/"},
-		{name: "Insight", icon: "heartbeat", list: [
+		/*{name: "Insight", icon: "heartbeat", list: [
 			{name: "Dashboards"},
 			{name: "Metrics"}
-		]},
+		]},*/
 		{name: "Alert", icon: "bell", list: [
 			{name: "Explore Alerts", path: "#/alert/"},
 			{name: "Manage Policies", path: "#/alert/policyList"},


Mime
View raw message