diff --git a/README.md b/README.md index a462fb6b..471f89a9 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,8 @@ It has support for multiple PuppetDB servers. ### Dependencies -It is using the V4 PuppetDB API, so therefore it needs PuppetDB 2.0. This is -currently marked as experimental, so PuppetDB 2.1 will likely break -compatibility but we should be able to create a fix for that quickly. +It is using the V4 PuppetDB API from PuppetDB 2.1. Version 1.0.0 works with +PuppetDB 2.0, but the current version only works with PuppetDB 2.1. ### Screenshots diff --git a/app/controllers/nodelist/nodelist.coffee b/app/controllers/nodelist/nodelist.coffee index 0b33868d..1d835445 100644 --- a/app/controllers/nodelist/nodelist.coffee +++ b/app/controllers/nodelist/nodelist.coffee @@ -22,7 +22,7 @@ angular.module("app").controller "NodeListCtrl", class { offset: @Pagination.offset() limit: @Pagination.perPage - "order-by": angular.toJson([field: "name", order: "asc"]) + "order-by": angular.toJson([field: "certname", order: "asc"]) }, (data, total) => @Pagination.numItems(total) @@ -42,7 +42,7 @@ angular.module("app").controller "NodeListCtrl", class @PuppetDB.parseAndQuery( "event-counts" null - ["and", ["=", "certname", node.name], ["=", "latest-report?", true]], + ["and", ["=", "certname", node.certname], ["=", "latest-report?", true]], 'summarize-by': 'certname' 'order-by': angular.toJson([field: "certname", order: "asc"]) do (node) -> @@ -67,7 +67,7 @@ angular.module("app").controller "NodeListCtrl", class @PuppetDB.parseAndQuery( "facts" null - ["=", "certname", node.name], + ["=", "certname", node.certname], 'order-by': angular.toJson([field: "name", order: "asc"]) do (node) -> (data, total) -> @@ -85,7 +85,7 @@ angular.module("app").controller "NodeListCtrl", class # Returns: `undefined` fetchSelectedNode: () => for node in @nodes - if node.name == @$location.search().node + if node.certname == @$location.search().node @selectNode(node) @@ -109,7 +109,7 @@ angular.module("app").controller "NodeListCtrl", class @$location.search('node', null) @selectedNode = null else - @$location.search('node', node.name) + @$location.search('node', node.certname) @selectedNode = node unless node.facts? @fetchNodeFacts(node) diff --git a/app/controllers/nodelist/nodelist.tpl.html b/app/controllers/nodelist/nodelist.tpl.html index 01bc496f..c595c2d8 100644 --- a/app/controllers/nodelist/nodelist.tpl.html +++ b/app/controllers/nodelist/nodelist.tpl.html @@ -16,13 +16,13 @@
Fact | diff --git a/app/services/puppetdb/puppetdb.coffee b/app/services/puppetdb/puppetdb.coffee index 66f8fa8e..dcb08330 100644 --- a/app/services/puppetdb/puppetdb.coffee +++ b/app/services/puppetdb/puppetdb.coffee @@ -30,13 +30,10 @@ angular.module('app').factory "PuppetDB", ($http, # Public: Parse a query # # query - The {String} query to parse - # nodeQuery - A {Boolean} specifying if it should be - # parsed for the nodes endpoint or other endpoints. # # Returns: The resulting query - parse: (query, nodeQuery) -> + parse: (query) -> if query - @puppetdbquery.yy.nodeQuery = nodeQuery @puppetdbquery.parse query else null @@ -62,7 +59,7 @@ angular.module('app').factory "PuppetDB", ($http, parseAndQuery: (endpoint, nodeQuery, additionalQuery, params = {}, success) -> # Handle all the parsing of the query and putting them together if nodeQuery - query = @parse(nodeQuery, endpoint is "nodes") + query = @parse(nodeQuery) else query = null if additionalQuery
---|