-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1647 from Senyoret1/tab-ui
UI improvements
- Loading branch information
Showing
12 changed files
with
175 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ic/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="top-dialog-button" (click)="showTabSelector()"> | ||
<div class="top-dialog-button-content"> | ||
<div class="tab-name"> | ||
<span>{{ tabNames[selectedTab] | translate }}</span> | ||
</div> | ||
<mat-icon class="icon" [inline]="true">expand_more</mat-icon> | ||
</div> | ||
<div class="top-dialog-button-margin"></div> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
...ic/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.top-dialog-button{ | ||
.top-dialog-button-content { | ||
display: flex; | ||
|
||
.tab-name { | ||
flex-grow: 1; | ||
margin-right: 10px; | ||
align-self: center; | ||
} | ||
|
||
.icon { | ||
font-size: 20px; | ||
flex-shrink: 0; | ||
align-self: center; | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
static/skywire-manager-src/src/app/components/layout/tab-selector/tab-selector.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Component, EventEmitter, Input, OnDestroy, Output } from '@angular/core'; | ||
import { SelectOptionComponent, SelectableOption } from '../select-option/select-option.component'; | ||
import { MatDialog } from '@angular/material/dialog'; | ||
|
||
/** | ||
* Button for changing the selected tab of an app-tab-selector component in small screens. | ||
*/ | ||
@Component({ | ||
selector: 'app-tab-selector', | ||
templateUrl: './tab-selector.component.html', | ||
styleUrls: ['./tab-selector.component.scss'] | ||
}) | ||
export class TabSelectorComponent implements OnDestroy { | ||
// Name of the available tabs, for the translation pipe. | ||
@Input() tabNames: string[] = ['']; | ||
// Index of the currently selected tab. | ||
@Input() selectedTab = 0; | ||
// Event emited if the user selects a different tab. The selectedTab var is not | ||
// updated automatically when this event is sent. | ||
@Output() tabChanged = new EventEmitter<number>(); | ||
|
||
constructor( | ||
private dialog: MatDialog | ||
) { } | ||
|
||
ngOnDestroy() { | ||
this.tabChanged.complete(); | ||
} | ||
|
||
showTabSelector() { | ||
const options: SelectableOption[] = []; | ||
|
||
// Create a list with all the tabs. | ||
this.tabNames.forEach((name, i) => { | ||
options.push({ icon: i === this.selectedTab ? 'check' : '', label: name }) | ||
}); | ||
|
||
// Show the tab selection modal window. | ||
SelectOptionComponent.openDialog(this.dialog, options, 'node.logs.filter-title').afterClosed().subscribe((selectedOption: number) => { | ||
this.tabChanged.emit(selectedOption - 1); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 9 additions & 4 deletions
13
...wire-manager-src/src/app/components/pages/node/apps/node-apps-list/log/log.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters