|
1 | 1 | {% extends 'base.html' %} |
2 | 2 | {% load i18n %} |
3 | | -{% block title %}{% trans "Rating Summary" %}{% endblock %} |
| 3 | +{% block title %}{% trans "Rating Dashboard" %}{% endblock %} |
4 | 4 |
|
5 | 5 | {% block page_header %} |
6 | | -{% include "horizon/common/_page_header.html" with title=_("Rating Summary") %} |
| 6 | + {% include "horizon/common/_page_header.html" with title=_("Rating Dashboard") %} |
7 | 7 | {% endblock page_header %} |
8 | 8 |
|
9 | 9 | {% block main %} |
10 | | -{{ groupby_list|json_script:"groupby_list_config" }} |
11 | | -{% include "project/rating/groupby.html" %} |
12 | | -{{ table.render }} |
13 | 10 |
|
14 | | -{{ modules }} |
| 11 | +<!-- Summary Cards --> |
| 12 | +<div class="row"> |
| 13 | + <div class="col-sm-4"> |
| 14 | + <div class="panel panel-default"> |
| 15 | + <div class="panel-heading"> |
| 16 | + <h3 class="panel-title">{% trans "Current Month" %}</h3> |
| 17 | + <small class="text-muted">{{ current_month_name }}</small> |
| 18 | + </div> |
| 19 | + <div class="panel-body"> |
| 20 | + <p class="h2" style="margin-top: 5px;">{{ current_month_total }}</p> |
| 21 | + <small class="text-muted">{% trans "Day" %} {{ days_elapsed }} {% trans "of" %} {{ days_in_month }}</small> |
| 22 | + </div> |
| 23 | + </div> |
| 24 | + </div> |
| 25 | + |
| 26 | + <div class="col-sm-4"> |
| 27 | + <div class="panel panel-default"> |
| 28 | + <div class="panel-heading"> |
| 29 | + <h3 class="panel-title">{% trans "Forecasted Month End" %}</h3> |
| 30 | + <small class="text-muted">{% trans "Based on current usage" %}</small> |
| 31 | + </div> |
| 32 | + <div class="panel-body"> |
| 33 | + <p class="h2" style="margin-top: 5px;">{{ forecast_total }}</p> |
| 34 | + <small class="text-muted">{% trans "Projected total" %}</small> |
| 35 | + </div> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + |
| 39 | + <div class="col-sm-4"> |
| 40 | + <div class="panel panel-default"> |
| 41 | + <div class="panel-heading"> |
| 42 | + <h3 class="panel-title">{% trans "Last Month" %}</h3> |
| 43 | + <small class="text-muted">{{ last_month_name }}</small> |
| 44 | + </div> |
| 45 | + <div class="panel-body"> |
| 46 | + <p class="h2" style="margin-top: 5px;">{{ last_month_total }}</p> |
| 47 | + <small class="text-muted">{% trans "Total spent" %}</small> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | +</div> |
| 52 | + |
| 53 | +<!-- Cost Breakdown Section --> |
| 54 | +<div class="row"> |
| 55 | + <div class="col-sm-6"> |
| 56 | + <div class="panel panel-default"> |
| 57 | + <div class="panel-heading"> |
| 58 | + <h3 class="panel-title">{% trans "Current Month Breakdown" %}</h3> |
| 59 | + </div> |
| 60 | + <div class="panel-body"> |
| 61 | + <table class="table table-striped table-hover"> |
| 62 | + <thead> |
| 63 | + <tr> |
| 64 | + <th>{% trans "Metric Type" %}</th> |
| 65 | + <th>{% trans "Cost" %}</th> |
| 66 | + <th>{% trans "Percentage" %}</th> |
| 67 | + </tr> |
| 68 | + </thead> |
| 69 | + <tbody> |
| 70 | + {% for item in breakdown_data %} |
| 71 | + <tr> |
| 72 | + <td>{{ item.type }}</td> |
| 73 | + <td>{{ item.rate_display }}</td> |
| 74 | + <td> |
| 75 | + <div class="progress" style="margin-bottom: 0; min-width: 100px; background-color: #e9ecef;"> |
| 76 | + <div class="progress-bar" role="progressbar" |
| 77 | + style="width: {{ item.percentage_css }}%; background-color: #337ab7;" |
| 78 | + aria-valuenow="{{ item.percentage }}" |
| 79 | + aria-valuemin="0" |
| 80 | + aria-valuemax="100"> |
| 81 | + {{ item.percentage }}% |
| 82 | + </div> |
| 83 | + </div> |
| 84 | + </td> |
| 85 | + </tr> |
| 86 | + {% empty %} |
| 87 | + <tr> |
| 88 | + <td colspan="3" class="text-center">{% trans "No data available" %}</td> |
| 89 | + </tr> |
| 90 | + {% endfor %} |
| 91 | + </tbody> |
| 92 | + </table> |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + </div> |
| 96 | + |
| 97 | + <div class="col-sm-6"> |
| 98 | + <div class="panel panel-default"> |
| 99 | + <div class="panel-heading"> |
| 100 | + <h3 class="panel-title">{% trans "Costs Breakdown Comparison" %}</h3> |
| 101 | + </div> |
| 102 | + <div class="panel-body"> |
| 103 | + <div id="breakdown-chart" style="height: 300px;"> |
| 104 | + {% for item in breakdown_data %} |
| 105 | + <div style="margin-bottom: 10px;"> |
| 106 | + <div style="display: flex; justify-content: space-between; margin-bottom: 2px;"> |
| 107 | + <span>{{ item.type }}</span> |
| 108 | + <span>{{ item.rate_display }}</span> |
| 109 | + </div> |
| 110 | + <div class="progress" style="height: 25px; background-color: #e9ecef;"> |
| 111 | + <div class="progress-bar" role="progressbar" |
| 112 | + style="width: {{ item.percentage_css }}%; line-height: 25px; background-color: #5bc0de;" |
| 113 | + aria-valuenow="{{ item.percentage }}" |
| 114 | + aria-valuemin="0" |
| 115 | + aria-valuemax="100"> |
| 116 | + </div> |
| 117 | + </div> |
| 118 | + </div> |
| 119 | + {% empty %} |
| 120 | + <p class="text-center text-muted">{% trans "No data available for chart" %}</p> |
| 121 | + {% endfor %} |
| 122 | + </div> |
| 123 | + </div> |
| 124 | + </div> |
| 125 | + </div> |
| 126 | +</div> |
| 127 | + |
| 128 | +<!-- Top Cost Generators --> |
| 129 | +<div class="row"> |
| 130 | + <div class="col-sm-12"> |
| 131 | + <div class="panel panel-default"> |
| 132 | + <div class="panel-heading"> |
| 133 | + <h3 class="panel-title">{% trans "Top Cost Generators" %}</h3> |
| 134 | + </div> |
| 135 | + <div class="panel-body"> |
| 136 | + <table class="table table-striped table-hover datatable"> |
| 137 | + <thead> |
| 138 | + <tr> |
| 139 | + <th>{% trans "Resource ID" %}</th> |
| 140 | + <th>{% trans "Type" %}</th> |
| 141 | + <th>{% trans "Current Cost" %}</th> |
| 142 | + </tr> |
| 143 | + </thead> |
| 144 | + <tbody> |
| 145 | + {% for resource in top_resources %} |
| 146 | + <tr> |
| 147 | + <td>{{ resource.resource_id|default:"-" }}</td> |
| 148 | + <td>{{ resource.type|default:"-" }}</td> |
| 149 | + <td>{{ resource.rate_display }}</td> |
| 150 | + </tr> |
| 151 | + {% empty %} |
| 152 | + <tr> |
| 153 | + <td colspan="3" class="text-center">{% trans "No resources found" %}</td> |
| 154 | + </tr> |
| 155 | + {% endfor %} |
| 156 | + </tbody> |
| 157 | + </table> |
| 158 | + </div> |
| 159 | + </div> |
| 160 | + </div> |
| 161 | +</div> |
| 162 | + |
15 | 163 | {% endblock %} |
0 commit comments