diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue
deleted file mode 100644
index 5b06cac2..00000000
--- a/src/components/HelloWorld.vue
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
{{ msg }}
-
- For a guide and recipes on how to configure / customize this project,
- check out the
- vue-cli documentation.
-
-
Installed CLI Plugins
-
-
Essential Links
-
-
Ecosystem
-
-
-
-
-
-
-
-
diff --git a/src/components/MetricsViewer.vue b/src/components/MetricsViewer.vue
index 248dcb72..02c8ee34 100644
--- a/src/components/MetricsViewer.vue
+++ b/src/components/MetricsViewer.vue
@@ -2,18 +2,21 @@
GitHub Copilot Business Metrics Viewer
-
Acceptance rate (%)
-
+
+
+
+
Acceptance rate (%)
+
- Total Suggestions Count | Total Acceptances Count
-
+ Total Suggestions Count | Total Acceptances Count
+
- Total Lines Suggested | Total Lines Accepted
-
-
- Total Active Users
-
+ Total Lines Suggested | Total Lines Accepted
+
+ Total Active Users
+
+
@@ -68,13 +71,17 @@ export default defineComponent({
//Total Active Users
const totalActiveUsersChartData = ref<{ labels: string[]; datasets: any[] }>({ labels: [], datasets: [] });
+ // API Error Message
+ const apiError = ref(null);
+
+
const chartOptions = {
responsive: true,
maintainAspectRatio: true,
layout: {
padding: {
- left: 40,
- right: 40,
+ left: 150,
+ right: 150,
top: 20,
bottom: 40
}
@@ -173,9 +180,37 @@ export default defineComponent({
}
]
};
+ }).catch(error => {
+ console.log(error);
+ // Check the status code of the error response
+ if (error.response && error.response.status) {
+ switch (error.response.status) {
+ case 401:
+ apiError.value = '401 Unauthorized access - check if your token in the .env file is correct.';
+ break;
+ case 404:
+ apiError.value = `404 Not Found - is the organization '${process.env.VUE_APP_GITHUB_ORG}' correct?`;
+ break;
+ default:
+ apiError.value = error.message;
+ break;
+ }
+ } else {
+ // Update apiError with the error message
+ apiError.value = error.message;
+ }
+ // Add a new line to the apiError message
+ apiError.value += '
If .env file is modified, restart the changes to take effect.';
+
});
- return { totalSuggestionsAndAcceptanceChartData, chartData, chartOptions, totalActiveUsersChartData, totalActiveUsersChartOptions, acceptanceRateChartData };
+ return { totalSuggestionsAndAcceptanceChartData, chartData, chartOptions, totalActiveUsersChartData, totalActiveUsersChartOptions, acceptanceRateChartData, apiError };
}
});
-
\ No newline at end of file
+
+
+
\ No newline at end of file