Skip to content

Commit fe4b428

Browse files
committed
Merge branch 'main' of github.com:Cryptographic-API-Services/AngularSPA
2 parents 19edae4 + 336d3d7 commit fe4b428

File tree

3 files changed

+46
-23
lines changed

3 files changed

+46
-23
lines changed
Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1-
<div class="row">
2-
<div class="col-12">
3-
<p>Your Production API key is listed below</p>
4-
<p>{{apiKey}}</p>
5-
<br />
6-
</div>
1+
<div class="form-check" (click)="formCheckChanged($event)">
2+
<input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault1"checked>
3+
<label class="form-check-label" for="flexRadioDefault1">
4+
Production
5+
</label>
6+
</div>
7+
<div class="form-check" (click)="formCheckChanged($event)">
8+
<input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault2">
9+
<label class="form-check-label" for="flexRadioDefault2">
10+
Development
11+
</label>
712
</div>
8-
<div class="row">
9-
<div class="col-12">
10-
<p>Your Development API key is listed below</p>
11-
<p>{{developmentKey}}</p>
12-
<br />
13+
14+
@if (apiKey && isProductionKey) {
15+
<div class="row">
16+
<div class="col-12">
17+
<p>Your Production API key is listed below</p>
18+
<p>{{apiKey}}</p>
19+
<br />
20+
</div>
21+
</div>
22+
} @else if (developmentKey && developmentKey) {
23+
<div class="row">
24+
<div class="col-12">
25+
<p>Your Development API key is listed below</p>
26+
<p>{{developmentKey}}</p>
27+
<br />
28+
</div>
1329
</div>
14-
</div>
30+
}
Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
1-
import { Component, OnInit } from '@angular/core';
2-
import { HttpService } from 'src/app/services/http.service';
3-
import { environment } from 'src/environments/environment';
1+
import { Component, OnInit } from "@angular/core";
2+
import { HttpService } from "src/app/services/http.service";
3+
import { environment } from "src/environments/environment";
44

55
@Component({
6-
selector: 'app-api-key',
7-
templateUrl: './api-key.component.html',
8-
styleUrls: ['./api-key.component.css']
6+
selector: "app-api-key",
7+
templateUrl: "./api-key.component.html",
8+
styleUrls: ["./api-key.component.css"],
99
})
1010
export class ApiKeyComponent implements OnInit {
1111
public apiKey: string = "";
1212
public developmentKey: string = "";
1313

14-
constructor(private httpService: HttpService) { }
14+
public isProductionKey: boolean = true;
15+
public isDevelopmentKEY: boolean = false;
16+
17+
constructor(private httpService: HttpService) {}
1518

1619
ngOnInit(): void {
1720
this.getApiKey();
1821
}
1922

20-
2123
private getApiKey(): void {
22-
this.httpService.getAuthenticated(environment.apiUrl + "UserLogin/GetApiKey").subscribe((response: any) => {
24+
this.httpService.getAuthenticated(
25+
environment.apiUrl + "UserLogin/GetApiKey",
26+
).subscribe((response: any) => {
2327
this.apiKey = response.apiKey;
2428
this.developmentKey = response.developmentKey;
2529
}, (error) => {
26-
2730
});
2831
}
32+
33+
public formCheckChanged(event: any) {
34+
this.isProductionKey = !this.isProductionKey;
35+
this.isDevelopmentKEY = !this.isDevelopmentKEY;
36+
}
2937
}

src/app/modules/user-home/successful-logins/successful-logins.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ <h3>Successful Logins</h3>
99
<div class="card">
1010
<div class="card-title text-center">
1111
<h5>{{login.city}}, {{login.country}}</h5>
12-
<p><b>Your IP Address:</b> {{login.ip}}</p>
1312
<p><b>User Agent:</b> {{login.userAgent}}</p>
1413
<p><b>Was This You?</b></p>
1514
<button class="btn btn-primary" (click)="handleWasThisMe(true, login.id)">Yes</button>

0 commit comments

Comments
 (0)