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
This commit is contained in:
parent
6b892f36ec
commit
8b731e1a87
|
@ -13,6 +13,7 @@
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
|
||||||
|
@ -143,7 +144,8 @@ def update_policyaction_attributes(request, paction):
|
||||||
|
|
||||||
|
|
||||||
def update_sc_spec_attributes(request, scspec):
|
def update_sc_spec_attributes(request, scspec):
|
||||||
img_path = "/static/dashboard/img/"
|
static_url = getattr(settings, 'STATIC_URL', "/static/")
|
||||||
|
img_path = static_url + "dashboard/img/"
|
||||||
provider = "default"
|
provider = "default"
|
||||||
nodes = scspec.nodes
|
nodes = scspec.nodes
|
||||||
nodes = [client.get_servicechain_node(request, item) for item in nodes]
|
nodes = [client.get_servicechain_node(request, item) for item in nodes]
|
||||||
|
@ -154,8 +156,8 @@ def update_sc_spec_attributes(request, scspec):
|
||||||
if os.path.exists(ds_path):
|
if os.path.exists(ds_path):
|
||||||
local_img_path = ds_path
|
local_img_path = ds_path
|
||||||
else:
|
else:
|
||||||
local_img_path = "/usr/share/openstack-dashboard/openstack_dashboard/" \
|
local_img_path = "/usr/share/openstack-dashboard/" \
|
||||||
+ "static/dashboard/img/"
|
+ "openstack_dashboard/static/dashboard/img/"
|
||||||
if os.path.exists(local_img_path):
|
if os.path.exists(local_img_path):
|
||||||
providers = os.listdir(local_img_path)
|
providers = os.listdir(local_img_path)
|
||||||
for p in providers:
|
for p in providers:
|
||||||
|
@ -239,7 +241,7 @@ def update_classifier_attributes(classifiers):
|
||||||
if type(classifiers) == list:
|
if type(classifiers) == list:
|
||||||
for classifier in classifiers:
|
for classifier in classifiers:
|
||||||
classifier.set_id_as_name_if_empty()
|
classifier.set_id_as_name_if_empty()
|
||||||
if classifier.protocol in ['tcp', 'udp'] and classifier.port_range \
|
if classifier.protocol in ['tcp', 'udp'] and classifier.port_range\
|
||||||
in port_protocol_map:
|
in port_protocol_map:
|
||||||
classifier.protocol = port_protocol_map[classifier.port_range]
|
classifier.protocol = port_protocol_map[classifier.port_range]
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -26,5 +26,5 @@
|
||||||
|
|
||||||
|
|
||||||
{% block modal-js %}
|
{% block modal-js %}
|
||||||
<script src='/static/dashboard/js/horizon.protocolmap.js' type="text/javascript"></script>
|
<script src='{{ STATIC_URL }}dashboard/js/horizon.protocolmap.js' type="text/javascript"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -25,5 +25,5 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block modal-js %}
|
{% block modal-js %}
|
||||||
<script src='/static/dashboard/js/horizon.protocolmap.js' type="text/javascript"></script>
|
<script src='{{ STATIC_URL }}dashboard/js/horizon.protocolmap.js' type="text/javascript"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
import json
|
import json
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
from django.contrib.staticfiles.templatetags.staticfiles import static
|
||||||
from django.core.urlresolvers import reverse_lazy
|
from django.core.urlresolvers import reverse_lazy
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
@ -164,7 +165,7 @@ class ServiceChainNodeDetailsTab(tabs.Tab):
|
||||||
node["text"] = key
|
node["text"] = key
|
||||||
else:
|
else:
|
||||||
node["text"] = key + " : " + str(value)
|
node["text"] = key + " : " + str(value)
|
||||||
node["icon"] = "/static/dashboard/img/text.png"
|
node["icon"] = static("dashboard/img/text.png")
|
||||||
|
|
||||||
tree.append(node)
|
tree.append(node)
|
||||||
return json.dumps(tree)
|
return json.dumps(tree)
|
||||||
|
@ -206,7 +207,7 @@ class ServiceChainNodeDetailsTab(tabs.Tab):
|
||||||
node["text"] = key
|
node["text"] = key
|
||||||
else:
|
else:
|
||||||
node["text"] = key + " : " + str(value)
|
node["text"] = key + " : " + str(value)
|
||||||
node["icon"] = "/static/dashboard/img/text.png"
|
node["icon"] = static("dashboard/img/text.png")
|
||||||
arr.append(node)
|
arr.append(node)
|
||||||
return arr
|
return arr
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
{% block modal-header %}{% trans "Create Service Chain Spec" %}{% endblock %}
|
{% block modal-header %}{% trans "Create Service Chain Spec" %}{% endblock %}
|
||||||
|
|
||||||
{% block modal-body %}
|
{% block modal-body %}
|
||||||
<link href="/static/dashboard/css/scspec.css" rel='stylesheet' type='text/css'>
|
<link href="{{ STATIC_URL }}dashboard/css/scspec.css" rel='stylesheet' type='text/css'>
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<table class="table-fixed" id="nodeListIdContainer">
|
<table class="table-fixed" id="nodeListIdContainer">
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
|
|
||||||
{% block modal-js %}
|
{% block modal-js %}
|
||||||
<script src='/static/dashboard/js/horizon.scspec.js' type='text/javascript'></script>
|
<script src='{{ STATIC_URL }}dashboard/js/horizon.scspec.js' type='text/javascript'></script>
|
||||||
<script>
|
<script>
|
||||||
if (typeof $ !== 'undefined') {
|
if (typeof $ !== 'undefined') {
|
||||||
horizon.Node.sc_init($(".workflow"));
|
horizon.Node.sc_init($(".workflow"));
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
{% load i18n sizeformat parse_date %}
|
{% load i18n sizeformat parse_date %}
|
||||||
{% load url from future %}
|
{% load url from future %}
|
||||||
|
{% load staticfiles %}
|
||||||
|
|
||||||
{% block css %}
|
{% block css %}
|
||||||
<link href="/static/dashboard/css/jstree.css" rel='stylesheet' type='text/css'>
|
<link href="{% static "dashboard/css/jstree.css" %}" rel='stylesheet' type='text/css'>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
<div class="info row detail">
|
<div class="info row detail">
|
||||||
<hr class="header_rule">
|
<hr class="header_rule">
|
||||||
|
@ -23,8 +24,8 @@
|
||||||
<dd>{{ scnode.shared }}</dd>
|
<dd>{{ scnode.shared }}</dd>
|
||||||
|
|
||||||
<dt>
|
<dt>
|
||||||
<img src="/static/dashboard/img/config_as_text.png"
|
<img src="{% static "dashboard/img/config_as_text.png" %}"
|
||||||
data-swap="/static/dashboard/img/config_as_tree.png"
|
data-swap="{% static "dashboard/img/config_as_tree.png" %}"
|
||||||
id="display_format" alt="" > {% trans "Config" %}</dt>
|
id="display_format" alt="" > {% trans "Config" %}</dt>
|
||||||
<dd >
|
<dd >
|
||||||
<div style="white-space:pre;display:none" id="config_text" >{{ scnode.config }} </div>
|
<div style="white-space:pre;display:none" id="config_text" >{{ scnode.config }} </div>
|
||||||
|
@ -35,7 +36,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% block custom_js %}
|
{% block custom_js %}
|
||||||
<script src='/static/dashboard/js/jstree.min.js' type='text/javascript'></script>
|
<script src='{% static "dashboard/js/jstree.min.js" %}' type='text/javascript'></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function display_config_as_tree(){
|
function display_config_as_tree(){
|
||||||
var data = JSON.stringify({{scnode.tree|safe}});
|
var data = JSON.stringify({{scnode.tree|safe}});
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
{% block modal-header %}{% trans "Update Service Chain Spec" %}{% endblock %}
|
{% block modal-header %}{% trans "Update Service Chain Spec" %}{% endblock %}
|
||||||
|
|
||||||
{% block modal-body %}
|
{% block modal-body %}
|
||||||
<link href="/static/dashboard/css/scspec.css" rel='stylesheet' type='text/css'>
|
<link href="{{ STATIC_URL }}dashboard/css/scspec.css" rel='stylesheet' type='text/css'>
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<table class="table-fixed" id="nodeListIdContainer">
|
<table class="table-fixed" id="nodeListIdContainer">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
|
|
||||||
{% block modal-js %}
|
{% block modal-js %}
|
||||||
<script src='/static/dashboard/js/horizon.scspec.js' type='text/javascript'></script>
|
<script src='{{ STATIC_URL }}dashboard/js/horizon.scspec.js' type='text/javascript'></script>
|
||||||
<script>
|
<script>
|
||||||
if (typeof $ !== 'undefined') {
|
if (typeof $ !== 'undefined') {
|
||||||
horizon.Node.sc_init($(".workflow"));
|
horizon.Node.sc_init($(".workflow"));
|
||||||
|
|
|
@ -392,7 +392,7 @@
|
||||||
}
|
}
|
||||||
.jstree-default .jstree-node,
|
.jstree-default .jstree-node,
|
||||||
.jstree-default .jstree-icon {
|
.jstree-default .jstree-icon {
|
||||||
background-image: url("/static/dashboard/img/32px.png");
|
background-image: url("../img/32px.png");
|
||||||
}
|
}
|
||||||
.jstree-default .jstree-node {
|
.jstree-default .jstree-node {
|
||||||
background-position: -292px -4px;
|
background-position: -292px -4px;
|
||||||
|
@ -488,13 +488,13 @@
|
||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
}
|
}
|
||||||
.jstree-default > .jstree-container-ul .jstree-loading > .jstree-ocl {
|
.jstree-default > .jstree-container-ul .jstree-loading > .jstree-ocl {
|
||||||
background: url("/static/dashboard/img/throbber.gif") center center no-repeat;
|
background: url("../img/throbber.gif") center center no-repeat;
|
||||||
}
|
}
|
||||||
.jstree-default .jstree-file {
|
.jstree-default .jstree-file {
|
||||||
background: url("/static/dashboard/img/32px.png") -100px -68px no-repeat;
|
background: url("../img/32px.png") -100px -68px no-repeat;
|
||||||
}
|
}
|
||||||
.jstree-default .jstree-folder {
|
.jstree-default .jstree-folder {
|
||||||
background: url("/static/dashboard/img/32px.png") -260px -4px no-repeat;
|
background: url("../img/32px.png") -260px -4px no-repeat;
|
||||||
}
|
}
|
||||||
.jstree-default > .jstree-container-ul > .jstree-node {
|
.jstree-default > .jstree-container-ul > .jstree-node {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
|
@ -506,7 +506,7 @@
|
||||||
}
|
}
|
||||||
#jstree-dnd.jstree-default .jstree-ok,
|
#jstree-dnd.jstree-default .jstree-ok,
|
||||||
#jstree-dnd.jstree-default .jstree-er {
|
#jstree-dnd.jstree-default .jstree-er {
|
||||||
background-image: url("/static/dashboard/img/32px.png");
|
background-image: url("../img/32px.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
@ -556,7 +556,7 @@
|
||||||
}
|
}
|
||||||
.jstree-default-small .jstree-node,
|
.jstree-default-small .jstree-node,
|
||||||
.jstree-default-small .jstree-icon {
|
.jstree-default-small .jstree-icon {
|
||||||
background-image: url("/static/dashboard/img/32px.png");
|
background-image: url("../img/32px.png");
|
||||||
}
|
}
|
||||||
.jstree-default-small .jstree-node {
|
.jstree-default-small .jstree-node {
|
||||||
background-position: -295px -7px;
|
background-position: -295px -7px;
|
||||||
|
@ -652,13 +652,13 @@
|
||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
}
|
}
|
||||||
.jstree-default-small > .jstree-container-ul .jstree-loading > .jstree-ocl {
|
.jstree-default-small > .jstree-container-ul .jstree-loading > .jstree-ocl {
|
||||||
background: url("/static/dashboard/img/throbber.gif") center center no-repeat;
|
background: url("../img/throbber.gif") center center no-repeat;
|
||||||
}
|
}
|
||||||
.jstree-default-small .jstree-file {
|
.jstree-default-small .jstree-file {
|
||||||
background: url("/static/dashboard/img/32px.png") -103px -71px no-repeat;
|
background: url("../img/32px.png") -103px -71px no-repeat;
|
||||||
}
|
}
|
||||||
.jstree-default-small .jstree-folder {
|
.jstree-default-small .jstree-folder {
|
||||||
background: url("/static/dashboard/img/32px.png") -263px -7px no-repeat;
|
background: url("../img/32px.png") -263px -7px no-repeat;
|
||||||
}
|
}
|
||||||
.jstree-default-small > .jstree-container-ul > .jstree-node {
|
.jstree-default-small > .jstree-container-ul > .jstree-node {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
|
@ -670,7 +670,7 @@
|
||||||
}
|
}
|
||||||
#jstree-dnd.jstree-default-small .jstree-ok,
|
#jstree-dnd.jstree-default-small .jstree-ok,
|
||||||
#jstree-dnd.jstree-default-small .jstree-er {
|
#jstree-dnd.jstree-default-small .jstree-er {
|
||||||
background-image: url("/static/dashboard/img/32px.png");
|
background-image: url("../img/32px.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
@ -720,7 +720,7 @@
|
||||||
}
|
}
|
||||||
.jstree-default-large .jstree-node,
|
.jstree-default-large .jstree-node,
|
||||||
.jstree-default-large .jstree-icon {
|
.jstree-default-large .jstree-icon {
|
||||||
background-image: url("/static/dashboard/img/32px.png");
|
background-image: url("../img/32px.png");
|
||||||
}
|
}
|
||||||
.jstree-default-large .jstree-node {
|
.jstree-default-large .jstree-node {
|
||||||
background-position: -288px 0px;
|
background-position: -288px 0px;
|
||||||
|
@ -816,13 +816,13 @@
|
||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
}
|
}
|
||||||
.jstree-default-large > .jstree-container-ul .jstree-loading > .jstree-ocl {
|
.jstree-default-large > .jstree-container-ul .jstree-loading > .jstree-ocl {
|
||||||
background: url("/static/dashboard/img/throbber.gif") center center no-repeat;
|
background: url("../img/throbber.gif") center center no-repeat;
|
||||||
}
|
}
|
||||||
.jstree-default-large .jstree-file {
|
.jstree-default-large .jstree-file {
|
||||||
background: url("/static/dashboard/img/32px.png") -96px -64px no-repeat;
|
background: url("../img/32px.png") -96px -64px no-repeat;
|
||||||
}
|
}
|
||||||
.jstree-default-large .jstree-folder {
|
.jstree-default-large .jstree-folder {
|
||||||
background: url("/static/dashboard/img/32px.png") -256px 0px no-repeat;
|
background: url("../img/32px.png") -256px 0px no-repeat;
|
||||||
}
|
}
|
||||||
.jstree-default-large > .jstree-container-ul > .jstree-node {
|
.jstree-default-large > .jstree-container-ul > .jstree-node {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
|
@ -834,7 +834,7 @@
|
||||||
}
|
}
|
||||||
#jstree-dnd.jstree-default-large .jstree-ok,
|
#jstree-dnd.jstree-default-large .jstree-ok,
|
||||||
#jstree-dnd.jstree-default-large .jstree-er {
|
#jstree-dnd.jstree-default-large .jstree-er {
|
||||||
background-image: url("/static/dashboard/img/32px.png");
|
background-image: url("../img/32px.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
@ -869,12 +869,12 @@
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
#jstree-dnd.jstree-dnd-responsive > .jstree-ok {
|
#jstree-dnd.jstree-dnd-responsive > .jstree-ok {
|
||||||
background-image: url("/static/dashboard/img/40px.png");
|
background-image: url("../img/40px.png");
|
||||||
background-position: 0 -200px;
|
background-position: 0 -200px;
|
||||||
background-size: 120px 240px;
|
background-size: 120px 240px;
|
||||||
}
|
}
|
||||||
#jstree-dnd.jstree-dnd-responsive > .jstree-er {
|
#jstree-dnd.jstree-dnd-responsive > .jstree-er {
|
||||||
background-image: url("/static/dashboard/img/40px.png");
|
background-image: url("../img/40px.png");
|
||||||
background-position: -40px -200px;
|
background-position: -40px -200px;
|
||||||
background-size: 120px 240px;
|
background-size: 120px 240px;
|
||||||
}
|
}
|
||||||
|
@ -893,7 +893,7 @@
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
.jstree-default-responsive .jstree-icon {
|
.jstree-default-responsive .jstree-icon {
|
||||||
background-image: url("/static/dashboard/img/40px.png");
|
background-image: url("../img/40px.png");
|
||||||
}
|
}
|
||||||
.jstree-default-responsive .jstree-node,
|
.jstree-default-responsive .jstree-node,
|
||||||
.jstree-default-responsive .jstree-leaf > .jstree-ocl {
|
.jstree-default-responsive .jstree-leaf > .jstree-ocl {
|
||||||
|
@ -995,7 +995,7 @@
|
||||||
.jstree-default-responsive .jstree-node > .jstree-ocl,
|
.jstree-default-responsive .jstree-node > .jstree-ocl,
|
||||||
.jstree-default-responsive .jstree-themeicon,
|
.jstree-default-responsive .jstree-themeicon,
|
||||||
.jstree-default-responsive .jstree-checkbox {
|
.jstree-default-responsive .jstree-checkbox {
|
||||||
background-image: url("/static/dashboard/img/40px.png");
|
background-image: url("../img/40px.png");
|
||||||
background-size: 120px 240px;
|
background-size: 120px 240px;
|
||||||
}
|
}
|
||||||
.jstree-default-responsive .jstree-node {
|
.jstree-default-responsive .jstree-node {
|
||||||
|
@ -1017,11 +1017,11 @@
|
||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
}
|
}
|
||||||
.jstree-default-responsive .jstree-file {
|
.jstree-default-responsive .jstree-file {
|
||||||
background: url("/static/dashboard/img/40px.png") 0 -160px no-repeat;
|
background: url("../img/40px.png") 0 -160px no-repeat;
|
||||||
background-size: 120px 240px;
|
background-size: 120px 240px;
|
||||||
}
|
}
|
||||||
.jstree-default-responsive .jstree-folder {
|
.jstree-default-responsive .jstree-folder {
|
||||||
background: url("/static/dashboard/img/40px.png") -40px -40px no-repeat;
|
background: url("../img/40px.png") -40px -40px no-repeat;
|
||||||
background-size: 120px 240px;
|
background-size: 120px 240px;
|
||||||
}
|
}
|
||||||
.jstree-default-responsive > .jstree-container-ul > .jstree-node {
|
.jstree-default-responsive > .jstree-container-ul > .jstree-node {
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
cursor: move;
|
cursor: move;
|
||||||
padding-left: 23px;
|
padding-left: 23px;
|
||||||
background: #ffffff url('/static/dashboard/img/drag.png?93ec7e23f795') no-repeat 11px 50%; }
|
background: #ffffff url('../img/drag.png?93ec7e23f795') no-repeat 11px 50%; }
|
||||||
.nodelist li em {
|
.nodelist li em {
|
||||||
font-size: 0.5em;
|
font-size: 0.5em;
|
||||||
line-height: 1em;
|
line-height: 1em;
|
||||||
|
|
Loading…
Reference in New Issue