Skip to content

Commit

Permalink
Creating new zone
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Dębowski committed Dec 13, 2024
1 parent a397ecf commit 5efbcab
Show file tree
Hide file tree
Showing 16 changed files with 266 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@
<div class="drawer-container">
<button mat-raised-button type="button" aria-label="Go to dashboard" routerLink="/" ><mat-icon>dashboard</mat-icon>Dashboard</button>
<mat-divider></mat-divider>
<button mat-raised-button type="button" aria-label="Go to dns zones" routerLink="zones"><mat-icon>share</mat-icon>Zones</button>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-icon>share</mat-icon>
<span>Zones</span>
</mat-expansion-panel-header>
<button mat-raised-button type="button" aria-label="Go to dns zones" routerLink="zones/new"><mat-icon>share</mat-icon>New zone</button>
<button mat-raised-button type="button" aria-label="Go to dns zones" routerLink="zones"><mat-icon>share</mat-icon>Zones</button>
</mat-expansion-panel>
<button mat-raised-button type="button" aria-label="Go to server statistics" routerLink="state"><mat-icon>visibility</mat-icon>State</button>
<button mat-raised-button type="button" aria-label="Go to servers" routerLink="servers"><mat-icon>computer</mat-icon>Servers</button>
<button mat-raised-button type="button" aria-label="Go to data centers" routerLink="datacenters"><mat-icon>map</mat-icon>Data centers</button>
<mat-divider></mat-divider>
<button mat-raised-button type="button" aria-label="Go to user manager" routerLink="/"><mat-icon>people</mat-icon>Users</button>
</div>
</div>
<div class="author">
2024 - Adam Debowski
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,16 @@
.mat-drawer-container {
background-color: $color-gray-light;
}

.sidenav-container {
// height: 100vh;
}

mat-sidenav {
width: 250px;
}

mat-sidenav-content {
padding: 16px;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { MatSidenav } from '@angular/material/sidenav';

@Component({
selector: 'app-layout',
Expand All @@ -8,6 +9,8 @@ import { Component } from '@angular/core';
export class LayoutComponent {
isOpen = true;

@ViewChild(MatSidenav) sidenav!: MatSidenav;

openClose(): void {
this.isOpen = !this.isOpen;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<mat-card>
<mat-card-header>
Create a new zone
</mat-card-header>
<mat-card-content>
<div>
<div></div>
<div></div>
</div>
</mat-card-content>
<mat-card-actions align="end">
<button mat-raised-button
type="button"
aria-label="Back to list button"
routerLink="/dashboard/zones"><mat-icon>chevron_left</mat-icon>Back</button>
<button mat-raised-button
color="secondary"
type="button"
aria-label="Reset form"
(click)="form.reset()"><mat-icon>delete_forever</mat-icon>Clear form</button>
<button mat-raised-button
color="primary"
type="button"
aria-label="Create new data center"
(click)="onSubmit()"><mat-icon>save</mat-icon>Create</button>
</mat-card-actions>
</mat-card>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@import '/src/styles/utils/variables';

:host {
display: flex;
width: 100%;
height: 100%;

mat-card {
width: inherit;

mat-card-header {
font-size: 1rem;
color: $color-white;
}

mat-card-content {
height: calc(100% - 100px);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { NewZoneComponent } from './new-zone.component';

describe('NewZoneComponent', () => {
let component: NewZoneComponent;
let fixture: ComponentFixture<NewZoneComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [NewZoneComponent]
})
.compileComponents();

fixture = TestBed.createComponent(NewZoneComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Component } from '@angular/core';
import { FormBuilder } from '@angular/forms';

@Component({
selector: 'app-new-zone',
templateUrl: './new-zone.component.html',
styleUrl: './new-zone.component.scss'
})
export class NewZoneComponent {

form = this.fb.group({
serviceId: [''],
zone: [''],
});

constructor(private fb: FormBuilder){}

onSubmit(): void {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>new-zoneexit works!</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { NewZoneexitComponent } from './new-zoneexit.component';

describe('NewZoneexitComponent', () => {
let component: NewZoneexitComponent;
let fixture: ComponentFixture<NewZoneexitComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [NewZoneexitComponent]
})
.compileComponents();

fixture = TestBed.createComponent(NewZoneexitComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-new-zoneexit',
standalone: true,
imports: [],
templateUrl: './new-zoneexit.component.html',
styleUrl: './new-zoneexit.component.scss'
})
export class NewZoneexitComponent {

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,84 @@
<ng-container>
<div class="listContainer">
<div>
<mat-list>
<div mat-subheader class="header">Data centers</div>
@for(dataCenter of dataCenters$ | async; track dataCenter.id) {
<mat-list-item>
<mat-icon matListItemIcon>folder</mat-icon>
<div matListItemTitle
class="listItem">
<a (click)="onDataCenterClick(dataCenter.id!)">
{{ dataCenter.name }}
</a>
</div>
<div matListItemLine
class="description">
{{ dataCenter.city }} (Country: {{ dataCenter.country }})
</div>
</mat-list-item>
}
</mat-list>
<mat-card>
<mat-card-header>
Data centers
</mat-card-header>
<mat-card-content>
<mat-list>
@for(dataCenter of dataCenters$ | async; track dataCenter.id) {
<mat-list-item>
<mat-icon matListItemIcon>folder</mat-icon>
<div matListItemTitle
class="listItem">
<a (click)="onDataCenterClick(dataCenter.id!)">
{{ dataCenter.name }}
</a>
</div>
<div matListItemLine
class="description">
{{ dataCenter.city }} (Country: {{ dataCenter.country }})
</div>
</mat-list-item>
}
@empty {
<p>No data</p>
}
</mat-list>
</mat-card-content>
</mat-card>
</div>
<div>
<mat-list>
<div mat-subheader class="header">Services</div>
@for(service of services$ | async; track service.id) {
<mat-list-item>
<mat-icon matListItemIcon>folder</mat-icon>
<div matListItemTitle
class="listItem">
<a (click)="onServiceClick(service.id)">
{{ service.name }}
</a>
</div>
<div matListItemLine>
{{ service.proto}}://{{ service.hostAddress }}:{{ service.port}}
</div>
</mat-list-item>
}
</mat-list>
<mat-card>
<mat-card-header>Services</mat-card-header>
<mat-card-content>
<mat-list>
@for(service of services$ | async; track service.id) {
<mat-list-item>
<mat-icon matListItemIcon>folder</mat-icon>
<div matListItemTitle
class="listItem">
<a (click)="onServiceClick(service.id)">
{{ service.name }}
</a>
</div>
<div matListItemLine>
mode: {{ service.serviceMode }}, [{{ service.proto}}://{{ service.hostAddress }}:{{ service.port}}]
</div>
</mat-list-item>
}
@empty {
<p>No data</p>
}
</mat-list>
</mat-card-content>
</mat-card>
</div>
<div>
<mat-list>
<div mat-subheader class="header">Zones</div>
@for(zoneItem of zones$ | async; track zoneItem.id) {
<mat-list-item>
<mat-icon matListItemIcon>map</mat-icon>
<div matListItemTitle
class="listItem">
<a (click)="onZoneDetailsClick(zoneItem.id)">
{{ zoneItem.name }}
</a>
</div>
</mat-list-item>
}
</mat-list>
<mat-card>
<mat-card-header>Zones</mat-card-header>
<mat-card-content>
<div>
<mat-list>
@for(zoneItem of zones$ | async; track zoneItem.id) {
<mat-list-item>
<mat-icon matListItemIcon>map</mat-icon>
<div matListItemTitle
class="listItem">
<a (click)="onZoneDetailsClick(zoneItem.id)">
{{ zoneItem.name }}
</a>
</div>
</mat-list-item>
}
@empty {
<p>No data</p>
}
</mat-list>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
</ng-container>
Expand All @@ -64,7 +89,7 @@
<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>Last check</span>{{ zone.last_check | date:'yyyy-MM-dd HH:mm:ss' }}</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>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
@import '/src/styles/utils/variables';

:host {
color: $color-white;

mat-card {
height: 300px;
}

mat-card-header {
font-size: 1rem;
}

mat-card-content {
p {
font-size: 1rem;
color: $color-white;
}
> div {
height: 220px;
overflow: hidden;
overflow-y: auto;
}

mat-list-item {
a {
color: $color-white !important;
}
}
}

ul {
font-size: 1rem;
list-style-type: '» ';
Expand Down Expand Up @@ -36,14 +64,6 @@
text-decoration: underline;
}

> div {
background-color: $color-white;
height: 280px;
overflow: hidden;
overflow-y: auto;
}


.listItem {
a {
color: $color-blue-navy;
Expand All @@ -62,10 +82,10 @@
}

.resultContainer {
height: 500px !important;
color: $color-black;
height: 480px !important;
width: 1550px;
overflow: hidden;
background-color: $color-white;

.details {
border-top: solid 1px $color-blue-navy;
Expand Down
Loading

0 comments on commit 5efbcab

Please sign in to comment.