-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09ba3ed
commit 553d369
Showing
23 changed files
with
212 additions
and
28 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './lib/uuid'; | ||
export * from './lib/problem'; | ||
export * from './lib/sbb-menu-item'; |
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,6 @@ | ||
import { MenuItem } from 'primeng/api'; | ||
import { MenuItemCommandEvent } from 'primeng/api/menuitem'; | ||
|
||
export interface SbbMenuItem<T> extends MenuItem { | ||
onSelect?(data: T, event: MenuItemCommandEvent): void | ||
} |
12 changes: 11 additions & 1 deletion
12
libs/topology/components/src/lib/namespace-tree-node/namespace-tree-node.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 |
---|---|---|
@@ -1 +1,11 @@ | ||
<span class="name" [pTooltip]="namespace().name"><fa-icon [icon]="icon"></fa-icon> {{ namespace().name }}</span> | ||
<div class="line-container" #ns> | ||
<span class="name" [pTooltip]="namespace().name"><fa-icon [icon]="icon"></fa-icon> {{ namespace().name }}</span> | ||
</div> | ||
@if (contextMenuItems()) { | ||
<p-contextmenu | ||
[target]="ns" | ||
[model]="modifiedContextMenuItems() ?? []" | ||
appendTo="body" | ||
> | ||
</p-contextmenu> | ||
} |
5 changes: 5 additions & 0 deletions
5
libs/topology/components/src/lib/namespace-tree-node/namespace-tree-node.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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
:host { | ||
display: block; | ||
width: 100%; | ||
} | ||
|
||
.line-container { | ||
display: flex; | ||
width: 100%; | ||
flex-direction: row; | ||
|
21 changes: 19 additions & 2 deletions
21
libs/topology/components/src/lib/namespace-tree-node/namespace-tree-node.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 |
---|---|---|
@@ -1,17 +1,34 @@ | ||
import { Component, input } from '@angular/core'; | ||
import { Component, computed, input } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { Namespace } from '@service-bus-browser/topology-contracts'; | ||
import { FaIconComponent } from '@fortawesome/angular-fontawesome'; | ||
import { faServer } from '@fortawesome/free-solid-svg-icons'; | ||
import { Tooltip } from 'primeng/tooltip'; | ||
import { ContextMenu } from 'primeng/contextmenu'; | ||
import { SbbMenuItem } from '@service-bus-browser/shared-contracts'; | ||
import { MenuItemCommandEvent } from 'primeng/api/menuitem'; | ||
|
||
@Component({ | ||
selector: 'sbb-tpl-namespace-tree-node', | ||
imports: [CommonModule, FaIconComponent, Tooltip], | ||
imports: [CommonModule, FaIconComponent, Tooltip, ContextMenu], | ||
templateUrl: './namespace-tree-node.component.html', | ||
styleUrl: './namespace-tree-node.component.scss', | ||
}) | ||
export class NamespaceTreeNodeComponent { | ||
namespace = input.required<Namespace>(); | ||
icon = faServer; | ||
contextMenuItems = input<SbbMenuItem<Namespace>[]>(); | ||
modifiedContextMenuItems = computed(() => { | ||
return this.contextMenuItems()?.map((item) => { | ||
return { | ||
...item, | ||
command: (event: MenuItemCommandEvent) => this.onSelect(event, item), | ||
}; | ||
}); | ||
}) | ||
|
||
|
||
onSelect(event: MenuItemCommandEvent, menuItem: SbbMenuItem<Namespace>) { | ||
menuItem.onSelect?.(this.namespace(), event); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
libs/topology/components/src/lib/queue-tree-node/queue-tree-node.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 |
---|---|---|
@@ -1,2 +1,11 @@ | ||
<div class="line-container" #q> | ||
<span class="name" [pTooltip]="queue().name"><fa-icon [icon]="icon"></fa-icon> {{ queue().name }}</span> | ||
<span class="counters">({{queue().messageCount}},{{queue().deadLetterMessageCount}},{{queue().transferDeadLetterMessageCount}})</span> | ||
</div> | ||
@if (contextMenuItems()) { | ||
<p-contextmenu | ||
[target]="q" | ||
[model]="contextMenuItems() ?? []" | ||
appendTo="body" | ||
></p-contextmenu> | ||
} |
5 changes: 5 additions & 0 deletions
5
libs/topology/components/src/lib/queue-tree-node/queue-tree-node.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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
:host { | ||
display: block; | ||
width: 100%; | ||
} | ||
|
||
.line-container { | ||
display: flex; | ||
width: 100%; | ||
flex-direction: row; | ||
|
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
14 changes: 12 additions & 2 deletions
14
.../topology/components/src/lib/subscription-tree-node/subscription-tree-node.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 |
---|---|---|
@@ -1,2 +1,12 @@ | ||
<span class="name" [pTooltip]="subscription().name"><fa-icon [icon]="icon"></fa-icon> {{ subscription().name }}</span> | ||
<span>({{subscription().messageCount}},{{subscription().deadLetterMessageCount}},{{subscription().transferDeadLetterMessageCount}})</span> | ||
<div class="line-container" #sub> | ||
<span class="name" [pTooltip]="subscription().name"><fa-icon [icon]="icon"></fa-icon> {{ subscription().name }}</span> | ||
<span>({{subscription().messageCount}},{{subscription().deadLetterMessageCount}},{{subscription().transferDeadLetterMessageCount}})</span> | ||
</div> | ||
|
||
@if (contextMenuItems()) { | ||
<p-contextmenu | ||
[target]="sub" | ||
[model]="contextMenuItems() ?? []" | ||
appendTo="body" | ||
></p-contextmenu> | ||
} |
5 changes: 5 additions & 0 deletions
5
.../topology/components/src/lib/subscription-tree-node/subscription-tree-node.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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
:host { | ||
display: block; | ||
width: 100%; | ||
} | ||
|
||
.line-container { | ||
display: flex; | ||
width: 100%; | ||
flex-direction: row; | ||
|
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: 12 additions & 1 deletion
13
libs/topology/components/src/lib/topic-tree-node/topic-tree-node.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 |
---|---|---|
@@ -1 +1,12 @@ | ||
<span class="name" [pTooltip]="topic().name"><fa-icon [icon]="icon"></fa-icon> {{ topic().name }}</span> | ||
<div class="line-container" #t> | ||
<span class="name" [pTooltip]="topic().name"><fa-icon [icon]="icon"></fa-icon> {{ topic().name }}</span> | ||
<p-button icon="pi pi-refresh" [rounded]="true" [text]="true" (click)="refresh($event)"/> | ||
</div> | ||
|
||
@if (contextMenuItems()) { | ||
<p-contextmenu | ||
[target]="t" | ||
[model]="contextMenuItems() ?? []" | ||
appendTo="body" | ||
></p-contextmenu> | ||
} |
6 changes: 6 additions & 0 deletions
6
libs/topology/components/src/lib/topic-tree-node/topic-tree-node.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
15 changes: 13 additions & 2 deletions
15
libs/topology/components/src/lib/topic-tree-node/topic-tree-node.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 |
---|---|---|
@@ -1,17 +1,28 @@ | ||
import { Component, input } from '@angular/core'; | ||
import { Component, input, output } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { Topic } from '@service-bus-browser/topology-contracts'; | ||
import { faFolderTree } from '@fortawesome/free-solid-svg-icons'; | ||
import { FaIconComponent } from '@fortawesome/angular-fontawesome'; | ||
import { Tooltip } from 'primeng/tooltip'; | ||
import { Button } from 'primeng/button'; | ||
import { ContextMenu } from 'primeng/contextmenu'; | ||
import { MenuItem } from 'primeng/api'; | ||
|
||
@Component({ | ||
selector: 'sbb-tpl-topic-tree-node', | ||
imports: [CommonModule, FaIconComponent, Tooltip], | ||
imports: [CommonModule, FaIconComponent, Tooltip, Button, ContextMenu], | ||
templateUrl: './topic-tree-node.component.html', | ||
styleUrl: './topic-tree-node.component.scss', | ||
}) | ||
export class TopicTreeNodeComponent { | ||
topic = input.required<Topic>(); | ||
icon = faFolderTree; | ||
|
||
refreshTopic = output<Topic>(); | ||
contextMenuItems = input<MenuItem[]>(); | ||
|
||
refresh($event: MouseEvent) { | ||
this.refreshTopic.emit(this.topic()); | ||
$event.stopPropagation(); | ||
} | ||
} |
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
Oops, something went wrong.