File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed
Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -691,3 +691,13 @@ <h3>{{user.fullname}}</h3>
691691 } ) ( ) ;
692692</ script >
693693{% endmacro -%}
694+
695+ {%- macro render_stats_dashboard_link(project, private_instance) %}
696+ {% if config.get('STATS_DASHBOARD_URL') %}
697+ {% set cluster = config.get('STATS_DASHBOARD_CLUSTER', '') %}
698+ {% set dashboard_url = config.get('STATS_DASHBOARD_URL') + "?var-project_id=" + project.id|string + "&var-task_source=GIGWORK_" + ("PRIV" if private_instance else "PUBLIC") + "&from=now-30d&to=now&var-cluster=" + cluster %}
699+ < div class ="row " style ="margin-top: 2em; " id ="grafana-link ">
700+ < a class ="btn btn-primary " target ="_blank " href ="{{dashboard_url}} "> Metrics Dashboard</ a >
701+ </ div >
702+ {% endif %}
703+ {% endmacro -%}
Original file line number Diff line number Diff line change 1414 < span class ="alert alert-warning "> < strong > Ooops</ strong > Sorry, the project does not have tasks to process and
1515 show some statistics</ span >
1616 </ div >
17- {% if config.get('STATS_DASHBOARD_URL') %}
18- {% set dashboard_url = config.get('STATS_DASHBOARD_URL') + "?var-project_id=" + project.id|string + "&var-task_source=GIGWORK_" + ("PRIV" if private_instance else "PUBLIC") %}
19- < div class ="row " style ="margin-top: 2em; " id ="grafana-link ">
20- < a class ="btn btn-primary " target ="_blank " href ="{{dashboard_url}} "> Metrics Dashboard</ a >
21- </ div >
22- {% endif %}
17+ {{ helper.render_stats_dashboard_link(project, private_instance) }}
2318 </ div >
2419</ div >
2520{{ helper.broken_image() }}
Original file line number Diff line number Diff line change 2121 </ div >
2222 </ div >
2323 {% endif %}
24- {% if config.get('STATS_DASHBOARD_URL') %}
25- {% set dashboard_url = config.get('STATS_DASHBOARD_URL') + "?var-project_id=" + project.id|string + "&var-task_source=GIGWORK_" + ("PRIV" if private_instance else "PUBLIC") %}
26- < div class ="row " style ="margin-top: 2em; " id ="grafana-link ">
27- < a class ="btn btn-primary " target ="_blank " href ="{{dashboard_url}} "> Metrics Dashboard</ a >
28- </ div >
29- {% endif %}
24+ {{ helper.render_stats_dashboard_link(project, private_instance) }}
3025 <!-- Hour Stats CARD -->
3126 < div id ="card " class ="row ">
3227 < div class ="col-md-12 ">
You can’t perform that action at this time.
0 commit comments