-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Zones: service, fe: model for getting zones data
- Loading branch information
Adam Dębowski
committed
Dec 10, 2024
1 parent
1dc242d
commit 53a3c6a
Showing
25 changed files
with
292 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace hiPower.Abstracts; | ||
|
||
public interface IZoneService | ||
{ | ||
Task<ErrorOr<object>> GetListAsync (string serviceId); | ||
Task<ErrorOr<object>> GetDetailsAsync(string zoneId); | ||
Task<ErrorOr<object>> UpdateDetailsAsync (); | ||
Task<ErrorOr<bool>> CreateMasterAsync(); | ||
Task<ErrorOr<bool>> CreateSlaveAsync(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System.Text.Json; | ||
using System.Text.Json.Nodes; | ||
using hiPower.Abstracts; | ||
|
||
namespace hiPower.Core; | ||
|
||
public class ZoneService : IZoneService | ||
{ | ||
public Task<ErrorOr<bool>> CreateMasterAsync () | ||
{ | ||
throw new NotImplementedException (); | ||
} | ||
|
||
public Task<ErrorOr<bool>> CreateSlaveAsync () | ||
{ | ||
throw new NotImplementedException (); | ||
} | ||
|
||
public async Task<ErrorOr<object>> GetDetailsAsync (string zoneId) | ||
{ | ||
string json = "{\r\n \"account\": \"\",\r\n \"api_rectify\": false,\r\n \"catalog\": \"\",\r\n \"dnssec\": false,\r\n \"edited_serial\": 2024050502,\r\n \"id\": \"hihost.pl.\",\r\n \"kind\": \"Slave\",\r\n \"last_check\": 1732782113,\r\n \"master_tsig_key_ids\": [],\r\n \"masters\": [\r\n \"54.38.63.174\"\r\n ],\r\n \"name\": \"hihost.pl.\",\r\n \"notified_serial\": 0,\r\n \"nsec3narrow\": false,\r\n \"nsec3param\": \"\",\r\n \"rrsets\": [\r\n {\r\n \"comments\": [],\r\n \"name\": \"20210905._domainkey.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"\\\"v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCiNKEpEquwoG1rHvkl0/zTe7pCe9VANvI+NBaSbI1qoO7LFY2w9toBR9ckuv/AFeSi5+t8b4TblFvAoNNTkbppUdf41YdTyDm5vpsAii5vUInwfb/fuawkSc7B1eu/xdzAUJQdoLxvjpLFmdTqaGFTd3u44D/egC96Ty1KmGRLiQIDAQAB;\\\"\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"TXT\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"www.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.171\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"support.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.172\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"autodiscover.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.165\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"ftp.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.161\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"help.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"support.hihost.pl.\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"CNAME\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"_imaps._tcp.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"0 0 993 imap4.hihost.pl.\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"SRV\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"_pop3s._tcp.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"0 0 995 pop3.hihost.pl.\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"SRV\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"_autodiscover._tcp.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"0 0 80 autodiscover.hihost.pl.\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"SRV\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"_imap._tcp.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"0 0 143 imap4.hihost.pl.\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"SRV\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"_submission._tcp.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"0 0 587 smtp2.hihost.pl.\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"SRV\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"_pop3._tcp.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"0 0 110 pop3.hihost.pl.\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"SRV\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"google-site-verification.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"\\\"sYsoadOMu1x1lC-e_bWvptvdKJybcxpcj4e63lnUD-U\\\"\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"TXT\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"panel.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.170\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"devapi.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"stage02.hihost.pl.\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"CNAME\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"vpngate.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.36.174.14\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"_dmarc.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"\\\"v=DMARC1; p=reject; rua=mailto:[email protected]; ruf=mailto:[email protected]; fo=1; adkim=s; aspf=s;\\\"\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"TXT\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"imap4.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.164\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"pop3.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.163\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"smtp2.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.162\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"admin2.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.165\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"poczta2.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.165\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"stage02.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"88.220.117.8\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"mx01.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.162\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"stage01.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.175\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"*.hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.171\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"mail01.hidnservice.com. .\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"RP\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"\\\"google-site-verification=sYsoadOMu1x1lC-e_bWvptvdKJybcxpcj4e63lnUD-U\\\"\",\r\n \"disabled\": false\r\n },\r\n {\r\n \"content\": \"\\\"v=spf1 mx ip4:54.38.63.162/32 -all\\\"\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"TXT\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"20 mx01.hihost.pl.\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"MX\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"nst01.hidnservice.net. dnsmaster.hidnservice.net. 2024050502 1200 900 1209600 3600\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"SOA\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"nst02.hidnservice.net.\",\r\n \"disabled\": false\r\n },\r\n {\r\n \"content\": \"nst01.hidnservice.net.\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"NS\"\r\n },\r\n {\r\n \"comments\": [],\r\n \"name\": \"hihost.pl.\",\r\n \"records\": [\r\n {\r\n \"content\": \"54.38.63.171\",\r\n \"disabled\": false\r\n }\r\n ],\r\n \"ttl\": 3600,\r\n \"type\": \"A\"\r\n }\r\n ],\r\n \"serial\": 2024050502,\r\n \"slave_tsig_key_ids\": [],\r\n \"soa_edit\": \"\",\r\n \"soa_edit_api\": \"DEFAULT\",\r\n \"url\": \"/api/v1/servers/localhost/zones/hihost.pl.\"\r\n}"; | ||
|
||
var result = JsonSerializer.Deserialize<JsonObject>(json); | ||
|
||
return await Task.FromResult (result!); | ||
} | ||
|
||
public Task<ErrorOr<object>> GetListAsync (string serviceId) | ||
{ | ||
throw new NotImplementedException (); | ||
} | ||
|
||
public Task<ErrorOr<object>> UpdateDetailsAsync () | ||
{ | ||
throw new NotImplementedException (); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using hiPower.Abstracts; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace hiPower.WebApi.Controllers | ||
{ | ||
[Route ("api/zones")] | ||
[ApiController] | ||
[Produces (MediaTypeNames.Application.Json)] | ||
public class ZonesController : ControllerBase | ||
public class ZonesController(IZoneService zoneService) : ControllerBase | ||
{ | ||
[HttpGet("{zoneId}")] | ||
[ProducesResponseType(StatusCodes.Status200OK, Type=typeof(ApiResult<object>))] | ||
public async Task<IActionResult> GetDetails ([FromRoute] string zoneId) | ||
{ | ||
var result = await zoneService.GetDetailsAsync (zoneId); | ||
return Ok (new ApiResult<object>(!result.IsError, result.Value)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/powerdns-manager/src/app/features/dashboard/zones/components/zone/zone.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h2>Zone details</h2> |
Empty file.
23 changes: 23 additions & 0 deletions
23
src/powerdns-manager/src/app/features/dashboard/zones/components/zone/zone.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ZoneComponent } from './zone.component'; | ||
|
||
describe('ZoneComponent', () => { | ||
let component: ZoneComponent; | ||
let fixture: ComponentFixture<ZoneComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [ZoneComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(ZoneComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
src/powerdns-manager/src/app/features/dashboard/zones/components/zone/zone.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-zone', | ||
standalone: true, | ||
imports: [], | ||
templateUrl: './zone.component.html', | ||
styleUrl: './zone.component.scss' | ||
}) | ||
export class ZoneComponent { | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
src/powerdns-manager/src/app/features/dashboard/zones/core/models/record-item.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface RecordItem { | ||
content: string; | ||
disabled: boolean; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/powerdns-manager/src/app/features/dashboard/zones/core/models/zone-details.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ZoneKind } from "../types/zone-kind"; | ||
import { ZoneRecord } from "./zone-record"; | ||
|
||
export interface ZoneDetails { | ||
id: string; | ||
name: string; | ||
kind: ZoneKind, | ||
account: string; | ||
catalog: string; | ||
serial: number; | ||
notifiedSerial: number; | ||
editedSerial: number; | ||
last_check: number; | ||
api_rectify: boolean; | ||
masters: string[]; | ||
dnssec: boolean; | ||
masterTsigKeyIds: string[]; | ||
slaveTsigKeyIds: string[], | ||
msec3Narrow: boolean; | ||
nsec3param: string; | ||
soaEdit: string; | ||
soaEditApi: string; | ||
rrsets: ZoneRecord[]; | ||
url: string; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/powerdns-manager/src/app/features/dashboard/zones/core/models/zone-item.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ZoneKind } from "../types/zone-kind"; | ||
|
||
export interface ZoneItem { | ||
id: string; | ||
name: string; | ||
serial: number; | ||
editedSerial: number; | ||
notifiedSerial: number; | ||
lastCheck: string; | ||
account: string; | ||
catalog: string; | ||
dnssec: boolean; | ||
kind: ZoneKind; | ||
masters: string[] | ||
} |
9 changes: 9 additions & 0 deletions
9
src/powerdns-manager/src/app/features/dashboard/zones/core/models/zone-record.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { RecordItem } from "./record-item"; | ||
|
||
export interface ZoneRecord { | ||
type: string; | ||
name: string; | ||
ttl: number; | ||
comments: string []; | ||
records: RecordItem[]; | ||
} |
Empty file.
1 change: 1 addition & 0 deletions
1
src/powerdns-manager/src/app/features/dashboard/zones/core/types/zone-kind.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type ZoneKind = 'Slave' | 'Master'; |
26 changes: 26 additions & 0 deletions
26
src/powerdns-manager/src/app/features/dashboard/zones/home/home.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
<p>zones home works!</p> | ||
<ng-container *ngIf="zoneDetails$ | async as zone"> | ||
<ul> | ||
<li><span>Name</span>{{ zone.name }}</li> | ||
<li><span>Serial</span>{{ zone.serial }}</li> | ||
<li><span>Last check</span>{{ zone.last_check }}</li> | ||
<li><span>Kind</span>{{ zone.kind }}</li> | ||
<li><span>DNS SEC</span>{{ zone.dnssec}}</li> | ||
<li><span>Records no</span>{{ zone.rrsets.length }}</li> | ||
<li><span>Api rectify</span>{{ zone.api_rectify}}</li> | ||
<li><span>Url</span>{{ zone.url }}</li> | ||
</ul> | ||
<hr> | ||
<ul> | ||
@for(item of zone.rrsets; track (item.type + item.name) ) { | ||
<li><span>{{ item.type }}</span><br/> | ||
Name: {{ item.name }}<br/> | ||
values: | ||
<ul> | ||
@for(recordValue of item.records; track recordValue.content ) { | ||
<li>{{ recordValue.content }}</li> | ||
} | ||
</ul> | ||
</li> | ||
} | ||
</ul> | ||
</ng-container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
:host { | ||
ul { | ||
font-size: 1rem; | ||
list-style-type: '» '; | ||
margin-left: 2rem; | ||
|
||
li { | ||
font-weight: 600; | ||
|
||
& > span { | ||
display: inline-block; | ||
width: 12ch; | ||
font-weight: 500; | ||
|
||
&::after { | ||
content: ':'; | ||
} | ||
} | ||
} | ||
ul { | ||
list-style-type: '- '; | ||
} | ||
} | ||
} |
16 changes: 14 additions & 2 deletions
16
src/powerdns-manager/src/app/features/dashboard/zones/home/home.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ZonesService } from '../services/zones.service'; | ||
import { EMPTY, Observable } from 'rxjs'; | ||
import { ZoneDetails } from '../core/models/zone-details'; | ||
|
||
@Component({ | ||
selector: 'app-home-zones', | ||
templateUrl: './home.component.html', | ||
styleUrl: './home.component.scss' | ||
}) | ||
export class HomeComponent { | ||
export class HomeComponent implements OnInit { | ||
|
||
zoneDetails$: Observable<ZoneDetails> = EMPTY; | ||
|
||
constructor(private zonesService: ZonesService){} | ||
|
||
ngOnInit(): void { | ||
this.zoneDetails$ = this.zonesService.getDetails('hihost.pl'); | ||
|
||
this.zoneDetails$.subscribe(); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/powerdns-manager/src/app/features/dashboard/zones/services/zones.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { ZonesServiceService } from './zones.service'; | ||
|
||
describe('ZonesServiceService', () => { | ||
let service: ZonesServiceService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(ZonesServiceService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.