diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 7a49e21..21ec26e 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -1,7 +1,28 @@ -import { Routes } from '@angular/router'; import {Routes} from '@angular/router'; import {ScheduleComponent} from "@page/schedule/schedule.component"; +import {WelcomeComponent} from "@page/setup/welcome/welcome.component"; +import {DatabaseComponent} from "@page/setup/database/database.component"; +import {CacheComponent} from "@page/setup/cache/cache.component"; +import {LoggingComponent} from "@page/setup/logging/logging.component"; +import {ScheduleComponent as SetupScheduleComponent} from "@page/setup/schedule/schedule.component"; +import {SetupComponent} from "@page/setup/setup.component"; +import {CreateAdminComponent} from "@page/setup/create-admin/create-admin.component"; +import {SummaryComponent} from "@page/setup/summary/summary.component"; -export const routes: Routes = []; export const routes: Routes = [ + {path: '', title: 'Расписание', pathMatch: 'full', component: ScheduleComponent}, + { + path: 'setup', title: 'Установка', component: SetupComponent, children: [ + {path: 'welcome', component: WelcomeComponent}, + {path: 'database', component: DatabaseComponent}, + {path: 'cache', component: CacheComponent}, + {path: 'create-admin', component: CreateAdminComponent}, + {path: 'schedule', component: SetupScheduleComponent}, + {path: 'logging', component: LoggingComponent}, + {path: 'summary', component: SummaryComponent}, + {path: '', redirectTo: 'welcome', pathMatch: 'full'} + ] + } + /*{path: 'not-found', title: '404 страница не найдена'}, + {path: '**', redirectTo: '/not-found'}*/ ]; diff --git a/src/services/navigation.service.ts b/src/services/navigation.service.ts new file mode 100644 index 0000000..89a5fbd --- /dev/null +++ b/src/services/navigation.service.ts @@ -0,0 +1,18 @@ +import {EventEmitter, Injectable} from '@angular/core'; +import {BehaviorSubject, Observable} from "rxjs"; + +@Injectable({ + providedIn: 'root' +}) +export class NavigationService { + private nextButtonState = new BehaviorSubject(false); + + nextButtonState$ = this.nextButtonState.asObservable(); + nextButtonAction!: () => Observable; + + skipNavigation: EventEmitter<() => Observable> = new EventEmitter(); + + setNextButtonState(state: boolean) { + this.nextButtonState.next(state); + } +}