-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NAS-129643 / 24.10 / Pool tint in new enclosure (#10301)
- Loading branch information
Showing
32 changed files
with
550 additions
and
210 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
66 changes: 51 additions & 15 deletions
66
src/app/core/testing/mock-enclosure/enclosure-templates/utils/pool.utils.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
53 changes: 53 additions & 0 deletions
53
src/app/core/testing/mock-enclosure/enclosure-templates/utils/slots.utils.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,53 @@ | ||
import { EnclosureElementType } from 'app/enums/enclosure-slot-status.enum'; | ||
import { | ||
DashboardEnclosure, | ||
DashboardEnclosureSlot, | ||
DashboardEnclosureElements, | ||
} from 'app/interfaces/enclosure.interface'; | ||
import { mapSlots, countSlots } from './slots.utils'; | ||
|
||
describe('mapSlots', () => { | ||
it('should correctly map slots for each enclosure', () => { | ||
const enclosures = [ | ||
{ | ||
elements: { | ||
[EnclosureElementType.ArrayDeviceSlot]: { | ||
1: { model: 'test1' } as DashboardEnclosureSlot, | ||
2: { model: 'test2' } as DashboardEnclosureSlot, | ||
}, | ||
} as DashboardEnclosureElements, | ||
}, | ||
] as DashboardEnclosure[]; | ||
|
||
const result = mapSlots(enclosures, ({ slot }) => ({ | ||
...slot, | ||
model: `mapped-${slot.model}`, | ||
})); | ||
|
||
expect(result).toEqual([ | ||
{ | ||
elements: { | ||
[EnclosureElementType.ArrayDeviceSlot]: { | ||
1: { model: 'mapped-test1' } as DashboardEnclosureSlot, | ||
2: { model: 'mapped-test2' } as DashboardEnclosureSlot, | ||
}, | ||
} as DashboardEnclosureElements, | ||
}, | ||
]); | ||
}); | ||
}); | ||
|
||
describe('countSlots', () => { | ||
it('should return the correct number of slots', () => { | ||
const enclosure = { | ||
elements: { | ||
[EnclosureElementType.ArrayDeviceSlot]: { | ||
1: {} as DashboardEnclosureSlot, | ||
2: {} as DashboardEnclosureSlot, | ||
}, | ||
} as DashboardEnclosureElements, | ||
} as DashboardEnclosure; | ||
const result = countSlots(enclosure); | ||
expect(result).toBe(2); | ||
}); | ||
}); |
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
40 changes: 19 additions & 21 deletions
40
...re-page/enclosure-view/disk-topology-description/disk-topology-description.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,23 +1,21 @@ | ||
<div class="container"> | ||
@if (selectedSlot().dev) { | ||
<h1>{{ selectedSlot().dev }}</h1> | ||
} | ||
@if (selectedSlot().pool_info) { | ||
<span> | ||
<span class="title">{{ 'Topology' | translate }}:</span> | ||
<span class="value">{{ selectedSlot().pool_info.vdev_name }}</span> | ||
@if (selectedSlot().dev) { | ||
<h1>{{ selectedSlot().dev }}</h1> | ||
} | ||
@if (selectedSlot().pool_info) { | ||
<div> | ||
<span class="title">{{ 'Topology' | translate }}:</span> | ||
<span class="value">{{ selectedSlot().pool_info.vdev_name }}</span> | ||
</div> | ||
} | ||
@if (selectedSlot().pool_info) { | ||
<div> | ||
<span class="title">{{ 'Category' | translate }}:</span> | ||
<span class="value"> | ||
{{ selectedSlot().pool_info.vdev_type | mapValue: vdevTypeLabels | translate }} | ||
</span> | ||
} | ||
@if (selectedSlot().pool_info) { | ||
<span> | ||
<span class="title">{{ 'Category' | translate }}:</span> | ||
<span class="value"> | ||
{{ selectedSlot().pool_info.vdev_type | mapValue: vdevTypeLabels | translate }} | ||
</span> | ||
</span> | ||
} | ||
<span> | ||
<span class="title">{{ 'Slot' | translate }}:</span> | ||
<span class="value">{{ selectedSlot().drive_bay_number }}</span> | ||
</span> | ||
</div> | ||
} | ||
<div> | ||
<span class="title">{{ 'Slot' | translate }}:</span> | ||
<span class="value">{{ selectedSlot().drive_bay_number }}</span> | ||
</div> |
10 changes: 2 additions & 8 deletions
10
...re-page/enclosure-view/disk-topology-description/disk-topology-description.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
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.