diff options
Diffstat (limited to 'src/lib/Server/Reports/reports/templates')
22 files changed, 594 insertions, 606 deletions
diff --git a/src/lib/Server/Reports/reports/templates/404.html b/src/lib/Server/Reports/reports/templates/404.html new file mode 100644 index 000000000..168bd9fec --- /dev/null +++ b/src/lib/Server/Reports/reports/templates/404.html @@ -0,0 +1,8 @@ +{% extends 'base.html' %} +{% block title %}Bcfg2 - Page not found{% endblock %} +{% block fullcontent %} +<h2>Page not found</h2> +<p> +The page or object requested could not be found. +</p> +{% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/base-timeview.html b/src/lib/Server/Reports/reports/templates/base-timeview.html new file mode 100644 index 000000000..d0617cde7 --- /dev/null +++ b/src/lib/Server/Reports/reports/templates/base-timeview.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} + +{% block timepiece %} +<script type="text/javascript"> +function showCalendar() { + var cal = new CalendarPopup("calendar_div"); + cal.showYearNavigation(); + cal.select(document.forms['cal_form'].cal_date,'cal_link', + 'yyyy/MM/dd' {% if timestamp %}, '{{ timestamp|date:'Y/m/d' }}'{% endif %} ); + return false; +} +function bcfg2_check_date() { + var new_date = document.getElementById('cal_date').value; + if(new_date) { + document.cal_form.submit(); + } +} +document.write(getCalendarStyles()); +</script> +{% if not timestamp %}Rendered at {% now "Y-m-d H:i" %} | {% else %}View as of {{ timestamp|date:"Y-m-d H:i" }} | {% endif %}{% spaceless %} + <a id='cal_link' name='cal_link' href='#' onclick='showCalendar(); return false;' + >[change]</a> + <form method='post' action='{{ path }}' id='cal_form' name='cal_form'><input id='cal_date' name='cal_date' type='hidden' value=''/></form> +{% endspaceless %} +{% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/base.html b/src/lib/Server/Reports/reports/templates/base.html index d42e26960..64c105e34 100644 --- a/src/lib/Server/Reports/reports/templates/base.html +++ b/src/lib/Server/Reports/reports/templates/base.html @@ -1,55 +1,93 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<?xml version="1.0"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <title>{% block title %}Bcfg2 Reporting System{% endblock %}</title> - <link rel="stylesheet" type="text/css" href="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/boxypastel.css" /> - <link rel="stylesheet" type="text/css" href="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/base.css" /> - <script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/main.js"></script> - {% block extra_header_info %}{% endblock %} +<title>{% block title %}Bcfg2 Reporting System{% endblock %}</title> + +<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> +<meta http-equiv="Content-language" content="en" /> +<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> +<meta name="robots" content="noindex, nofollow" /> +<meta http-equiv="cache-control" content="no-cache" /> + +<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}/bcfg2_base.css" media="all" /> +<script type="text/javascript" src="{{ MEDIA_URL }}/bcfg2.js"></script> +<script type="text/javascript" src="{{ MEDIA_URL }}/date.js"></script> +<script type="text/javascript" src="{{ MEDIA_URL }}/AnchorPosition.js"></script> +<script type="text/javascript" src="{{ MEDIA_URL }}/CalendarPopup.js"></script> +<script type="text/javascript" src="{{ MEDIA_URL }}/PopupWindow.js"></script> +{% block extra_header_info %}{% endblock %} + </head> +<body onload="{% block body_onload %}{% endblock %}"> -<body> <div id="header"> - <div id="branding"> - <h1>Bcfg2 Reporting System</h1> + <a href="http://trac.mcs.anl.gov/projects/bcfg2"><img src='{{ MEDIA_URL }}/bcfg2_logo.png' + height='115' width='300' alt='Bcfg2' style='float:left; height: 115px' /></a> </div> - <div id="user-tools">...Change is Coming...</div> + +<div id="document"> + <div id="content"><div id="contentwrapper"> + {% block fullcontent %} + <div class='page_name'> + <h1>{% block pagebanner %}Page Banner{% endblock %}</h1> + <div id="timepiece">{% block timepiece %}Rendered at {% now "Y-m-d H:i" %}{% endblock %}</div> </div> - <div id="content-main"> - <div id="sidebar"> - {% block sidebar %} - <ul class="sidebar"> - <li><a href="{% url Bcfg2.Server.Reports.reports.views.client_index %}../" class="sidebar">Home</a></li> - <li> - <a href="{% url Bcfg2.Server.Reports.reports.views.client_index %}" class="sidebar">Clients</a> - <ul class="sidebar-level2"> - <li><a href="{% url Bcfg2.Server.Reports.reports.views.client_detailed_list %}" class="sidebar">Detailed List</a></li> - </ul> - </li> - <li> - <a href="{% url Bcfg2.Server.Reports.reports.views.display_index %}" class="sidebar">Displays</a> - <ul class="sidebar-level2"> - <li><a href="{% url Bcfg2.Server.Reports.reports.views.display_sys_view %}" class="sidebar">System</a></li> - <li><a href="{% url Bcfg2.Server.Reports.reports.views.display_summary %}" class="sidebar">Summary</a></li> - <li><a href="{% url Bcfg2.Server.Reports.reports.views.display_timing %}" class="sidebar">Timing</a></li> - </ul> - </li> - <li> - <span class="sidebar">Config Items</span> - <ul class="sidebar-level2"> - <li><a href="{% url Bcfg2.Server.Reports.reports.views.bad_item_index %}" class="sidebar">Bad</a></li> - <li><a href="{% url Bcfg2.Server.Reports.reports.views.modified_item_index %}" class="sidebar">Modified</a></li> - </ul> - </li> + <div class='detail_wrapper'> + {% block content %}{% endblock %} + </div> + {% endblock %} + </div></div><!-- content --> + <div id="sidemenucontainer"><div id="sidemenu"> + {% block sidemenu %} + <ul class='menu-level1'> + <li>Overview</li> + </ul> + <ul class='menu-level2'> + <li><a href="{% url reports_summary %}">Summary</a></li> + <li><a href="{% url reports_history %}">Recent Interactions</a></li> + <li><a href="{% url reports_timing %}">Timing</a></li> + </ul> + <ul class='menu-level1'> + <li>Clients</li> + </ul> + <ul class='menu-level2'> + <li><a href="{% url reports_grid_view %}">Grid View</a></li> + <li><a href="{% url reports_detailed_list %}">Detailed List</a></li> + <li><a href="{% url reports_client_manage %}">Manage</a></li> + </ul> + <ul class='menu-level1'> + <li>Entries Configured</li> + </ul> + <ul class='menu-level2'> + <li><a href="{% url reports_item_list "bad" %}">Bad</a></li> + <li><a href="{% url reports_item_list "modified" %}">Modified</a></li> + <li><a href="{% url reports_item_list "extra" %}">Extra</a></li> + </ul> +{% comment %} + TODO + <ul class='menu-level1'> + <li>Entry Types</li> + </ul> + <ul class='menu-level2'> + <li><a href="#">Action</a></li> + <li><a href="#">Package</a></li> + <li><a href="#">Path</a></li> + <li><a href="#">Service</a></li> + </ul> +{% endcomment %} + <ul class='menu-level1'> + <li><a href="http://trac.mcs.anl.gov/projects/bcfg2">Homepage</a></li> + <li><a href="http://doc.bcfg2.fourkitchens.com/index.html">Documentation</a></li> </ul> {% endblock %} + </div></div><!-- sidemenu --> + <div style='clear:both'></div> +</div><!-- document --> + <div id="footer"> + <span>Bcfg2 Version 1.1.0</span> </div> - <div id="container"> - {% block pagebanner %}{% endblock %} - {% block content %}{% endblock %} - </div> - </div> +<div id="calendar_div" style='position:absolute; visibility:hidden; background-color:white; layer-background-color:white;'></div> </body> </html> diff --git a/src/lib/Server/Reports/reports/templates/clients/client-nodebox.html b/src/lib/Server/Reports/reports/templates/clients/client-nodebox.html deleted file mode 100644 index 8dbd01d9a..000000000 --- a/src/lib/Server/Reports/reports/templates/clients/client-nodebox.html +++ /dev/null @@ -1,63 +0,0 @@ -{% load django_templating_sigh %} -{% if client %} - <a name="{{client.name}}"></a> - <div class="nodebox"> - <span class="notebox">Time Ran: {{interaction.timestamp}}</span> - <!--<span class="configbox">(-Insert Profile Name Here-)</span>--> - - <table class="invisitable"> - <tr><td width="43%"><h2>Node: <span class="nodename"> - <a href="{% url Bcfg2.Server.Reports.reports.views.client_detail hostname=client.name, pk=client.current_interaction.id %}">{{client.name}}</a></span></h2></td> - <td width="23%"> - {% if interaction.repo_rev_code %}Revision: {{interaction.repo_rev_code}}{% endif %} - </td> - <td width="33%"><div class="statusborder"> - <div class="greenbar" style="width: {{interaction.percentgood}}%;"> </div> - <div class="redbar" style="width: {{interaction.percentbad}}%;"> </div> - </div> - </td></tr> - </table> - {% if interaction.isclean %} - <div class="clean"> - <span class="nodelisttitle">Node is clean; Everything has been satisfactorily configured.</span> - </div> - {% endif %} - {% if interaction.isstale %} - <div class="warning"> - <span class="nodelisttitle">This node did not run within the last 24 hours-- it may be out of date.</span> - </div> - {% endif %} - {% if interaction.bad %} - <div class="bad"> - <span class="nodelisttitle"><a href="javascript:toggleLayer('{{client.name}}-bad');" title="Click to expand" class="commentLink">{{interaction.bad.count}}</a> items did not verify and are considered Dirty.<br /></span> - <div class="items" id="{{client.name}}-bad"><ul class="plain"> - {% for bad in interaction.bad|sortwell %} - <li><strong>{{bad.entry.kind}}: </strong><tt><a href="{% url Bcfg2.Server.Reports.reports.views.config_item_bad bad.id%}">{{bad.entry.name}}</a></tt></li> - {% endfor %} - </ul></div> - </div> - {% endif %} - {% if interaction.modified %} - <div class="modified"> - <span class="nodelisttitle"><a href="javascript:toggleLayer('{{client.name}}-modified');" title="Click to expand" class="commentLink">{{interaction.modified.count}}</a> items were modified in the last run.<br /></span> - <div class="items" id="{{client.name}}-modified"><ul class="plain"> - {% for modified in interaction.modified|sortwell %} - <li><strong>{{modified.entry.kind}}: </strong><tt><a href="{% url Bcfg2.Server.Reports.reports.views.config_item_modified modified.id %}">{{modified.entry.name}}</a></tt></li> - {% endfor %} - </ul></div> - </div> - {% endif %} - {% if interaction.extra %} - <div class="extra"> - <span class="nodelisttitle"><a href="javascript:toggleLayer('{{client.name}}-extra');" title="Click to expand" class="commentLink">{{interaction.extra.count}}</a> extra configuration elements on the node.<br /></span> - <div class="items" id="{{client.name}}-extra"><ul class="plain"> - {% for extra in interaction.extra|sortwell %} - <li><strong>{{extra.entry.kind}}: </strong><tt>{{extra.entry.name}}</tt></li> - {% endfor %} - </ul></div> - </div> - {% endif %} - </div> -{% else %} - <p>No record could be found for this client.</p> -{% endif %} diff --git a/src/lib/Server/Reports/reports/templates/clients/detail.html b/src/lib/Server/Reports/reports/templates/clients/detail.html index 77f505804..efd5f9e00 100644 --- a/src/lib/Server/Reports/reports/templates/clients/detail.html +++ b/src/lib/Server/Reports/reports/templates/clients/detail.html @@ -1,17 +1,127 @@ {% extends "base.html" %} +{% load bcfg2_tags %} -{% block title %}Info for: {{client.name}}{% endblock %} +{% block title %}Bcfg2 - Client {{client.name}}{% endblock %} + +{% block extra_header_info %} +<style type="text/css"> +.node_data { + border: 1px solid #98DBCC; + margin: 10px; + padding-left: 18px; +} +.node_data td { + padding: 1px 20px 1px 2px; +} +span.history_links { + font-size: 90%; + margin-left: 50px; +} +span.history_links a { + font-size: 90%; +} +</style> +{% endblock %} + +{% block body_onload %}javascript:clientdetailload(){% endblock %} + +{% block pagebanner %}Client Details{% endblock %} {% block content %} -<h2>Client Status Detail page for {{client.name}}</h2><br/> -<b>Select time: </b> -<select name=quick onChange="MM_jumpMenu('parent',this,0)"> - {% for i in client.interactions.all %} - <option {% ifequal i.id interaction.id %}selected {% endifequal %} value="{% url Bcfg2.Server.Reports.reports.views.client_detail hostname=client.name, pk=i.id %}"> {{i.timestamp}} + <div class='detail_header'> + <h2>{{client.name}}</h2> + <a href='{% url reports_client_manage %}#{{ client.name }}'>[manage]</a> + <span class='history_links'><a href="{% url reports_client_history client.name %}">View History</a> | Jump to + <select id="quick" name="quick" onchange="javascript:pageJump('quick');"> + <option value="" selected="selected">--- Time ---</option> + {% for i in client.interactions.all|slice:":25" %} + <option value="{% url reports_client_detail_pk hostname=client.name, pk=i.id %}">{{i.timestamp}}</option> + {% endfor %} + </select></span> + </div> + + {% if interaction.isstale %} + <div class="warningbox"> + This node did not run within the last 24 hours — it may be out of date. + </div> + {% endif %} + <table class='node_data'> + <tr><td>Timestamp</td><td>{{interaction.timestamp}}</td></tr> + {% if interaction.server %} + <tr><td>Served by</td><td>{{interaction.server}}</td></tr> + {% endif %} + {% if interaction.repo_rev_code %} + <tr><td>Revision</td><td>{{interaction.repo_rev_code}}</td></tr> + {% endif %} + <tr><td>State</td><td class='{{interaction.state}}-lineitem'>{{interaction.state|capfirst}}</td></tr> + <tr><td>Managed entries</td><td>{{interaction.totalcount}}</td></tr> + {% if not interaction.isclean %} + <tr><td>Deviation</td><td>{{interaction.percentbad|floatformat:"3"}}%</td></tr> + {% endif %} + </table> + + {% if interaction.bad_entry_count %} + <div class='entry_list'> + <div class='entry_list_head dirty-lineitem'> + <div class='entry_expand_tab' onclick='javascript:toggleMe("bad_table");'>[+]</div> + <h3>Bad Entries — {{ interaction.bad_entry_count }}</h3> + </div> + <table id='bad_table' class='entry_list'> + {% for e in interaction.bad|sortwell %} + <tr class='{% cycle listview,listview_alt %}'> + <td class='entry_list_type'>{{e.entry.kind}}:</td> + <td><a href="{% url reports_item "bad",e.id %}"> + {{e.entry.name}}</a></td> + </tr> + {% endfor %} + </table> + </div> + {% endif %} + + {% if interaction.modified_entry_count %} + <div class='entry_list'> + <div class='entry_list_head modified-lineitem'> + <div class='entry_expand_tab' onclick='javascript:toggleMe("modified_table");'>[+]</div> + <h3>Modified Entries — {{ interaction.modified_entry_count }}</h3> + </div> + <table id='modified_table' class='entry_list'> + {% for e in interaction.modified|sortwell %} + <tr class='{% cycle listview,listview_alt %}'> + <td class='entry_list_type'>{{e.entry.kind}}:</td> + <td><a href="{% url reports_item "modified",e.id %}"> + {{e.entry.name}}</a></td> + </tr> + {% endfor %} + </table> + </div> + {% endif %} + + {% if interaction.extra_entry_count %} + <div class='entry_list'> + <div class='entry_list_head extra-lineitem'> + <div class='entry_expand_tab' onclick='javascript:toggleMe("extra_table");'>[+]</div> + <h3>Extra Entries — {{ interaction.extra_entry_count }}</h3> + </div> + <table id='extra_table' class='entry_list'> + {% for e in interaction.extra|sortwell %} + <tr class='{% cycle listview,listview_alt %}'> + <td class='entry_list_type'>{{e.entry.kind}}:</td> + <td><a href="{% url reports_item "extra",e.id %}">{{e.entry.name}}</a></td> + </tr> {% endfor %} -</select> - -<a href="{% url Bcfg2.Server.Reports.reports.views.client_manage hostname=client.name %}">Manage</a> {{client.name}} options.<br/> + </table> + </div> + {% endif %} -{% include "clients/client-nodebox.html" %} + {% if entry_list %} + <div class="entry_list recent_history_wrapper"> + <div class="entry_list_head" style="border-bottom: 2px solid #98DBCC;"> + <h4 style="display: inline"><a href="{% url reports_client_history client.name %}">Recent Interactions</a></h4> + </div> + <div class='recent_history_box'> + {% include "widgets/interaction_list.inc" %} + <div style='padding-left: 5px'><a href="{% url reports_client_history client.name %}">more...</a></div> + </div> + </div> + {% endif %} {% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/clients/detailed-list.html b/src/lib/Server/Reports/reports/templates/clients/detailed-list.html index 5a1352cff..0c1fae8d5 100644 --- a/src/lib/Server/Reports/reports/templates/clients/detailed-list.html +++ b/src/lib/Server/Reports/reports/templates/clients/detailed-list.html @@ -1,57 +1,15 @@ -{% extends "base.html" %} +{% extends "base-timeview.html" %} +{% load bcfg2_tags %} -{% block title %}Detailed Client Listing{% endblock %} - -{% block extra_header_info %} -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/CalendarPopup.js"></script> -<script type="text/javascript">var cal = new CalendarPopup();</script> -<style type="text/css"> -#client_list_header { - font-weight: bold; - border-bottom:1px solid; - /*color: #333366;*/ -} -/*#client_list_box { - min-width:875px; -}*/ -.listview { - padding-top:3px; - padding-bottom:3px; -} -.listview_alt { - background:#f1ffc9; - padding-top:3px; - padding-bottom:3px; -} -</style> -{% endblock%} - -{% block pagebanner %} - <div class="header"> - <h1>Detailed Client List</h1> - </div> - <br/> -{% endblock %} +{% block title %}Bcfg2 - Detailed Client Listing{% endblock %} +{% block pagebanner %}Clients - Detailed View{% endblock %} {% block content %} -<div> -<form name="timestamp-select" action='{{ path }}' method='get'> -<span class="mini-date"> -<b>Enter date or use calendar popup: </b> -<input type="text" name="date1" value="{{timestamp_date}}" size="10" />@ -<input type="text" name="time" value="{{timestamp_time}}" size="8" /> -<a href="#" onclick="cal.select(document.forms['timestamp-select'].date1,'anchor1','yyyy-MM-dd'); return false;" - name="anchor1" id="anchor1">Calendar</a> -<input type="button" value="Go" onclick="document.forms['timestamp-select'].submit();"/> - | <input type="button" name="now" value="Now" onclick="location.href='{{ path }}';"/> -</span><br/><br/> -</form> -</div> - -<div id='client_list_box'> +<div class='client_list_box'> {% if entry_list %} + {% filter_navigator %} <table cellpadding="3"> - <tr id='client_list_header' class='listview'> + <tr id='table_list_header' class='listview'> <td class='left_column'>Node</td> <td class='right_column' style='width:75px'>State</td> <td class='right_column_narrow'>Good</td> @@ -61,30 +19,19 @@ <td class='right_column'>Last Run</td> <td class='right_column_wide'>Server</td> </tr> - {% for client,entry,stale in entry_list %} + {% for entry in entry_list %} <tr class='{% cycle listview,listview_alt %}'> - <td class='left_column'><a href='{% url Bcfg2.Server.Reports.reports.views.client_detail hostname=client, pk=entry.id %}'>{{ client }}</a></td> - <td class='right_column' style='width:75px'><a href= - {% if server %} - '{% url Bcfg2.Server.Reports.reports.views.client_detailed_list server=server,state=entry.state %}{{ qsa }}' - {% else %} - '{% url Bcfg2.Server.Reports.reports.views.client_detailed_list state=entry.state %}{{ qsa }}' - {% endif %} - {% ifequal entry.state 'dirty' %}style='background:#FF6A6A'{% endifequal %}>{{ entry.state }}</a></td> + <td class='left_column'><a href='{% url Bcfg2.Server.Reports.reports.views.client_detail hostname=entry.client.name, pk=entry.id %}'>{{ entry.client.name }}</a></td> + <td class='right_column' style='width:75px'><a href='{% add_url_filter state=entry.state %}' + {% ifequal entry.state 'dirty' %}class='dirty-lineitem'{% endifequal %}>{{ entry.state }}</a></td> <td class='right_column_narrow'>{{ entry.goodcount }}</td> <td class='right_column_narrow'>{{ entry.bad_entry_count }}</td> <td class='right_column_narrow'>{{ entry.modified_entry_count }}</td> <td class='right_column_narrow'>{{ entry.extra_entry_count }}</td> - <td class='right_column'><span {% if stale %}style='background:#FF6A6A'{% endif %}>{{ entry.timestamp|date:"Y-m-d H:i" }}</span></td> + <td class='right_column'><span {% if entry.timestamp|isstale:entry_max %}class='dirty-lineitem'{% endif %}>{{ entry.timestamp|date:"Y-m-d\&\n\b\s\p\;H:i"|safe }}</span></td> <td class='right_column_wide'> {% if entry.server %} - <a href= - {% if state %} - '{% url Bcfg2.Server.Reports.reports.views.client_detailed_list server=entry.server,state=state %}{{ qsa }}' - {% else %} - '{% url Bcfg2.Server.Reports.reports.views.client_detailed_list server=entry.server %}{{ qsa }}' - {% endif %} - >{{ entry.server }}</a> + <a href='{% add_url_filter server=entry.server %}'>{{ entry.server }}</a> {% else %} {% endif %} diff --git a/src/lib/Server/Reports/reports/templates/clients/history.html b/src/lib/Server/Reports/reports/templates/clients/history.html new file mode 100644 index 000000000..01d4ec2f4 --- /dev/null +++ b/src/lib/Server/Reports/reports/templates/clients/history.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} +{% load bcfg2_tags %} + +{% block title %}Bcfg2 - Interaction History{% endblock %} +{% block pagebanner %}Interaction history{% if client %} for {{ client.name }}{% endif %}{% endblock %} + +{% block extra_header_info %} +{% endblock %} + +{% block content %} +<div class='client_list_box'> +{% if entry_list %} + {% filter_navigator %} + {% include "widgets/interaction_list.inc" %} +{% else %} + <p>No client records are available.</p> +{% endif %} +</div> +{% page_navigator %} +{% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/clients/index.html b/src/lib/Server/Reports/reports/templates/clients/index.html index cfb8a6c83..e0c0d2d7a 100644 --- a/src/lib/Server/Reports/reports/templates/clients/index.html +++ b/src/lib/Server/Reports/reports/templates/clients/index.html @@ -1,56 +1,33 @@ -{% extends "base.html" %} +{% extends "base-timeview.html" %} {% block extra_header_info %} -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/sorttable.js"></script> -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/CalendarPopup.js"></script> -<script language="JavaScript" type="text/javascript">var cal = new CalendarPopup();</script> {% endblock%} -{% block title %}Client Index Listing{% endblock %} +{% block title %}Bcfg2 - Client Grid View{% endblock %} -{% block pagebanner %} - <div class="header"> - <h1>Clients List</h1> - </div> - <br/> -{% endblock %} +{% block pagebanner %}Clients - Grid View{% endblock %} {% block content %} -<div> -<span class="mini-date"> -<b>Enter date or use calendar popup: </b> -</span> -<form name="timestamp-select" action="{{path}}" method="get"> -<span class="mini-date"> -<input type="text" name="date1" value="{{timestamp_date}}" size=10 />@ -<input type="text" name="time" value="{{timestamp_time}}" size=8 /> -<a href="#" onClick="cal.select(document.forms['timestamp-select'].date1,'anchor1','yyyy-MM-dd'); return false;" - name="anchor1" ID="anchor1">Calendar</A> -<input type="button" name="go" value="Go" onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.client_index %}'+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.client_index %}';"/> -</span></form> -<br/><br/><br/></div> {% if inter_list %} -<table><tr><td valign="top"> - <ul style="list-style-type:none;"> - {% for client,inter in inter_list %} - <li><div class="{{inter.state}}-lineitem"> - <a href="{% spaceless %}{% ifequal timestamp 'now' %} - {% url Bcfg2.Server.Reports.reports.views.client_detail client %} + <table class='grid-view' align='center'> + {% for inter in inter_list %} + {% if forloop.first %}<tr>{% endif %} + <td class="{{inter.state}}-lineitem"> + <a href="{% spaceless %}{% if not timestamp %} + {% url reports_client_detail inter.client.name %} + {% else %} + {% url reports_client_detail_pk inter.client.name,inter.id %} + {% endif %} + {% endspaceless %}">{{ inter.client.name }}</a> + </td> + {% if forloop.last %} + </tr> {% else %} - {% url Bcfg2.Server.Reports.reports.views.client_detail client,inter.id %} - {% endifequal %} - {% endspaceless %}">{{ client }}</a> - </div></li> - {% ifequal half_list forloop.counter0 %} - </ul> -</td><td valign="top"> - <ul style="list-style-type:none;"> - {% endifequal %} + {% if forloop.counter|divisibleby:"4" %}</tr><tr>{% endif %} + {% endif %} {% endfor %} - </ul> -</tr></table> + </table> {% else %} <p>No client records are available.</p> {% endif %} diff --git a/src/lib/Server/Reports/reports/templates/clients/manage.html b/src/lib/Server/Reports/reports/templates/clients/manage.html index 61f0fe017..5725ae577 100644 --- a/src/lib/Server/Reports/reports/templates/clients/manage.html +++ b/src/lib/Server/Reports/reports/templates/clients/manage.html @@ -1,29 +1,45 @@ {% extends "base.html" %} + {% block extra_header_info %} -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/CalendarPopup.js"></script> -<script language="JavaScript" type="text/javascript">var cal = new CalendarPopup();</script> {% endblock%} -{% block title %}{{client.name}}{% endblock %} -{% block content %} -<h2>Client Options Management page for {{client.name}}</h2><br/> -<p>Client status detail page: <a href="{% url Bcfg2.Server.Reports.reports.views.client_detail client.name %}">{{client.name}}</a>.</p> -<p>Hosts may be prevented from showing up in the reporting system if they have been retired, are no longer managed by bcfg2 :(, etc. </p> -<b>Select deactivation date: </b> -<div> -<span class="mini-date"> -<b>Enter date or use calendar popup: </b> -</span> -<form name="timestamp-select" action="{% url Bcfg2.Server.Reports.reports.views.client_manage client.name %}" method="post"> -<span class="mini-date"> -<input type="text" name="date1" value="{{timestamp_date}}" size="10" />@ -<input type="text" name="time" value="{{timestamp_time}}" size="8" /> -<a href="#" onClick="cal.select(document.forms['timestamp-select'].date1,'anchor1','yyyy-MM-dd'); return false;" - name="anchor1" ID="anchor1">Calendar</a> -<input type="submit" value="Submit"> -</span></form> -<br/><br/><br/></div> -<br/><br/> -<p>{{message}}</p> +{% block title %}Bcfg2 - Manage Clients{% endblock %} +{% block pagebanner %}Clients - Manage{% endblock %} + +{% block content %} +<div class='client_list_box'> + {% if message %} + <div class="warningbox">{{ message }}</div> + {% endif %} +{% if clients %} + <table cellpadding="3"> + <tr id='table_list_header' class='listview'> + <td class='left_column'>Node</td> + <td class='right_column'>Expiration</td> + <td class='right_column_narrow'>Manage</td> + </tr> + {% for client in clients %} + <tr class='{% cycle listview,listview_alt %}'> + <td><span id="{{ client.name }}"> </span> + <span id="ttag-{{ client.name }}"> </span> + <span id="s-ttag-{{ client.name }}"> </span> + <a href="{% url reports_client_detail client.name %}">{{ client.name }}</a></td> + <td>{% firstof client.expiration 'Active' %}</td> + <td> + <form method="post" action="{% url reports_client_manage %}"> + <div> {# here for no reason other then to validate #} + <input type="hidden" name="client_name" value="{{ client.name }}" /> + <input type="hidden" name="client_action" value="{% if client.expiration %}unexpire{% else %}expire{% endif %}" /> + <input type="submit" value="{% if client.expiration %}Activate{% else %}Expire Now{% endif %}" /> + </div> + </form> + </td> + </tr> + {% endfor %} + </table> + </div> +{% else %} + <p>No client records are available.</p> +{% endif %} {% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/config_items/index.html b/src/lib/Server/Reports/reports/templates/config_items/index.html deleted file mode 100644 index 04083344c..000000000 --- a/src/lib/Server/Reports/reports/templates/config_items/index.html +++ /dev/null @@ -1,100 +0,0 @@ -{% extends "base.html" %} - -{% load syntax_coloring %} - -{% block extra_header_info %} -<link rel="stylesheet" type="text/css" href="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/syntax-coloring.css" /> -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/CalendarPopup.js"></script> -<script language="JavaScript" type="text/javascript">var cal = new CalendarPopup();</script> -{% endblock%} -{% block title %}Configuration Element Details{% endblock %} - -{% block pagebanner %} - <div class="header"> - <h1>Configuration Element Details</h1> - </div> - <br/> -{% endblock %} - -{% block content %} - -{% ifequal mod_or_bad "bad" %} -<div class="bad"> -<h2>Bad {{item.entry.kind}}: {{item.entry.name}}</h2> -</div> -{% else %} -<div class="modified"> -<h2>Modified {{item.entry.kind}}: {{item.entry.name}}</h2> -</div> -{% endifequal %} -<center> -<table border=1 padding=0 > -<tr><th>Reason</th><th>Current Status</th><th>Specified in bcfg2</th></tr> -{% if item.reason.current_owner %} -<tr><td align="right"><b>Owner: </b></td><td>{{item.reason.current_owner}}</td><td>{{item.reason.owner}}</td></tr> -{% endif %}{% if item.reason.current_group %} -<tr><td align="right"><b>Group: </b></td><td>{{item.reason.current_group}}</td><td>{{item.reason.group}}</td></tr> -{% endif %}{% if item.reason.current_perms %} -<tr><td align="right"><b>Permissions: </b></td><td>{{item.reason.current_perms}}</td><td>{{item.reason.perms}}</td></tr> -{% endif %}{% if item.reason.current_status %} -<tr><td align="right"><b>Status: </b></td><td>{{item.reason.current_status}}</td><td>{{item.reason.status}}</td></tr> -{% endif %}{% if item.reason.current_to %} -<tr><td align="right"><b>Link Destination: </b></td><td>{{item.reason.current_to}}</td><td>{{item.reason.to}}</td></tr> -{% endif %}{% if item.reason.current_version %} -<tr><td align="right"><b>Version: </b></td><td>{{item.reason.current_version}}</td><td>{{item.reason.version}}</td></tr> -{% endif %}{% if not item.reason.current_exists %} -<tr><td align="right"><b>Existence: </b></td><td colspan=2>This item does not currently exist on the host but is specified to exist in the configuration.</td></tr> -{% endif %}{% if item.reason.current_diff %} -<tr><td align="right"><b>NDiff: </b></td><td colspan=2><pre>{{item.reason.current_diff|syntaxhilight:"diff"}}</pre></td></tr> -{% endif %} -</table></center> -<hr/> -<div> -<span class="mini-date"> -<b>Enter date or use calendar popup: </b> -</span> -<form name="timestamp-select" action="{{path}}" method="get"> -<span class="mini-date"> -<input type="text" name="date1" value="{{timestamp_date}}" size="10" />@ -<input type="text" name="time" value="{{timestamp_time}}" size="8" /> -<a href="#" onClick="cal.select(document.forms['timestamp-select'].date1,'anchor1','yyyy-MM-dd'); return false;" - name="anchor1" ID="anchor1">Calendar</A> -{% ifequal mod_or_bad "modified" %} - <input type="button" - name="go" - value="Go" - 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.id %}';"/> -{% else %} - <input type="button" - name="go" - value="Go" - 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.id %}';"/> -{% endifequal %} -</span></form> -<br/><br/><br/></div> -{% if associated_client_list %} - <p>The following clients had this problem as of {{timestamp_date}}@{{timestamp_time}}:</p> - {% for client in associated_client_list %} - <a href="{% url Bcfg2.Server.Reports.reports.views.client_detail client.name %}">{{client.name}}</a><br/> - {% endfor %} - <br /> - <br /> -{% else %} - <p>No Clients had this problem at {{timestamp}}</p> -{% endif %} - - - - - - - -{% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/config_items/item.html b/src/lib/Server/Reports/reports/templates/config_items/item.html new file mode 100644 index 000000000..41474922b --- /dev/null +++ b/src/lib/Server/Reports/reports/templates/config_items/item.html @@ -0,0 +1,109 @@ +{% extends "base.html" %} +{% load syntax_coloring %} + + +{% block title %}Bcfg2 - Element Details{% endblock %} + + +{% block extra_header_info %} +<style type="text/css"> +#table_list_header { + font-size: 100%; +} +table.entry_list { + width: auto; +} +div.information_wrapper { + margin: 15px; +} +div.diff_wrapper { + overflow: auto; +} +div.entry_list h3 { + font-size: 90%; + padding: 5px; +} +</style> +{% endblock%} + +{% block pagebanner %}Element Details{% endblock %} + +{% block content %} + <div class='detail_header'> + <h3>{{mod_or_bad|capfirst}} {{item.entry.kind}}: {{item.entry.name}}</h3> + </div> + + <div class="information_wrapper"> + + {% if isextra %} + <p>This item exists on the host but is not defined in the configuration.</p> + {% endif %} + + {% if not item.reason.current_exists %} + <div class="warning">This item does not currently exist on the host but is specified to exist in the configuration.</div> + {% endif %} + + {% if item.reason.current_owner or item.reason.current_group or item.reason.current_perms or item.reason.current_status or item.reason.current_status or item.reason.current_to or item.reason.current_version %} + <table class='entry_list'> + <tr id='table_list_header'> + <td style='text-align: right;'>Problem Type</td><td>Expected</td><td style='border-bottom: 1px solid #98DBCC;'>Found</td></tr> + {% if item.reason.current_owner %} + <tr><td style='text-align: right'><b>Owner</b></td><td>{{item.reason.owner}}</td> + <td>{{item.reason.current_owner}}</td></tr> + {% endif %} + {% if item.reason.current_group %} + <tr><td style='text-align: right'><b>Group</b></td><td>{{item.reason.group}}</td> + <td>{{item.reason.current_group}}</td></tr> + {% endif %} + {% if item.reason.current_perms %} + <tr><td style='text-align: right'><b>Permissions</b></td><td>{{item.reason.perms}}</td> + <td>{{item.reason.current_perms}}</td></tr> + {% endif %} + {% if item.reason.current_status %} + <tr><td style='text-align: right'><b>Status</b></td><td>{{item.reason.status}}</td> + <td>{{item.reason.current_status}}</td></tr> + {% endif %} + {% if item.reason.current_to %} + <tr><td style='text-align: right'><b>Symlink Target</b></td><td>{{item.reason.to}}</td> + <td>{{item.reason.current_to}}</td></tr> + {% endif %} + {% if item.reason.current_version %} + <tr><td style='text-align: right'><b>Package Version</b></td><td>{{item.reason.version|cut:"("|cut:")"}}</td> + <td>{{item.reason.current_version|cut:"("|cut:")"}}</td></tr> + {% endif %} + </table> + {% endif %} + + {% if item.reason.current_diff %} + <div class='entry_list'> + <div class='entry_list_head'> + <h3>Incorrect file contents</h3> + </div> + <div class='diff_wrapper'> + {{ item.reason.current_diff|syntaxhilight }} + </div> + </div> + {% endif %} + + + <div class='entry_list'> + <div class='entry_list_head'> + <h3>Occurances on {{ timestamp|date:"Y-m-d" }}</h3> + </div> + {% if associated_list %} + <table class="entry_list" cellpadding="3"> + {% for inter in associated_list %} + <tr><td><a href="{% url reports_client_detail inter.client.name %}" + >{{inter.client.name}}</a></td> + <td><a href="{% url reports_client_detail_pk hostname=inter.client.name,pk=inter.id %}" + >{{inter.timestamp}}</a></td> + </tr> + {% endfor %} + </table> + {% else %} + <p>Missing client list</p> + {% endif %} + </div> + + </div><!-- information_wrapper --> +{% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/config_items/listing.html b/src/lib/Server/Reports/reports/templates/config_items/listing.html index 64a60e506..572249470 100644 --- a/src/lib/Server/Reports/reports/templates/config_items/listing.html +++ b/src/lib/Server/Reports/reports/templates/config_items/listing.html @@ -1,50 +1,32 @@ -{% extends "base.html" %} -{% load django_templating_sigh %} +{% extends "base-timeview.html" %} +{% load bcfg2_tags %} -{% block extra_header_info %} -<link rel="stylesheet" type="text/css" href="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/yui/tabview/assets/tabview.css" /> -<link rel="stylesheet" type="text/css" href="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/yui/round_tabs.css" /> - -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/yui/yahoo/yahoo.js"></script> -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/yui/event/event.js"></script> -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/yui/dom/dom.js"></script> -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/yui/tabview/tabview.js"></script> -<script type="text/javascript"> -YAHOO.example.init = function( ){ - var tabView = new YAHOO.widget.TabView( { id: 'demo' } ); - {% for item_list in item_list_pseudodict %} - tabView.addTab( new YAHOO.widget.Tab({ - label: '{{item_list.0}}', - content: '<p><ul style="list-style-type:none;">{% for item in item_list.1|sortwell %}<li><strong>{{item.entry.kind}}: <'+'/strong><tt>{% ifequal mod_or_bad "modified" %}<a href="{%url Bcfg2.Server.Reports.reports.views.config_item_modified eyedee=item.id%}">{{item.entry.name}}<'+'/a>{% else %}<a href="{%url Bcfg2.Server.Reports.reports.views.config_item_bad eyedee=item.id%}">{{item.entry.name}}<'+'/a>{% endifequal %}<'+'/tt><'+'/li>{% endfor %}<'+'/ul><'+'/p>', - active: 'True' - })); - {% endfor %} +{% block title %}Bcfg2 - Element Listing{% endblock %} - YAHOO.util.Event.onContentReady('tabview', function() { - tabView.appendTo(this); /* append to #doc */ - }); - -}; -YAHOO.example.init(); +{% block extra_header_info %} +{% endblock%} -</script> -<style type="text/css"> -#demo .yui-content { padding:1em; } /* pad content container */ -</style> -{% endblock %} +{% block pagebanner %}{{mod_or_bad|capfirst}} Element Listing{% endblock %} -{% block title %}{{mod_or_bad|capfirst}} Item Listing{% endblock %} +{% block content %} +{% if item_list_dict %} + {% for kind, entries in item_list_dict.items %} -{% block pagebanner %} - <div class="header"> - <h1>{{mod_or_bad|capfirst}} Configuration Elements</h1> + <div class='entry_list'> + <div class='entry_list_head element_list_head'> + <div class='entry_expand_tab' onclick='javascript:toggleMe("table_{{ kind }}");'>[+]</div> + <h3>{{ kind }} — {{ entries|length }}</h3> </div> - <br/> -{% endblock %} -{% block content %} -{% if item_list_pseudodict %} -<div id="tabview"></div> + <table id='table_{{ kind }}' class='entry_list'> + {% for e in entries %} + <tr class='{% cycle listview,listview_alt %}'> + <td><a href="{% url reports_item type=mod_or_bad,pk=e.id %}">{{e.entry.name}}</a></td> + </tr> + {% endfor %} + </table> + </div> + {% endfor %} {% else %} <p>There are currently no inconsistent configuration entries.</p> {% endif %} diff --git a/src/lib/Server/Reports/reports/templates/displays/index.html b/src/lib/Server/Reports/reports/templates/displays/index.html deleted file mode 100644 index c078539b6..000000000 --- a/src/lib/Server/Reports/reports/templates/displays/index.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Display Index Listing{% endblock %} -{% block pagebanner %} - <div class="header"> - <h1>BCFG Display Index</h1> - {% comment %} <span class="notebox">Report Run @ {% now "F j, Y P"%}</span>{% endcomment %} - </div> - <br/> -{% endblock %} - -{% block content %} -<ul> -<li><a href="{% url Bcfg2.Server.Reports.reports.views.display_sys_view %}">System View</a></li> -<li><a href="{% url Bcfg2.Server.Reports.reports.views.display_summary %}">Summary Only</a></li> -<li><a href="{% url Bcfg2.Server.Reports.reports.views.display_timing %}">Timing</a></li> -</ul> -{% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/displays/summary-block-direct-links.html b/src/lib/Server/Reports/reports/templates/displays/summary-block-direct-links.html deleted file mode 100644 index 60f97eadc..000000000 --- a/src/lib/Server/Reports/reports/templates/displays/summary-block-direct-links.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends "displays/summary-block.html" %} -{% block linkprefix1 %}{% url Bcfg2.Server.Reports.reports.views.client_index %}{% endblock %} -{% block linkprefix2 %}{% url Bcfg2.Server.Reports.reports.views.client_index %}{% endblock %} -{% block linkprefix3 %}{% url Bcfg2.Server.Reports.reports.views.client_index %}{% endblock %} -{% block linkprefix4 %}{% url Bcfg2.Server.Reports.reports.views.client_index %}{% endblock %} -{% block linkprefix5 %}{% url Bcfg2.Server.Reports.reports.views.client_index %}{% endblock %} -{% block linkprefix6 %}{% url Bcfg2.Server.Reports.reports.views.client_index %}{% endblock %}
\ No newline at end of file diff --git a/src/lib/Server/Reports/reports/templates/displays/summary-block.html b/src/lib/Server/Reports/reports/templates/displays/summary-block.html deleted file mode 100644 index 060ff0fa1..000000000 --- a/src/lib/Server/Reports/reports/templates/displays/summary-block.html +++ /dev/null @@ -1,90 +0,0 @@ -{% load django_templating_sigh %} - - <div class="nodebox"> - <h2>Summary:</h2> - <p class="indented">{{client_list|length }} Nodes were included in your report.</p> - {% if clean_client_list %} - <div class="clean"> - <span class="nodelisttitle"><a href="javascript:toggleLayer('goodsummary');" title="Click to Expand" class="commentLink">{{clean_client_list|length}}</a> nodes are clean.<br /></span> - <div class="items" id="goodsummary"><ul class="plain"> - {% for client in clean_client_list|sortname %} - {% set_interaction "foo" %} - <li><b>Node: </b> - <tt><a href="{% block linkprefix1 %}#{% endblock %}{{client.name}}">{{client.name}}</a></tt><span class="mini-date">{{interaction.timestamp}}</span></li> - {% endfor %} - </ul></div> - </div> - {% endif %} - {% if bad_client_list %} - <div class="bad"> - <span class="nodelisttitle"><a href="javascript:toggleLayer('badsummary');" title="Click to Expand" class="commentLink">{{bad_client_list|length}}</a> nodes are bad.<br /></span> - <div class="items" id="badsummary"><ul class="plain"> - {% for client in bad_client_list|sortname %} - {% set_interaction "foo" %} - <li><b>Node: </b> - <tt><a href="{% block linkprefix2 %}#{% endblock %}{{client.name}}">{{client.name}}</a></tt><span class="mini-date">{{interaction.timestamp}}</span></li> - {% endfor %} - </ul></div> - </div> - {% endif %} - {% if modified_client_list %} - <div class="modified"> - <span class="nodelisttitle"><a href="javascript:toggleLayer('modifiedsummary');" title="Click to Expand" class="commentLink">{{modified_client_list|length}}</a> nodes were modified in the previous run.<br /></span> - <div class="items" id="modifiedsummary"><ul class="plain"> - {% for client in modified_client_list|sortname %} - {% set_interaction "foo" %} - <li><b>Node: </b> - <tt><a href="{% block linkprefix3 %}#{% endblock %}{{client.name}}">{{client.name}}</a></tt><span class="mini-date">{{interaction.timestamp}}</span></li> - {% endfor %} - </ul></div> - </div> - {% endif %} - {% if extra_client_list %} - <div class="extra"> - <span class="nodelisttitle"><a href="javascript:toggleLayer('extrasummary');" title="Click to Expand" class="commentLink">{{extra_client_list|length}}</a> nodes have extra configuration. (includes both good and bad nodes)<br /></span> - <div class="items" id="extrasummary"><ul class="plain"> - {% for client in extra_client_list|sortname %} - {% set_interaction "foo" %} - <li><b>Node: </b> - <tt><a href="{% block linkprefix4 %}#{% endblock %}{{client.name}}">{{client.name}}</a></tt><span class="mini-date">{{interaction.timestamp}}</span></li> - {% endfor %} - </ul></div> - </div> - {% endif %} - {% if stale_up_client_list %} - <div class="warning"> - <span class="nodelisttitle"><a href="javascript:toggleLayer('vstalesummary');" title="Click to Expand" class="commentLink">{{stale_up_client_list|length}}</a> nodes did not run within the last 24 hours but were pingable.<br /></span> - <div class="items" id="vstalesummary"><ul class="plain"> - {% for client in stale_up_client_list|sortname %} - {% set_interaction "foo" %} - <li><b>Node: </b> - <tt><a href="{% block linkprefix5 %}#{% endblock %}{{client.name}}">{{client.name}}</a></tt><span class="mini-date">{{interaction.timestamp}}</span></li> - {% endfor %} - </ul></div> - </div> - {% endif %} - {% if stale_all_client_list %} - <div class="all-warning"> - <span class="nodelisttitle"><a href="javascript:toggleLayer('stalesummary');" title="Click to Expand" class="commentLink">{{stale_all_client_list|length}}</a> nodes did not run within the last 24 hours. (includes nodes up and down)<br /></span> - <div class="items" id="stalesummary"><ul class="plain"> - {% for client in stale_all_client_list|sortname %} - {% set_interaction "foo" %} - <li><b>Node: </b> - <tt><a href="{% block linkprefix6 %}#{% endblock %}{{client.name}}">{{client.name}}</a></tt><span class="mini-date">{{interaction.timestamp}}</span></li> - {% endfor %} - </ul></div> - </div> - {% endif %} - {% if down_client_list %} - <div class="down"> - <span class="nodelisttitle"><a href="javascript:toggleLayer('unpingablesummary');" title="Click to Expand" class="commentLink">{{down_client_list|length}}</a> nodes were down.<br /></span> - <div class="items" id="unpingablesummary"><ul class="plain"> - {% for client in down_client_list|sortname %} - {% set_interaction "foo" %} - <li><b>Node: </b> - <tt><a href="#{{client.name}}">{{client.name}}</a></tt><span class="mini-date">{{interaction.timestamp}}</span></li> - {% endfor %} - </ul></div> - </div> - {% endif %} - </div> diff --git a/src/lib/Server/Reports/reports/templates/displays/summary.html b/src/lib/Server/Reports/reports/templates/displays/summary.html index 29cbb22d7..0124f635d 100644 --- a/src/lib/Server/Reports/reports/templates/displays/summary.html +++ b/src/lib/Server/Reports/reports/templates/displays/summary.html @@ -1,31 +1,42 @@ -{% extends "base.html" %} +{% extends "base-timeview.html" %} +{% load bcfg2_tags %} + +{% block title %}Bcfg2 - Client Summary{% endblock %} +{% block pagebanner %}Clients - Summary{% endblock %} + +{% block body_onload %}javascript:hide_table_array(hide_tables){% endblock %} + {% block extra_header_info %} -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/CalendarPopup.js"></script> -<script language="JavaScript" type="text/javascript">var cal = new CalendarPopup();</script> +<script type="text/javascript"> +var hide_tables = new Array({{ summary_data|length }}); +{% for summary in summary_data %} +hide_tables[{{ forloop.counter0 }}] = "table_{{ summary.name }}"; +{% endfor %} +</script> {% endblock%} -{% block title %}Display Index Listing{% endblock %} -{% block pagebanner %} - <div class="header"> - <h1>BCFG Clients Summary</h1> - <span class="notebox">Report Run @ {% now "F j, Y P"%}</span> - </div> - <br/> -{% endblock %} {% block content %} -<div> -<span class="mini-date"> -<b>Enter date or use calendar popup: </b> -</span> -<form name="timestamp-select" action="{{path}" method="get"> -<span class="mini-date"> -<input type="text" name="date1" value="{{timestamp_date}}" size="10" />@ -<input type="text" name="time" value="{{timestamp_time}}" size="8" /> -<a href="#" onClick="cal.select(document.forms['timestamp-select'].date1,'anchor1','yyyy-MM-dd'); return false;" - name="anchor1" ID="anchor1">Calendar</A> -<input type="button" name="go" value="Go" onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.display_summary %}'+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.display_summary %}';"/> -</span></form> -<br/><br/><br/></div> - {% include "displays/summary-block-direct-links.html" %} + <div class='detail_header'> + <h2>{{ node_count }} nodes reporting in</h2> + </div> +{% if summary_data %} + {% for summary in summary_data %} + <div class='entry_list'> + <div class='entry_list_head element_list_head'> + <div class='entry_expand_tab' onclick='javascript:toggleMe("table_{{ summary.name }}");'>[+]</div> + <h3>{{ summary.nodes|length }} {{ summary.label }}</h3> + </div> + + <table id='table_{{ summary.name }}' class='entry_list'> + {% for node in summary.nodes|sort_interactions_by_name %} + <tr class='{% cycle listview,listview_alt %}'> + <td><a href="{% url reports_client_detail_pk hostname=node.client.name,pk=node.id %}">{{ node.client.name }}</a></td> + </tr> + {% endfor %} + </table> + </div> + {% endfor %} +{% else %} + <p>No data to report on</p> +{% endif %} {% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/displays/sys_view.html b/src/lib/Server/Reports/reports/templates/displays/sys_view.html deleted file mode 100644 index 1298059bf..000000000 --- a/src/lib/Server/Reports/reports/templates/displays/sys_view.html +++ /dev/null @@ -1,20 +0,0 @@ -{% extends "base.html" %} -{% load django_templating_sigh %} - -{% block title %}System-View Display{% endblock %} -{% block pagebanner %} - <div class="header"> - <h1>Grand System View</h1> - <span class="notebox">Report Run @ {% now "F j, Y P"%}</span> - </div> - <br/> -{% endblock %} -{% block content %} -<center><h2>This view is deprecated and will be removed soon.</h2><br/>Please use the "Summary" view and drill down instead.</center> - - {% include "displays/summary-block.html" %} - {% for client in client_list %} - {% set_interaction "foo" %} - {% include "clients/client-nodebox.html" %} - {% endfor %} -{% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/displays/timing.html b/src/lib/Server/Reports/reports/templates/displays/timing.html index 32ddab464..47accb2cb 100644 --- a/src/lib/Server/Reports/reports/templates/displays/timing.html +++ b/src/lib/Server/Reports/reports/templates/displays/timing.html @@ -1,54 +1,38 @@ -{% extends "base.html" %} +{% extends "base-timeview.html" %} +{% load bcfg2_tags %} + +{% block title %}Bcfg2 - Performance Metrics{% endblock %} +{% block pagebanner %}Performance Metrics{% endblock %} + {% block extra_header_info %} -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/sorttable.js"></script> -<script type="text/javascript" src="{% url Bcfg2.Server.Reports.reports.views.client_index %}../site_media/CalendarPopup.js"></script> -<script language="JavaScript" type="text/javascript">var cal = new CalendarPopup();</script> {% endblock%} -{% block title %}Display Index Listing{% endblock %} {% block content %} - <div class="header"> - <h1>BCFG Performance Timings</h1> - <span class="notebox">Report Run @ {% now "F j, Y P"%}</span> - </div> - <br/> -<div> -<span class="mini-date"> -<b>Enter date or use calendar popup: </b> -</span> -<form name="timestamp-select" action="{{path}}" method="get"> -<span class="mini-date"> -<input type="text" name="date1" value="{{timestamp_date}}" size="10" />@ -<input type="text" name="time" value="{{timestamp_time}}" size="8" /> -<a href="#" onClick="cal.select(document.forms['timestamp-select'].date1,'anchor1','yyyy-MM-dd'); return false;" - name="anchor1" ID="anchor1">Calendar</A> -<input type="button" name="go" value="Go" onClick="location.href='{% url Bcfg2.Server.Reports.reports.views.display_timing %}'+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.display_timing %}';"/> -</span></form> -<br/><br/><br/></div> - <center> - <table id="t1" class="sortable"> - <tr> - <th class="sortable">Hostname</th> - <th class="sortable">Parse</th> - <th class="sortable">Probe</th> - <th class="sortable">Inventory</th> - <th class="sortable">Install</th> - <th class="sortable">Config</th> - <th class="sortable">Total</th> +<div class='client_list_box'> + {% if metrics %} + <table cellpadding="3"> + <tr id='table_list_header' class='listview'> + <td>Name</td> + <td>Parse</td> + <td>Probe</td> + <td>Inventory</td> + <td>Install</td> + <td>Config</td> + <td>Total</td> </tr> - {% for dict_unit in stats_list %} - <tr> - <td class="sortable"><a href="{% url Bcfg2.Server.Reports.reports.views.client_detail dict_unit.name%}/">{{dict_unit.name}}</a></td> - <td class="sortable">{{dict_unit.parse}}</td> - <td class="sortable">{{dict_unit.probe}}</td> - <td class="sortable">{{dict_unit.inventory}}</td> - <td class="sortable">{{dict_unit.install}}</td> - <td class="sortable">{{dict_unit.config}}</td> - <td class="sortable">{{dict_unit.total}}</td> + {% for metric in metrics|dictsort:"name" %} + <tr class='{% cycle listview,listview_alt %}'> + <td><a style='font-size: 100%' + href="{% url reports_client_detail hostname=metric.name %}">{{ metric.name }}</a></td> + {% for mitem in metric|build_metric_list %} + <td>{{ mitem }}</td> + {% endfor %} </tr> {% endfor %} </table> - </center> + {% else %} + <p>No metric data available</p> + {% endif %} +</div> {% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/index.html b/src/lib/Server/Reports/reports/templates/index.html deleted file mode 100644 index 002a3f770..000000000 --- a/src/lib/Server/Reports/reports/templates/index.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends "base.html" %} - -{% block pagebanner %} - <div class="header"> - <h1>BCFG Reports</h1> - {% comment %} <span class="notebox">Report Run @ {% now "F j, Y P"%}</span>{% endcomment %} - </div> - <br/> -{% endblock %} -{% block content %} -<h1>Welcome to the Bcfg2 Reporting System</h1> -<p> -Please use the links at the left to navigate. -</p> -{% endblock %} diff --git a/src/lib/Server/Reports/reports/templates/widgets/filter_bar.html b/src/lib/Server/Reports/reports/templates/widgets/filter_bar.html new file mode 100644 index 000000000..6b57baf6a --- /dev/null +++ b/src/lib/Server/Reports/reports/templates/widgets/filter_bar.html @@ -0,0 +1,13 @@ +{% spaceless %} +{% if filters %} +{% for filter, filter_url in filters %} + {% if forloop.first %} + <div class="filter_bar">Active filters (click to remove): + {% endif %} + <a href='{{ filter_url }}'>{{ filter|capfirst }}</a>{% if not forloop.last %}, {% endif %} + {% if forloop.last %} + </div> + {% endif %} +{% endfor %} +{% endif %} +{% endspaceless %} diff --git a/src/lib/Server/Reports/reports/templates/widgets/interaction_list.inc b/src/lib/Server/Reports/reports/templates/widgets/interaction_list.inc new file mode 100644 index 000000000..8f2dec1dc --- /dev/null +++ b/src/lib/Server/Reports/reports/templates/widgets/interaction_list.inc @@ -0,0 +1,38 @@ +{% load bcfg2_tags %} +<div class='interaction_history_widget'> + <table cellpadding="3"> + <tr id='table_list_header' class='listview'> + <td class='left_column'>Timestamp</td> + {% if not client %} + <td class='right_column_wide'>Client</td> + {% endif %} + <td class='right_column' style='width:75px'>State</td> + <td class='right_column_narrow'>Good</td> + <td class='right_column_narrow'>Bad</td> + <td class='right_column_narrow'>Modified</td> + <td class='right_column_narrow'>Extra</td> + <td class='right_column_wide'>Server</td> + </tr> + {% for entry in entry_list %} + <tr class='{% cycle listview,listview_alt %}'> + <td class='left_column'><a href='{% url reports_client_detail_pk hostname=entry.client.name, pk=entry.id %}'>{{ entry.timestamp|date:"Y-m-d\&\n\b\s\p\;H:i"|safe }}</a></td> + {% if not client %} + <td class='right_column_wide'><a href='{% add_url_filter hostname=entry.client.name %}'>{{ entry.client.name }}</a></td> + {% endif %} + <td class='right_column' style='width:75px'><a href='{% add_url_filter state=entry.state %}' + {% ifequal entry.state 'dirty' %}class='dirty-lineitem'{% endifequal %}>{{ entry.state }}</a></td> + <td class='right_column_narrow'>{{ entry.goodcount }}</td> + <td class='right_column_narrow'>{{ entry.bad_entry_count }}</td> + <td class='right_column_narrow'>{{ entry.modified_entry_count }}</td> + <td class='right_column_narrow'>{{ entry.extra_entry_count }}</td> + <td class='right_column_wide'> + {% if entry.server %} + <a href='{% add_url_filter server=entry.server %}'>{{ entry.server }}</a> + {% else %} + + {% endif %} + </td> + </tr> + {% endfor %} + </table> +</div> diff --git a/src/lib/Server/Reports/reports/templates/widgets/page_bar.html b/src/lib/Server/Reports/reports/templates/widgets/page_bar.html new file mode 100644 index 000000000..aa0def83e --- /dev/null +++ b/src/lib/Server/Reports/reports/templates/widgets/page_bar.html @@ -0,0 +1,23 @@ +{% spaceless %} +{% for page, page_url in pager %} + {% if forloop.first %} + <div class="page_bar"> + {% if prev_page %}<a href="{{ prev_page }}">< Prev</a><span> </span>{% endif %} + {% if first_page %}<a href="{{ first_page }}">1</a><span> ... </span>{% endif %} + {% endif %} + {% ifequal page current_page %} + <span class='nav_bar_current'>{{ page }}</span> + {% else %} + <a href="{{ page_url }}">{{ page }}</a> + {% endifequal %} + {% if forloop.last %} + {% if last_page %}<span> ... </span><a href="{{ last_page }}">{{ total_pages }}</a><span> </span>{% endif %} + {% if next_page %}<a href="{{ next_page }}">Next ></a><span> </span>{% endif %} + |{% for limit, limit_url in page_limits %} <a href="{{ limit_url }}">{{ limit }}</a>{% endfor %} + </div> + {% else %} + <span> </span> + {% endif %} +{% endfor %} +{% endspaceless %} +<!-- {{ path }} --> |