UI improvements: href support for side menu
This commit is contained in:
parent
c14d36d4ea
commit
1d960b96bc
@ -30,12 +30,14 @@ import { getCurrentAuthState, selectAuthUser, selectUserDetails } from '@core/au
|
|||||||
import { MediaBreakpoints } from '@shared/models/constants';
|
import { MediaBreakpoints } from '@shared/models/constants';
|
||||||
import { ActionNotificationShow } from '@core/notification/notification.actions';
|
import { ActionNotificationShow } from '@core/notification/notification.actions';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import * as screenfull from 'screenfull';
|
import * as _screenfull from 'screenfull';
|
||||||
import { MatSidenav } from '@angular/material/sidenav';
|
import { MatSidenav } from '@angular/material/sidenav';
|
||||||
import { AuthState } from '@core/auth/auth.models';
|
import { AuthState } from '@core/auth/auth.models';
|
||||||
import { WINDOW } from '@core/services/window.service';
|
import { WINDOW } from '@core/services/window.service';
|
||||||
import { ISearchableComponent, instanceOfSearchableComponent } from '@home/models/searchable-component.models';
|
import { ISearchableComponent, instanceOfSearchableComponent } from '@home/models/searchable-component.models';
|
||||||
|
|
||||||
|
const screenfull = _screenfull as _screenfull.Screenfull;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tb-home',
|
selector: 'tb-home',
|
||||||
templateUrl: './home.component.html',
|
templateUrl: './home.component.html',
|
||||||
@ -60,8 +62,7 @@ export class HomeComponent extends PageComponent implements AfterViewInit, OnIni
|
|||||||
|
|
||||||
@ViewChild('searchInput') searchInputField: ElementRef;
|
@ViewChild('searchInput') searchInputField: ElementRef;
|
||||||
|
|
||||||
// @ts-ignore
|
fullscreenEnabled = screenfull.isEnabled;
|
||||||
fullscreenEnabled = screenfull.enabled;
|
|
||||||
|
|
||||||
authUser$: Observable<any>;
|
authUser$: Observable<any>;
|
||||||
userDetails$: Observable<User>;
|
userDetails$: Observable<User>;
|
||||||
@ -125,15 +126,12 @@ export class HomeComponent extends PageComponent implements AfterViewInit, OnIni
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleFullscreen() {
|
toggleFullscreen() {
|
||||||
// @ts-ignore
|
if (screenfull.isEnabled) {
|
||||||
if (screenfull.enabled) {
|
|
||||||
// @ts-ignore
|
|
||||||
screenfull.toggle();
|
screenfull.toggle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isFullscreen() {
|
isFullscreen() {
|
||||||
// @ts-ignore
|
|
||||||
return screenfull.isFullscreen;
|
return screenfull.isFullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,9 +15,10 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<button mat-button
|
<a class="mat-button" routerLinkActive="tb-active" [routerLinkActiveOptions]="{exact: true}" routerLink="{{section.path}}">
|
||||||
routerLinkActive="tb-active" [routerLinkActiveOptions]="{exact: true}" routerLink="{{section.path}}">
|
<span class="mat-button-wrapper">
|
||||||
<mat-icon *ngIf="!section.isMdiIcon && section.icon != null" class="material-icons">{{section.icon}}</mat-icon>
|
<mat-icon *ngIf="!section.isMdiIcon && section.icon != null" class="material-icons">{{section.icon}}</mat-icon>
|
||||||
<mat-icon *ngIf="section.isMdiIcon && section.icon != null" [svgIcon]="section.icon"></mat-icon>
|
<mat-icon *ngIf="section.isMdiIcon && section.icon != null" [svgIcon]="section.icon"></mat-icon>
|
||||||
<span>{{section.name | translate}}</span>
|
<span>{{section.name | translate}}</span>
|
||||||
</button>
|
</span>
|
||||||
|
</a>
|
||||||
|
|||||||
@ -15,15 +15,16 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<button mat-button
|
<a class="mat-button tb-button-toggle"
|
||||||
routerLinkActive="tb-active" [routerLinkActiveOptions]="{exact: true}" routerLink="{{section.path}}"
|
routerLinkActive="tb-active" [routerLinkActiveOptions]="{exact: true}" routerLink="{{section.path}}">
|
||||||
class="tb-button-toggle">
|
<span class="mat-button-wrapper">
|
||||||
<mat-icon *ngIf="!section.isMdiIcon && section.icon != null" class="material-icons">{{section.icon}}</mat-icon>
|
<mat-icon *ngIf="!section.isMdiIcon && section.icon != null" class="material-icons">{{section.icon}}</mat-icon>
|
||||||
<mat-icon *ngIf="section.isMdiIcon && section.icon != null" [svgIcon]="section.icon"></mat-icon>
|
<mat-icon *ngIf="section.isMdiIcon && section.icon != null" [svgIcon]="section.icon"></mat-icon>
|
||||||
<span>{{section.name | translate}}</span>
|
<span>{{section.name | translate}}</span>
|
||||||
<span class=" pull-right fa fa-chevron-down tb-toggle-icon"
|
<span class=" pull-right fa fa-chevron-down tb-toggle-icon"
|
||||||
[ngClass]="{'tb-toggled' : sectionActive()}"></span>
|
[ngClass]="{'tb-toggled' : sectionActive()}"></span>
|
||||||
</button>
|
</span>
|
||||||
|
</a>
|
||||||
<ul id="docs-menu-{{section.name | nospace}}" class="tb-menu-toggle-list" [ngStyle]="{height: sectionHeight()}">
|
<ul id="docs-menu-{{section.name | nospace}}" class="tb-menu-toggle-list" [ngStyle]="{height: sectionHeight()}">
|
||||||
<li *ngFor="let page of section.pages">
|
<li *ngFor="let page of section.pages">
|
||||||
<tb-menu-link [section]="page"></tb-menu-link>
|
<tb-menu-link [section]="page"></tb-menu-link>
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
:host {
|
:host {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@ -30,7 +31,8 @@
|
|||||||
border-bottom: 1px solid rgba(0, 0, 0, .12);
|
border-bottom: 1px solid rgba(0, 0, 0, .12);
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
a.mat-button {
|
||||||
|
text-transform: uppercase;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-height: 40px;
|
max-height: 40px;
|
||||||
@ -46,52 +48,46 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
&:hover {
|
&:hover {
|
||||||
|
border-bottom: none;
|
||||||
background-color: rgba(255,255,255,0.08);
|
background-color: rgba(255,255,255,0.08);
|
||||||
}
|
}
|
||||||
|
&:focus {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
&.tb-active {
|
||||||
|
font-weight: 500;
|
||||||
|
background-color: rgba(255, 255, 255, .15);
|
||||||
|
}
|
||||||
|
|
||||||
.mat-button-wrapper {
|
.mat-button-wrapper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
mat-icon {
|
||||||
|
margin-right: 8px;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
span {
|
span {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
&.tb-toggle-icon {
|
||||||
|
padding-top: 12px;
|
||||||
|
padding-bottom: 12px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button.tb-active {
|
.tb-button-toggle {
|
||||||
font-weight: 500;
|
.tb-toggle-icon {
|
||||||
background-color: rgba(255, 255, 255, .15);
|
display: inline-block;
|
||||||
}
|
width: 15px;
|
||||||
|
margin: auto 0 auto auto;
|
||||||
span.tb-toggle-icon {
|
background-size: 100% auto;
|
||||||
padding-top: 12px;
|
transition: transform .3s, ease-in-out;
|
||||||
padding-bottom: 12px;
|
&.tb-toggled {
|
||||||
}
|
transform: rotateZ(180deg);
|
||||||
|
}
|
||||||
mat-icon {
|
}
|
||||||
margin-right: 8px;
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tb-menu-toggle-list button {
|
|
||||||
padding: 0 16px 0 32px;
|
|
||||||
font-weight: 500;
|
|
||||||
text-transform: none;
|
|
||||||
text-rendering: optimizeLegibility;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tb-button-toggle .tb-toggle-icon {
|
|
||||||
display: inline-block;
|
|
||||||
width: 15px;
|
|
||||||
margin: auto 0 auto auto;
|
|
||||||
background-size: 100% auto;
|
|
||||||
|
|
||||||
transition: transform .3s, ease-in-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tb-button-toggle .tb-toggle-icon.tb-toggled {
|
|
||||||
transform: rotateZ(180deg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tb-menu-toggle-list {
|
.tb-menu-toggle-list {
|
||||||
@ -103,7 +99,7 @@
|
|||||||
|
|
||||||
transition-property: height;
|
transition-property: height;
|
||||||
|
|
||||||
button {
|
a.mat-button {
|
||||||
padding: 0 16px 0 32px;
|
padding: 0 16px 0 32px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
text-transform: none !important;
|
text-transform: none !important;
|
||||||
|
|||||||
@ -110,7 +110,9 @@ export interface WidgetTimewindow {
|
|||||||
|
|
||||||
export function historyInterval(timewindowMs: number): Timewindow {
|
export function historyInterval(timewindowMs: number): Timewindow {
|
||||||
const timewindow: Timewindow = {
|
const timewindow: Timewindow = {
|
||||||
|
selectedTab: TimewindowType.HISTORY,
|
||||||
history: {
|
history: {
|
||||||
|
historyType: HistoryWindowType.LAST_INTERVAL,
|
||||||
timewindowMs
|
timewindowMs
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user