Display all Project Contributors on About page using GitHub API (#382)

This commit is contained in:
wiz 2021-03-09 03:56:41 +09:00 committed by GitHub
parent d5cc558670
commit e32066affd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 4 deletions

View File

@ -281,19 +281,43 @@
<div class="row row-cols-2" dir="ltr">
<div class="col col-md-2 offset-md-4">
<a href="https://twitter.com/softsimon_">
<div class="profile_photo mx-auto" style="background-image: url(/resources/profile/softsimon.jpg)"></div>
@softsimon_
<div class="profile_photo d-inline-block" title="softsimon">
<img class="profile_img" src="resources/profile/softsimon.jpg" />
softsimon
</div>
</a>
</div>
<div class="col col-md-2">
<a href="https://twitter.com/wiz">
<div class="profile_photo mx-auto" style="background-image: url(/resources/profile/wiz.png)"></div>
@wiz
<div class="profile_photo d-inline-block" title="wiz">
<img class="profile_img" src="resources/profile/wiz.png" />
wiz
</div>
</a>
</div>
</div>
</div>
<br><br>
<h3 i18n="about.contributors">Project Contributors</h3>
<div *ngIf="contributors === null">
<br>
<div class="spinner-border text-light"></div>
</div>
<ng-template ngFor let-contributor [ngForOf]="contributors">
<a [href]="'https://github.com/' + contributor.name" target="_blank">
<div class="profile_photo d-inline-block" [title]="contributor.name">
<img class="profile_img" [src]="'/api/v1/contributors/images/' + contributor.id" />
{{ contributor.name }}
</div>
</a>
</ng-template>
<br><br>
</div>
<br><br>

View File

@ -19,9 +19,11 @@ export class AboutComponent implements OnInit, OnDestroy {
paymentForm: FormGroup;
donationStatus = 1;
sponsors$: Observable<any>;
contributors$: Observable<any>;
donationObj: any;
sponsorsEnabled = this.stateService.env.OFFICIAL_MEMPOOL_SPACE;
sponsors = null;
contributors = null;
requestSubscription: Subscription | undefined;
constructor(
@ -51,6 +53,11 @@ export class AboutComponent implements OnInit, OnDestroy {
.subscribe((sponsors) => {
this.sponsors = sponsors;
});
this.apiService.getContributor$()
.subscribe((contributors) => {
this.contributors = contributors;
});
}
ngOnDestroy() {

View File

@ -77,6 +77,10 @@ export class ApiService {
return this.httpClient.get<any[]>(this.apiBaseUrl + this.apiBasePath + '/api/v1/donations');
}
getContributor$(): Observable<any[]> {
return this.httpClient.get<any[]>(this.apiBaseUrl + this.apiBasePath + '/api/v1/contributors');
}
checkDonation$(orderId: string): Observable<any[]> {
return this.httpClient.get<any[]>(this.apiBaseUrl + this.apiBasePath + '/api/v1/donations/check?order_id=' + orderId);
}

View File

@ -40,6 +40,12 @@
location /api/v1/donations/images {
proxy_pass https://mempool.space;
}
location /api/v1/contributors {
proxy_pass https://mempool.space;
}
location /api/v1/contributors/images {
proxy_pass https://mempool.space;
}
location /api/v1/ws {
proxy_pass http://127.0.0.1:8999/;
proxy_http_version 1.1;