summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorank <ank.svu@gmail.com>2016-01-28 17:47:56 +0530
committerSumit Naiksatam <sumitnaiksatam@gmail.com>2016-02-08 03:59:21 +0000
commit8b731e1a87e22b7aa5e281bbe84d5fe3e5311618 (patch)
treedc81ca245df2e2426adc738786abe5a89f339e98
parent6b892f36ecf6b8a8033f988a3419387464d8c5ee (diff)
Policy Classifier creation dialog keeps loading forever
Due to change in horizon base url from / to /dashboard, javascript files are not getting loaded Change-Id: I7bd713124ffaff4d3a884a1ba40b1bdd1342439e Closes-bug: #1538679
Notes
Notes (review): Code-Review+2: Sumit Naiksatam <sumitnaiksatam@gmail.com> Workflow+1: Magesh GV <mageshgv@gmail.com> Code-Review+2: Magesh GV <mageshgv@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 08 Feb 2016 05:17:43 +0000 Reviewed-on: https://review.openstack.org/273496 Project: openstack/group-based-policy-ui Branch: refs/heads/master
-rw-r--r--gbpui/column_filters.py10
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/_add_policy_classifier.html2
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/_update_policy_classifier.html2
-rw-r--r--gbpui/panels/network_services/tabs.py5
-rw-r--r--gbpui/panels/network_services/templates/network_services/_create_service_chain_spec.html4
-rw-r--r--gbpui/panels/network_services/templates/network_services/_scnode_details.html9
-rw-r--r--gbpui/panels/network_services/templates/network_services/_update_service_chain_spec.html4
-rw-r--r--gbpui/static/dashboard/css/jstree.css42
-rw-r--r--gbpui/static/dashboard/css/scspec.css2
9 files changed, 42 insertions, 38 deletions
diff --git a/gbpui/column_filters.py b/gbpui/column_filters.py
index 9939167..bba5b70 100644
--- a/gbpui/column_filters.py
+++ b/gbpui/column_filters.py
@@ -13,6 +13,7 @@
13import logging 13import logging
14import os 14import os
15 15
16from django.conf import settings
16from django.core.urlresolvers import reverse 17from django.core.urlresolvers import reverse
17from django.utils.safestring import mark_safe 18from django.utils.safestring import mark_safe
18 19
@@ -143,7 +144,8 @@ def update_policyaction_attributes(request, paction):
143 144
144 145
145def update_sc_spec_attributes(request, scspec): 146def update_sc_spec_attributes(request, scspec):
146 img_path = "/static/dashboard/img/" 147 static_url = getattr(settings, 'STATIC_URL', "/static/")
148 img_path = static_url + "dashboard/img/"
147 provider = "default" 149 provider = "default"
148 nodes = scspec.nodes 150 nodes = scspec.nodes
149 nodes = [client.get_servicechain_node(request, item) for item in nodes] 151 nodes = [client.get_servicechain_node(request, item) for item in nodes]
@@ -154,8 +156,8 @@ def update_sc_spec_attributes(request, scspec):
154 if os.path.exists(ds_path): 156 if os.path.exists(ds_path):
155 local_img_path = ds_path 157 local_img_path = ds_path
156 else: 158 else:
157 local_img_path = "/usr/share/openstack-dashboard/openstack_dashboard/" \ 159 local_img_path = "/usr/share/openstack-dashboard/" \
158 + "static/dashboard/img/" 160 + "openstack_dashboard/static/dashboard/img/"
159 if os.path.exists(local_img_path): 161 if os.path.exists(local_img_path):
160 providers = os.listdir(local_img_path) 162 providers = os.listdir(local_img_path)
161 for p in providers: 163 for p in providers:
@@ -239,7 +241,7 @@ def update_classifier_attributes(classifiers):
239 if type(classifiers) == list: 241 if type(classifiers) == list:
240 for classifier in classifiers: 242 for classifier in classifiers:
241 classifier.set_id_as_name_if_empty() 243 classifier.set_id_as_name_if_empty()
242 if classifier.protocol in ['tcp', 'udp'] and classifier.port_range \ 244 if classifier.protocol in ['tcp', 'udp'] and classifier.port_range\
243 in port_protocol_map: 245 in port_protocol_map:
244 classifier.protocol = port_protocol_map[classifier.port_range] 246 classifier.protocol = port_protocol_map[classifier.port_range]
245 else: 247 else:
diff --git a/gbpui/panels/application_policy/templates/application_policy/_add_policy_classifier.html b/gbpui/panels/application_policy/templates/application_policy/_add_policy_classifier.html
index 8441f12..feedad6 100644
--- a/gbpui/panels/application_policy/templates/application_policy/_add_policy_classifier.html
+++ b/gbpui/panels/application_policy/templates/application_policy/_add_policy_classifier.html
@@ -26,5 +26,5 @@
26 26
27 27
28{% block modal-js %} 28{% block modal-js %}
29 <script src='/static/dashboard/js/horizon.protocolmap.js' type="text/javascript"></script> 29 <script src='{{ STATIC_URL }}dashboard/js/horizon.protocolmap.js' type="text/javascript"></script>
30{% endblock %} 30{% endblock %}
diff --git a/gbpui/panels/application_policy/templates/application_policy/_update_policy_classifier.html b/gbpui/panels/application_policy/templates/application_policy/_update_policy_classifier.html
index c6aaa86..8b6efad 100644
--- a/gbpui/panels/application_policy/templates/application_policy/_update_policy_classifier.html
+++ b/gbpui/panels/application_policy/templates/application_policy/_update_policy_classifier.html
@@ -25,5 +25,5 @@
25{% endblock %} 25{% endblock %}
26 26
27{% block modal-js %} 27{% block modal-js %}
28 <script src='/static/dashboard/js/horizon.protocolmap.js' type="text/javascript"></script> 28 <script src='{{ STATIC_URL }}dashboard/js/horizon.protocolmap.js' type="text/javascript"></script>
29{% endblock %} 29{% endblock %}
diff --git a/gbpui/panels/network_services/tabs.py b/gbpui/panels/network_services/tabs.py
index 87f20ca..cb6b946 100644
--- a/gbpui/panels/network_services/tabs.py
+++ b/gbpui/panels/network_services/tabs.py
@@ -13,6 +13,7 @@
13import json 13import json
14import yaml 14import yaml
15 15
16from django.contrib.staticfiles.templatetags.staticfiles import static
16from django.core.urlresolvers import reverse_lazy 17from django.core.urlresolvers import reverse_lazy
17from django.utils.translation import ugettext_lazy as _ 18from django.utils.translation import ugettext_lazy as _
18 19
@@ -164,7 +165,7 @@ class ServiceChainNodeDetailsTab(tabs.Tab):
164 node["text"] = key 165 node["text"] = key
165 else: 166 else:
166 node["text"] = key + " : " + str(value) 167 node["text"] = key + " : " + str(value)
167 node["icon"] = "/static/dashboard/img/text.png" 168 node["icon"] = static("dashboard/img/text.png")
168 169
169 tree.append(node) 170 tree.append(node)
170 return json.dumps(tree) 171 return json.dumps(tree)
@@ -206,7 +207,7 @@ class ServiceChainNodeDetailsTab(tabs.Tab):
206 node["text"] = key 207 node["text"] = key
207 else: 208 else:
208 node["text"] = key + " : " + str(value) 209 node["text"] = key + " : " + str(value)
209 node["icon"] = "/static/dashboard/img/text.png" 210 node["icon"] = static("dashboard/img/text.png")
210 arr.append(node) 211 arr.append(node)
211 return arr 212 return arr
212 213
diff --git a/gbpui/panels/network_services/templates/network_services/_create_service_chain_spec.html b/gbpui/panels/network_services/templates/network_services/_create_service_chain_spec.html
index 36e37f6..e9b4997 100644
--- a/gbpui/panels/network_services/templates/network_services/_create_service_chain_spec.html
+++ b/gbpui/panels/network_services/templates/network_services/_create_service_chain_spec.html
@@ -8,7 +8,7 @@
8{% block modal-header %}{% trans "Create Service Chain Spec" %}{% endblock %} 8{% block modal-header %}{% trans "Create Service Chain Spec" %}{% endblock %}
9 9
10{% block modal-body %} 10{% block modal-body %}
11<link href="/static/dashboard/css/scspec.css" rel='stylesheet' type='text/css'> 11<link href="{{ STATIC_URL }}dashboard/css/scspec.css" rel='stylesheet' type='text/css'>
12<div class="left"> 12<div class="left">
13 <fieldset> 13 <fieldset>
14<table class="table-fixed" id="nodeListIdContainer"> 14<table class="table-fixed" id="nodeListIdContainer">
@@ -51,7 +51,7 @@
51 51
52 52
53{% block modal-js %} 53{% block modal-js %}
54<script src='/static/dashboard/js/horizon.scspec.js' type='text/javascript'></script> 54<script src='{{ STATIC_URL }}dashboard/js/horizon.scspec.js' type='text/javascript'></script>
55 <script> 55 <script>
56 if (typeof $ !== 'undefined') { 56 if (typeof $ !== 'undefined') {
57 horizon.Node.sc_init($(".workflow")); 57 horizon.Node.sc_init($(".workflow"));
diff --git a/gbpui/panels/network_services/templates/network_services/_scnode_details.html b/gbpui/panels/network_services/templates/network_services/_scnode_details.html
index 9da5f98..f631c0d 100644
--- a/gbpui/panels/network_services/templates/network_services/_scnode_details.html
+++ b/gbpui/panels/network_services/templates/network_services/_scnode_details.html
@@ -1,8 +1,9 @@
1{% load i18n sizeformat parse_date %} 1{% load i18n sizeformat parse_date %}
2{% load url from future %} 2{% load url from future %}
3{% load staticfiles %}
3 4
4{% block css %} 5{% block css %}
5 <link href="/static/dashboard/css/jstree.css" rel='stylesheet' type='text/css'> 6 <link href="{% static "dashboard/css/jstree.css" %}" rel='stylesheet' type='text/css'>
6{% endblock %} 7{% endblock %}
7<div class="info row detail"> 8<div class="info row detail">
8 <hr class="header_rule"> 9 <hr class="header_rule">
@@ -23,8 +24,8 @@
23 <dd>{{ scnode.shared }}</dd> 24 <dd>{{ scnode.shared }}</dd>
24 25
25 <dt> 26 <dt>
26 <img src="/static/dashboard/img/config_as_text.png" 27 <img src="{% static "dashboard/img/config_as_text.png" %}"
27 data-swap="/static/dashboard/img/config_as_tree.png" 28 data-swap="{% static "dashboard/img/config_as_tree.png" %}"
28 id="display_format" alt="" > {% trans "Config" %}</dt> 29 id="display_format" alt="" > {% trans "Config" %}</dt>
29 <dd > 30 <dd >
30 <div style="white-space:pre;display:none" id="config_text" >{{ scnode.config }} </div> 31 <div style="white-space:pre;display:none" id="config_text" >{{ scnode.config }} </div>
@@ -35,7 +36,7 @@
35</div> 36</div>
36 37
37{% block custom_js %} 38{% block custom_js %}
38<script src='/static/dashboard/js/jstree.min.js' type='text/javascript'></script> 39<script src='{% static "dashboard/js/jstree.min.js" %}' type='text/javascript'></script>
39<script type="text/javascript"> 40<script type="text/javascript">
40 function display_config_as_tree(){ 41 function display_config_as_tree(){
41 var data = JSON.stringify({{scnode.tree|safe}}); 42 var data = JSON.stringify({{scnode.tree|safe}});
diff --git a/gbpui/panels/network_services/templates/network_services/_update_service_chain_spec.html b/gbpui/panels/network_services/templates/network_services/_update_service_chain_spec.html
index f8880e1..62a4467 100644
--- a/gbpui/panels/network_services/templates/network_services/_update_service_chain_spec.html
+++ b/gbpui/panels/network_services/templates/network_services/_update_service_chain_spec.html
@@ -8,7 +8,7 @@
8{% block modal-header %}{% trans "Update Service Chain Spec" %}{% endblock %} 8{% block modal-header %}{% trans "Update Service Chain Spec" %}{% endblock %}
9 9
10{% block modal-body %} 10{% block modal-body %}
11<link href="/static/dashboard/css/scspec.css" rel='stylesheet' type='text/css'> 11<link href="{{ STATIC_URL }}dashboard/css/scspec.css" rel='stylesheet' type='text/css'>
12<div class="left"> 12<div class="left">
13<table class="table-fixed" id="nodeListIdContainer"> 13<table class="table-fixed" id="nodeListIdContainer">
14 <tbody> 14 <tbody>
@@ -48,7 +48,7 @@
48 48
49 49
50{% block modal-js %} 50{% block modal-js %}
51<script src='/static/dashboard/js/horizon.scspec.js' type='text/javascript'></script> 51<script src='{{ STATIC_URL }}dashboard/js/horizon.scspec.js' type='text/javascript'></script>
52 <script> 52 <script>
53 if (typeof $ !== 'undefined') { 53 if (typeof $ !== 'undefined') {
54 horizon.Node.sc_init($(".workflow")); 54 horizon.Node.sc_init($(".workflow"));
diff --git a/gbpui/static/dashboard/css/jstree.css b/gbpui/static/dashboard/css/jstree.css
index c54ed0e..608c7cd 100644
--- a/gbpui/static/dashboard/css/jstree.css
+++ b/gbpui/static/dashboard/css/jstree.css
@@ -392,7 +392,7 @@
392} 392}
393.jstree-default .jstree-node, 393.jstree-default .jstree-node,
394.jstree-default .jstree-icon { 394.jstree-default .jstree-icon {
395 background-image: url("/static/dashboard/img/32px.png"); 395 background-image: url("../img/32px.png");
396} 396}
397.jstree-default .jstree-node { 397.jstree-default .jstree-node {
398 background-position: -292px -4px; 398 background-position: -292px -4px;
@@ -488,13 +488,13 @@
488 background-position: 0 0; 488 background-position: 0 0;
489} 489}
490.jstree-default > .jstree-container-ul .jstree-loading > .jstree-ocl { 490.jstree-default > .jstree-container-ul .jstree-loading > .jstree-ocl {
491 background: url("/static/dashboard/img/throbber.gif") center center no-repeat; 491 background: url("../img/throbber.gif") center center no-repeat;
492} 492}
493.jstree-default .jstree-file { 493.jstree-default .jstree-file {
494 background: url("/static/dashboard/img/32px.png") -100px -68px no-repeat; 494 background: url("../img/32px.png") -100px -68px no-repeat;
495} 495}
496.jstree-default .jstree-folder { 496.jstree-default .jstree-folder {
497 background: url("/static/dashboard/img/32px.png") -260px -4px no-repeat; 497 background: url("../img/32px.png") -260px -4px no-repeat;
498} 498}
499.jstree-default > .jstree-container-ul > .jstree-node { 499.jstree-default > .jstree-container-ul > .jstree-node {
500 margin-left: 0; 500 margin-left: 0;
@@ -506,7 +506,7 @@
506} 506}
507#jstree-dnd.jstree-default .jstree-ok, 507#jstree-dnd.jstree-default .jstree-ok,
508#jstree-dnd.jstree-default .jstree-er { 508#jstree-dnd.jstree-default .jstree-er {
509 background-image: url("/static/dashboard/img/32px.png"); 509 background-image: url("../img/32px.png");
510 background-repeat: no-repeat; 510 background-repeat: no-repeat;
511 background-color: transparent; 511 background-color: transparent;
512} 512}
@@ -556,7 +556,7 @@
556} 556}
557.jstree-default-small .jstree-node, 557.jstree-default-small .jstree-node,
558.jstree-default-small .jstree-icon { 558.jstree-default-small .jstree-icon {
559 background-image: url("/static/dashboard/img/32px.png"); 559 background-image: url("../img/32px.png");
560} 560}
561.jstree-default-small .jstree-node { 561.jstree-default-small .jstree-node {
562 background-position: -295px -7px; 562 background-position: -295px -7px;
@@ -652,13 +652,13 @@
652 background-position: 0 0; 652 background-position: 0 0;
653} 653}
654.jstree-default-small > .jstree-container-ul .jstree-loading > .jstree-ocl { 654.jstree-default-small > .jstree-container-ul .jstree-loading > .jstree-ocl {
655 background: url("/static/dashboard/img/throbber.gif") center center no-repeat; 655 background: url("../img/throbber.gif") center center no-repeat;
656} 656}
657.jstree-default-small .jstree-file { 657.jstree-default-small .jstree-file {
658 background: url("/static/dashboard/img/32px.png") -103px -71px no-repeat; 658 background: url("../img/32px.png") -103px -71px no-repeat;
659} 659}
660.jstree-default-small .jstree-folder { 660.jstree-default-small .jstree-folder {
661 background: url("/static/dashboard/img/32px.png") -263px -7px no-repeat; 661 background: url("../img/32px.png") -263px -7px no-repeat;
662} 662}
663.jstree-default-small > .jstree-container-ul > .jstree-node { 663.jstree-default-small > .jstree-container-ul > .jstree-node {
664 margin-left: 0; 664 margin-left: 0;
@@ -670,7 +670,7 @@
670} 670}
671#jstree-dnd.jstree-default-small .jstree-ok, 671#jstree-dnd.jstree-default-small .jstree-ok,
672#jstree-dnd.jstree-default-small .jstree-er { 672#jstree-dnd.jstree-default-small .jstree-er {
673 background-image: url("/static/dashboard/img/32px.png"); 673 background-image: url("../img/32px.png");
674 background-repeat: no-repeat; 674 background-repeat: no-repeat;
675 background-color: transparent; 675 background-color: transparent;
676} 676}
@@ -720,7 +720,7 @@
720} 720}
721.jstree-default-large .jstree-node, 721.jstree-default-large .jstree-node,
722.jstree-default-large .jstree-icon { 722.jstree-default-large .jstree-icon {
723 background-image: url("/static/dashboard/img/32px.png"); 723 background-image: url("../img/32px.png");
724} 724}
725.jstree-default-large .jstree-node { 725.jstree-default-large .jstree-node {
726 background-position: -288px 0px; 726 background-position: -288px 0px;
@@ -816,13 +816,13 @@
816 background-position: 0 0; 816 background-position: 0 0;
817} 817}
818.jstree-default-large > .jstree-container-ul .jstree-loading > .jstree-ocl { 818.jstree-default-large > .jstree-container-ul .jstree-loading > .jstree-ocl {
819 background: url("/static/dashboard/img/throbber.gif") center center no-repeat; 819 background: url("../img/throbber.gif") center center no-repeat;
820} 820}
821.jstree-default-large .jstree-file { 821.jstree-default-large .jstree-file {
822 background: url("/static/dashboard/img/32px.png") -96px -64px no-repeat; 822 background: url("../img/32px.png") -96px -64px no-repeat;
823} 823}
824.jstree-default-large .jstree-folder { 824.jstree-default-large .jstree-folder {
825 background: url("/static/dashboard/img/32px.png") -256px 0px no-repeat; 825 background: url("../img/32px.png") -256px 0px no-repeat;
826} 826}
827.jstree-default-large > .jstree-container-ul > .jstree-node { 827.jstree-default-large > .jstree-container-ul > .jstree-node {
828 margin-left: 0; 828 margin-left: 0;
@@ -834,7 +834,7 @@
834} 834}
835#jstree-dnd.jstree-default-large .jstree-ok, 835#jstree-dnd.jstree-default-large .jstree-ok,
836#jstree-dnd.jstree-default-large .jstree-er { 836#jstree-dnd.jstree-default-large .jstree-er {
837 background-image: url("/static/dashboard/img/32px.png"); 837 background-image: url("../img/32px.png");
838 background-repeat: no-repeat; 838 background-repeat: no-repeat;
839 background-color: transparent; 839 background-color: transparent;
840} 840}
@@ -869,12 +869,12 @@
869 height: 40px; 869 height: 40px;
870 } 870 }
871 #jstree-dnd.jstree-dnd-responsive > .jstree-ok { 871 #jstree-dnd.jstree-dnd-responsive > .jstree-ok {
872 background-image: url("/static/dashboard/img/40px.png"); 872 background-image: url("../img/40px.png");
873 background-position: 0 -200px; 873 background-position: 0 -200px;
874 background-size: 120px 240px; 874 background-size: 120px 240px;
875 } 875 }
876 #jstree-dnd.jstree-dnd-responsive > .jstree-er { 876 #jstree-dnd.jstree-dnd-responsive > .jstree-er {
877 background-image: url("/static/dashboard/img/40px.png"); 877 background-image: url("../img/40px.png");
878 background-position: -40px -200px; 878 background-position: -40px -200px;
879 background-size: 120px 240px; 879 background-size: 120px 240px;
880 } 880 }
@@ -893,7 +893,7 @@
893 */ 893 */
894 } 894 }
895 .jstree-default-responsive .jstree-icon { 895 .jstree-default-responsive .jstree-icon {
896 background-image: url("/static/dashboard/img/40px.png"); 896 background-image: url("../img/40px.png");
897 } 897 }
898 .jstree-default-responsive .jstree-node, 898 .jstree-default-responsive .jstree-node,
899 .jstree-default-responsive .jstree-leaf > .jstree-ocl { 899 .jstree-default-responsive .jstree-leaf > .jstree-ocl {
@@ -995,7 +995,7 @@
995 .jstree-default-responsive .jstree-node > .jstree-ocl, 995 .jstree-default-responsive .jstree-node > .jstree-ocl,
996 .jstree-default-responsive .jstree-themeicon, 996 .jstree-default-responsive .jstree-themeicon,
997 .jstree-default-responsive .jstree-checkbox { 997 .jstree-default-responsive .jstree-checkbox {
998 background-image: url("/static/dashboard/img/40px.png"); 998 background-image: url("../img/40px.png");
999 background-size: 120px 240px; 999 background-size: 120px 240px;
1000 } 1000 }
1001 .jstree-default-responsive .jstree-node { 1001 .jstree-default-responsive .jstree-node {
@@ -1017,11 +1017,11 @@
1017 background-position: 0 0; 1017 background-position: 0 0;
1018 } 1018 }
1019 .jstree-default-responsive .jstree-file { 1019 .jstree-default-responsive .jstree-file {
1020 background: url("/static/dashboard/img/40px.png") 0 -160px no-repeat; 1020 background: url("../img/40px.png") 0 -160px no-repeat;
1021 background-size: 120px 240px; 1021 background-size: 120px 240px;
1022 } 1022 }
1023 .jstree-default-responsive .jstree-folder { 1023 .jstree-default-responsive .jstree-folder {
1024 background: url("/static/dashboard/img/40px.png") -40px -40px no-repeat; 1024 background: url("../img/40px.png") -40px -40px no-repeat;
1025 background-size: 120px 240px; 1025 background-size: 120px 240px;
1026 } 1026 }
1027 .jstree-default-responsive > .jstree-container-ul > .jstree-node { 1027 .jstree-default-responsive > .jstree-container-ul > .jstree-node {
diff --git a/gbpui/static/dashboard/css/scspec.css b/gbpui/static/dashboard/css/scspec.css
index 2398eb6..82ede00 100644
--- a/gbpui/static/dashboard/css/scspec.css
+++ b/gbpui/static/dashboard/css/scspec.css
@@ -62,7 +62,7 @@
62 border-radius: 3px; 62 border-radius: 3px;
63 cursor: move; 63 cursor: move;
64 padding-left: 23px; 64 padding-left: 23px;
65 background: #ffffff url('/static/dashboard/img/drag.png?93ec7e23f795') no-repeat 11px 50%; } 65 background: #ffffff url('../img/drag.png?93ec7e23f795') no-repeat 11px 50%; }
66 .nodelist li em { 66 .nodelist li em {
67 font-size: 0.5em; 67 font-size: 0.5em;
68 line-height: 1em; 68 line-height: 1em;