summaryrefslogtreecommitdiffstats
path: root/tools/pharos-dashboard/templates
diff options
context:
space:
mode:
authormaxbr <maxbr@mi.fu-berlin.de>2016-07-29 12:43:43 +0200
committerMax Breitenfeldt <max.breitenfeldt@gmail.com>2016-07-29 11:25:20 +0000
commit35c34c690ae9616d791c39fa218fe1621fa8d8d2 (patch)
tree6168caaeb4be9144ed6bfde0150850d6559c8b6f /tools/pharos-dashboard/templates
parent7ae1f204de947a3c12804c04f32e20d45eb99eba (diff)
import pharos dashboard code
JIRA: RELENG-12 The last commit was missing some JS/CSS dependencies of the site. This happened because they are in folders that are named 'build' or 'dist'. This commit adds a bower.json file, that specifies dependencies. Dependencies can now be installed by running 'bower install' in the dashboard/static folder. Change-Id: I054f319c66771f767e97711cb678d79d3bd6bee4 Signed-off-by: maxbr <maxbr@mi.fu-berlin.de>
Diffstat (limited to 'tools/pharos-dashboard/templates')
-rw-r--r--tools/pharos-dashboard/templates/dashboard/base.html93
-rw-r--r--tools/pharos-dashboard/templates/dashboard/booking_calendar.html79
-rw-r--r--tools/pharos-dashboard/templates/dashboard/table.html50
-rw-r--r--tools/pharos-dashboard/templates/layout/base.html70
-rw-r--r--tools/pharos-dashboard/templates/registration/login.html61
-rw-r--r--tools/pharos-dashboard/templates/tables/ci_pods.html59
-rw-r--r--tools/pharos-dashboard/templates/tables/dev_pods.html58
-rw-r--r--tools/pharos-dashboard/templates/tables/jenkins_slaves.html42
8 files changed, 512 insertions, 0 deletions
diff --git a/tools/pharos-dashboard/templates/dashboard/base.html b/tools/pharos-dashboard/templates/dashboard/base.html
new file mode 100644
index 00000000..544bf0b3
--- /dev/null
+++ b/tools/pharos-dashboard/templates/dashboard/base.html
@@ -0,0 +1,93 @@
+{% extends "layout/base.html" %}
+{% load bootstrap3 %}
+
+{% block basecontent %}
+ <div id="wrapper">
+ <!-- Navigation -->
+ <nav class="navbar navbar-default navbar-static-top" role="navigation"
+ style="margin-bottom: 0">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse"
+ data-target=".navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a href="https://www.opnfv.org/" class="navbar-left"><img
+ src="https://www.opnfv.org/sites/all/themes/opnfv/logo.png"></a>
+ <a class="navbar-brand" href={% url 'dashboard:' %}>Pharos Dashboard</a>
+ </div>
+ <!-- /.navbar-header -->
+
+ <ul class="nav navbar-top-links navbar-right">
+ <li class="dropdown">
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
+ </a>
+ <ul class="dropdown-menu dropdown-user">
+ {% if user.is_authenticated %}
+ <li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
+ </li>
+ <li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
+ </li>
+ <li class="divider"></li>
+ <li><a href="{% url 'dashboard:logout' %}?next={{ request.path }}"><i
+ class="fa fa-sign-out fa-fw"></i>
+ Logout</a>
+ </li>
+ {% else %}
+ <li><a href="{% url 'dashboard:login' %}"><i
+ class="fa fa-sign-out fa-fw"></i>
+ Login</a>
+ {% endif %}
+ </ul>
+ <!-- /.dropdown-user -->
+ </li>
+ <!-- /.dropdown -->
+ </ul>
+ <!-- /.navbar-top-links -->
+
+ <div class="navbar-default sidebar" role="navigation">
+ <div class="sidebar-nav navbar-collapse">
+ <ul class="nav" id="side-menu">
+ <li>
+ <a href="{% url 'dashboard:ci_pods' %}"><i
+ class="fa fa-table fa-fw"></i>CI-Pods</a>
+ </li>
+ <li>
+ <a href="{% url 'dashboard:dev_pods' %}"><i
+ class="fa fa-table fa-fw"></i>Development
+ Pods</a>
+ </li>
+ <li>
+ <a href="{% url 'dashboard:jenkins_slaves' %}"><i
+ class="fa fa-table fa-fw"></i>Jenkins
+ Slaves</a>
+ </li>
+ </ul>
+ </div>
+ <!-- /.sidebar-collapse -->
+ </div>
+ <!-- /.navbar-static-side -->
+ </nav>
+
+ <!-- Page Content -->
+ <div id="page-wrapper">
+ <div class="row">
+ <div class="col-lg-12">
+ <h1 class="page-header">{{ title }}</h1>
+ </div>
+ <!-- /.col-lg-12 -->
+ </div>
+
+ {% bootstrap_messages %}
+
+ {% block content %}
+
+ {% endblock content %}
+ </div>
+ <!-- /#page-wrapper -->
+ </div>
+ <!-- /#wrapper -->
+{% endblock basecontent %} \ No newline at end of file
diff --git a/tools/pharos-dashboard/templates/dashboard/booking_calendar.html b/tools/pharos-dashboard/templates/dashboard/booking_calendar.html
new file mode 100644
index 00000000..0f6bece0
--- /dev/null
+++ b/tools/pharos-dashboard/templates/dashboard/booking_calendar.html
@@ -0,0 +1,79 @@
+{% extends "dashboard/base.html" %}
+{% load staticfiles %}
+{% load bootstrap3 %}
+
+{% block extrahead %}
+ <link href="{% static "bower_components/fullcalendar/dist/fullcalendar.css" %}"
+ rel='stylesheet'/>
+ <link href="{% static "bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" %}"
+ rel='stylesheet'/>
+{% endblock extrahead %}
+
+{% block content %}
+ <div class="row">
+ <div class="col-lg-8">
+ <div class="container-fluid">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ Calendar
+ </div>
+ <div class="panel-body">
+ <div id='calendar'>
+ </div>
+ </div>
+ <!-- /.panel-body -->
+ </div>
+ <!-- /.panel -->
+ </div>
+ </div>
+
+ <div class="col-lg-4">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ Booking
+ </div>
+ <div class="panel-body">
+ {% bootstrap_form_errors form type='non_fields' %}
+
+ <form method="post" class="form" id="bookingform">
+ {% csrf_token %}
+ <div class='input-group' id='starttimepicker'>
+ {% bootstrap_field form.start_date_time addon_after='<span class="glyphicon glyphicon-calendar"></span>' %}
+ </div>
+ <div class='input-group' id='endtimepicker'>
+ {% bootstrap_field form.end_date_time addon_after='<span class="glyphicon glyphicon-calendar"></span>' %}
+ </div>
+ {% bootstrap_field form.purpose %}
+ {{ form.booking_id }}
+ {% buttons %}
+ <button type="submit" class="btn btn btn-success"
+ id="submitform">
+ Book Pod
+ </button>
+ <button type="button" class="btn btn btn-danger hidden"
+ id="deletebutton">
+ Delete Booking
+ </button>
+ {% endbuttons %}
+ </form>
+
+ </div>
+ </div>
+ </div>
+ </div>
+{% endblock content %}
+
+{% block extrajs %}
+ <script type="text/javascript">
+ var bookings_url = '/resource/' + {{ resource.resource_id }} +'/bookings/';
+ </script>
+
+ <script src={% static "bower_components/moment/moment.js" %}></script>
+ <script src={% static "bower_components/fullcalendar/dist/fullcalendar.js" %}></script>
+ <script type="text/javascript"
+ src={% static "bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js" %}></script>
+ <script src={% static "js/fullcalendar-options.js" %}></script>
+ <script src={% static "js/datetimepicker-options.js" %}></script>
+ <script src={% static "js/csrf.js" %}></script>
+ <script src={% static "js/booking-calendar.js" %}></script>
+{% endblock extrajs %} \ No newline at end of file
diff --git a/tools/pharos-dashboard/templates/dashboard/table.html b/tools/pharos-dashboard/templates/dashboard/table.html
new file mode 100644
index 00000000..2d0b82ee
--- /dev/null
+++ b/tools/pharos-dashboard/templates/dashboard/table.html
@@ -0,0 +1,50 @@
+{% extends "dashboard/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
diff --git a/tools/pharos-dashboard/templates/layout/base.html b/tools/pharos-dashboard/templates/layout/base.html
new file mode 100644
index 00000000..e9e1cd1f
--- /dev/null
+++ b/tools/pharos-dashboard/templates/layout/base.html
@@ -0,0 +1,70 @@
+{% load staticfiles %}
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="description" content="">
+ <meta name="author" content="">
+
+ <title>OPNFV Pharos {{ title }}</title>
+
+ <!-- Bootstrap Core CSS -->
+ <link href="{% static "bower_components/bootstrap/dist/css/bootstrap.min.css" %}"
+ rel="stylesheet">
+
+ <!-- MetisMenu CSS -->
+ <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" %}"
+ rel="stylesheet">
+ <link href="{% static "css/theme.css" %}" rel="stylesheet">
+
+ <!-- Custom Fonts -->
+ <link href="{% static "bower_components/font-awesome/css/font-awesome.min.css" %}"
+ rel="stylesheet" type="text/css">
+
+ <!-- Favicon -->
+ <link rel="shortcut icon" href="{% static 'favicon.ico' %}">
+
+ {% block extrahead %}
+ {% endblock extrahead %}
+
+ <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
+ <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
+ <!--[if lt IE 9]>
+ <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
+ <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
+ <![endif]-->
+
+</head>
+
+{% block extrastyle %}
+{% endblock extrastyle %}
+
+<body>
+{% block basecontent %}
+{% endblock basecontent %}
+
+<!-- jQuery -->
+<script src="{% static "bower_components/jquery/dist/jquery.min.js" %}"></script>
+<script src="{% static "bower_components/jquery-migrate/jquery-migrate.min.js" %}"></script>
+
+{#<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>#}
+<!-- Bootstrap Core JavaScript -->
+<script src="{% static "bower_components/bootstrap/dist/js/bootstrap.min.js" %}"></script>
+
+<!-- Metis Menu Plugin JavaScript -->
+<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>
+
+{% block extrajs %}
+{% endblock extrajs %}
+</body>
+</html>
diff --git a/tools/pharos-dashboard/templates/registration/login.html b/tools/pharos-dashboard/templates/registration/login.html
new file mode 100644
index 00000000..efdcd1fb
--- /dev/null
+++ b/tools/pharos-dashboard/templates/registration/login.html
@@ -0,0 +1,61 @@
+{% extends "layout/base.html" %}
+
+{% block basecontent %}
+ <div class="container">
+ <div class="row">
+ <div class="col-md-4 col-md-offset-4">
+ {% if next %}
+ <div class="alert alert-dismissable alert-info">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ {% if user.is_authenticated %}
+ Your account doesn't have access to this page. To proceed,
+ please login with an account that has access.
+ {% else %}
+ Please login to see this page.
+ {% endif %}
+ </div>
+ {% endif %}
+ {% if form.errors %}
+ <div class="alert alert-danger alert-dismissable">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ Your username and password didn't match. Please try again.
+ </div>
+ {% endif %}
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-4 col-md-offset-4">
+ <div class="login-panel panel panel-default">
+ <div class="panel-heading">
+ <h3 class="panel-title">
+ Login
+ </h3>
+ </div>
+ <div class="panel-body">
+ <form method="post" action="{% url 'dashboard:login' %}">
+ {% csrf_token %}
+ <fieldset>
+ <div class="form-group">
+ <input class="form-control" placeholder="Username" name="username" type="text"
+ autofocus>
+ </div>
+ <div class="form-group">
+ <input class="form-control" placeholder="Password" name="password"
+ type="password" value="">
+ </div>
+ <input type="submit" value="Login" class="btn btn-lg btn-success btn-block"/>
+ <input type="hidden" name="next" value="{{ next }}"/>
+ </fieldset>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ {# Assumes you setup the password_reset view in your URLconf #}
+ {# <p><a href="{% url 'password_reset' %}">Lost password?</a></p>#}
+{% endblock basecontent %}
diff --git a/tools/pharos-dashboard/templates/tables/ci_pods.html b/tools/pharos-dashboard/templates/tables/ci_pods.html
new file mode 100644
index 00000000..3889664b
--- /dev/null
+++ b/tools/pharos-dashboard/templates/tables/ci_pods.html
@@ -0,0 +1,59 @@
+{% extends "dashboard/table.html" %}
+{% load staticfiles %}
+
+{% 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>
+ <th>
+ <a target='_blank' href={{ pod.url }}>{{ pod.name }}</a>
+ </th>
+ <th>
+ <a target='_blank' href={{ pod.slaveurl }}>{{ pod.slavename }}</a>
+ </th>
+ <th style="background-color:{{ pod.status_color }}">
+ {{ pod.status }}
+ </th>
+ <th {{ pod.last_job.blink }}>
+ {{ pod.last_job.installer }}
+ </th>
+ <th {{ pod.last_job.blink }}>
+ {{ pod.last_job.scenario }}
+ </th>
+ <th {{ pod.last_job.blink }}>
+ {{ pod.last_job.branch }}
+ </th>
+ <th><a {{ pod.last_job.blink }} style="color:{{ pod.last_job.color }}"
+ target='_blank'
+ href={{ pod.last_job.url }}>{{ pod.last_job.name }}</a>
+ </th>
+ </tr>
+ {% endfor %}`
+ </tbody>
+ </table>
+{% 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/templates/tables/dev_pods.html b/tools/pharos-dashboard/templates/tables/dev_pods.html
new file mode 100644
index 00000000..730aa953
--- /dev/null
+++ b/tools/pharos-dashboard/templates/tables/dev_pods.html
@@ -0,0 +1,58 @@
+{% extends "dashboard/table.html" %}
+{% load staticfiles %}
+
+{% block table %}
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Slave Name</th>
+ <th>Booked by</th>
+ <th>Booked until</th>
+ <th>Purpose</th>
+ <th>Status</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for pod in dev_pods %}
+ <tr>
+ <th>
+ <a target='_blank' href={{ pod.url }}>{{ pod.name }}</a>
+ </th>
+ <th>
+ <a target='_blank' href={{ pod.slaveurl }}>{{ pod.slavename }}</a>
+ </th>
+ <th>
+ {{ pod.current_booking.user }}
+ </th>
+ <th>
+ {{ pod.current_booking.end_date_time }}
+ </th>
+ <th>
+ {{ pod.current_booking.purpose }}
+ </th>
+ <th style="background-color:{{ pod.status_color }}">
+ {{ pod.status }}
+ </th>
+ <th>
+ <a href='{% url 'dashboard:booking_calendar' %}{{ pod.resource_id }}' class="btn btn-primary">
+ Book
+ </a>
+ </th>
+ </tr>
+ {% endfor %}
+ </tbody>
+{% endblock table %}
+
+{% block tablejs %}
+ <script type="text/javascript">
+ $(document).ready(function () {
+ $('#table').DataTable({
+ columnDefs: [
+ {type: 'status', targets: 5}
+ ],
+ "order": [[5, "asc"]]
+ });
+ });
+ </script>
+{% endblock tablejs %} \ No newline at end of file
diff --git a/tools/pharos-dashboard/templates/tables/jenkins_slaves.html b/tools/pharos-dashboard/templates/tables/jenkins_slaves.html
new file mode 100644
index 00000000..2d011b46
--- /dev/null
+++ b/tools/pharos-dashboard/templates/tables/jenkins_slaves.html
@@ -0,0 +1,42 @@
+{% extends "dashboard/table.html" %}
+{% load staticfiles %}
+
+{% block table %}
+ <thead>
+ <tr>
+ <th>Slave name</th>
+ <th>Status</th>
+ <th>Job</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for slave in slaves %}
+ <tr>
+ <th><a target='_blank'
+ href={{ slave.slaveurl }}>{{ slave.displayName }}</a>
+ </th>
+ <th style="background-color:{{ slave.status_color }}">
+ {{ slave.status }}
+ </th>
+ <th><a {{ slave.last_job.blink }} style="color:{{ slave.last_job.color }}"
+ target="_blank" href={{ slave.last_job.url }}>
+ {{ slave.last_job.name }}</a>
+ </th>
+ </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