Browse Source
Merge pull request #131 from dandevaud/feature/Add-Gather-Missing-data-only
Add Gather all Missing data to market data overview
pull/5027/head
dandevaud
8 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
35 additions and
0 deletions
-
apps/api/src/app/admin/admin.controller.ts
-
apps/client/src/app/components/admin-market-data/admin-market-data.component.ts
-
apps/client/src/app/components/admin-market-data/admin-market-data.html
-
apps/client/src/app/services/admin.service.ts
|
@ -105,6 +105,23 @@ export class AdminController { |
|
|
this.dataGatheringService.gatherMax(); |
|
|
this.dataGatheringService.gatherMax(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@HasPermission(permissions.accessAdminControl) |
|
|
|
|
|
@Post('gather/missing') |
|
|
|
|
|
@UseGuards(AuthGuard('jwt'), HasPermissionGuard) |
|
|
|
|
|
public async gatherMissing(): Promise<void> { |
|
|
|
|
|
const assetProfileIdentifiers = |
|
|
|
|
|
await this.dataGatheringService.getAllAssetProfileIdentifiers(); |
|
|
|
|
|
|
|
|
|
|
|
const promises = assetProfileIdentifiers.map(({ dataSource, symbol }) => { |
|
|
|
|
|
return this.dataGatheringService.gatherSymbolMissingOnly({ |
|
|
|
|
|
dataSource, |
|
|
|
|
|
symbol |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
await Promise.all(promises); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@HasPermission(permissions.accessAdminControl) |
|
|
@HasPermission(permissions.accessAdminControl) |
|
|
@Post('gather/profile-data') |
|
|
@Post('gather/profile-data') |
|
|
@UseGuards(AuthGuard('jwt'), HasPermissionGuard) |
|
|
@UseGuards(AuthGuard('jwt'), HasPermissionGuard) |
|
|
|
@ -260,6 +260,17 @@ export class AdminMarketDataComponent |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public onGatherMissing() { |
|
|
|
|
|
this.adminService |
|
|
|
|
|
.gatherMissingOnly() |
|
|
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
|
|
.subscribe(() => { |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
window.location.reload(); |
|
|
|
|
|
}, 300); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public onGatherProfileData() { |
|
|
public onGatherProfileData() { |
|
|
this.adminService |
|
|
this.adminService |
|
|
.gatherProfileData() |
|
|
.gatherProfileData() |
|
|
|
@ -194,6 +194,9 @@ |
|
|
<button mat-menu-item (click)="onGatherMax()"> |
|
|
<button mat-menu-item (click)="onGatherMax()"> |
|
|
<ng-container i18n>Gather All Data</ng-container> |
|
|
<ng-container i18n>Gather All Data</ng-container> |
|
|
</button> |
|
|
</button> |
|
|
|
|
|
<button mat-menu-item (click)="onGatherMissing()"> |
|
|
|
|
|
<ng-container i18n>Gather All Missing Data</ng-container> |
|
|
|
|
|
</button> |
|
|
<button mat-menu-item (click)="onGatherProfileData()"> |
|
|
<button mat-menu-item (click)="onGatherProfileData()"> |
|
|
<ng-container i18n>Gather Profile Data</ng-container> |
|
|
<ng-container i18n>Gather Profile Data</ng-container> |
|
|
</button> |
|
|
</button> |
|
|
|
@ -168,6 +168,10 @@ export class AdminService { |
|
|
return this.http.post<void>('/api/v1/admin/gather/max', {}); |
|
|
return this.http.post<void>('/api/v1/admin/gather/max', {}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public gatherMissingOnly() { |
|
|
|
|
|
return this.http.post<void>('/api/v1/admin/gather/missing', {}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public gatherProfileData() { |
|
|
public gatherProfileData() { |
|
|
return this.http.post<void>('/api/v1/admin/gather/profile-data', {}); |
|
|
return this.http.post<void>('/api/v1/admin/gather/profile-data', {}); |
|
|
} |
|
|
} |
|
|