summaryrefslogtreecommitdiffstats
path: root/tools/pharos-dashboard/src/templates/dashboard
diff options
context:
space:
mode:
authormaxbr <maxbr@mi.fu-berlin.de>2016-09-26 16:36:11 +0200
committermaxbr <maxbr@mi.fu-berlin.de>2016-09-26 16:36:11 +0200
commitff30b14a212f38cf59084d30e9f13f9f92d2be3b (patch)
treecbe10ef00ef2be5650bedb5b81e24bd3b205f52c /tools/pharos-dashboard/src/templates/dashboard
parent3ebfdcbcc91202482edb3f63fedde48646728fcd (diff)
Restructure dashboard project for docker deploying
Change-Id: I13cad51270504ee4bed8558598a8891af58a26ab Signed-off-by: maxbr <maxbr@mi.fu-berlin.de>
Diffstat (limited to 'tools/pharos-dashboard/src/templates/dashboard')
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/ci_pods.html60
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/dev_pods.html69
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html45
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/resource.html58
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/resource_all.html73
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/resource_detail.html184
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/server_table.html30
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/table.html50
8 files changed, 569 insertions, 0 deletions
diff --git a/tools/pharos-dashboard/src/templates/dashboard/ci_pods.html b/tools/pharos-dashboard/src/templates/dashboard/ci_pods.html
new file mode 100644
index 00000000..7ef62a43
--- /dev/null
+++ b/tools/pharos-dashboard/src/templates/dashboard/ci_pods.html
@@ -0,0 +1,60 @@
+{% extends "dashboard/table.html" %}
+{% load staticfiles %}
+{% load jenkins_filters %}
+
+{% block table %}
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Slave Name</th>
+ <th>Status</th>
+ <th>Installer</th>
+ <th>Scenario</th>
+ <th>Branch</th>
+ <th>Job</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for pod in ci_pods %}
+ <tr>
+ <td>
+ <a target='_blank' href={{ pod.url }}>{{ pod.name }}</a>
+ </td>
+ <td>
+ <a target='_blank' href={{ pod.slave.url }}>{{ pod.slave.name }}</a>
+ </td>
+ <td style="background-color:{{ pod.slave.status | jenkins_status_color }}">
+ {{ pod.slave.status }}
+ </td>
+ <td {{ pod.slave.last_job_result | jenkins_job_blink }}>
+ {{ pod.slave.last_job_installer }}
+ </td>
+ <td {{ pod.slave.last_job_result | jenkins_job_blink }}>
+ {{ pod.slave.last_job_scenario }}
+ </td>
+ <td {{ pod.slave.last_job_result | jenkins_job_blink }}>
+ {{ pod.slave.last_job_branch }}
+ </td>
+ <td><a {{ pod.slave.last_job_result | jenkins_job_blink }}
+ style="color:{{ pod.slave.last_job_result | jenkins_job_color }}"
+ target='_blank'
+ href={{ pod.slave.last_job_url }}>{{ pod.slave.last_job_name }}</a>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+{% endblock table %}
+
+
+{% block tablejs %}
+ <script type="text/javascript">
+ $(document).ready(function () {
+ $('#table').DataTable({
+ columnDefs: [
+ {type: 'status', targets: 2}
+ ],
+ "order": [[2, "asc"]]
+ });
+ });
+ </script>
+{% endblock tablejs %} \ No newline at end of file
diff --git a/tools/pharos-dashboard/src/templates/dashboard/dev_pods.html b/tools/pharos-dashboard/src/templates/dashboard/dev_pods.html
new file mode 100644
index 00000000..2b4b0177
--- /dev/null
+++ b/tools/pharos-dashboard/src/templates/dashboard/dev_pods.html
@@ -0,0 +1,69 @@
+{% extends "dashboard/table.html" %}
+{% load staticfiles %}
+{% load jenkins_filters %}
+
+{% block table %}
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Slave Name</th>
+ <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, utilization in dev_pods %}
+ <tr>
+ <td>
+ <a href={% url 'dashboard:resource' resource_id=pod.id %}>{{ pod.name }}</a>
+ </td>
+ <td>
+ <a target='_blank' href={{ pod.slave.url }}>{{ pod.slave.name }}</a>
+ </td>
+ <td>
+ {{ booking.user.username }}
+ </td>
+ <td>
+ {{ booking.end }}
+ </td>
+ <td>
+ {{ booking.purpose }}
+ </td>
+ <td>
+ {{ utilization }}
+ </td>
+ <td style="background-color:{{ pod.slave.status | jenkins_status_color }}">
+ {{ pod.slave.status }}
+ </td>
+ <td>
+ <a href="{% url 'booking:create' resource_id=pod.id %}" class="btn btn-primary">
+ Book
+ </a>
+ </td>
+ <td>
+ <a href="{% url 'dashboard:resource' resource_id=pod.id %}" class="btn btn-primary">
+ Info
+ </a>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+{% endblock table %}
+
+{% block tablejs %}
+ <script type="text/javascript">
+ $(document).ready(function () {
+ $('#table').DataTable({
+ columnDefs: [
+ {type: 'status', targets: 6}
+ ],
+ "order": [[6, "asc"]]
+ });
+ });
+ </script>
+{% endblock tablejs %} \ No newline at end of file
diff --git a/tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html b/tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html
new file mode 100644
index 00000000..aa74507c
--- /dev/null
+++ b/tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html
@@ -0,0 +1,45 @@
+{% extends "dashboard/table.html" %}
+{% load staticfiles %}
+
+{% load jenkins_filters %}
+
+{% block table %}
+ <thead>
+ <tr>
+ <th>Slave name</th>
+ <th>Status</th>
+ <th>Job</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for slave in slaves %}
+ <tr>
+ <td><a target='_blank'
+ href={{ slave.url }}>{{ slave.name }}</a>
+ </td>
+ <td style="background-color:{{ slave.status | jenkins_status_color }}">
+ {{ slave.status }}
+ </td>
+ <td><a {{ slave.last_job_result | jenkins_job_blink }}
+ style="color:{{ slave.last_job_result | jenkins_job_color }}"
+ target="_blank" href={{ slave.last_job_url }}>
+ {{ slave.last_job_name }}</a>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+{% endblock table %}
+
+
+{% block tablejs %}
+ <script type="text/javascript">
+ $(document).ready(function () {
+ $('#table').DataTable({
+ columnDefs: [
+ {type: 'status', targets: 1}
+ ],
+ "order": [[1, "asc"]]
+ });
+ });
+ </script>
+{% endblock tablejs %} \ No newline at end of file
diff --git a/tools/pharos-dashboard/src/templates/dashboard/resource.html b/tools/pharos-dashboard/src/templates/dashboard/resource.html
new file mode 100644
index 00000000..c9e57354
--- /dev/null
+++ b/tools/pharos-dashboard/src/templates/dashboard/resource.html
@@ -0,0 +1,58 @@
+{% extends "base.html" %}
+{% load staticfiles %}
+
+{% block extrahead %}
+ <!-- Morris Charts CSS -->
+ <link href="{% static "bower_components/morrisjs/morris.css" %}" rel="stylesheet">
+
+ <!-- DataTables CSS -->
+ <link href="{% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" %}"
+ rel="stylesheet">
+
+ <!-- DataTables Responsive CSS -->
+ <link href="{% static "bower_components/datatables-responsive/css/dataTables.responsive.css" %}"
+ rel="stylesheet">
+{% endblock extrahead %}
+
+
+{% block content %}
+ {% include "dashboard/resource_detail.html" %}
+{% endblock content %}
+
+
+{% block extrajs %}
+ <!-- DataTables JavaScript -->
+ <link href="{% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" %}"
+ rel="stylesheet">
+
+ <script src={% static "bower_components/datatables/media/js/jquery.dataTables.min.js" %}></script>
+ <script src={% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js" %}></script>
+
+
+
+ <!-- Flot Charts JavaScript -->
+ <script src="{% static "bower_components/flot/excanvas.min.js" %}"></script>
+ <script src="{% static "bower_components/flot/jquery.flot.js" %}"></script>
+ <script src="{% static "bower_components/flot/jquery.flot.pie.js" %}"></script>
+ <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 () {
+ $('#{{ resource.id }}_server_table').DataTable({});
+ $('#{{ resource.id }}_bookings_table').DataTable({});
+ $('#{{ resource.id }}_vpn_user_table').DataTable({});
+
+ 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/src/templates/dashboard/resource_all.html b/tools/pharos-dashboard/src/templates/dashboard/resource_all.html
new file mode 100644
index 00000000..a770d4e8
--- /dev/null
+++ b/tools/pharos-dashboard/src/templates/dashboard/resource_all.html
@@ -0,0 +1,73 @@
+{% extends "base.html" %}
+{% load staticfiles %}
+
+{% block extrahead %}
+ <!-- Morris Charts CSS -->
+ <link href="{% static "bower_components/morrisjs/morris.css" %}" rel="stylesheet">
+
+ <!-- DataTables CSS -->
+ <link href="{% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" %}"
+ rel="stylesheet">
+
+ <!-- DataTables Responsive CSS -->
+ <link href="{% static "bower_components/datatables-responsive/css/dataTables.responsive.css" %}"
+ rel="stylesheet">
+{% endblock extrahead %}
+
+
+{% block content %}
+ {% for resource, utilization, bookings in pods %}
+ <div class="row">
+ <div class="col-lg-12">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{ resource.name }}
+ </div>
+ <div class="panel-body">
+ {% include "dashboard/resource_detail.html" %}
+ </div>
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+{% endblock content %}
+
+
+{% block extrajs %}
+ <!-- DataTables JavaScript -->
+ <link href="{% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" %}"
+ rel="stylesheet">
+
+ <script src={% static "bower_components/datatables/media/js/jquery.dataTables.min.js" %}></script>
+ <script src={% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js" %}></script>
+
+
+
+ <!-- Flot Charts JavaScript -->
+ <script src="{% static "bower_components/flot/excanvas.min.js" %}"></script>
+ <script src="{% static "bower_components/flot/jquery.flot.js" %}"></script>
+ <script src="{% static "bower_components/flot/jquery.flot.pie.js" %}"></script>
+ <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 () {
+ {% for resource, utilization, bookings in pods %}
+
+ $('#{{ resource.id }}_server_table').DataTable({});
+ $('#{{ resource.id }}_bookings_table').DataTable({});
+ $('#{{ resource.id }}_vpn_user_table').DataTable({});
+
+ 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>
+{% endblock extrajs %} \ No newline at end of file
diff --git a/tools/pharos-dashboard/src/templates/dashboard/resource_detail.html b/tools/pharos-dashboard/src/templates/dashboard/resource_detail.html
new file mode 100644
index 00000000..657d5656
--- /dev/null
+++ b/tools/pharos-dashboard/src/templates/dashboard/resource_detail.html
@@ -0,0 +1,184 @@
+{% load jenkins_filters %}
+
+<div class="row">
+ <div class="col-lg-3">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ 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 }}_jenkins_utilization"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="col-lg-9">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ Servers
+ </div>
+ <div class="panel-body">
+ <div class="dataTables_wrapper">
+ <table class="table table-striped table-bordered table-hover"
+ id="{{ resource.id }}_server_table" cellspacing="0"
+ width="100%">
+ {% include "dashboard/server_table.html" %}
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<div class="row">
+ <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
+ </div>
+ <div class="panel-body">
+ <div class="dataTables_wrapper">
+ <table class="table table-striped table-bordered table-hover"
+ id="{{ resource.id }}_bookings_table" cellspacing="0"
+ width="100%">
+ {% include "booking/booking_table.html" %}
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<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>
+ <td>
+ {{ user.username }}
+ </td>
+ <td>
+ {{ user.email }}
+ </td>
+ <td>
+ {{ user.userprofile.company }}
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+ </tbody>
+ </div>
+ </div>
+ </div>
+ </div>
+</div> \ No newline at end of file
diff --git a/tools/pharos-dashboard/src/templates/dashboard/server_table.html b/tools/pharos-dashboard/src/templates/dashboard/server_table.html
new file mode 100644
index 00000000..f01bd603
--- /dev/null
+++ b/tools/pharos-dashboard/src/templates/dashboard/server_table.html
@@ -0,0 +1,30 @@
+<thead>
+<tr>
+ <th>Server</th>
+ <th>Model</th>
+ <th>CPU</th>
+ <th>RAM</th>
+ <th>Storage</th>
+</tr>
+</thead>
+<tbody>
+{% for server in resource.server_set.all %}
+ <tr>
+ <td>
+ {{ server.name }}
+ </td>
+ <td>
+ {{ server.model }}
+ </td>
+ <td>
+ {{ server.cpu }}
+ </td>
+ <td>
+ {{ server.ram }}
+ </td>
+ <td>
+ {{ server.storage }}
+ </td>
+ </tr>
+{% endfor %}
+</tbody> \ No newline at end of file
diff --git a/tools/pharos-dashboard/src/templates/dashboard/table.html b/tools/pharos-dashboard/src/templates/dashboard/table.html
new file mode 100644
index 00000000..addd5c12
--- /dev/null
+++ b/tools/pharos-dashboard/src/templates/dashboard/table.html
@@ -0,0 +1,50 @@
+{% extends "base.html" %}
+{% load staticfiles %}
+
+{% block extrahead %}
+ <!-- DataTables CSS -->
+ <link href="{% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" %}"
+ rel="stylesheet">
+
+ <!-- DataTables Responsive CSS -->
+ <link href="{% static "bower_components/datatables-responsive/css/dataTables.responsive.css" %}" rel="stylesheet">
+{% endblock extrahead %}
+
+{% block content %}
+ <div class="row">
+ <div class="col-lg-12">
+ <div class="panel panel-default">
+ <div class="panel-body">
+ <div class="dataTables_wrapper">
+ <table class="table table-striped table-bordered table-hover" id="table" cellspacing="0"
+ width="100%">
+
+ {% block table %}
+ {% endblock table %}
+
+ </table>
+ </div>
+ <!-- /.table-responsive -->
+ </div>
+ <!-- /.panel-body -->
+ </div>
+ <!-- /.panel -->
+ </div>
+ <!-- /.col-lg-12 -->
+ </div>
+{% endblock content %}
+
+{% block extrajs %}
+ <!-- DataTables JavaScript -->
+ <link href="{% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" %}"
+ rel="stylesheet">
+
+
+ <script src={% static "bower_components/datatables/media/js/jquery.dataTables.min.js" %}></script>
+ <script src={% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js" %}></script>
+
+ <script src={% static "js/dataTables-sort.js" %}></script>
+
+ {% block tablejs %}
+ {% endblock tablejs %}
+{% endblock extrajs %} \ No newline at end of file