|
61 | 61 | <tr> |
62 | 62 | <th>Repository</th> |
63 | 63 | <th>Minutes</th> |
| 64 | + <th>Estimated Cost</th> |
64 | 65 | </tr> |
65 | 66 | </thead> |
66 | 67 | <tbody> |
67 | 68 | @foreach (var item in Model.ActionMinutesByRepository) |
68 | 69 | { |
69 | 70 | <tr> |
70 | | - <td>@item.Key</td> |
71 | | - <td data-sort="@item.Value">@item.Value minutes</td> |
| 71 | + <td>@item.Label</td> |
| 72 | + <td data-sort="@item.Minutes">@item.Minutes minutes</td> |
| 73 | + <td data-sort="@item.TotalCost">$@item.TotalCost</td> |
72 | 74 | </tr> |
73 | 75 | } |
74 | 76 | </tbody> |
|
77 | 79 | <div class="tab-pane fade" id="nav-tab-action-repository-chart" role="tabpanel" aria-labelledby="nav-tab-action-repository-chart-tab"> |
78 | 80 | <canvas id="action-minutes-by-repository-chart" width="300" height="250"></canvas> |
79 | 81 | <script> |
80 | | - var actionMinChartContext = $('#action-minutes-by-repository-chart'); |
81 | | - var actionMinChart = new Chart(actionMinChartContext, |
82 | | - { |
83 | | - type: 'pie', |
84 | | - data: { |
85 | | - datasets: [ |
86 | | - { |
87 | | - data: [@Html.Raw(string.Join(", ", Model.ActionMinutesByRepository.Select(s => s.Value)))], |
88 | | - backgroundColor: getColors(@Model.ActionMinutesByRepository.Count, 'primary', 'dark', 'secondary', 'light') |
89 | | - } |
90 | | - ], |
91 | | - labels: [@Html.Raw(String.Join(", ", Model.ActionMinutesByRepository.Select(m => $"'{m.Key}'")))] |
92 | | - }, |
93 | | - options: { |
94 | | - tooltips: { |
95 | | - enabled: true, |
96 | | - callbacks: { |
97 | | - label: function(tooltipItem, data) { |
98 | | - var label = data.labels[tooltipItem.index]; |
99 | | - var val = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]; |
100 | | - return label + ':' + val + ' (' + (100 * val / @Html.Raw(Model.ActionMinutesByRepository.Sum(d => d.Value))).toFixed(2) + '%)'; |
| 82 | + var actionMinChartContext = $('#action-minutes-by-repository-chart'); |
| 83 | + var actionMinChart = new Chart(actionMinChartContext, |
| 84 | + { |
| 85 | + type: 'pie', |
| 86 | + data: { |
| 87 | + datasets: [ |
| 88 | + { |
| 89 | + data: [@Html.Raw(string.Join(", ", Model.ActionMinutesByRepository.Select(s => s.Minutes)))], |
| 90 | + backgroundColor: getColors(@Model.ActionMinutesByRepository.Count, 'primary', 'dark', 'secondary', 'light') |
| 91 | + } |
| 92 | + ], |
| 93 | + labels: [@Html.Raw(String.Join(", ", Model.ActionMinutesByRepository.Select(m => $"'{m.Label}'")))] |
| 94 | + }, |
| 95 | + options: { |
| 96 | + tooltips: { |
| 97 | + enabled: true, |
| 98 | + callbacks: { |
| 99 | + label: function (tooltipItem, data) { |
| 100 | + var label = data.labels[tooltipItem.index]; |
| 101 | + var val = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]; |
| 102 | + return label + ':' + val + ' (' + (100 * val / @Html.Raw(Model.ActionMinutesByRepository.Sum(d => d.Minutes))).toFixed(2) + '%)'; |
| 103 | + } |
101 | 104 | } |
102 | | - } |
103 | 105 |
|
| 106 | + } |
104 | 107 | } |
105 | | - } |
106 | | - }); |
| 108 | + }); |
107 | 109 | </script> |
108 | 110 | </div> |
109 | 111 | <div class="tab-pane" id="nav-tab-action-workflow-list" role="tabpanel" aria-labelledby="nav-tab-action-workflow-list-tab"> |
110 | 112 | <table class="display w-100"> |
111 | 113 | <thead> |
112 | | - <tr> |
113 | | - <th>Workflow (Repository - File)</th> |
114 | | - <th>Minutes</th> |
115 | | - </tr> |
116 | | - </thead> |
117 | | - <tbody> |
118 | | - @foreach (var item in Model.ActionMinutesByWorkflow) |
119 | | - { |
120 | 114 | <tr> |
121 | | - <td>@item.Key</td> |
122 | | - <td data-sort="@item.Value">@item.Value minutes</td> |
| 115 | + <th>Workflow (Repository - File)</th> |
| 116 | + <th>Minutes</th> |
| 117 | + <th>Estimated Cost</th> |
123 | 118 | </tr> |
124 | | - } |
| 119 | + </thead> |
| 120 | + <tbody> |
| 121 | + @foreach (var item in Model.ActionMinutesByWorkflow) |
| 122 | + { |
| 123 | + <tr> |
| 124 | + <td>@item.Label</td> |
| 125 | + <td data-sort="@item.Minutes">@item.Minutes minutes</td> |
| 126 | + <td data-sort="@item.TotalCost">$@item.TotalCost</td> |
| 127 | + </tr> |
| 128 | + } |
125 | 129 | </tbody> |
126 | 130 | </table> |
127 | 131 | </div> |
|
164 | 168 | tooltips: { |
165 | 169 | enabled: true, |
166 | 170 | callbacks: { |
167 | | - label: function(tooltipItem, data) { |
| 171 | + label: function (tooltipItem, data) { |
168 | 172 | var label = data.labels[tooltipItem.index]; |
169 | 173 | var val = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]; |
170 | 174 | return label + ':' + val + ' (' + (100 * val / @Html.Raw(Model.ActionsSummary.Sum(d => d.Value))).toFixed(2) + '%)'; |
|
0 commit comments