Modify Kibana button to support events
Story: 2003458 Task: 27035 Change-Id: Iee497028b11565cd4eb1c98e8c42d1960a0b7ac8
This commit is contained in:
parent
fb1d2226f1
commit
a22ccca580
@ -104,7 +104,9 @@ GRAFANA_URL = getattr(settings, 'GRAFANA_URL', None)
|
||||
|
||||
SHOW_GRAFANA_HOME = getattr(settings, 'SHOW_GRAFANA_HOME', True)
|
||||
|
||||
ENABLE_KIBANA_BUTTON = getattr(settings, 'ENABLE_KIBANA_BUTTON', False)
|
||||
ENABLE_LOG_MANAGEMENT_BUTTON = getattr(settings, 'ENABLE_LOG_MANAGEMENT_BUTTON', False)
|
||||
ENABLE_EVENT_MANAGEMENT_BUTTON = getattr(settings, 'ENABLE_EVENT_MANAGEMENT_BUTTON', False)
|
||||
|
||||
KIBANA_POLICY_RULE = getattr(settings, 'KIBANA_POLICY_RULE',
|
||||
'monitoring:kibana_access')
|
||||
KIBANA_POLICY_SCOPE = getattr(settings, 'KIBANA_POLICY_SCOPE',
|
||||
|
@ -43,11 +43,21 @@
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if can_access_logs and enable_kibana_button %}
|
||||
<a target="dashboard" href="{% url 'horizon:monitoring:overview:kibana_proxy' url='/' %}" class="btn btn-default">
|
||||
{% if can_access_kibana %}
|
||||
{% if enable_log_management_button or enable_event_management_button %}
|
||||
<a target="dashboard" href="{% url 'horizon:monitoring:overview:kibana_proxy' url='/' %}" class="btn btn-default">
|
||||
<span class="fa fa-bar-chart"></span>
|
||||
Log Management
|
||||
</a>
|
||||
{% if enable_log_management_button %}
|
||||
{% if enable_event_management_button %}
|
||||
Log and Event Management
|
||||
{% else %}
|
||||
Log Management
|
||||
{% endif %}
|
||||
{% elif enable_event_management_button %}
|
||||
Event Management
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% include 'monitoring/overview/monitor.html' %}
|
||||
|
@ -252,11 +252,12 @@ class IndexView(TemplateView):
|
||||
# Ensure all links have a 'raw' attribute
|
||||
for link in context["dashboards"]:
|
||||
link['raw'] = link.get('raw', False)
|
||||
context['can_access_logs'] = policy.check(
|
||||
context['can_access_kibana'] = policy.check(
|
||||
((getattr(settings, 'KIBANA_POLICY_SCOPE'), getattr(settings, 'KIBANA_POLICY_RULE')), ),
|
||||
self.request
|
||||
)
|
||||
context['enable_kibana_button'] = settings.ENABLE_KIBANA_BUTTON
|
||||
context['enable_log_management_button'] = settings.ENABLE_LOG_MANAGEMENT_BUTTON
|
||||
context['enable_event_management_button'] = settings.ENABLE_EVENT_MANAGEMENT_BUTTON
|
||||
context['show_grafana_home'] = settings.SHOW_GRAFANA_HOME
|
||||
return context
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user