diff options
Diffstat (limited to 'src/app/gns-page/gns-page.component.ts')
-rw-r--r-- | src/app/gns-page/gns-page.component.ts | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/app/gns-page/gns-page.component.ts b/src/app/gns-page/gns-page.component.ts new file mode 100644 index 0000000..ea25fc5 --- /dev/null +++ b/src/app/gns-page/gns-page.component.ts | |||
@@ -0,0 +1,57 @@ | |||
1 | import { Component, OnInit } from '@angular/core'; | ||
2 | import { ApiService } from '../api.service'; | ||
3 | |||
4 | @Component({ | ||
5 | selector: 'gns-page', | ||
6 | templateUrl: './gns-page.component.html' | ||
7 | }) | ||
8 | export class GnsPageComponent implements OnInit { | ||
9 | |||
10 | private gns_name:string; | ||
11 | private gns_recordtype:number = 0; | ||
12 | private gns_options:number = 0; | ||
13 | private gns_zonekey:string = ''; | ||
14 | private display_ego: boolean = true; | ||
15 | private display_zonekey: boolean = true; | ||
16 | private gns_ego:string = ''; | ||
17 | private gns_response:any =[]; | ||
18 | |||
19 | private url: string; | ||
20 | |||
21 | constructor(private apiService:ApiService) { } | ||
22 | |||
23 | ngOnInit() { | ||
24 | } | ||
25 | |||
26 | onSearch(){ | ||
27 | this.url = '?name='+this.gns_name; | ||
28 | if(this.gns_recordtype != null && this.gns_recordtype != ''){ | ||
29 | this.url += '&record_type='+this.gns_recordtype; | ||
30 | } | ||
31 | if(this.gns_options != null && this.gns_options != ''){ | ||
32 | this.url += '&options='+this.gns_options; | ||
33 | } | ||
34 | if(this.gns_zonekey != null && this.gns_zonekey != ''){ | ||
35 | this.url += '&pkey='+this.gns_zonekey; | ||
36 | } | ||
37 | if(this.gns_ego != null && this.gns_ego != ''){ | ||
38 | this.url += '&ego='+this.gns_ego; | ||
39 | } | ||
40 | console.log(this.url); | ||
41 | this.apiService.searchNameSystem(this.url).subscribe(data => { | ||
42 | this.gns_response = data; | ||
43 | }); | ||
44 | } | ||
45 | |||
46 | toggleEgo(){ | ||
47 | if(this.gns_zonekey == ''){ this.display_ego = true; } | ||
48 | else { this.display_ego = false; } | ||
49 | } | ||
50 | |||
51 | toggleZonekey(){ | ||
52 | if(this.gns_ego == ''){ this.display_zonekey = true; } | ||
53 | else { this.display_zonekey = false; } | ||
54 | } | ||
55 | |||
56 | |||
57 | } | ||