mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +00:00
start menu lol (#2389)
* start menu lol * add icons, abstract header menu * chore: few tweaks --------- Co-authored-by: waterplea <alexander@inkin.ru>
This commit is contained in:
@@ -80,7 +80,8 @@ tui-dropdown[data-appearance='start-os'][data-appearance='start-os'] {
|
|||||||
&::before {
|
&::before {
|
||||||
background: var(--tui-clear);
|
background: var(--tui-clear);
|
||||||
box-shadow: 1rem 0 var(--tui-clear), -1rem 0 var(--tui-clear);
|
box-shadow: 1rem 0 var(--tui-clear), -1rem 0 var(--tui-clear);
|
||||||
padding-top: 0.375rem;
|
padding-top: 0.375rem !important;
|
||||||
|
padding-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<img alt="" class="icon" [src]="icon" />
|
<img alt="" class="icon" [src]="icon" />
|
||||||
<label ticker class="title">{{ title }}</label>
|
<label ticker class="title">{{ title }}</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="side">
|
<span *ngIf="isService" class="side">
|
||||||
<tui-hosted-dropdown
|
<tui-hosted-dropdown
|
||||||
#dropdown
|
#dropdown
|
||||||
[content]="content"
|
[content]="content"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: 0 0.25rem 0.25rem rgb(0 0 0 / 25%);
|
box-shadow: 0 0.25rem 0.25rem rgb(0 0 0 / 25%);
|
||||||
// TODO: Theme
|
// TODO: Theme
|
||||||
background: rgb(111 109 109 / 90%);
|
background: rgb(111 109 109);
|
||||||
}
|
}
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
|
|||||||
@@ -38,18 +38,22 @@ import { toRouterLink } from '../../utils/to-router-link'
|
|||||||
export class CardComponent {
|
export class CardComponent {
|
||||||
private readonly navigation = inject(NavigationService)
|
private readonly navigation = inject(NavigationService)
|
||||||
|
|
||||||
@Input()
|
@Input({ required: true })
|
||||||
id = ''
|
id!: string
|
||||||
|
|
||||||
@Input()
|
@Input({ required: true })
|
||||||
icon = ''
|
icon!: string
|
||||||
|
|
||||||
@Input()
|
@Input({ required: true })
|
||||||
title = ''
|
title!: string
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
actions: Record<string, readonly Action[]> = {}
|
actions: Record<string, readonly Action[]> = {}
|
||||||
|
|
||||||
|
get isService(): boolean {
|
||||||
|
return !this.id.includes('/')
|
||||||
|
}
|
||||||
|
|
||||||
@HostListener('click')
|
@HostListener('click')
|
||||||
onClick() {
|
onClick() {
|
||||||
const { id, icon, title } = this
|
const { id, icon, title } = this
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<tui-hosted-dropdown
|
||||||
|
[content]="content"
|
||||||
|
[tuiDropdownMaxHeight]="9999"
|
||||||
|
(click.stop.prevent)="(0)"
|
||||||
|
(pointerdown.stop)="(0)"
|
||||||
|
>
|
||||||
|
<button tuiIconButton appearance="">
|
||||||
|
<img style="max-width: 62%" src="assets/img/icon.png" alt="StartOS" />
|
||||||
|
</button>
|
||||||
|
<ng-template #content>
|
||||||
|
<tui-data-list>
|
||||||
|
<h3 class="title">StartOS</h3>
|
||||||
|
<button tuiOption class="item" (click)="({})">
|
||||||
|
<tui-svg src="tuiIconInfo"></tui-svg>
|
||||||
|
About this server
|
||||||
|
</button>
|
||||||
|
<tui-opt-group>
|
||||||
|
<button tuiOption class="item" (click)="({})">
|
||||||
|
<tui-svg src="tuiIconBookOpen"></tui-svg>
|
||||||
|
User Manual
|
||||||
|
<tui-svg class="external" src="tuiIconArrowUpRight"></tui-svg>
|
||||||
|
</button>
|
||||||
|
<button tuiOption class="item" (click)="({})">
|
||||||
|
<tui-svg src="tuiIconHeadphones"></tui-svg>
|
||||||
|
Contact Support
|
||||||
|
<tui-svg class="external" src="tuiIconArrowUpRight"></tui-svg>
|
||||||
|
</button>
|
||||||
|
<button tuiOption class="item" (click)="({})">
|
||||||
|
<tui-svg src="tuiIconDollarSign"></tui-svg>
|
||||||
|
Donate to Start9
|
||||||
|
<tui-svg class="external" src="tuiIconArrowUpRight"></tui-svg>
|
||||||
|
</button>
|
||||||
|
</tui-opt-group>
|
||||||
|
<tui-opt-group>
|
||||||
|
<button tuiOption class="item" (click)="({})">
|
||||||
|
<tui-svg src="tuiIconTool"></tui-svg>
|
||||||
|
System Rebuild
|
||||||
|
</button>
|
||||||
|
<button tuiOption class="item" (click)="({})">
|
||||||
|
<tui-svg src="tuiIconRefreshCw"></tui-svg>
|
||||||
|
Restart
|
||||||
|
</button>
|
||||||
|
<button tuiOption class="item" (click)="({})">
|
||||||
|
<tui-svg src="tuiIconPower"></tui-svg>
|
||||||
|
Shutdown
|
||||||
|
</button>
|
||||||
|
</tui-opt-group>
|
||||||
|
<tui-opt-group>
|
||||||
|
<button tuiOption class="item" (click)="({})">
|
||||||
|
<tui-svg src="tuiIconLogOut"></tui-svg>
|
||||||
|
Logout
|
||||||
|
</button>
|
||||||
|
</tui-opt-group>
|
||||||
|
</tui-data-list>
|
||||||
|
</ng-template>
|
||||||
|
</tui-hosted-dropdown>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
.item {
|
||||||
|
justify-content: flex-start;
|
||||||
|
gap: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 0.5rem 0.25rem;
|
||||||
|
white-space: nowrap;
|
||||||
|
font: var(--tui-font-text-l);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.external {
|
||||||
|
margin-left: auto;
|
||||||
|
padding-left: 0.5rem;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
||||||
|
import {
|
||||||
|
TuiButtonModule,
|
||||||
|
TuiDataListModule,
|
||||||
|
TuiHostedDropdownModule,
|
||||||
|
TuiSvgModule,
|
||||||
|
} from '@taiga-ui/core'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'header-menu',
|
||||||
|
templateUrl: 'header-menu.component.html',
|
||||||
|
styleUrls: ['header-menu.component.scss'],
|
||||||
|
standalone: true,
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
imports: [
|
||||||
|
TuiHostedDropdownModule,
|
||||||
|
TuiDataListModule,
|
||||||
|
TuiSvgModule,
|
||||||
|
TuiButtonModule,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class HeaderMenuComponent {}
|
||||||
@@ -8,4 +8,5 @@
|
|||||||
Notifications
|
Notifications
|
||||||
</button>
|
</button>
|
||||||
</tui-badged-content>
|
</tui-badged-content>
|
||||||
|
<header-menu></header-menu>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,9 +5,10 @@
|
|||||||
padding: 0 1rem 0 2rem;
|
padding: 0 1rem 0 2rem;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
// TODO: Theme
|
// TODO: Theme
|
||||||
background: rgb(51 51 51 / 74%);
|
background: rgb(51 51 51 / 84%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
|
display: flex;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
||||||
import { TuiBadgedContentModule } from '@taiga-ui/kit'
|
import { TuiBadgedContentModule } from '@taiga-ui/kit'
|
||||||
import { TuiButtonModule } from '@taiga-ui/core'
|
import {
|
||||||
|
TuiButtonModule,
|
||||||
|
TuiDataListModule,
|
||||||
|
TuiHostedDropdownModule,
|
||||||
|
TuiSvgModule,
|
||||||
|
} from '@taiga-ui/core'
|
||||||
|
import { HeaderMenuComponent } from './header-menu/header-menu.component'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'header[appHeader]',
|
selector: 'header[appHeader]',
|
||||||
@@ -8,6 +14,13 @@ import { TuiButtonModule } from '@taiga-ui/core'
|
|||||||
styleUrls: ['header.component.scss'],
|
styleUrls: ['header.component.scss'],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
imports: [TuiBadgedContentModule, TuiButtonModule],
|
imports: [
|
||||||
|
TuiBadgedContentModule,
|
||||||
|
TuiButtonModule,
|
||||||
|
TuiHostedDropdownModule,
|
||||||
|
TuiDataListModule,
|
||||||
|
TuiSvgModule,
|
||||||
|
HeaderMenuComponent,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class HeaderComponent {}
|
export class HeaderComponent {}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
routerLinkActive="tab_active"
|
routerLinkActive="tab_active"
|
||||||
[routerLinkActiveOptions]="{ exact: true }"
|
[routerLinkActiveOptions]="{ exact: true }"
|
||||||
>
|
>
|
||||||
<img class="icon" src="assets/img/icon_transparent.png" alt="Home" />
|
<tui-svg src="tuiIconHomeLarge" class="home"></tui-svg>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
*ngFor="let tab of tabs$ | async"
|
*ngFor="let tab of tabs$ | async"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
height: 3rem;
|
height: 3rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
// TODO: Theme
|
// TODO: Theme
|
||||||
background: rgb(97 95 95 / 75%);
|
background: rgb(97 95 95 / 84%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab {
|
.tab {
|
||||||
@@ -29,3 +29,7 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.home {
|
||||||
|
color: var(--tui-base-08);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { CommonModule, Location } from '@angular/common'
|
import { CommonModule, Location } from '@angular/common'
|
||||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
|
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
|
||||||
import { RouterModule } from '@angular/router'
|
import { RouterModule } from '@angular/router'
|
||||||
import { TuiButtonModule } from '@taiga-ui/core'
|
import { TuiButtonModule, TuiSvgModule } from '@taiga-ui/core'
|
||||||
import { NavigationItem, NavigationService } from './navigation.service'
|
import { NavigationItem, NavigationService } from './navigation.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -10,7 +10,7 @@ import { NavigationItem, NavigationService } from './navigation.service'
|
|||||||
styleUrls: ['navigation.component.scss'],
|
styleUrls: ['navigation.component.scss'],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
imports: [CommonModule, RouterModule, TuiButtonModule],
|
imports: [CommonModule, RouterModule, TuiButtonModule, TuiSvgModule],
|
||||||
})
|
})
|
||||||
export class NavigationComponent {
|
export class NavigationComponent {
|
||||||
private readonly location = inject(Location)
|
private readonly location = inject(Location)
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import { toRouterLink } from '../utils/to-router-link'
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class ToDesktopItemPipe implements PipeTransform {
|
export class ToDesktopItemPipe implements PipeTransform {
|
||||||
private readonly system = SYSTEM_UTILITIES
|
|
||||||
|
|
||||||
transform(
|
transform(
|
||||||
packages: Record<string, PackageDataEntry>,
|
packages: Record<string, PackageDataEntry>,
|
||||||
id: string,
|
id: string,
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
[icon]="icon"
|
[icon]="icon"
|
||||||
></button>
|
></button>
|
||||||
<ng-template #icon>
|
<ng-template #icon>
|
||||||
<tui-svg src="tuiIconMoreHorizontal" class="icon"></tui-svg>
|
<tui-svg src="tuiIconMoreHorizontal"></tui-svg>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</tui-hosted-dropdown>
|
</tui-hosted-dropdown>
|
||||||
<ng-template #dropdown let-close="close">
|
<ng-template #dropdown let-close="close">
|
||||||
|
|||||||
Reference in New Issue
Block a user