summaryrefslogtreecommitdiffstats
path: root/tools/pharos-dashboard/templates
diff options
context:
space:
mode:
authormaxbr <maxbr@mi.fu-berlin.de>2016-08-19 17:15:28 +0200
committermaxbr <maxbr@mi.fu-berlin.de>2016-08-19 17:15:28 +0200
commitebaa05ab2b53634a7a3e738618a031fd1518d796 (patch)
tree2df4bf769f6ed52f4b9109a96d3194aa5a95e453 /tools/pharos-dashboard/templates
parent54322038f766be460b676d60974886be5f04d8f3 (diff)
Use Jira Oauth for user authentication
JIRA: RELENG-12 Users can use their jira accounts for the dashboard. This also allows the dasboard to open jira tickets for bookings. Signed-off-by: maxbr <maxbr@mi.fu-berlin.de>
Diffstat (limited to 'tools/pharos-dashboard/templates')
-rw-r--r--tools/pharos-dashboard/templates/account/userprofile_update_form.html30
-rw-r--r--tools/pharos-dashboard/templates/base.html16
-rw-r--r--tools/pharos-dashboard/templates/booking/booking_calendar.html21
-rw-r--r--tools/pharos-dashboard/templates/dashboard/lab_owner.html151
4 files changed, 210 insertions, 8 deletions
diff --git a/tools/pharos-dashboard/templates/account/userprofile_update_form.html b/tools/pharos-dashboard/templates/account/userprofile_update_form.html
new file mode 100644
index 00000000..0a921d51
--- /dev/null
+++ b/tools/pharos-dashboard/templates/account/userprofile_update_form.html
@@ -0,0 +1,30 @@
+{% extends "layout.html" %}
+{% load bootstrap3 %}
+
+{% block basecontent %}
+ <div class="container">
+ <div class="row">
+ <div class="col-md-4 col-md-offset-4">
+ {% bootstrap_messages %}
+ <div class="login-panel panel panel-default">
+ <div class="panel-heading">
+ <h3 class="panel-title">
+ {{ title }}
+ </h3>
+ </div>
+ <div class="panel-body">
+ <form method="post" action="">
+ {% csrf_token %}
+ {% bootstrap_form form %}
+ {% buttons %}
+ <button type="submit" class="btn btn btn-success">
+ Submit
+ </button>
+ {% endbuttons %}
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+{% endblock basecontent %}
diff --git a/tools/pharos-dashboard/templates/base.html b/tools/pharos-dashboard/templates/base.html
index 1479b043..64174a1f 100644
--- a/tools/pharos-dashboard/templates/base.html
+++ b/tools/pharos-dashboard/templates/base.html
@@ -39,11 +39,8 @@
{% else %}
<li><a href="{% url 'account:login' %}"><i
class="fa fa-sign-in fa-fw"></i>
- Login</a>
+ Login with Jira</a>
<li>
- <a href="{% url 'account:registration' %}"><i
- class="fa fa-edit fa-fw"></i>
- Register</a>
{% endif %}
</ul>
<!-- /.dropdown-user -->
@@ -57,18 +54,23 @@
<ul class="nav" id="side-menu">
<li>
<a href="{% url 'dashboard:ci_pods' %}"><i
- class="fa fa-table fa-fw"></i>CI-Pods</a>
+ class="fa fa-fw"></i>CI-Pods</a>
</li>
<li>
<a href="{% url 'dashboard:dev_pods' %}"><i
- class="fa fa-table fa-fw"></i>Development
+ class="fa fa-fw"></i>Development
Pods</a>
</li>
<li>
<a href="{% url 'dashboard:jenkins_slaves' %}"><i
- class="fa fa-table fa-fw"></i>Jenkins
+ class="fa fa-fw"></i>Jenkins
Slaves</a>
</li>
+ <li>
+ <a href="{% url 'dashboard:resources' %}"><i
+ class="fa fa-fw"></i>Resources
+ </a>
+ </li>
</ul>
</div>
<!-- /.sidebar-collapse -->
diff --git a/tools/pharos-dashboard/templates/booking/booking_calendar.html b/tools/pharos-dashboard/templates/booking/booking_calendar.html
index 1fa5dc4d..d144bb83 100644
--- a/tools/pharos-dashboard/templates/booking/booking_calendar.html
+++ b/tools/pharos-dashboard/templates/booking/booking_calendar.html
@@ -1,6 +1,8 @@
{% extends "dashboard/table.html" %}
{% load staticfiles %}
+{% load bootstrap3 %}
+
{% block extrahead %}
<link href="{% static "bower_components/fullcalendar/dist/fullcalendar.css" %}"
rel='stylesheet'/>
@@ -33,7 +35,24 @@
</div>
<div class="panel-body">
<div id="booking_form_div">
- {% include 'booking/booking_form.html' %}
+ {% bootstrap_form_errors form type='non_fields' %}
+ <form method="post" action="" class="form" id="bookingform">
+ {% csrf_token %}
+
+ <div class='input-group' id='starttimepicker'>
+ {% bootstrap_field form.start addon_after='<span class="glyphicon glyphicon-calendar"></span>' %}
+ </div>
+ <div class='input-group' id='endtimepicker'>
+ {% bootstrap_field form.end addon_after='<span class="glyphicon glyphicon-calendar"></span>' %}
+ </div>
+ {% bootstrap_field form.purpose %}
+
+ {% buttons %}
+ <button type="submit" class="btn btn btn-success">
+ Book
+ </button>
+ {% endbuttons %}
+ </form>
</div>
</div>
</div>
diff --git a/tools/pharos-dashboard/templates/dashboard/lab_owner.html b/tools/pharos-dashboard/templates/dashboard/lab_owner.html
new file mode 100644
index 00000000..a4f428c7
--- /dev/null
+++ b/tools/pharos-dashboard/templates/dashboard/lab_owner.html
@@ -0,0 +1,151 @@
+{% 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-3">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{ resource.name }}
+ </div>
+ <div class="panel-body">
+ <div class="flot-chart">
+ <div class="flot-chart-content" id="{{ resource.slave.name }}"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="col-lg-6">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ {{ resource.name }} Bookings
+ </div>
+ <div class="panel-body">
+ <div class="dataTables_wrapper">
+ <table class="table table-striped table-bordered table-hover"
+ id="{{ resource.slave.name }}_bookings" cellspacing="0"
+ width="100%">
+ <thead>
+ <tr>
+ <th>User</th>
+ <th>Purpose</th>
+ <th>Start</th>
+ <th>End</th>
+ <th>Status</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for booking in bookings %}
+ <tr>
+ <th>
+ {{ booking.user.username }}
+ </th>
+ <th>
+ {{ booking.purpose }}
+ </th>
+ <th>
+ {{ booking.start }}
+ </th>
+ <th>
+ {{ booking.end }}
+ </th>
+ <th>
+ Jira Status
+ </th>
+ </tr>
+ {% endfor %}`
+ </tbody>
+ </table>
+ </div>
+ </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 type="text/javascript">
+ $(document).ready(function () {
+
+
+ {% for resource, utilization, bookings in pods %}
+ $('#{{ resource.slave.name }}_bookings').DataTable({});
+
+ $(function () {
+ var data = [{
+ label: "Offline",
+ data: {{ utilization.offline }},
+ color: '#d9534f'
+ }, {
+ label: "Online",
+ data: {{ utilization.online }},
+ color: '#5cb85c'
+ }, {
+ label: "Idle",
+ data: {{ utilization.idle }},
+ color: '#5bc0de'
+ }];
+
+ var plotObj = $.plot($("#{{ resource.slave.name }}"), data, {
+ series: {
+ pie: {
+ show: true
+ }
+ },
+ grid: {
+ hoverable: false
+ },
+ tooltip: true,
+ tooltipOpts: {
+ content: "%p.0%, %s", // show percentages, rounding to 2 decimal places
+ shifts: {
+ x: 20,
+ y: 0
+ },
+ defaultTheme: false
+ }
+ });
+
+ });
+ {% endfor %}
+
+ });
+ </script>
+
+{% endblock extrajs %} \ No newline at end of file