From 567b1f702c7ac27450e8dab6417aef595b823210 Mon Sep 17 00:00:00 2001 From: Graham Gilbert Date: Tue, 11 Aug 2015 10:00:59 +0100 Subject: [PATCH] The plugin actually shows things now --- server/plugins/salscriptsversion/salscriptsversion.py | 4 ++-- server/plugins/salscriptsversion/templates/front.html | 4 ++-- server/plugins/salscriptsversion/templates/id.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/plugins/salscriptsversion/salscriptsversion.py b/server/plugins/salscriptsversion/salscriptsversion.py index 9aff02f6..539d0ad6 100644 --- a/server/plugins/salscriptsversion/salscriptsversion.py +++ b/server/plugins/salscriptsversion/salscriptsversion.py @@ -28,7 +28,7 @@ def show_widget(self, page, machines=None, theid=None): machines = Machine.objects.filter(machine_group=machine_group) if machines: - sal_info = machines.values('sal_version').annotate(count=Count('sal_version')).order_by() + sal_info = machines.values('sal_version').exclude(sal_version__isnull=True).annotate(count=Count('sal_version')).order_by() else: sal_info = [] @@ -45,6 +45,6 @@ def filter_machines(self, machines, data): machines = machines.filter(sal_version__exact=data) - title = 'Machines running version '+data+' of Sa;' + title = 'Machines running version '+data+' of Sal' return machines, title \ No newline at end of file diff --git a/server/plugins/salscriptsversion/templates/front.html b/server/plugins/salscriptsversion/templates/front.html index 99ab8817..876ca4ff 100644 --- a/server/plugins/salscriptsversion/templates/front.html +++ b/server/plugins/salscriptsversion/templates/front.html @@ -19,7 +19,7 @@ element: 'salversiongraph', data: [ {% for item in data|dictsort:'sal_version' %} -{% if item.munki_version %} +{% if item.sal_version %} { label: "{{ item.sal_version }}", value: {{ item.count }} @@ -31,7 +31,7 @@ resize: true }).on('click', function(i, row){ console.log(row['label']); - var url_mask = "{% url 'machine_list_front' 'SalVersion' 'abc123' %}".replace(/abc123/, row['label'].toString()); + var url_mask = "{% url 'machine_list_front' 'SalScriptsVersion' 'abc123' %}".replace(/abc123/, row['label'].toString()); window.location=url_mask; }); }); diff --git a/server/plugins/salscriptsversion/templates/id.html b/server/plugins/salscriptsversion/templates/id.html index 8a6de950..34176837 100644 --- a/server/plugins/salscriptsversion/templates/id.html +++ b/server/plugins/salscriptsversion/templates/id.html @@ -19,7 +19,7 @@ element: 'salversiongraph', data: [ {% for item in data|dictsort:'sal_version' %} -{% if item.munki_version %} +{% if item.sal_version %} { label: "{{ item.sal_version }}", value: {{ item.count }} @@ -31,7 +31,7 @@ resize: true }).on('click', function(i, row){ console.log(row['label']); - var url_mask = "{% url 'machine_list_id' 'MunkiVersion' 'abc123' page theid %}".replace(/abc123/, row['label'].toString()); + var url_mask = "{% url 'machine_list_id' 'SalScriptsVersion' 'abc123' page theid %}".replace(/abc123/, row['label'].toString()); window.location=url_mask; }); });