FIX the grafana link from alarm table

The grafana path has been changed to NOT under static, but the URL of
alarm table still linked under static path.
This patch modifies the link for grafana.

Conflicts:
	monitoring/alarms/tables.py

Change-Id: I1bc3124511abbccc755e95e6fc6093ee75e6e0e9
Closes-Bug: 1569809
(cherry picked from commit 33100166ca)
This commit is contained in:
Koji Nakazono 2016-04-13 20:02:09 +09:00 committed by Witold Bedyk
parent 9682a137b6
commit 37bbefe690
2 changed files with 2 additions and 3 deletions

View File

@ -163,8 +163,7 @@ class GraphMetric(tables.LinkAction):
endpoint = str(reverse_lazy(ov_constants.URL_PREFIX + 'proxy'))
endpoint = self.table.request.build_absolute_uri(endpoint)
self.attrs['target'] = '_blank'
url = (settings.STATIC_URL or '') + \
'grafana/index.html#/dashboard/script/detail.js'
url = '/grafana/index.html#/dashboard/script/detail.js'
query = "?name=%s&threshold=%s&api=%s" % \
(name, threshold, endpoint)
return url + query

View File

@ -41,7 +41,7 @@ class GraphMetricLinkActionTests(TestCase):
self.assertEqual(
link_url,
r'/static/grafana/index.html#/dashboard/script/detail.js?'
r'/grafana/index.html#/dashboard/script/detail.js?'
r'name=metric1'
r'&threshold=[{"name": "metric1"}, {"name": "metric \u2461"}]'
r'&api=http://foo/api/'