mirror of https://github.com/ghostfolio/ghostfolio
Browse Source
* Set up open color for CSS variables usage * Simplify data providers management * Update changelogpull/4993/head
committed by
GitHub
10 changed files with 83 additions and 149 deletions
@ -1,60 +0,0 @@ |
|||||
import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; |
|
||||
import { DataService } from '@ghostfolio/client/services/data.service'; |
|
||||
import { PROPERTY_API_KEY_GHOSTFOLIO } from '@ghostfolio/common/config'; |
|
||||
import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; |
|
||||
|
|
||||
import { Component, Inject } from '@angular/core'; |
|
||||
import { MatButtonModule } from '@angular/material/button'; |
|
||||
import { |
|
||||
MAT_DIALOG_DATA, |
|
||||
MatDialogModule, |
|
||||
MatDialogRef |
|
||||
} from '@angular/material/dialog'; |
|
||||
|
|
||||
import { GfDialogFooterModule } from '../../dialog-footer/dialog-footer.module'; |
|
||||
import { GfDialogHeaderModule } from '../../dialog-header/dialog-header.module'; |
|
||||
import { GhostfolioPremiumApiDialogParams } from './interfaces/interfaces'; |
|
||||
|
|
||||
@Component({ |
|
||||
imports: [ |
|
||||
GfDialogFooterModule, |
|
||||
GfDialogHeaderModule, |
|
||||
GfPremiumIndicatorComponent, |
|
||||
MatButtonModule, |
|
||||
MatDialogModule |
|
||||
], |
|
||||
selector: 'gf-ghostfolio-premium-api-dialog', |
|
||||
styleUrls: ['./ghostfolio-premium-api-dialog.scss'], |
|
||||
templateUrl: './ghostfolio-premium-api-dialog.html' |
|
||||
}) |
|
||||
export class GfGhostfolioPremiumApiDialogComponent { |
|
||||
public constructor( |
|
||||
@Inject(MAT_DIALOG_DATA) public data: GhostfolioPremiumApiDialogParams, |
|
||||
private dataService: DataService, |
|
||||
public dialogRef: MatDialogRef<GfGhostfolioPremiumApiDialogComponent>, |
|
||||
private notificationService: NotificationService |
|
||||
) {} |
|
||||
|
|
||||
public onCancel() { |
|
||||
this.dialogRef.close(); |
|
||||
} |
|
||||
|
|
||||
public onSetGhostfolioApiKey() { |
|
||||
this.notificationService.prompt({ |
|
||||
confirmFn: (value) => { |
|
||||
const ghostfolioApiKey = value?.trim(); |
|
||||
|
|
||||
if (ghostfolioApiKey) { |
|
||||
this.dataService |
|
||||
.putAdminSetting(PROPERTY_API_KEY_GHOSTFOLIO, { |
|
||||
value: ghostfolioApiKey |
|
||||
}) |
|
||||
.subscribe(() => { |
|
||||
this.dialogRef.close(); |
|
||||
}); |
|
||||
} |
|
||||
}, |
|
||||
title: $localize`Please enter your Ghostfolio API key.` |
|
||||
}); |
|
||||
} |
|
||||
} |
|
@ -1,49 +0,0 @@ |
|||||
<gf-dialog-header |
|
||||
mat-dialog-title |
|
||||
position="center" |
|
||||
title="Ghostfolio Premium Data Provider" |
|
||||
[deviceType]="data.deviceType" |
|
||||
(closeButtonClicked)="onCancel()" |
|
||||
/> |
|
||||
|
|
||||
<div class="text-center" mat-dialog-content> |
|
||||
<p class="gf-text-wrap-balance"> |
|
||||
Early access to the official |
|
||||
<a |
|
||||
class="align-items-center d-inline-flex" |
|
||||
target="_blank" |
|
||||
[href]="data.pricingUrl" |
|
||||
>Ghostfolio Premium |
|
||||
<gf-premium-indicator class="d-inline-block ml-1" [enableLink]="false" /> |
|
||||
</a> |
|
||||
data provider <strong>for self-hosters</strong>, offering |
|
||||
<strong>80’000+ tickers</strong> from over <strong>50 exchanges</strong>, is |
|
||||
ready now! |
|
||||
</p> |
|
||||
<div> |
|
||||
<a |
|
||||
color="primary" |
|
||||
href="mailto:hi@ghostfol.io?Subject=Ghostfolio Premium Data Provider&body=Hello%0D%0DI am interested in the Ghostfolio Premium data provider. Could you please give me early access so I can try it for some time?%0D%0DKind regards" |
|
||||
i18n |
|
||||
mat-flat-button |
|
||||
>Get Early Access</a |
|
||||
> |
|
||||
<div> |
|
||||
<small class="text-muted" i18n>or</small> |
|
||||
</div> |
|
||||
<button |
|
||||
color="accent" |
|
||||
i18n |
|
||||
mat-stroked-button |
|
||||
(click)="onSetGhostfolioApiKey()" |
|
||||
> |
|
||||
I have an API key |
|
||||
</button> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<gf-dialog-footer |
|
||||
mat-dialog-actions |
|
||||
[deviceType]="data.deviceType" |
|
||||
(closeButtonClicked)="onCancel()" |
|
||||
/> |
|
@ -1,2 +0,0 @@ |
|||||
:host { |
|
||||
} |
|
@ -1,4 +0,0 @@ |
|||||
export interface GhostfolioPremiumApiDialogParams { |
|
||||
deviceType: string; |
|
||||
pricingUrl: string; |
|
||||
} |
|
Loading…
Reference in new issue