|
1 | 1 | <template>
|
2 | 2 | <div>
|
3 |
| - <h1>GitHub Copilot Business Metrics Viewer</h1> |
4 |
| - |
5 | 3 | <!-- API Error Message -->
|
6 | 4 | <div v-if="apiError" class="error-message" v-html="apiError"></div>
|
7 | 5 | <div v-if="!apiError">
|
8 | 6 | <div class="tiles-container">
|
9 |
| - <!-- Acceptance Rate Tile --> |
10 |
| - <div class="tile"> |
11 |
| - <h3>Acceptance Rate Average</h3> |
12 |
| - <p>{{ acceptanceRateAverage.toFixed(2) }}%</p> |
13 |
| - <p>Over the last 28 days</p> |
14 |
| - </div> |
15 |
| - |
16 |
| - <div class="tile"> |
17 |
| - <h3>Cumulative Number of Suggestions</h3> |
18 |
| - <p>{{ cumulativeNumberSuggestions }}</p> |
19 |
| - <p>On the last 28 days</p> |
20 |
| - </div> |
21 |
| - |
22 |
| - <div class="tile"> |
23 |
| - <h3>Cumulative Number of Accepted Prompts</h3> |
24 |
| - <p>{{ cumulativeNumberAcceptances }}</p> |
25 |
| - <p>On the last 28 days</p> |
26 |
| - </div> |
27 |
| - |
28 |
| - <div class="tile"> |
29 |
| - <h3>Cumulative Number of Lines of Code Accepted</h3> |
30 |
| - <p>{{ cumulativeNumberLOCAccepted }}</p> |
31 |
| - <p>On the last 28 days</p> |
32 |
| - </div> |
33 |
| - </div> |
34 | 7 |
|
| 8 | + <!-- Acceptance Rate Tile --> |
| 9 | + <v-card elevation="4" color="white" variant="elevated" class="mx-auto my-3" style="width: 300px; height: 175px;"> |
| 10 | + <v-card-item> |
| 11 | + <div> |
| 12 | + <div class="text-overline mb-1" style="visibility: hidden;">filler</div> |
| 13 | + <div class="text-h6 mb-1">Acceptance Rate Average</div> |
| 14 | + <div class="text-caption"> |
| 15 | + Over the last 28 days |
| 16 | + </div> |
| 17 | + <p>{{ acceptanceRateAverage.toFixed(2) }}%</p> |
| 18 | + </div> |
| 19 | + </v-card-item> |
| 20 | + </v-card> |
| 21 | + |
| 22 | + <v-card elevation="4" color="white" variant="elevated" class="mx-auto my-3" style="width: 300px; height: 175px;"> |
| 23 | + <v-card-item> |
| 24 | + <div> |
| 25 | + <div class="text-overline mb-1" style="visibility: hidden;">filler</div> |
| 26 | + <div class="text-h6 mb-1">Cumulative Number of Suggestions</div> |
| 27 | + <div class="text-caption"> |
| 28 | + Over the last 28 days |
| 29 | + </div> |
| 30 | + <p>{{ cumulativeNumberSuggestions }}</p> |
| 31 | + </div> |
| 32 | + </v-card-item> |
| 33 | + </v-card> |
| 34 | + |
| 35 | + <v-card elevation="4" color="white" variant="elevated" class="mx-auto my-3" style="width: 300px; height: 175px;"> |
| 36 | + <v-card-item> |
| 37 | + <div> |
| 38 | + <div class="text-overline mb-1" style="visibility: hidden;">filler</div> |
| 39 | + <div class="text-h6 mb-1">Cumulative Number of Accepted Prompts</div> |
| 40 | + <div class="text-caption"> |
| 41 | + Over the last 28 days |
| 42 | + </div> |
| 43 | + <p>{{ cumulativeNumberAcceptances }}</p> |
| 44 | + </div> |
| 45 | + </v-card-item> |
| 46 | + </v-card> |
| 47 | + |
| 48 | + <v-card elevation="4" color="white" variant="elevated" class="mx-auto my-3" style="width: 300px; height: 175px;"> |
| 49 | + <v-card-item> |
| 50 | + <div> |
| 51 | + <div class="text-overline mb-1" style="visibility: hidden;">filler</div> |
| 52 | + <div class="text-h6 mb-1">Cumulative Number of Lines of Code Accepted</div> |
| 53 | + <div class="text-caption"> |
| 54 | + Over the last 28 days |
| 55 | + </div> |
| 56 | + <p>{{ cumulativeNumberLOCAccepted }}</p> |
| 57 | + </div> |
| 58 | + </v-card-item> |
| 59 | + </v-card> |
| 60 | + </div> |
35 | 61 |
|
36 |
| - <h2>Acceptance rate (%)</h2> |
37 |
| - <Bar :data="acceptanceRateChartData" :options="chartOptions" /> |
38 |
| - |
39 |
| - <h2>Total Suggestions Count | Total Acceptances Count</h2> |
40 |
| - <Line :data="totalSuggestionsAndAcceptanceChartData" :options="chartOptions" /> |
41 |
| - |
42 |
| - <h2>Total Lines Suggested | Total Lines Accepted</h2> |
43 |
| - <Line :data="chartData" :options="chartOptions" /> |
44 |
| - |
45 |
| - <h2>Total Active Users</h2> |
46 |
| - <Bar :data="totalActiveUsersChartData" :options="totalActiveUsersChartOptions" /> |
47 |
| - |
48 |
| - <h2>Languages Breakdown</h2> |
49 |
| - <table class="center-table" style="border: 1px solid black;"> |
50 |
| - <thead> |
51 |
| - <tr> |
52 |
| - <th style="text-align: left; border-right: 1px solid black; border-bottom: 1px solid black; padding-right: 10px;">Language Name</th> |
53 |
| - <th style="text-align: left; border-right: 1px solid black; border-bottom: 1px solid black; padding-right: 10px;">Accepted Prompts</th> |
54 |
| - <th style="border-right: 1px solid black; border-bottom: 1px solid black; padding-right: 10px;">Accepted Lines of Code</th> |
55 |
| - <th style="border-bottom: 1px solid black; padding-right: 10px;">Acceptance Rate (%)</th> |
56 |
| - </tr> |
57 |
| - </thead> |
58 |
| - <tbody> |
59 |
| - <tr v-for="(language, languageName) in Array.from(languages)" :key="languageName"> |
60 |
| - <td style="text-align: left;">{{ language[0] }}</td> |
61 |
| - <td style="text-align: left;">{{ language[1].acceptedPrompts }}</td> |
62 |
| - <td style="text-align: left;">{{ language[1].acceptedLinesOfCode }}</td> |
63 |
| - <td v-if="language[1].acceptanceRate !== undefined">{{ language[1].acceptanceRate.toFixed(2) }}%</td> |
64 |
| - </tr> |
65 |
| - </tbody> |
66 |
| - </table> |
67 |
| - |
| 62 | + <v-main class="p-1" style="min-height: 300px;"> |
| 63 | + <v-container style="min-height: 300px;" class="px-4 elevation-2"> |
| 64 | + <h2>Acceptance rate (%)</h2> |
| 65 | + <Bar :data="acceptanceRateChartData" :options="chartOptions" /> |
| 66 | + |
| 67 | + <h2>Total Suggestions Count | Total Acceptances Count</h2> |
| 68 | + <Line :data="totalSuggestionsAndAcceptanceChartData" :options="chartOptions" /> |
| 69 | + |
| 70 | + <h2>Total Lines Suggested | Total Lines Accepted</h2> |
| 71 | + <Line :data="chartData" :options="chartOptions" /> |
| 72 | + |
| 73 | + <h2>Total Active Users</h2> |
| 74 | + <Bar :data="totalActiveUsersChartData" :options="totalActiveUsersChartOptions" /> |
| 75 | + |
| 76 | + <h2>Languages Breakdown</h2> |
| 77 | + <table class="center-table" style="border: 1px solid black;"> |
| 78 | + <thead> |
| 79 | + <tr> |
| 80 | + <th style="text-align: left; border-right: 1px solid black; border-bottom: 1px solid black; padding-right: 10px;">Language Name</th> |
| 81 | + <th style="text-align: left; border-right: 1px solid black; border-bottom: 1px solid black; padding-right: 10px;">Accepted Prompts</th> |
| 82 | + <th style="border-right: 1px solid black; border-bottom: 1px solid black; padding-right: 10px;">Accepted Lines of Code</th> |
| 83 | + <th style="border-bottom: 1px solid black; padding-right: 10px;">Acceptance Rate (%)</th> |
| 84 | + </tr> |
| 85 | + </thead> |
| 86 | + <tbody> |
| 87 | + <tr v-for="(language, languageName) in Array.from(languages)" :key="languageName"> |
| 88 | + <td style="text-align: left;">{{ language[0] }}</td> |
| 89 | + <td style="text-align: left;">{{ language[1].acceptedPrompts }}</td> |
| 90 | + <td style="text-align: left;">{{ language[1].acceptedLinesOfCode }}</td> |
| 91 | + <td v-if="language[1].acceptanceRate !== undefined">{{ language[1].acceptanceRate.toFixed(2) }}%</td> |
| 92 | + </tr> |
| 93 | + </tbody> |
| 94 | + </table> |
| 95 | + </v-container> |
| 96 | + </v-main> |
68 | 97 | </div>
|
69 | 98 | </div>
|
70 | 99 | </template>
|
@@ -136,6 +165,8 @@ export default defineComponent({
|
136 | 165 | const chartOptions = {
|
137 | 166 | responsive: true,
|
138 | 167 | maintainAspectRatio: true,
|
| 168 | + height: 300, |
| 169 | + width: 300, |
139 | 170 | layout: {
|
140 | 171 | padding: {
|
141 | 172 | left: 150,
|
|
0 commit comments