-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NAS-132996 / 25.04 / Add fibre channel connections card (#11181)
* NAS-132996: Add fibre channel connections card * NAS-132996: Update tests * NAS-132996: Clean up
- Loading branch information
1 parent
ef1717a
commit 2dd4566
Showing
96 changed files
with
465 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
...rget-details/fibre-channel-connections-card/fibre-channel-connections-card.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,19 @@ | ||
<mat-card class="card"> | ||
<mat-card-header> | ||
<h3 mat-card-title> | ||
{{ 'Fibre Channel Connections' | translate }} | ||
</h3> | ||
</mat-card-header> | ||
<mat-card-content> | ||
@for(connection of connections(); track connection) { | ||
@if (connection?.A?.wwpn && connection?.A?.sessions?.length) { | ||
<p>{{ connection.A.wwpn }} ({{ 'Active Controller' | translate }})</p> | ||
} | ||
@if (connection?.B?.wwpn_b && connection?.B?.sessions?.length) { | ||
<p>{{ connection.B.wwpn_b }} ({{ 'Passive Controller' | translate }})</p> | ||
} | ||
} @empty { | ||
<p>{{ 'No connections' | translate }}</p> | ||
} | ||
</mat-card-content> | ||
</mat-card> |
4 changes: 4 additions & 0 deletions
4
...rget-details/fibre-channel-connections-card/fibre-channel-connections-card.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,4 @@ | ||
:host { | ||
box-sizing: border-box; | ||
display: block; | ||
} |
57 changes: 57 additions & 0 deletions
57
...t-details/fibre-channel-connections-card/fibre-channel-connections-card.component.spec.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,57 @@ | ||
import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { FibreChannelStatus } from 'app/interfaces/fibre-channel.interface'; | ||
import { FibreChannelConnectionsCardComponent } from './fibre-channel-connections-card.component'; | ||
|
||
describe('FibreChannelConnectionsCardComponent', () => { | ||
let spectator: Spectator<FibreChannelConnectionsCardComponent>; | ||
const createComponent = createComponentFactory({ | ||
component: FibreChannelConnectionsCardComponent, | ||
imports: [TranslateModule.forRoot()], | ||
}); | ||
|
||
beforeEach(() => { | ||
spectator = createComponent({ | ||
props: { | ||
connections: [{ | ||
A: { | ||
port_type: 'NPort (fabric via point-to-point)', | ||
port_state: 'Online', | ||
speed: '16 Gbit', | ||
physical: true, | ||
wwpn: 'naa.210034800d75aec4', | ||
sessions: [ | ||
'21:00:00:24:ff:19:a2:e2', | ||
'21:00:00:24:ff:19:a5:80', | ||
'21:00:00:24:ff:19:a9:0a', | ||
'21:00:00:24:ff:19:a2:e3', | ||
'21:00:00:24:ff:19:a5:81', | ||
'21:00:00:24:ff:19:a9:0b', | ||
'21:00:00:0e:1e:25:24:80', | ||
], | ||
}, | ||
port: 'fc0', | ||
B: { | ||
port_type: 'Unknown', | ||
port_state: 'Offline', | ||
speed: 'unknown', | ||
physical: true, | ||
wwpn_b: 'naa.210034800d75aed8', | ||
sessions: [], | ||
}, | ||
}] as FibreChannelStatus[], | ||
}, | ||
}); | ||
}); | ||
|
||
it('shows fibre channel connections heading', () => { | ||
const title = spectator.query('h3'); | ||
expect(title).toHaveText('Fibre Channel Connections'); | ||
}); | ||
|
||
it('shows connections', () => { | ||
const content = spectator.queryAll('mat-card-content p'); | ||
expect(content).toHaveLength(1); | ||
expect(content[0]).toHaveText('naa.210034800d75aec4 (Active Controller)'); | ||
}); | ||
}); |
26 changes: 26 additions & 0 deletions
26
...target-details/fibre-channel-connections-card/fibre-channel-connections-card.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,26 @@ | ||
import { | ||
Component, ChangeDetectionStrategy, input, | ||
} from '@angular/core'; | ||
import { | ||
MatCard, MatCardContent, MatCardHeader, MatCardTitle, | ||
} from '@angular/material/card'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { FibreChannelStatus } from 'app/interfaces/fibre-channel.interface'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'ix-fibre-channel-connections-card', | ||
templateUrl: './fibre-channel-connections-card.component.html', | ||
styleUrls: ['./fibre-channel-connections-card.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
imports: [ | ||
MatCard, | ||
MatCardTitle, | ||
MatCardContent, | ||
MatCardHeader, | ||
TranslateModule, | ||
], | ||
}) | ||
export class FibreChannelConnectionsCardComponent { | ||
connections = input<FibreChannelStatus[]>([]); | ||
} |
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
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
Oops, something went wrong.