Skip to content

Commit 0a30fd0

Browse files
authored
Merge branch 'main' into main
2 parents 0be8402 + 720713f commit 0a30fd0

12 files changed

+26
-23
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ VUE_APP_GITHUB_ORG=octodemo
1111
VUE_APP_GITHUB_ENT=
1212

1313
# Determines the GitHub Personal Access Token to use for API calls.
14-
# Create with scopes copilot, manage_billing:copilot, admin:enterprise, or manage_billing:enterprise, read:enterprise AND read:org
14+
# Create with scopes copilot, manage_billing:copilot or manage_billing:enterprise, read:enterprise AND read:org
1515
VUE_APP_GITHUB_TOKEN=

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ RUN npm run build
88

99
# Stage 2: Serve the application with Nginx
1010
FROM nginx:1.27 as production-stage
11+
1112
COPY --from=build-stage /app/dist /usr/share/nginx/html
1213
COPY --from=build-stage /app/dist/assets/app-config.js /usr/share/nginx/html-template/app-config.template.js
1314
COPY ./docker-entrypoint.d/*.sh /docker-entrypoint.d/

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,18 @@ The language breakdown analysis tab also displays a table showing the Accepted P
7171
4. **Total Active Copilot Chat Users:** a bar chart that illustrates the total number of users who have actively interacted with Copilot over the past 28 days.
7272

7373
## Seat Analysis
74+
<p align="center">
75+
<img width="800" alt="image" src="https://github.com/github-copilot-resources/copilot-metrics-viewer/assets/54096296/51747194-df30-4bfb-8849-54a0510fffcb">
76+
</p>
77+
1. **Total Assigned:** This metric represents the total number of Copilot seats assigned within current organization/enterprise.
7478

75-
![image](https://github.com/DevOps-zhuang/copilot-metrics-viewer/assets/54096296/d1fa9d1d-4fab-4e87-84ba-7be189dd4dd0)
76-
77-
1. **Total Assigned:** This metric represents the total number of Copilot seats assigned within current organization.
78-
79-
2. **Assigned But Never Used:** This metric shows seats that were assigned but never within the current organization. The assigned timestamp is also displayed in the below chart.
79+
2. **Assigned But Never Used:** This metric shows seats that were assigned but never used within the current organization/enterprise. The assigned timestamp is also displayed in the chart.
8080

8181
3. **No Activity in the Last 7 days:** never used seats or seats used, but with no activity in the past 7 days.
8282

8383
4. **No Activity in the last 7 days (including never used seats):** a table to display seats that have had no activity in the past 7 days, ordered by the date of last activity. Seats that were used earlier are displayed at the top.
8484

8585

86-
8786
## Setup instructions
8887

8988
In the `.env` file, you can configure several environment variables that control the behavior of the application.
@@ -115,7 +114,7 @@ To access Copilot metrics from the last 28 days via the API and display actual d
115114
```
116115

117116
#### VUE_APP_GITHUB_TOKEN
118-
Specifies the GitHub Personal Access Token utilized for API requests. Generate this token with the following scopes: _copilot_, _manage_billing:copilot_, _manage_billing:enterprise_, _read:enterprise_, _admin:org_.
117+
Specifies the GitHub Personal Access Token utilized for API requests. Generate this token with the following scopes: _copilot_, _manage_billing:copilot_, _manage_billing:enterprise_, _read:enterprise_, _read:org_.
119118

120119
```
121120
VUE_APP_GITHUB_TOKEN=

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "copilot-metrics-viewer",
3-
"version": "1.5.0",
3+
"version": "1.6.0",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",

src/api/ExtractSeats.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const getSeatsApi = async (): Promise<Seat[]> => {
1212
let seatsData: Seat[] = [];
1313

1414
let response;
15+
1516
if (config.scope.type !== "organization") {
1617
// when the scope is not organization, return seatsData,by default it will return empty array
1718
return seatsData;
@@ -34,8 +35,9 @@ export const getSeatsApi = async (): Promise<Seat[]> => {
3435
page: page
3536
}
3637
});
37-
38+
3839
seatsData = seatsData.concat(response.data.seats.map((item: any) => new Seat(item)));
40+
3941
// Calculate the total pages
4042
const totalSeats = response.data.total_seats;
4143
const totalPages = Math.ceil(totalSeats / perPage);
@@ -59,4 +61,4 @@ export const getSeatsApi = async (): Promise<Seat[]> => {
5961
}
6062
return seatsData;
6163
}
62-
}
64+
}

src/assets/enterprise_response_sample_seats.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"last_activity_at": "2021-10-14T00:53:32-06:00",
99
"last_activity_editor": "vscode/1.77.3/copilot/1.86.82",
1010
"assignee": {
11-
"login": "octocat",
11+
"login": "octocat_byEnterprise",
1212
"id": 1,
1313
"node_id": "MDQ6VXNlcjE=",
1414
"avatar_url": "https://github.com/images/error/octocat_happy.gif",

src/assets/organization_response_sample_seats.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"last_activity_at": "2021-10-14T00:53:32-06:00",
99
"last_activity_editor": "vscode/1.77.3/copilot/1.86.82",
1010
"assignee": {
11-
"login": "octocat",
11+
"login": "octocat_org",
1212
"id": 1,
1313
"node_id": "MDQ6VXNlcjE=",
1414
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
@@ -50,7 +50,7 @@
5050
"last_activity_at": "2021-10-13T00:53:32-06:00",
5151
"last_activity_editor": "vscode/1.77.3/copilot/1.86.82",
5252
"assignee": {
53-
"login": "octokitten",
53+
"login": "octokitten_org",
5454
"id": 1,
5555
"node_id": "MDQ76VNlcjE=",
5656
"avatar_url": "https://github.com/images/error/octokitten_happy.gif",

src/components/ApiResponse.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</div>
1414

1515
<br><br>
16-
<div v-if="vueAppScope === 'organization'">
16+
1717
<v-card max-height="575px" class="overflow-y-auto">
1818
<pre ref="jsonText">{{ JSON.stringify(seats, null, 2) }}</pre>
1919
</v-card>
@@ -24,7 +24,6 @@
2424
<div v-if="showSeatMessage" :class="{'copy-message': true, 'error': isError}">{{ message }}</div>
2525
</transition>
2626
</div>
27-
</div>
2827
</v-container>
2928
</template>
3029

src/components/MainComponent.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131
<BreakdownComponent v-if="item === 'languages'" :metrics="metrics" :breakdownKey="'language'"/>
3232
<BreakdownComponent v-if="item === 'editors'" :metrics="metrics" :breakdownKey="'editor'"/>
3333
<CopilotChatViewer v-if="item === 'copilot chat'" :metrics="metrics" />
34-
<div v-if="isScopeOrganization">
3534
<SeatsAnalysisViewer v-if="item === 'seat analysis'" :seats="seats" />
36-
</div>
3735
<ApiResponse v-if="item === 'api response'" :metrics="metrics" :seats="seats" />
3836
</v-card>
3937
</v-window-item>
@@ -90,12 +88,12 @@ export default defineComponent({
9088
},
9189
data () {
9290
return {
93-
tabItems: ['languages', 'editors', 'copilot chat', 'api response'],
91+
tabItems: ['languages', 'editors', 'copilot chat','seat analysis' , 'api response'],
9492
tab: null
9593
}
9694
},
9795
created() {
98-
this.tabItems.unshift(this.itemName);
96+
this.tabItems.unshift(this.itemName);
9997
if (config.scope.type === 'organization') {
10098
// get the last item in the array,which is 'api response'
10199
//and add 'seat analysis' before it

0 commit comments

Comments
 (0)