summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulien zhang <zhang.jun3g@zte.com.cn>2017-09-11 14:20:17 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-09-11 14:20:17 +0000
commit8d34f96fb1ed9bf34ad3da17048e1e29f71106ed (patch)
tree187c2b1ee6cc79b342f007185d37f78278279e68
parentaa88673c38be12368dead5e8241fb915d790c431 (diff)
parentb21ea724ac619f218d6e18ee2439492609d5755b (diff)
Merge "Fix Booking API"
-rw-r--r--tools/pharos-dashboard/src/api/serializers.py7
-rw-r--r--tools/pharos-dashboard/src/templates/account/user_list.html1
-rw-r--r--tools/pharos-dashboard/src/templates/booking/booking_list.html10
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/ci_pods.html3
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/dev_pods.html3
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html3
-rw-r--r--tools/pharos-dashboard/src/templates/dashboard/table.html9
-rw-r--r--tools/pharos-dashboard/src/templates/layout.html4
8 files changed, 17 insertions, 23 deletions
diff --git a/tools/pharos-dashboard/src/api/serializers.py b/tools/pharos-dashboard/src/api/serializers.py
index f8f02a2c..237ca029 100644
--- a/tools/pharos-dashboard/src/api/serializers.py
+++ b/tools/pharos-dashboard/src/api/serializers.py
@@ -13,10 +13,9 @@ from rest_framework import serializers
from booking.models import Booking
from dashboard.models import Server, Resource, ResourceStatus
-
class BookingSerializer(serializers.ModelSerializer):
- installer_name = serializers.RelatedField(source='installer', read_only=True)
- scenario_name = serializers.RelatedField(source='scenario', read_only=True)
+ installer_name = serializers.CharField(source='installer.name')
+ scenario_name = serializers.CharField(source='scenario.name')
class Meta:
model = Booking
@@ -37,4 +36,4 @@ class ResourceSerializer(serializers.ModelSerializer):
class ResourceStatusSerializer(serializers.ModelSerializer):
class Meta:
model = ResourceStatus
- fields = ('id', 'resource', 'timestamp','type', 'title', 'content') \ No newline at end of file
+ fields = ('id', 'resource', 'timestamp','type', 'title', 'content')
diff --git a/tools/pharos-dashboard/src/templates/account/user_list.html b/tools/pharos-dashboard/src/templates/account/user_list.html
index f18e1618..68178ebe 100644
--- a/tools/pharos-dashboard/src/templates/account/user_list.html
+++ b/tools/pharos-dashboard/src/templates/account/user_list.html
@@ -47,6 +47,7 @@
<script type="text/javascript">
$(document).ready(function () {
$('#table').DataTable({
+ scrollX: true,
"order": [[0, "asc"]]
});
});
diff --git a/tools/pharos-dashboard/src/templates/booking/booking_list.html b/tools/pharos-dashboard/src/templates/booking/booking_list.html
index f2991e4c..ccdc46d7 100644
--- a/tools/pharos-dashboard/src/templates/booking/booking_list.html
+++ b/tools/pharos-dashboard/src/templates/booking/booking_list.html
@@ -13,8 +13,6 @@
{% 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"
@@ -24,9 +22,7 @@
</table>
</div>
<!-- /.table-responsive -->
- </div>
<!-- /.panel-body -->
- </div>
<!-- /.panel -->
</div>
<!-- /.col-lg-12 -->
@@ -44,7 +40,9 @@
<script type="text/javascript">
$(document).ready(function () {
- $('#table').DataTable({});
+ $('#table').DataTable({
+ scrollX: true,
+ });
});
</script>
-{% endblock extrajs %} \ No newline at end of file
+{% endblock extrajs %}
diff --git a/tools/pharos-dashboard/src/templates/dashboard/ci_pods.html b/tools/pharos-dashboard/src/templates/dashboard/ci_pods.html
index 7ef62a43..a20be957 100644
--- a/tools/pharos-dashboard/src/templates/dashboard/ci_pods.html
+++ b/tools/pharos-dashboard/src/templates/dashboard/ci_pods.html
@@ -50,6 +50,7 @@
<script type="text/javascript">
$(document).ready(function () {
$('#table').DataTable({
+ scrollX: true,
columnDefs: [
{type: 'status', targets: 2}
],
@@ -57,4 +58,4 @@
});
});
</script>
-{% endblock tablejs %} \ No newline at end of file
+{% endblock tablejs %}
diff --git a/tools/pharos-dashboard/src/templates/dashboard/dev_pods.html b/tools/pharos-dashboard/src/templates/dashboard/dev_pods.html
index 2b4b0177..a6f3b2ee 100644
--- a/tools/pharos-dashboard/src/templates/dashboard/dev_pods.html
+++ b/tools/pharos-dashboard/src/templates/dashboard/dev_pods.html
@@ -59,6 +59,7 @@
<script type="text/javascript">
$(document).ready(function () {
$('#table').DataTable({
+ scrollX: true,
columnDefs: [
{type: 'status', targets: 6}
],
@@ -66,4 +67,4 @@
});
});
</script>
-{% endblock tablejs %} \ No newline at end of file
+{% endblock tablejs %}
diff --git a/tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html b/tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html
index aa74507c..fa361b13 100644
--- a/tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html
+++ b/tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html
@@ -35,6 +35,7 @@
<script type="text/javascript">
$(document).ready(function () {
$('#table').DataTable({
+ scrollX: true,
columnDefs: [
{type: 'status', targets: 1}
],
@@ -42,4 +43,4 @@
});
});
</script>
-{% endblock tablejs %} \ No newline at end of file
+{% endblock tablejs %}
diff --git a/tools/pharos-dashboard/src/templates/dashboard/table.html b/tools/pharos-dashboard/src/templates/dashboard/table.html
index addd5c12..d59f0e34 100644
--- a/tools/pharos-dashboard/src/templates/dashboard/table.html
+++ b/tools/pharos-dashboard/src/templates/dashboard/table.html
@@ -13,8 +13,6 @@
{% 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%">
@@ -25,9 +23,7 @@
</table>
</div>
<!-- /.table-responsive -->
- </div>
<!-- /.panel-body -->
- </div>
<!-- /.panel -->
</div>
<!-- /.col-lg-12 -->
@@ -36,9 +32,6 @@
{% 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>
@@ -47,4 +40,4 @@
{% block tablejs %}
{% endblock tablejs %}
-{% endblock extrajs %} \ No newline at end of file
+{% endblock extrajs %}
diff --git a/tools/pharos-dashboard/src/templates/layout.html b/tools/pharos-dashboard/src/templates/layout.html
index 64fed4ae..9578e155 100644
--- a/tools/pharos-dashboard/src/templates/layout.html
+++ b/tools/pharos-dashboard/src/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-blackrockdigital/dist/css/sb-admin-2.css" %}"
+ <link href="{% static "bower_components/startbootstrap-sb-admin-2-blackrockdigital/dist/css/sb-admin-2.min.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-blackrockdigital/dist/js/sb-admin-2.js" %}"></script>
+<script src="{% static "bower_components/startbootstrap-sb-admin-2-blackrockdigital/dist/js/sb-admin-2.min.js" %}"></script>
{% block extrajs %}
{% endblock extrajs %}