Skip to content

Commit cc380c1

Browse files
committed
export button
1 parent 19eed07 commit cc380c1

File tree

5 files changed

+244
-19
lines changed

5 files changed

+244
-19
lines changed

package-lock.json

Lines changed: 185 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"github-usage-report": "^1.5.0",
2525
"highcharts": "^11.2.0",
2626
"highcharts-angular": "^4.0.0",
27+
"jspdf": "^2.5.1",
2728
"rxjs": "~7.8.0",
2829
"tslib": "^2.3.0",
2930
"zone.js": "~0.14.3"
@@ -49,4 +50,4 @@
4950
"karma-jasmine-html-reporter": "~2.0.0",
5051
"typescript": "~5.3.3"
5152
}
52-
}
53+
}

src/app/components/usage/usage.component.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ <h1 class="mat-headline-2" style="user-select: none; font-weight: 800; text-alig
1313
<mat-progress-bar *ngIf="progress && progress < 99" mode="determinate" [value]="progress"></mat-progress-bar>
1414
<mat-progress-bar *ngIf="progress && progress >= 99" mode="indeterminate"></mat-progress-bar>
1515

16-
<ng-container *ngIf="usage">
16+
<button mat-button *ngIf="usage" (click)="exportHtml()">
17+
<mat-icon>download</mat-icon>
18+
Export
19+
</button>
20+
21+
<div id="usage-report" *ngIf="usage">
1722
<form class="mat-app-background">
1823
<mat-form-field appearance="fill">
1924
<mat-label>Choose a date range</mat-label>
@@ -61,7 +66,7 @@ <h1 class="mat-headline-2" style="user-select: none; font-weight: 800; text-alig
6166
</ng-template>
6267
<ng-template matTabContent>
6368
<div style="margin-top: 25px;"></div>
64-
<app-actions [data]="usageLinesActions" [currency]="currency"></app-actions>
69+
<app-actions [data]="this.usageLines.actions" [currency]="currency"></app-actions>
6570
</ng-template>
6671
</mat-tab>
6772
<mat-tab>
@@ -71,7 +76,7 @@ <h1 class="mat-headline-2" style="user-select: none; font-weight: 800; text-alig
7176
</ng-template>
7277
<ng-template matTabContent>
7378
<div style="margin-top: 25px;"></div>
74-
<app-shared-storage [data]="usageLinesSharedStorage" [currency]="currency"></app-shared-storage>
79+
<app-shared-storage [data]="this.usageLines.sharedStorage" [currency]="currency"></app-shared-storage>
7580
</ng-template>
7681
</mat-tab>
7782
<mat-tab>
@@ -81,12 +86,11 @@ <h1 class="mat-headline-2" style="user-select: none; font-weight: 800; text-alig
8186
</ng-template>
8287
<ng-template matTabContent>
8388
<div style="margin-top: 25px;"></div>
84-
<app-copilot [data]="usageLinesCopilot" [currency]="currency"></app-copilot>
89+
<app-copilot [data]="this.usageLines.copilot" [currency]="currency"></app-copilot>
8590
</ng-template>
8691
</mat-tab>
8792
</mat-tab-group>
88-
89-
</ng-container>
93+
</div>
9094

9195
<ng-container *ngIf="!usage && !progress">
9296
<div class="flex-center-column full-width" style="text-align: center;">

0 commit comments

Comments
 (0)