diff --git a/ogWebconsole/src/app/components/groups/groups.component.css b/ogWebconsole/src/app/components/groups/groups.component.css index cc550ac..7449a13 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.css +++ b/ogWebconsole/src/app/components/groups/groups.component.css @@ -457,3 +457,4 @@ mat-button-toggle-group { width: 100%; box-sizing: border-box; } + diff --git a/ogWebconsole/src/app/layout/header/header.component.css b/ogWebconsole/src/app/layout/header/header.component.css index c742d4c..4643182 100644 --- a/ogWebconsole/src/app/layout/header/header.component.css +++ b/ogWebconsole/src/app/layout/header/header.component.css @@ -45,3 +45,13 @@ mat-toolbar { background-color: #ced0df; cursor: not-allowed; } + +.hide-on-small { + display: none; +} + +@media (min-width: 1328px) { + .hide-on-small { + display: inline; + } +} \ No newline at end of file diff --git a/ogWebconsole/src/app/layout/header/header.component.html b/ogWebconsole/src/app/layout/header/header.component.html index d70bb71..c650b7e 100644 --- a/ogWebconsole/src/app/layout/header/header.component.html +++ b/ogWebconsole/src/app/layout/header/header.component.html @@ -1,5 +1,5 @@ - + Opengnsys webconsole diff --git a/ogWebconsole/src/app/layout/header/header.component.ts b/ogWebconsole/src/app/layout/header/header.component.ts index 7e50f1d..e490528 100644 --- a/ogWebconsole/src/app/layout/header/header.component.ts +++ b/ogWebconsole/src/app/layout/header/header.component.ts @@ -52,8 +52,6 @@ export class HeaderComponent implements OnInit { this.dialog.open(GlobalStatusComponent, { width: '45vw', height: '80vh', - // maxWidth: '60vw', - // maxHeight: '60vh' }) } } diff --git a/ogWebconsole/src/app/layout/main-layout/main-layout.component.css b/ogWebconsole/src/app/layout/main-layout/main-layout.component.css index 1fd8655..b5a644f 100644 --- a/ogWebconsole/src/app/layout/main-layout/main-layout.component.css +++ b/ogWebconsole/src/app/layout/main-layout/main-layout.component.css @@ -6,5 +6,4 @@ .sidebar { width: 15vw; min-width: 250px; - z-index: auto !important; -} +} \ No newline at end of file diff --git a/ogWebconsole/src/app/layout/main-layout/main-layout.component.html b/ogWebconsole/src/app/layout/main-layout/main-layout.component.html index 59eebe9..c8241e0 100644 --- a/ogWebconsole/src/app/layout/main-layout/main-layout.component.html +++ b/ogWebconsole/src/app/layout/main-layout/main-layout.component.html @@ -1,11 +1,12 @@ - - + + + - + \ No newline at end of file diff --git a/ogWebconsole/src/app/layout/main-layout/main-layout.component.ts b/ogWebconsole/src/app/layout/main-layout/main-layout.component.ts index dc6d912..ce50bfb 100644 --- a/ogWebconsole/src/app/layout/main-layout/main-layout.component.ts +++ b/ogWebconsole/src/app/layout/main-layout/main-layout.component.ts @@ -1,14 +1,30 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; @Component({ selector: 'app-main-layout', templateUrl: './main-layout.component.html', styleUrls: ['./main-layout.component.css'], }) -export class MainLayoutComponent { +export class MainLayoutComponent implements OnInit { isSidebarVisible: boolean = true; + sidebarMode: 'side' | 'over' = 'side'; + + constructor(private breakpointObserver: BreakpointObserver) { } + + ngOnInit(): void { + this.breakpointObserver.observe(['(max-width: 1328px)']).subscribe((result) => { + if (result.matches) { + this.sidebarMode = 'over'; + this.isSidebarVisible = false; + } else { + this.sidebarMode = 'side'; + this.isSidebarVisible = true; + } + }); + } toggleSidebar() { this.isSidebarVisible = !this.isSidebarVisible; } -} +} \ No newline at end of file diff --git a/ogWebconsole/src/app/layout/sidebar/sidebar.component.html b/ogWebconsole/src/app/layout/sidebar/sidebar.component.html index cde15ee..1c77fa8 100644 --- a/ogWebconsole/src/app/layout/sidebar/sidebar.component.html +++ b/ogWebconsole/src/app/layout/sidebar/sidebar.component.html @@ -7,14 +7,16 @@ - + apartment {{ 'groups' | translate }} - + playlist_play {{ 'actions' | translate }} @@ -23,19 +25,22 @@ - + chevron_right {{ 'commands' | translate }} - + chevron_right {{ 'commandGroups' | translate }} - + chevron_right {{ 'tasks' | translate }} @@ -43,14 +48,16 @@ - + lan {{ 'subnets' | translate }} - + desktop_windows {{ 'boot' | translate }} @@ -59,19 +66,22 @@ - + album {{ 'ogLive' | translate }} - + assignment {{ 'pxeTemplates' | translate }} - + save {{ 'pxeBootFiles' | translate }} @@ -79,14 +89,16 @@ - + calendar_month {{ 'calendars' | translate }} - + terminal {{ 'software' | translate }} @@ -95,19 +107,22 @@ - + list {{ 'softwareList' | translate }} - + folder_shared {{ 'softwareProfiles' | translate }} - + terminal {{ 'operativeSystems' | translate }} @@ -115,17 +130,19 @@ - + warehouse {{ 'repositories' | translate }} - + list {{ 'menus' | translate }} - + \ No newline at end of file diff --git a/ogWebconsole/src/app/layout/sidebar/sidebar.component.ts b/ogWebconsole/src/app/layout/sidebar/sidebar.component.ts index 8de24e6..83d250f 100644 --- a/ogWebconsole/src/app/layout/sidebar/sidebar.component.ts +++ b/ogWebconsole/src/app/layout/sidebar/sidebar.component.ts @@ -1,6 +1,7 @@ -import { Component, Input } from '@angular/core'; +import { Component, Input, Output, EventEmitter } from '@angular/core'; import { jwtDecode } from 'jwt-decode'; import { MatDialog } from '@angular/material/dialog'; + @Component({ selector: 'app-sidebar', templateUrl: './sidebar.component.html', @@ -8,6 +9,9 @@ import { MatDialog } from '@angular/material/dialog'; }) export class SidebarComponent { @Input() isVisible: boolean = false; + @Input() sidebarMode: 'side' | 'over' = 'side'; + @Output() closeSidebar: EventEmitter = new EventEmitter(); + isSuperAdmin: boolean = false; username: string = ""; decodedToken: any = ""; @@ -29,6 +33,12 @@ export class SidebarComponent { this.showSoftwareSub = !this.showSoftwareSub; } + onItemClick() { + if (this.isVisible && this.sidebarMode === 'over') { + this.closeSidebar.emit(); + } + } + constructor(public dialog: MatDialog) {} ngOnInit(): void { @@ -44,4 +54,4 @@ export class SidebarComponent { } } } -} +} \ No newline at end of file