diff --git a/src/api/index.py b/src/api/index.py index 54c9fdc..5986b4d 100644 --- a/src/api/index.py +++ b/src/api/index.py @@ -253,8 +253,17 @@ def get_folders(): d = gReader.read() if 'folders' in d: d = d['folders'] - index = len(d) - 1 - d = d[index] + hosts = set([row[0]['id'] for row in d]) + m = {} + for id in hosts: + for row in d: + if id == row[0]['id'] : + m[id] = row + d = m.values() + for row in d: + print row[0]['id'] + # index = len(d) - 1 + # d = d[index] # m = {} diff --git a/src/api/static/js/dashboard.js b/src/api/static/js/dashboard.js index 2360b2f..26a271d 100644 --- a/src/api/static/js/dashboard.js +++ b/src/api/static/js/dashboard.js @@ -408,7 +408,7 @@ monitor.folders.search.init = function(){ term = term.replace(/\x32/g,'') if (term.length == 0) { monitor.folders.render.summary(data) - } else if (term.length > 3) { + } else if (term.length > 0) { data = jx.utils.patterns.visitor(data, function (row) { if (row.id.match(term)) { @@ -517,9 +517,9 @@ monitor.folders.render.summary = function (data) { } options.paging = true options.pageSize = 4 - options.pageIndex = 1 + options.pageIndex = 2 options.pageButtonCount = 4 - options.pagerContainer = '#latest_process_pager' + options.pagerContainer = '#folderspager' options.pagerFormat= "{prev} Page {pageIndex} of {pageCount} {next}" options.pagePrevText= '' options.pageNextText= " " @@ -546,7 +546,7 @@ monitor.folders.render.summary = function (data) { options.autoload = true options.fields = [ { name: 'id', type: 'text', title: "Host", headercss: "small bold", css: "small"}, - { name: 'label', type: 'text', title: "Folder Name", headercss: "small bold", css: "small"}, + { name: 'name', type: 'text', title: "Folder Name", headercss: "small bold", css: "small"}, { name: "size", type: "number", title: "Folder Size", type: "number", headercss: "small bold" }, { name: "count", type: "number", title: "File Count", type: "number", headercss: "small bold" } diff --git a/src/api/templates/dashboard.html b/src/api/templates/dashboard.html index 10216fb..ccc3162 100644 --- a/src/api/templates/dashboard.html +++ b/src/api/templates/dashboard.html @@ -114,9 +114,9 @@ -
+
-
+
diff --git a/src/monitor.py b/src/monitor.py index 3429cc3..ad85026 100755 --- a/src/monitor.py +++ b/src/monitor.py @@ -293,9 +293,13 @@ class FileWatch(Analysis): xo = np.array(ML.Extract(['size','age'],xo_raw)) if len(xo) == 0: continue - name = re.findall("([a-z,A-Z,0-9]+$)",folder) - if len(name) == 0: + name = re.findall("([a-z,A-Z,0-9]+)",folder) + name = folder.split(os.sep) + if len(name) == 1: name = [folder] + else: + i = len(name) -1 + name = [name[i-1]+' '+name[i]] name = name[0] size = round(np.sum(xo[:,0]),2) diff --git a/src/utils/agents/data-collector.py b/src/utils/agents/data-collector.py index 7aebede..e727346 100644 --- a/src/utils/agents/data-collector.py +++ b/src/utils/agents/data-collector.py @@ -79,7 +79,8 @@ class ICollector(Thread) : label = thread.getName() row = {} if label == 'folders': - row = [ dict({"id":self.id}, **_row) for _row in data] + row = [ dict({"id":self.id}, **_row) for _row in data] + else: label = id row = data