Move Grafana to Apache's DocumentRoot

Static files are normally deployed with django's 'manage.py collectstatic'.
When run with --clear option, which seems to be default in some distributions
(e.g. RDO), all static resources are deleted first. Current Horizon integration
creates link to Grafana in static directory. Runing collectstatic --clear
leaves Grafana corrupted.

Proposed solution: Move Grafana to Apache's DocumentRoot.

also see: https://github.com/hpcloud-mon/ansible-monasca-ui/pull/6

Change-Id: Icbb2eecd45dfb1da48f63464ac83acb9e06cd71f
This commit is contained in:
Witold Bedyk 2015-11-26 15:01:57 +01:00
parent 132330f75a
commit c2c73f5254
2 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ by monasca-vagrant.
* git clone https://github.com/openstack/horizon.git # clone horizon
* git clone https://github.com/hpcloud-mon/grafana.git
* ln -s grafana/src horizon/static/grafana
* ln -r -s grafana/src *apache_document_root*/grafana
* cd horizon
* Add git+https://github.com/openstack/monasca-ui.git to requirements.txt
@ -55,8 +55,8 @@ ln -s ../monasca-ui/monitoring monitoring
##Set up Grafana
```
cd static
ln -s ../../grafana/src grafana
cd ..
ln -r -s grafana/src <apache_document_root>/grafana
cd grafana
cp config.monasca.js config.js
```

View File

@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% load static i18n %}
{% load i18n %}
{% block title %}{% trans 'Monitoring' %}{% endblock %}
{% block page_header %}
@ -9,7 +9,7 @@
{% block main %}
<div style="padding: 3px;">
{% for dashboard in dashboards %}
<a target={{ dashboard.title }} href="{% get_static_prefix %}grafana/index.html#/dashboard/file/{{ dashboard.fileName }}?api={{api}}" class="btn btn-default btn-sm">
<a target={{ dashboard.title }} href="/grafana/index.html#/dashboard/file/{{ dashboard.fileName }}?api={{api}}" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-dashboard"></span>
{% trans dashboard.title %}
</a>