create license management
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Maybe } from '@/core';
|
||||
import { AuthService, BreadcrumbService } from '@/core/services';
|
||||
import { BreadcrumbComponent } from '@/shared/components';
|
||||
import { CommonModule } from '@angular/common';
|
||||
@@ -9,7 +10,6 @@ import {
|
||||
Input,
|
||||
Renderer2,
|
||||
TemplateRef,
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import { NavigationEnd, Router, RouterModule } from '@angular/router';
|
||||
import { ProgressSpinner } from 'primeng/progressspinner';
|
||||
@@ -40,15 +40,14 @@ export class AppLayout {
|
||||
|
||||
@Input() fullLoading: boolean = false;
|
||||
|
||||
@ViewChild(AppSidebar) appSidebar!: AppSidebar;
|
||||
|
||||
@ViewChild(AppTopbar) appTopBar!: AppTopbar;
|
||||
@ContentChild('content', { static: true }) content?: TemplateRef<any> | null;
|
||||
@ContentChild('topBarMoreAction', { static: true }) topBarMoreAction?: TemplateRef<any> | null;
|
||||
// @ContentChild('topBarMoreAction', { static: true }) topBarMoreAction?: TemplateRef<any> | null;
|
||||
|
||||
private breadcrumbService = inject(BreadcrumbService);
|
||||
private authService = inject(AuthService);
|
||||
|
||||
topBarMoreAction?: Maybe<TemplateRef<any>> = null;
|
||||
|
||||
constructor(
|
||||
public layoutService: LayoutService,
|
||||
public renderer: Renderer2,
|
||||
@@ -144,6 +143,8 @@ export class AppLayout {
|
||||
});
|
||||
|
||||
ngOnInit() {
|
||||
this.layoutService.headerSlot$.subscribe((tpl) => (this.topBarMoreAction = tpl));
|
||||
|
||||
if (window.location.pathname === '/') {
|
||||
if (!this.authService.currentAccount()) {
|
||||
this.router.navigateByUrl('auth');
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<div class="layout-sidebar">
|
||||
<div class="layout-sidebar flex flex-col gap-4">
|
||||
<div class="grow">
|
||||
<app-menu></app-menu>
|
||||
</div>
|
||||
<div class="shrink-0 sticky bottom-0">
|
||||
<div class="py-2 w-full text-center">
|
||||
<span class="text-muted-color text-sm font-bold">ارایه شده توسط (برند نرمافزار)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layout-topbar-actions">
|
||||
<div class="layout-topbar-actions items-center">
|
||||
<ng-content></ng-content>
|
||||
<div class="layout-config-menu">
|
||||
<button type="button" class="layout-topbar-action" (click)="toggleDarkMode()">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { computed, effect, Injectable, signal } from '@angular/core';
|
||||
import { computed, effect, Injectable, signal, TemplateRef } from '@angular/core';
|
||||
import { MenuItem } from 'primeng/api';
|
||||
import { Subject } from 'rxjs';
|
||||
import { BehaviorSubject, Subject } from 'rxjs';
|
||||
|
||||
export interface layoutConfig {
|
||||
preset?: string;
|
||||
@@ -218,4 +218,11 @@ export class LayoutService {
|
||||
setPanelInfo(info: IPanelInfo) {
|
||||
this.panelInfo.set(info);
|
||||
}
|
||||
|
||||
private headerSlot = new BehaviorSubject<TemplateRef<any> | null>(null);
|
||||
headerSlot$ = this.headerSlot.asObservable();
|
||||
|
||||
setHeaderSlot(tpl: TemplateRef<any> | null) {
|
||||
this.headerSlot.next(tpl);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user