diff options
-rw-r--r-- | src/lib/Server/Reports/reports/templates/config_items/index.html | 8 | ||||
-rw-r--r-- | src/lib/Server/Reports/reports/views.py | 6 | ||||
-rw-r--r-- | src/lib/Server/Reports/urls.py | 1 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/Server/Reports/reports/templates/config_items/index.html b/src/lib/Server/Reports/reports/templates/config_items/index.html index 313e28633..04083344c 100644 --- a/src/lib/Server/Reports/reports/templates/config_items/index.html +++ b/src/lib/Server/Reports/reports/templates/config_items/index.html @@ -63,20 +63,20 @@ <input type="button" name="go" value="Go" - onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_modified eyedee=item.entry.id%}'+document.forms['timestamp-select'].date1.value+'@'+document.forms['timestamp-select'].time.value;" /> + onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_modified eyedee=item.id%}'+document.forms['timestamp-select'].date1.value+'@'+document.forms['timestamp-select'].time.value;" /> | <input type="button" name="now" value="Now" - onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_modified eyedee=item.entry.id%}';"/> + onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_modified eyedee=item.id %}';"/> {% else %} <input type="button" name="go" value="Go" - onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_bad eyedee=item.entry.id %}'+document.forms['timestamp-select'].date1.value+'@'+document.forms['timestamp-select'].time.value;"/> + onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_bad eyedee=item.id %}'+document.forms['timestamp-select'].date1.value+'@'+document.forms['timestamp-select'].time.value;"/> | <input type="button" name="now" value="Now" - onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_bad eyedee=item.entry.id %}';"/> + onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.config_item_bad eyedee=item.id %}';"/> {% endifequal %} </span></form> <br/><br/><br/></div> diff --git a/src/lib/Server/Reports/reports/views.py b/src/lib/Server/Reports/reports/views.py index b9fa371ef..cb8dbe650 100644 --- a/src/lib/Server/Reports/reports/views.py +++ b/src/lib/Server/Reports/reports/views.py @@ -40,8 +40,8 @@ def config_item_modified(request, eyedee =None, timestamp = 'now', type=TYPE_MOD cursor.execute("select client_id from reports_interaction, reports_entries_interactions, reports_client "+ "WHERE reports_entries_interactions.interaction_id IN %s "+ "AND reports_entries_interactions.interaction_id = reports_interaction.id "+ - "AND reports_entries_interactions.modified_id = %s " + - "AND reports_entries_interactions.type = %s ", [interactionlist, eyedee, type]) + "AND reports_entries_interactions.entry_id = %s " + + "AND reports_entries_interactions.type = %s ", [interactionlist, item.entry_id, type]) associated_client_list = Client.objects.active(timestamp).filter(id__in=[x[0] for x in cursor.fetchall()]) else: associated_client_list = [] @@ -131,7 +131,7 @@ def client_detailed_list(request, **kwargs): if entry_max: for client in client_list: try: - e = interaction.objects.filter(client=client).filter(timestamp__lt=entry_max).order_by('-timestamp')[0] + e = Interaction.objects.filter(client=client).filter(timestamp__lt=entry_max).order_by('-timestamp')[0] if 'server' in context and e.server != context['server']: continue if 'state' in context and e.state != context['state']: diff --git a/src/lib/Server/Reports/urls.py b/src/lib/Server/Reports/urls.py index 63c119d14..e1326b5ea 100644 --- a/src/lib/Server/Reports/urls.py +++ b/src/lib/Server/Reports/urls.py @@ -24,6 +24,7 @@ urlpatterns = patterns('', (r'^%sclients-detailed/server/(?P<server>[\w\-\.]+)/(?P<state>[A-Za-z]+)/$' % web_prefix,'Bcfg2.Server.Reports.reports.views.client_detailed_list'), (r'^%sclients-detailed/$' % web_prefix,'Bcfg2.Server.Reports.reports.views.client_detailed_list'), (r'^%sclients/(?P<timestamp>(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])@([01][0-9]|2[0-3]):([0-5][0-9]|60):([0-5][0-9]|60))/$' % web_prefix,'Bcfg2.Server.Reports.reports.views.client_index'), + (r'^%sclients/(?P<timestamp>(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])@([01][0-9]|2[0-3]):([0-5][0-9]|60):([0-5][0-9]|60))$' % web_prefix,'Bcfg2.Server.Reports.reports.views.client_index'), (r'^%sclients/(?P<hostname>\S+)/(?P<pk>\d+)/$' % web_prefix, 'Bcfg2.Server.Reports.reports.views.client_detail'), (r'^%sclients/(?P<hostname>\S+)/manage/$' % web_prefix, 'Bcfg2.Server.Reports.reports.views.client_manage'), (r'^%sclients/(?P<hostname>\S+)/$' % web_prefix, 'Bcfg2.Server.Reports.reports.views.client_detail'), |