-
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.
- Loading branch information
Showing
14 changed files
with
218 additions
and
52 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
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
15 changes: 15 additions & 0 deletions
15
frontend/src/app/features/admin/pages/admin-home-page/admin-home-page.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,3 +1,18 @@ | ||
<section class="page"> | ||
<h1 class="aurora">Дашборд</h1> | ||
|
||
<div class="dashboard"> | ||
<p-card header="Бронирования"> | ||
<p>Всего бронирований: <span class="aurora">{{ (books$ | async)?.length }}</span></p> | ||
</p-card> | ||
<p-card header="Пользователей"> | ||
<p>Всего пользователей: <span class="aurora">{{ (users$ | async)?.length }}</span></p> | ||
</p-card> | ||
<p-card header="Номера"> | ||
<p>Всего номеров: <span class="aurora">{{ (rooms$ | async)?.length }}</span></p> | ||
<p>Номера "Стандарт": <span class="aurora">{{ (roomsStandart$ | async)?.length }}</span></p> | ||
<p>Номера "Комфорт": <span class="aurora">{{ (roomsComfort$ | async)?.length }}</span></p> | ||
<p>Номер "Люкс": <span class="aurora">{{ (roomsLux$ | async)?.length }}</span></p> | ||
</p-card> | ||
</div> | ||
</section> |
20 changes: 5 additions & 15 deletions
20
frontend/src/app/features/admin/pages/admin-home-page/admin-home-page.component.scss
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,16 +1,6 @@ | ||
.dialog { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--spacing-04); | ||
|
||
&__form { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--spacing-03); | ||
} | ||
|
||
&__actions { | ||
display: flex; | ||
gap: var(--spacing-03); | ||
} | ||
.dashboard { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(200px, 350px)); | ||
justify-content: space-between; | ||
gap: var(--spacing-06); | ||
} |
45 changes: 42 additions & 3 deletions
45
frontend/src/app/features/admin/pages/admin-home-page/admin-home-page.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,14 +1,53 @@ | ||
import {ChangeDetectionStrategy, Component, inject} from '@angular/core'; | ||
import {ChangeDetectionStrategy, Component, inject, OnInit} from '@angular/core'; | ||
import {AdminService} from '../../services/admin.service'; | ||
import {Card} from 'primeng/card'; | ||
import {Booking} from '../../../booking/models/booking.model'; | ||
import {User} from '../../../iam/models/user.model'; | ||
import {Room} from '../../../booking/models/room.model'; | ||
import {map, Observable} from 'rxjs'; | ||
import {AsyncPipe} from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'app-admin-home-page', | ||
imports: [], | ||
imports: [ | ||
Card, | ||
AsyncPipe | ||
], | ||
templateUrl: './admin-home-page.component.html', | ||
styleUrl: './admin-home-page.component.scss', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class AdminHomePageComponent { | ||
export class AdminHomePageComponent implements OnInit { | ||
private readonly adminService = inject(AdminService); | ||
|
||
private destroy$ = new Observable<void>(); | ||
|
||
books$ = new Observable<Booking[]>(); | ||
|
||
users$ = new Observable<User[]>(); | ||
|
||
rooms$ = new Observable<Room[]>(); | ||
roomsStandart$ = new Observable<Room[]>(); | ||
roomsComfort$ = new Observable<Room[]>(); | ||
roomsLux$ = new Observable<Room[]>(); | ||
|
||
ngOnInit() { | ||
this.books$ = this.adminService.getAllBookings(); | ||
|
||
this.users$ = this.adminService.getAllUsers(); | ||
|
||
this.rooms$ = this.adminService.getAllRooms(); | ||
|
||
this.roomsStandart$ = this.rooms$.pipe(map(rooms => { | ||
return rooms.filter(room => room.roomType.id === 1); | ||
})); | ||
|
||
this.roomsComfort$ = this.rooms$.pipe(map(rooms => { | ||
return rooms.filter(room => room.roomType.id === 2); | ||
})); | ||
|
||
this.roomsLux$ = this.rooms$.pipe(map(rooms => { | ||
return rooms.filter(room => room.roomType.id === 3); | ||
})); | ||
} | ||
} |
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
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
57 changes: 51 additions & 6 deletions
57
frontend/src/app/features/iam/pages/sign-up-page/sign-up-page.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,9 +1,54 @@ | ||
<form [formGroup]="signUpForm" (ngSubmit)="signUp()"> | ||
<input formControlName="username" type="text" placeholder="Имя пользователя"> | ||
<section class="page page-auth"> | ||
<div class="auth-form"> | ||
<h1>Регистрация</h1> | ||
|
||
<input formControlName="email" type="email" placeholder="Электронная почта"> | ||
<form [formGroup]="signUpForm" (ngSubmit)="signUp()"> | ||
<p-iftalabel> | ||
<input pInputText formControlName="surname" id="surname" autocomplete="off" /> | ||
|
||
<input formControlName="password" type="password" placeholder="Пароль"> | ||
<label for="surname">Фамилия</label> | ||
</p-iftalabel> | ||
|
||
<button>Войти</button> | ||
</form> | ||
<p-iftalabel> | ||
<input pInputText formControlName="name" id="name" autocomplete="off" /> | ||
|
||
<label for="name">Имя</label> | ||
</p-iftalabel> | ||
|
||
<p-iftalabel> | ||
<input pInputText formControlName="patronymic" id="patronymic" autocomplete="off" /> | ||
|
||
<label for="patronymic">Отчество</label> | ||
</p-iftalabel> | ||
|
||
<p-iftalabel> | ||
<input pInputText formControlName="phone" id="phone" autocomplete="off" /> | ||
|
||
<label for="phone">Номер телефона</label> | ||
</p-iftalabel> | ||
|
||
<p-iftalabel> | ||
<input pInputText formControlName="username" id="username" autocomplete="off" /> | ||
|
||
<label for="username">Логин</label> | ||
</p-iftalabel> | ||
|
||
<p-iftalabel> | ||
<input pInputText formControlName="email" id="email" autocomplete="off" /> | ||
|
||
<label for="email">Электронная почта</label> | ||
</p-iftalabel> | ||
|
||
<p-iftalabel> | ||
<p-password inputId="password" formControlName="password" /> | ||
<label for="password">Пароль</label> | ||
</p-iftalabel> | ||
|
||
<p class="link"> | ||
Уже есть аккаунт? <a [routerLink]="['/auth/log-in']">Войти</a> | ||
</p> | ||
|
||
<p-button label="Зарегистрироваться" type="submit" /> | ||
</form> | ||
</div> | ||
</section> |
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,35 @@ | ||
.page-auth { | ||
justify-content: center; | ||
align-items: center; | ||
|
||
.auth-form { | ||
background-color: var(--overlay-background); | ||
border-radius: 8px; | ||
padding: var(--spacing-06); | ||
|
||
display: flex; | ||
flex-direction: column; | ||
gap: var(--spacing-05); | ||
|
||
max-width: 500px; | ||
|
||
h1 { | ||
font-size: 1.75rem; | ||
text-align: center; | ||
} | ||
|
||
form { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--spacing-04); | ||
align-items: center; | ||
} | ||
|
||
.link { | ||
a { | ||
text-decoration: underline; | ||
color: var(--primary-color) | ||
} | ||
} | ||
} | ||
} |
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