Skip to content

Commit a7901aa

Browse files
feat: add ocr to cloud environment
1 parent b72ab1d commit a7901aa

6 files changed

Lines changed: 36 additions & 41 deletions

File tree

src/app/devices/certificates/certificates.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<span matListItemLine>Type: {{ cert.trustedRootCertificate ? 'Root' : 'Client' }}</span>
2525
<span matListItemLine
2626
>Profile Associations:
27-
@if (!cert.associatedProfiles) {
27+
@if (!cert.associatedProfiles || cert.associatedProfiles.length === 0) {
2828
Unassociated
2929
} @else {
3030
{{ cert.associatedProfiles }}

src/app/devices/device-detail/device-detail.component.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,23 @@ export class DeviceDetailComponent implements OnInit {
108108
description: 'Manage device alarms',
109109
component: 'alarms',
110110
icon: 'alarm'
111+
},
112+
{
113+
name: 'Certificates',
114+
description: 'Manage certificates',
115+
component: 'certificates',
116+
icon: 'verified'
111117
}
112118
]
113119

114120
constructor() {
115121
if (!this.isCloudMode) {
116-
this.categories.push({
117-
name: 'Certificates',
118-
description: 'Manage certificates',
119-
component: 'certificates',
120-
icon: 'verified'
121-
})
122+
// this.categories.push({
123+
// name: 'Certificates',
124+
// description: 'Manage certificates',
125+
// component: 'certificates',
126+
// icon: 'verified'
127+
// })
122128
this.categories.push({
123129
name: 'Explorer',
124130
description: 'Send WSMAN commands',

src/app/devices/device-toolbar/device-toolbar.component.spec.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,6 @@ describe('DeviceToolbarComponent', () => {
155155
expect(ocrOption?.label).toBe('Reset to HTTPS Boot (OCR)')
156156
})
157157

158-
it('should not have OCR power option in cloud mode', () => {
159-
environment.cloud = true
160-
component.isCloudMode = true
161-
162-
component.ngOnInit()
163-
164-
const ocrOption = component.powerOptions.find((option) => option.action === 105)
165-
expect(ocrOption).toBeFalsy()
166-
})
167-
168158
it('should open HttpbootDetailComponent dialog in non-cloud mode', () => {
169159
environment.cloud = false
170160
component.isCloudMode = false

src/app/devices/device-toolbar/device-toolbar.component.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,18 @@ export class DeviceToolbarComponent implements OnInit {
105105
{
106106
label: 'Power Up to PXE',
107107
action: 401
108+
},
109+
{
110+
label: 'Reset to HTTPS Boot (OCR)',
111+
action: 105
112+
},
113+
{
114+
label: 'Power Up to HTTPS Boot (OCR)',
115+
action: 106
108116
}
109117
]
110118

111119
ngOnInit(): void {
112-
if (!this.isCloudMode) {
113-
this.powerOptions.push({
114-
label: 'Reset to HTTPS Boot (OCR)',
115-
action: 105
116-
})
117-
this.powerOptions.push({
118-
label: 'Power Up to HTTPS Boot (OCR)',
119-
action: 106
120-
})
121-
}
122-
123120
this.devicesService.getDevice(this.deviceId()).subscribe((data) => {
124121
this.device = data
125122
this.devicesService.device.next(this.device)

src/app/devices/general/general.component.html

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,16 @@
112112
</mat-select>
113113
</mat-form-field>
114114
</div>
115-
@if (!isCloudMode) {
116-
<div class="flex flex-50">
117-
<p>HTTPS Network boot:</p>
118-
</div>
119-
<div
120-
class="flex flex-50 justify-end"
121-
matTooltip="HTTPS Boot is not supported"
122-
[matTooltipDisabled]="!amtEnabledFeatures.get('httpsBootSupported')?.disabled"
123-
matTooltipPosition="after">
124-
<mat-checkbox formControlName="httpsBootSupported" (change)="setAmtFeatures()"></mat-checkbox>
125-
</div>
126-
}
115+
<div class="flex flex-50">
116+
<p>HTTPS Network boot:</p>
117+
</div>
118+
<div
119+
class="flex flex-50 justify-end"
120+
matTooltip="HTTPS Boot is not supported"
121+
[matTooltipDisabled]="!amtEnabledFeatures.get('httpsBootSupported')?.disabled"
122+
matTooltipPosition="after">
123+
<mat-checkbox formControlName="httpsBootSupported" (change)="setAmtFeatures()"></mat-checkbox>
124+
</div>
127125
</div>
128126
</mat-card-content>
129127
</mat-card>

src/app/devices/general/general.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ export class GeneralComponent implements OnInit {
144144
setAmtFeatures(): void {
145145
this.isLoading.set(true)
146146
this.devicesService
147-
.setAmtFeatures(this.deviceId(), this.amtEnabledFeatures.value as AMTFeaturesRequest)
147+
.setAmtFeatures(this.deviceId(), {
148+
...this.amtEnabledFeatures.getRawValue(),
149+
ocr: this.amtFeatures.ocr,
150+
remoteErase: this.amtFeatures.remoteErase
151+
} as AMTFeaturesRequest)
148152
.pipe(
149153
finalize(() => {
150154
this.isLoading.set(false)

0 commit comments

Comments
 (0)