|
|
@ -43,6 +43,7 @@ import { |
|
|
MatPaginatorModule, |
|
|
MatPaginatorModule, |
|
|
PageEvent |
|
|
PageEvent |
|
|
} from '@angular/material/paginator'; |
|
|
} from '@angular/material/paginator'; |
|
|
|
|
|
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; |
|
|
import { |
|
|
import { |
|
|
MatSort, |
|
|
MatSort, |
|
|
MatSortModule, |
|
|
MatSortModule, |
|
|
@ -64,6 +65,7 @@ import { |
|
|
ellipsisVertical, |
|
|
ellipsisVertical, |
|
|
trashOutline |
|
|
trashOutline |
|
|
} from 'ionicons/icons'; |
|
|
} from 'ionicons/icons'; |
|
|
|
|
|
import ms from 'ms'; |
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
import { Subject } from 'rxjs'; |
|
|
import { Subject } from 'rxjs'; |
|
|
@ -88,6 +90,7 @@ import { CreateAssetProfileDialogParams } from './create-asset-profile-dialog/in |
|
|
MatCheckboxModule, |
|
|
MatCheckboxModule, |
|
|
MatMenuModule, |
|
|
MatMenuModule, |
|
|
MatPaginatorModule, |
|
|
MatPaginatorModule, |
|
|
|
|
|
MatSnackBarModule, |
|
|
MatSortModule, |
|
|
MatSortModule, |
|
|
MatTableModule, |
|
|
MatTableModule, |
|
|
NgxSkeletonLoaderModule, |
|
|
NgxSkeletonLoaderModule, |
|
|
@ -177,6 +180,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { |
|
|
private readonly dialog = inject(MatDialog); |
|
|
private readonly dialog = inject(MatDialog); |
|
|
private readonly route = inject(ActivatedRoute); |
|
|
private readonly route = inject(ActivatedRoute); |
|
|
private readonly router = inject(Router); |
|
|
private readonly router = inject(Router); |
|
|
|
|
|
private readonly snackBar = inject(MatSnackBar); |
|
|
private readonly userService = inject(UserService); |
|
|
private readonly userService = inject(UserService); |
|
|
|
|
|
|
|
|
public constructor() { |
|
|
public constructor() { |
|
|
@ -239,7 +243,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { |
|
|
.subscribe((filters) => { |
|
|
.subscribe((filters) => { |
|
|
this.activeFilters = filters; |
|
|
this.activeFilters = filters; |
|
|
|
|
|
|
|
|
this.loadData(); |
|
|
this.reloadData({ pageIndex: 0 }); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
addIcons({ |
|
|
addIcons({ |
|
|
@ -285,15 +289,25 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { |
|
|
dataSource, |
|
|
dataSource, |
|
|
symbol |
|
|
symbol |
|
|
}: AssetProfileIdentifier) { |
|
|
}: AssetProfileIdentifier) { |
|
|
this.adminMarketDataService.deleteAssetProfile({ dataSource, symbol }); |
|
|
this.adminMarketDataService |
|
|
|
|
|
.deleteAssetProfile({ dataSource, symbol }) |
|
|
|
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
|
|
|
.subscribe(() => { |
|
|
|
|
|
this.reloadData(); |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected onDeleteAssetProfiles() { |
|
|
protected onDeleteAssetProfiles() { |
|
|
this.adminMarketDataService.deleteAssetProfiles( |
|
|
this.adminMarketDataService |
|
|
this.selection.selected.map(({ dataSource, symbol }) => { |
|
|
.deleteAssetProfiles( |
|
|
return { dataSource, symbol }; |
|
|
this.selection.selected.map(({ dataSource, symbol }) => { |
|
|
}) |
|
|
return { dataSource, symbol }; |
|
|
); |
|
|
}) |
|
|
|
|
|
) |
|
|
|
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
|
|
|
.subscribe(() => { |
|
|
|
|
|
this.reloadData(); |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected onGatherMax() { |
|
|
protected onGatherMax() { |
|
|
@ -301,9 +315,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { |
|
|
.gatherMax() |
|
|
.gatherMax() |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.subscribe(() => { |
|
|
.subscribe(() => { |
|
|
setTimeout(() => { |
|
|
this.notifyDataGatheringHasBeenStarted(); |
|
|
window.location.reload(); |
|
|
|
|
|
}, 300); |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -311,7 +323,9 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { |
|
|
this.adminService |
|
|
this.adminService |
|
|
.gatherProfileData() |
|
|
.gatherProfileData() |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.subscribe(); |
|
|
.subscribe(() => { |
|
|
|
|
|
this.notifyDataGatheringHasBeenStarted(); |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected onGatherRecentMarketData() { |
|
|
protected onGatherRecentMarketData() { |
|
|
@ -319,9 +333,7 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { |
|
|
.gatherRecentMarketData() |
|
|
.gatherRecentMarketData() |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.subscribe(() => { |
|
|
.subscribe(() => { |
|
|
setTimeout(() => { |
|
|
this.notifyDataGatheringHasBeenStarted(); |
|
|
window.location.reload(); |
|
|
|
|
|
}, 300); |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -396,6 +408,16 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private notifyDataGatheringHasBeenStarted() { |
|
|
|
|
|
this.snackBar.open( |
|
|
|
|
|
'✅ ' + $localize`Data gathering has been started.`, |
|
|
|
|
|
undefined, |
|
|
|
|
|
{ |
|
|
|
|
|
duration: ms('3 seconds') |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private openAssetProfileDialog({ |
|
|
private openAssetProfileDialog({ |
|
|
dataSource, |
|
|
dataSource, |
|
|
symbol |
|
|
symbol |
|
|
@ -431,6 +453,8 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { |
|
|
if (newAssetProfileIdentifier) { |
|
|
if (newAssetProfileIdentifier) { |
|
|
this.onOpenAssetProfileDialog(newAssetProfileIdentifier); |
|
|
this.onOpenAssetProfileDialog(newAssetProfileIdentifier); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
this.reloadData(); |
|
|
|
|
|
|
|
|
this.router.navigate(['.'], { relativeTo: this.route }); |
|
|
this.router.navigate(['.'], { relativeTo: this.route }); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
@ -483,4 +507,14 @@ export class GfAdminMarketDataComponent implements AfterViewInit, OnInit { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private reloadData({ |
|
|
|
|
|
pageIndex = this.paginator().pageIndex |
|
|
|
|
|
}: { pageIndex?: number } = {}) { |
|
|
|
|
|
this.loadData({ |
|
|
|
|
|
pageIndex, |
|
|
|
|
|
sortColumn: this.sort().active, |
|
|
|
|
|
sortDirection: this.sort().direction |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|