diff --git a/openstack_dashboard/dashboards/project/stacks/mappings.py b/openstack_dashboard/dashboards/project/stacks/mappings.py index 1a16fb473c..6ced28f45f 100644 --- a/openstack_dashboard/dashboards/project/stacks/mappings.py +++ b/openstack_dashboard/dashboards/project/stacks/mappings.py @@ -13,6 +13,7 @@ import json import logging +from django.conf import settings from django.core.urlresolvers import reverse from django.template.defaultfilters import register # noqa from django.utils import html @@ -145,108 +146,110 @@ def stack_output(output): output = json.dumps(output, indent=2) return safestring.mark_safe(u'
%s' % html.escape(output)) +static_url = getattr(settings, "STATIC_URL", "/static/") resource_images = { - 'LB_FAILED': '/static/dashboard/img/lb-red.svg', - 'LB_DELETE': '/static/dashboard/img/lb-red.svg', - 'LB_IN_PROGRESS': '/static/dashboard/img/lb-gray.gif', - 'LB_INIT': '/static/dashboard/img/lb-gray.svg', - 'LB_COMPLETE': '/static/dashboard/img/lb-green.svg', - 'DB_FAILED': '/static/dashboard/img/db-red.svg', - 'DB_DELETE': '/static/dashboard/img/db-red.svg', - 'DB_IN_PROGRESS': '/static/dashboard/img/db-gray.gif', - 'DB_INIT': '/static/dashboard/img/db-gray.svg', - 'DB_COMPLETE': '/static/dashboard/img/db-green.svg', - 'STACK_FAILED': '/static/dashboard/img/stack-red.svg', - 'STACK_DELETE': '/static/dashboard/img/stack-red.svg', - 'STACK_IN_PROGRESS': '/static/dashboard/img/stack-gray.gif', - 'STACK_INIT': '/static/dashboard/img/stack-gray.svg', - 'STACK_COMPLETE': '/static/dashboard/img/stack-green.svg', - 'SERVER_FAILED': '/static/dashboard/img/server-red.svg', - 'SERVER_DELETE': '/static/dashboard/img/server-red.svg', - 'SERVER_IN_PROGRESS': '/static/dashboard/img/server-gray.gif', - 'SERVER_INIT': '/static/dashboard/img/server-gray.svg', - 'SERVER_COMPLETE': '/static/dashboard/img/server-green.svg', - 'ALARM_FAILED': '/static/dashboard/img/alarm-red.svg', - 'ALARM_DELETE': '/static/dashboard/img/alarm-red.svg', - 'ALARM_IN_PROGRESS': '/static/dashboard/img/alarm-gray.gif', - 'ALARM_INIT': '/static/dashboard/img/alarm-gray.svg', - 'ALARM_COMPLETE': '/static/dashboard/img/alarm-green.svg', - 'VOLUME_FAILED': '/static/dashboard/img/volume-red.svg', - 'VOLUME_DELETE': '/static/dashboard/img/volume-red.svg', - 'VOLUME_IN_PROGRESS': '/static/dashboard/img/volume-gray.gif', - 'VOLUME_INIT': '/static/dashboard/img/volume-gray.svg', - 'VOLUME_COMPLETE': '/static/dashboard/img/volume-green.svg', - 'IMAGE_FAILED': '/static/dashboard/img/image-red.svg', - 'IMAGE_DELETE': '/static/dashboard/img/image-red.svg', - 'IMAGE_IN_PROGRESS': '/static/dashboard/img/image-gray.gif', - 'IMAGE_INIT': '/static/dashboard/img/image-gray.svg', - 'IMAGE_COMPLETE': '/static/dashboard/img/image-green.svg', - 'WAIT_FAILED': '/static/dashboard/img/wait-red.svg', - 'WAIT_DELETE': '/static/dashboard/img/wait-red.svg', - 'WAIT_IN_PROGRESS': '/static/dashboard/img/wait-gray.gif', - 'WAIT_INIT': '/static/dashboard/img/wait-gray.svg', - 'WAIT_COMPLETE': '/static/dashboard/img/wait-green.svg', - 'FIREWALL_FAILED': '/static/dashboard/img/firewall-red.svg', - 'FIREWALL_DELETE': '/static/dashboard/img/firewall-red.svg', - 'FIREWALL_IN_PROGRESS': '/static/dashboard/img/firewall-gray.gif', - 'FIREWALL_INIT': '/static/dashboard/img/firewall-gray.svg', - 'FIREWALL_COMPLETE': '/static/dashboard/img/firewall-green.svg', - 'FLOATINGIP_FAILED': '/static/dashboard/img/floatingip-red.svg', - 'FLOATINGIP_DELETE': '/static/dashboard/img/floatingip-red.svg', - 'FLOATINGIP_IN_PROGRESS': '/static/dashboard/img/floatingip-gray.gif', - 'FLOATINGIP_INIT': '/static/dashboard/img/floatingip-gray.svg', - 'FLOATINGIP_COMPLETE': '/static/dashboard/img/floatingip-green.svg', - 'ROUTER_FAILED': '/static/dashboard/img/router-red.svg', - 'ROUTER_DELETE': '/static/dashboard/img/router-red.svg', - 'ROUTER_IN_PROGRESS': '/static/dashboard/img/router-gray.gif', - 'ROUTER_INIT': '/static/dashboard/img/router-gray.svg', - 'ROUTER_COMPLETE': '/static/dashboard/img/router-green.svg', - 'POLICY_FAILED': '/static/dashboard/img/policy-red.svg', - 'POLICY_DELETE': '/static/dashboard/img/policy-red.svg', - 'POLICY_IN_PROGRESS': '/static/dashboard/img/policy-gray.gif', - 'POLICY_INIT': '/static/dashboard/img/policy-gray.svg', - 'POLICY_COMPLETE': '/static/dashboard/img/policy-green.svg', - 'CONFIG_FAILED': '/static/dashboard/img/config-red.svg', - 'CONFIG_DELETE': '/static/dashboard/img/config-red.svg', - 'CONFIG_IN_PROGRESS': '/static/dashboard/img/config-gray.gif', - 'CONFIG_INIT': '/static/dashboard/img/config-gray.svg', - 'CONFIG_COMPLETE': '/static/dashboard/img/config-green.svg', - 'NETWORK_FAILED': '/static/dashboard/img/network-red.svg', - 'NETWORK_DELETE': '/static/dashboard/img/network-red.svg', - 'NETWORK_IN_PROGRESS': '/static/dashboard/img/network-gray.gif', - 'NETWORK_INIT': '/static/dashboard/img/network-gray.svg', - 'NETWORK_COMPLETE': '/static/dashboard/img/network-green.svg', - 'PORT_FAILED': '/static/dashboard/img/port-red.svg', - 'PORT_DELETE': '/static/dashboard/img/port-red.svg', - 'PORT_IN_PROGRESS': '/static/dashboard/img/port-gray.gif', - 'PORT_INIT': '/static/dashboard/img/port-gray.svg', - 'PORT_COMPLETE': '/static/dashboard/img/port-green.svg', - 'SECURITYGROUP_FAILED': '/static/dashboard/img/securitygroup-red.svg', - 'SECURITYGROUP_DELETE': '/static/dashboard/img/securitygroup-red.svg', + 'LB_FAILED': static_url + 'dashboard/img/lb-red.svg', + 'LB_DELETE': static_url + 'dashboard/img/lb-red.svg', + 'LB_IN_PROGRESS': static_url + 'dashboard/img/lb-gray.gif', + 'LB_INIT': static_url + 'dashboard/img/lb-gray.svg', + 'LB_COMPLETE': static_url + 'dashboard/img/lb-green.svg', + 'DB_FAILED': static_url + 'dashboard/img/db-red.svg', + 'DB_DELETE': static_url + 'dashboard/img/db-red.svg', + 'DB_IN_PROGRESS': static_url + 'dashboard/img/db-gray.gif', + 'DB_INIT': static_url + 'dashboard/img/db-gray.svg', + 'DB_COMPLETE': static_url + 'dashboard/img/db-green.svg', + 'STACK_FAILED': static_url + 'dashboard/img/stack-red.svg', + 'STACK_DELETE': static_url + 'dashboard/img/stack-red.svg', + 'STACK_IN_PROGRESS': static_url + 'dashboard/img/stack-gray.gif', + 'STACK_INIT': static_url + 'dashboard/img/stack-gray.svg', + 'STACK_COMPLETE': static_url + 'dashboard/img/stack-green.svg', + 'SERVER_FAILED': static_url + 'dashboard/img/server-red.svg', + 'SERVER_DELETE': static_url + 'dashboard/img/server-red.svg', + 'SERVER_IN_PROGRESS': static_url + 'dashboard/img/server-gray.gif', + 'SERVER_INIT': static_url + 'dashboard/img/server-gray.svg', + 'SERVER_COMPLETE': static_url + 'dashboard/img/server-green.svg', + 'ALARM_FAILED': static_url + 'dashboard/img/alarm-red.svg', + 'ALARM_DELETE': static_url + 'dashboard/img/alarm-red.svg', + 'ALARM_IN_PROGRESS': static_url + 'dashboard/img/alarm-gray.gif', + 'ALARM_INIT': static_url + 'dashboard/img/alarm-gray.svg', + 'ALARM_COMPLETE': static_url + 'dashboard/img/alarm-green.svg', + 'VOLUME_FAILED': static_url + 'dashboard/img/volume-red.svg', + 'VOLUME_DELETE': static_url + 'dashboard/img/volume-red.svg', + 'VOLUME_IN_PROGRESS': static_url + 'dashboard/img/volume-gray.gif', + 'VOLUME_INIT': static_url + 'dashboard/img/volume-gray.svg', + 'VOLUME_COMPLETE': static_url + 'dashboard/img/volume-green.svg', + 'IMAGE_FAILED': static_url + 'dashboard/img/image-red.svg', + 'IMAGE_DELETE': static_url + 'dashboard/img/image-red.svg', + 'IMAGE_IN_PROGRESS': static_url + 'dashboard/img/image-gray.gif', + 'IMAGE_INIT': static_url + 'dashboard/img/image-gray.svg', + 'IMAGE_COMPLETE': static_url + 'dashboard/img/image-green.svg', + 'WAIT_FAILED': static_url + 'dashboard/img/wait-red.svg', + 'WAIT_DELETE': static_url + 'dashboard/img/wait-red.svg', + 'WAIT_IN_PROGRESS': static_url + 'dashboard/img/wait-gray.gif', + 'WAIT_INIT': static_url + 'dashboard/img/wait-gray.svg', + 'WAIT_COMPLETE': static_url + 'dashboard/img/wait-green.svg', + 'FIREWALL_FAILED': static_url + 'dashboard/img/firewall-red.svg', + 'FIREWALL_DELETE': static_url + 'dashboard/img/firewall-red.svg', + 'FIREWALL_IN_PROGRESS': static_url + 'dashboard/img/firewall-gray.gif', + 'FIREWALL_INIT': static_url + 'dashboard/img/firewall-gray.svg', + 'FIREWALL_COMPLETE': static_url + 'dashboard/img/firewall-green.svg', + 'FLOATINGIP_FAILED': static_url + 'dashboard/img/floatingip-red.svg', + 'FLOATINGIP_DELETE': static_url + 'dashboard/img/floatingip-red.svg', + 'FLOATINGIP_IN_PROGRESS': static_url + 'dashboard/img/floatingip-gray.gif', + 'FLOATINGIP_INIT': static_url + 'dashboard/img/floatingip-gray.svg', + 'FLOATINGIP_COMPLETE': static_url + 'dashboard/img/floatingip-green.svg', + 'ROUTER_FAILED': static_url + 'dashboard/img/router-red.svg', + 'ROUTER_DELETE': static_url + 'dashboard/img/router-red.svg', + 'ROUTER_IN_PROGRESS': static_url + 'dashboard/img/router-gray.gif', + 'ROUTER_INIT': static_url + 'dashboard/img/router-gray.svg', + 'ROUTER_COMPLETE': static_url + 'dashboard/img/router-green.svg', + 'POLICY_FAILED': static_url + 'dashboard/img/policy-red.svg', + 'POLICY_DELETE': static_url + 'dashboard/img/policy-red.svg', + 'POLICY_IN_PROGRESS': static_url + 'dashboard/img/policy-gray.gif', + 'POLICY_INIT': static_url + 'dashboard/img/policy-gray.svg', + 'POLICY_COMPLETE': static_url + 'dashboard/img/policy-green.svg', + 'CONFIG_FAILED': static_url + 'dashboard/img/config-red.svg', + 'CONFIG_DELETE': static_url + 'dashboard/img/config-red.svg', + 'CONFIG_IN_PROGRESS': static_url + 'dashboard/img/config-gray.gif', + 'CONFIG_INIT': static_url + 'dashboard/img/config-gray.svg', + 'CONFIG_COMPLETE': static_url + 'dashboard/img/config-green.svg', + 'NETWORK_FAILED': static_url + 'dashboard/img/network-red.svg', + 'NETWORK_DELETE': static_url + 'dashboard/img/network-red.svg', + 'NETWORK_IN_PROGRESS': static_url + 'dashboard/img/network-gray.gif', + 'NETWORK_INIT': static_url + 'dashboard/img/network-gray.svg', + 'NETWORK_COMPLETE': static_url + 'dashboard/img/network-green.svg', + 'PORT_FAILED': static_url + 'dashboard/img/port-red.svg', + 'PORT_DELETE': static_url + 'dashboard/img/port-red.svg', + 'PORT_IN_PROGRESS': static_url + 'dashboard/img/port-gray.gif', + 'PORT_INIT': static_url + 'dashboard/img/port-gray.svg', + 'PORT_COMPLETE': static_url + 'dashboard/img/port-green.svg', + 'SECURITYGROUP_FAILED': static_url + 'dashboard/img/securitygroup-red.svg', + 'SECURITYGROUP_DELETE': static_url + 'dashboard/img/securitygroup-red.svg', 'SECURITYGROUP_IN_PROGRESS': - '/static/dashboard/img/securitygroup-gray.gif', - 'SECURITYGROUP_INIT': '/static/dashboard/img/securitygroup-gray.svg', - 'SECURITYGROUP_COMPLETE': '/static/dashboard/img/securitygroup-green.svg', - 'VPN_FAILED': '/static/dashboard/img/vpn-red.svg', - 'VPN_DELETE': '/static/dashboard/img/vpn-red.svg', - 'VPN_IN_PROGRESS': '/static/dashboard/img/vpn-gray.gif', - 'VPN_INIT': '/static/dashboard/img/vpn-gray.svg', - 'VPN_COMPLETE': '/static/dashboard/img/vpn-green.svg', - 'FLAVOR_FAILED': '/static/dashboard/img/flavor-red.svg', - 'FLAVOR_DELETE': '/static/dashboard/img/flavor-red.svg', - 'FLAVOR_IN_PROGRESS': '/static/dashboard/img/flavor-gray.gif', - 'FLAVOR_INIT': '/static/dashboard/img/flavor-gray.svg', - 'FLAVOR_COMPLETE': '/static/dashboard/img/flavor-green.svg', - 'KEYPAIR_FAILED': '/static/dashboard/img/keypair-red.svg', - 'KEYPAIR_DELETE': '/static/dashboard/img/keypair-red.svg', - 'KEYPAIR_IN_PROGRESS': '/static/dashboard/img/keypair-gray.gif', - 'KEYPAIR_INIT': '/static/dashboard/img/keypair-gray.svg', - 'KEYPAIR_COMPLETE': '/static/dashboard/img/keypair-green.svg', - 'UNKNOWN_FAILED': '/static/dashboard/img/unknown-red.svg', - 'UNKNOWN_DELETE': '/static/dashboard/img/unknown-red.svg', - 'UNKNOWN_IN_PROGRESS': '/static/dashboard/img/unknown-gray.gif', - 'UNKNOWN_INIT': '/static/dashboard/img/unknown-gray.svg', - 'UNKNOWN_COMPLETE': '/static/dashboard/img/unknown-green.svg', + static_url + 'dashboard/img/securitygroup-gray.gif', + 'SECURITYGROUP_INIT': static_url + 'dashboard/img/securitygroup-gray.svg', + 'SECURITYGROUP_COMPLETE': + static_url + 'dashboard/img/securitygroup-green.svg', + 'VPN_FAILED': static_url + 'dashboard/img/vpn-red.svg', + 'VPN_DELETE': static_url + 'dashboard/img/vpn-red.svg', + 'VPN_IN_PROGRESS': static_url + 'dashboard/img/vpn-gray.gif', + 'VPN_INIT': static_url + 'dashboard/img/vpn-gray.svg', + 'VPN_COMPLETE': static_url + 'dashboard/img/vpn-green.svg', + 'FLAVOR_FAILED': static_url + 'dashboard/img/flavor-red.svg', + 'FLAVOR_DELETE': static_url + 'dashboard/img/flavor-red.svg', + 'FLAVOR_IN_PROGRESS': static_url + 'dashboard/img/flavor-gray.gif', + 'FLAVOR_INIT': static_url + 'dashboard/img/flavor-gray.svg', + 'FLAVOR_COMPLETE': static_url + 'dashboard/img/flavor-green.svg', + 'KEYPAIR_FAILED': static_url + 'dashboard/img/keypair-red.svg', + 'KEYPAIR_DELETE': static_url + 'dashboard/img/keypair-red.svg', + 'KEYPAIR_IN_PROGRESS': static_url + 'dashboard/img/keypair-gray.gif', + 'KEYPAIR_INIT': static_url + 'dashboard/img/keypair-gray.svg', + 'KEYPAIR_COMPLETE': static_url + 'dashboard/img/keypair-green.svg', + 'UNKNOWN_FAILED': static_url + 'dashboard/img/unknown-red.svg', + 'UNKNOWN_DELETE': static_url + 'dashboard/img/unknown-red.svg', + 'UNKNOWN_IN_PROGRESS': static_url + 'dashboard/img/unknown-gray.gif', + 'UNKNOWN_INIT': static_url + 'dashboard/img/unknown-gray.svg', + 'UNKNOWN_COMPLETE': static_url + 'dashboard/img/unknown-green.svg', }