diff options
Diffstat (limited to 'tools/pharos-dashboard/templates')
9 files changed, 220 insertions, 44 deletions
diff --git a/tools/pharos-dashboard/templates/account/user_list.html b/tools/pharos-dashboard/templates/account/user_list.html new file mode 100644 index 00000000..7618dc95 --- /dev/null +++ b/tools/pharos-dashboard/templates/account/user_list.html @@ -0,0 +1,42 @@ +{% extends "dashboard/table.html" %} +{% load staticfiles %} + +{% block table %} + <thead> + <tr> + <th>Username</th> + <th>Company</th> + <th>SSH Key</th> + <th>GPG Key</th> + </tr> + </thead> + <tbody> + {% for user in users %} + <tr> + <th> + {{ user.username }} + </th> + <th> + {{ user.userprofile.company }} + </th> + <th> + <a href={{ user.userprofile.ssh_public_key.url }}>Download</a> + </th> + <th> + <a href={{ user.userprofile.pgp_public_key.url }}>Download</a> + </th> + </tr> + {% endfor %} + </tbody> +{% endblock table %} + + +{% block tablejs %} + <script type="text/javascript"> + $(document).ready(function () { + $('#table').DataTable({ + "order": [[0, "asc"]] + }); + }); + </script> +{% endblock tablejs %}
\ No newline at end of file diff --git a/tools/pharos-dashboard/templates/base.html b/tools/pharos-dashboard/templates/base.html index 64174a1f..42156e3b 100644 --- a/tools/pharos-dashboard/templates/base.html +++ b/tools/pharos-dashboard/templates/base.html @@ -71,6 +71,11 @@ class="fa fa-fw"></i>Resources </a> </li> + <li> + <a href="{% url 'account:users' %}"><i + class="fa fa-fw"></i>Users + </a> + </li> </ul> </div> <!-- /.sidebar-collapse --> diff --git a/tools/pharos-dashboard/templates/dashboard/ci_pods.html b/tools/pharos-dashboard/templates/dashboard/ci_pods.html index 2982a6ff..a754252c 100644 --- a/tools/pharos-dashboard/templates/dashboard/ci_pods.html +++ b/tools/pharos-dashboard/templates/dashboard/ci_pods.html @@ -41,7 +41,7 @@ href={{ pod.slave.last_job_url }}>{{ pod.slave.last_job_name }}</a> </th> </tr> - {% endfor %}` + {% endfor %} </tbody> {% endblock table %} diff --git a/tools/pharos-dashboard/templates/dashboard/dev_pods.html b/tools/pharos-dashboard/templates/dashboard/dev_pods.html index 9c84bb91..c4cb1ba7 100644 --- a/tools/pharos-dashboard/templates/dashboard/dev_pods.html +++ b/tools/pharos-dashboard/templates/dashboard/dev_pods.html @@ -10,12 +10,14 @@ <th>Booked by</th> <th>Booked until</th> <th>Purpose</th> + <th>Utilization</th> <th>Status</th> <th></th> + <th></th> </tr> </thead> <tbody> - {% for pod, booking in dev_pods %} + {% for pod, booking, utilization in dev_pods %} <tr> <th> <a href={% url 'dashboard:resource' resource_id=pod.id %}>{{ pod.name }}</a> @@ -32,6 +34,9 @@ <th> {{ booking.purpose }} </th> + <th> + {{ utilization }} + </th> <th style="background-color:{{ pod.slave.status | jenkins_status_color }}"> {{ pod.slave.status }} </th> @@ -40,6 +45,11 @@ Book </a> </th> + <th> + <a href="{% url 'dashboard:resource' resource_id=pod.id %}" class="btn btn-primary"> + Info + </a> + </th> </tr> {% endfor %} </tbody> @@ -50,9 +60,9 @@ $(document).ready(function () { $('#table').DataTable({ columnDefs: [ - {type: 'status', targets: 5} + {type: 'status', targets: 6} ], - "order": [[5, "asc"]] + "order": [[6, "asc"]] }); }); </script> diff --git a/tools/pharos-dashboard/templates/dashboard/resource.html b/tools/pharos-dashboard/templates/dashboard/resource.html index 92d02f66..c9e57354 100644 --- a/tools/pharos-dashboard/templates/dashboard/resource.html +++ b/tools/pharos-dashboard/templates/dashboard/resource.html @@ -38,21 +38,21 @@ <script src="{% static "bower_components/flot/jquery.flot.time.js" %}"></script> <script src="{% static "bower_components/flot.tooltip/js/jquery.flot.tooltip.min.js" %}"></script> + <script src="{% static "js/flot-pie-chart.js" %}"></script> + <script type="text/javascript"> $(document).ready(function () { $('#{{ resource.id }}_server_table').DataTable({}); $('#{{ resource.id }}_bookings_table').DataTable({}); + $('#{{ resource.id }}_vpn_user_table').DataTable({}); - $(function () { - var plotObj = $.plot($("#{{ resource.id }}_slave_utilization"), data_{{ resource.id }}, { - series: { - pie: { - show: true - } - } - }); + var chart_id = "{{ resource.id }}_booking_utilization"; + var utilization_url = "{% url 'dashboard:booking_utilization' resource_id=resource.id weeks=4 %}"; + loadChartData(chart_id, utilization_url); - }); + var chart_id = "{{ resource.id }}_jenkins_utilization"; + var utilization_url = "{% url 'dashboard:jenkins_utilization' resource_id=resource.id weeks=1 %}"; + loadChartData(chart_id, utilization_url); }); </script> {% endblock extrajs %}
\ No newline at end of file diff --git a/tools/pharos-dashboard/templates/dashboard/resource_all.html b/tools/pharos-dashboard/templates/dashboard/resource_all.html index 2078475f..a770d4e8 100644 --- a/tools/pharos-dashboard/templates/dashboard/resource_all.html +++ b/tools/pharos-dashboard/templates/dashboard/resource_all.html @@ -50,6 +50,7 @@ <script src="{% static "bower_components/flot/jquery.flot.resize.js" %}"></script> <script src="{% static "bower_components/flot/jquery.flot.time.js" %}"></script> <script src="{% static "bower_components/flot.tooltip/js/jquery.flot.tooltip.min.js" %}"></script> + <script src="{% static "js/flot-pie-chart.js" %}"></script>< <script type="text/javascript"> $(document).ready(function () { @@ -57,17 +58,15 @@ $('#{{ resource.id }}_server_table').DataTable({}); $('#{{ resource.id }}_bookings_table').DataTable({}); + $('#{{ resource.id }}_vpn_user_table').DataTable({}); - $(function () { - var plotObj = $.plot($("#{{ resource.id }}_slave_utilization"), data_{{ resource.id }}, { - series: { - pie: { - show: true - } - } - }); + var chart_id = "{{ resource.id }}_booking_utilization"; + var utilization_url = "{% url 'dashboard:booking_utilization' resource_id=resource.id weeks=4 %}"; + loadChartData(chart_id, utilization_url); - }); + var chart_id = "{{ resource.id }}_jenkins_utilization"; + var utilization_url = "{% url 'dashboard:jenkins_utilization' resource_id=resource.id weeks=1 %}"; + loadChartData(chart_id, utilization_url); {% endfor %} }); </script> diff --git a/tools/pharos-dashboard/templates/dashboard/resource_detail.html b/tools/pharos-dashboard/templates/dashboard/resource_detail.html index 4fba4766..6067e1ea 100644 --- a/tools/pharos-dashboard/templates/dashboard/resource_detail.html +++ b/tools/pharos-dashboard/templates/dashboard/resource_detail.html @@ -1,12 +1,27 @@ +{% load jenkins_filters %} + <div class="row"> <div class="col-lg-3"> <div class="panel panel-default"> <div class="panel-heading"> - Utilization + Jenkins Utilization + <div class="pull-right"> + <div class="form-group"> + <select onchange="loadChartData('{{ resource.id }}_jenkins_utilization', this.value);"> + <option value="{% url 'dashboard:jenkins_utilization' resource_id=resource.id weeks=1 %}"> + Last Week + </option> + <option value="{% url 'dashboard:jenkins_utilization' resource_id=resource.id weeks=4 %}"> + Last Month + </option> + </select> + </div> + </div> </div> <div class="panel-body"> <div class="flot-chart"> - <div class="flot-chart-content" id="{{ resource.id }}_slave_utilization"></div> + <div class="flot-chart-content" + id="{{ resource.id }}_jenkins_utilization"></div> </div> </div> </div> @@ -29,7 +44,39 @@ </div> </div> <div class="row"> - <div class="col-lg-6"> + <div class="col-lg-3"> + <div class="panel panel-default"> + <div class="panel-heading"> + Booking Utilization + <div class="pull-right"> + <div class="form-group"> + <select onchange="loadChartData('{{ resource.id }}_booking_utilization', this.value);"> + <option value="{% url 'dashboard:booking_utilization' resource_id=resource.id weeks=-4 %}"> + Last Month + </option> + <option value="{% url 'dashboard:booking_utilization' resource_id=resource.id weeks=-1 %}"> + Last Week + </option> + <option value="{% url 'dashboard:booking_utilization' resource_id=resource.id weeks=1 %}"> + Next Week + </option> + <option selected="selected" + value="{% url 'dashboard:booking_utilization' resource_id=resource.id weeks=4 %}"> + Next Month + </option> + </select> + </div> + </div> + </div> + <div class="panel-body"> + <div class="flot-chart"> + <div class="flot-chart-content" + id="{{ resource.id }}_booking_utilization"></div> + </div> + </div> + </div> + </div> + <div class="col-lg-9"> <div class="panel panel-default"> <div class="panel-heading"> Bookings @@ -46,19 +93,92 @@ </div> </div> </div> - -<script type="text/javascript"> - var data_{{ resource.id }} = [{ - label: "Offline", - data: {{ utilization.offline }}, - color: '#d9534f' - }, { - label: "Online", - data: {{ utilization.online }}, - color: '#5cb85c' - }, { - label: "Idle", - data: {{ utilization.idle }}, - color: '#5bc0de' - }]; -</script>
\ No newline at end of file +<div class="row"> + <div class="col-lg-3"> + <div class="panel panel-default"> + <div class="panel-heading"> + Contact + </div> + <div class="panel-body"> + <p> + <b>Lab Owner: </b> + {{ resource.owner.username }} + </p> + <p> + <b>Email: </b> + </p> + <p> + <a href="{% url 'booking:create' resource_id=resource.id %}" class="btn + btn-primary"> + Booking + </a> + <a href="{{ resource.url }}" class="btn + btn-primary"> + OPNFV Wiki + </a> + </p> + </div> + </div> + </div> + <div class="col-lg-3"> + <div class="panel panel-default"> + <div class="panel-heading"> + Jenkins Status + </div> + <div class="panel-body"> + <p> + <b>Slave Name: </b> + <a target='_blank' + href={{ resource.slave.url }}>{{ resource.slave.name }}</a> + </p> + <p> + <b>Status: </b> + {{ resource.slave.status }} + </p> + <p> + <b>Last Job: </b> + <a href="{{ resource.slave.last_job_url }}"> + {{ resource.slave.last_job_name }} + </a> + </p> + </div> + </div> + </div> + <div class="col-lg-6"> + <div class="panel panel-default"> + <div class="panel-heading"> + VPN Users + </div> + <div class="panel-body"> + <div class="dataTables_wrapper"> + <table class="table table-striped table-bordered table-hover" + id="{{ resource.id }}_vpn_user_table" cellspacing="0" + width="100%"> + <thead> + <tr> + <th>User</th> + <th>Email</th> + <th>Company</th> + </tr> + </thead> + <tbody> + {% for user in resource.vpn_users.all %} + <tr> + <th> + {{ user.username }} + </th> + <th> + {{ user.email }} + </th> + <th> + {{ user.userprofile.company }} + </th> + </tr> + {% endfor %} + </table> + </tbody> + </div> + </div> + </div> + </div> +</div>
\ No newline at end of file diff --git a/tools/pharos-dashboard/templates/dashboard/server_table.html b/tools/pharos-dashboard/templates/dashboard/server_table.html index d47e5204..fee7e8b1 100644 --- a/tools/pharos-dashboard/templates/dashboard/server_table.html +++ b/tools/pharos-dashboard/templates/dashboard/server_table.html @@ -26,5 +26,5 @@ {{ server.storage }} </th> </tr> -{% endfor %}` +{% endfor %} </tbody>
\ No newline at end of file diff --git a/tools/pharos-dashboard/templates/layout.html b/tools/pharos-dashboard/templates/layout.html index db9490f5..64fed4ae 100644 --- a/tools/pharos-dashboard/templates/layout.html +++ b/tools/pharos-dashboard/templates/layout.html @@ -20,7 +20,7 @@ <link href="{% static "bower_components/metisMenu/dist/metisMenu.min.css" %}" rel="stylesheet"> <!-- Custom CSS --> - <link href="{% static "bower_components/startbootstrap-sb-admin-2/dist/css/sb-admin-2.css" %}" + <link href="{% static "bower_components/startbootstrap-sb-admin-2-blackrockdigital/dist/css/sb-admin-2.css" %}" rel="stylesheet"> <link href="{% static "css/theme.css" %}" rel="stylesheet"> @@ -65,7 +65,7 @@ <script src="{% static "bower_components/metisMenu/dist/metisMenu.min.js" %}"></script> <!-- Custom Theme JavaScript --> -<script src="{% static "bower_components/startbootstrap-sb-admin-2/dist/js/sb-admin-2.js" %}"></script> +<script src="{% static "bower_components/startbootstrap-sb-admin-2-blackrockdigital/dist/js/sb-admin-2.js" %}"></script> {% block extrajs %} {% endblock extrajs %} |