The changes upaded the comparison page

This commit is contained in:
Cyrus 2024-03-19 20:19:26 -04:00
parent e0ce4b2f05
commit 5a4d2e92af
2 changed files with 15 additions and 23 deletions

View File

@ -65,7 +65,6 @@ public class ComponentComparisonPageController extends PageController<Certificat
HashMap<String, Object> data = new HashMap<>(); HashMap<String, Object> data = new HashMap<>();
mav.addObject(MESSAGES_ATTRIBUTE, messages); mav.addObject(MESSAGES_ATTRIBUTE, messages);
mav.addObject(INITIAL_DATA, data);
// Check if parameters were set // Check if parameters were set
if (params.getSessionId() == null) { if (params.getSessionId() == null) {
String typeError = "ID was not provided"; String typeError = "ID was not provided";
@ -123,6 +122,8 @@ public class ComponentComparisonPageController extends PageController<Certificat
PlatformCredential platformCredential = null; PlatformCredential platformCredential = null;
List<ComponentAttributeResult> attributeResults = componentAttributeRepository List<ComponentAttributeResult> attributeResults = componentAttributeRepository
.findByProvisionSessionId(sessionId); .findByProvisionSessionId(sessionId);
data.put("deviceName", deviceName);
if (!attributeResults.isEmpty()) { if (!attributeResults.isEmpty()) {
ComponentResult componentResult = componentResultRepository.findById(attributeResults.get(0).getComponentId()).get(); ComponentResult componentResult = componentResultRepository.findById(attributeResults.get(0).getComponentId()).get();
platformCredential = platformCertificateRepository platformCredential = platformCertificateRepository
@ -132,6 +133,7 @@ public class ComponentComparisonPageController extends PageController<Certificat
if (platformCredential != null) { if (platformCredential != null) {
data.put("certificateId", platformCredential.getId()); data.put("certificateId", platformCredential.getId());
data.put("boardNumber", platformCredential.getPlatformSerial());
data.put("certificateSerialNumber", platformCredential.getSerialNumber()); data.put("certificateSerialNumber", platformCredential.getSerialNumber());
data.put("platformManufacturer", platformCredential.getManufacturer()); data.put("platformManufacturer", platformCredential.getManufacturer());
data.put("platformModel", platformCredential.getModel()); data.put("platformModel", platformCredential.getModel());
@ -146,7 +148,7 @@ public class ComponentComparisonPageController extends PageController<Certificat
tempIdList.add(dbObject.getComponentId()); tempIdList.add(dbObject.getComponentId());
} }
}); });
componentResultRepository componentResults = componentResultRepository
.findByBoardSerialNumber(platformCredential.getPlatformSerial()); .findByBoardSerialNumber(platformCredential.getPlatformSerial());
if (PciIds.DB.isReady()) { if (PciIds.DB.isReady()) {
componentResults = PciIds.translateResults(componentResults); componentResults = PciIds.translateResults(componentResults);

View File

@ -25,12 +25,12 @@
<div class="row"> <div class="row">
<div class="col-md-1 col-md-offset-1"><span class="colHeader">Support Component Objects</span></div> <div class="col-md-1 col-md-offset-1"><span class="colHeader">Support Component Objects</span></div>
<div id="measurements" class="col col-md-8"> <div id="measurements" class="col col-md-8">
<c:if test="${not empty initialData.hostName}"> <c:if test="${not empty initialData.deviceName}">
<div>Device:&nbsp;<span>${initialData.hostName}</span> <div>Device:&nbsp;<span>${initialData.deviceName}</span>
</div> </div>
</c:if> </c:if>
<c:if test="${not empty initialData.certificateId}"> <c:if test="${not empty initialData.certificateId}">
<div>Platform Certificate:&nbsp;<span><a href="${portal}/certificate-details?id=${initialData.certificateId}">${initialData.certificateFileName}</a></span> <div>Platform Certificate:&nbsp;<span><a href="${portal}/certificate-details?id=${initialData.certificateId}">${initialData.boardNumber}</a></span>
</div> </div>
</c:if> </c:if>
</div> </div>
@ -38,7 +38,7 @@
<br /> <br />
<div class="row" style="margin: auto 260px auto 125px"> <div class="row" style="margin: auto 260px auto 125px">
<div class="panel panel-default" style="flex: 1"> <div class="panel panel-default" style="flex: 1">
<div class="panel-heading">Client Log</div> <div class="panel-heading">Certificate Component</div>
<c:if test="${not empty initialData.componentResults}"> <c:if test="${not empty initialData.componentResults}">
<c:set var="iterator" value="0" scope="page"/> <c:set var="iterator" value="0" scope="page"/>
<c:forEach items="${initialData.componentResults}" var="componentResult"> <c:forEach items="${initialData.componentResults}" var="componentResult">
@ -49,12 +49,8 @@
<div style="display: flex 2; margin: 2px auto 2px 25px"> <div style="display: flex 2; margin: 2px auto 2px 25px">
<span class="mappedData">Manufacturer:</span> ${componentResult.getManufacturer()}<br /> <span class="mappedData">Manufacturer:</span> ${componentResult.getManufacturer()}<br />
<span class="mappedData">Model:</span> ${componentResult.getModel()}<br /> <span class="mappedData">Model:</span> ${componentResult.getModel()}<br />
<c:if test="${not empty fn:trim(componentResult.getSerialNumber())}"> <span class="mappedData">Serial Number:</span> ${componentResult.getSerialNumber()}<br />
<span class="mappedData">Serial Number:</span> ${component.getSerialNumber()}<br /> <span class="mappedData">Revision:</span> ${componentResult.getRevisionNumber()}<br />
</c:if>
<c:if test="${not empty fn:trim(componentResult.getRevisionNumber())}">
<span class="mappedData">Revision:</span> ${component.getRevisionNumber()}<br />
</c:if>
</div> </div>
</div> </div>
</div> </div>
@ -64,17 +60,11 @@
<span style="word-wrap: break-word"><a role="button" data-toggle="collapse" href="#eventContent${iterator}">${lEvent.getEventTypeString()}</a></span> <span style="word-wrap: break-word"><a role="button" data-toggle="collapse" href="#eventContent${iterator}">${lEvent.getEventTypeString()}</a></span>
</div> </div>
<div id="eventContent${iterator}" class="panel-collapse collapse in" style="flex: 2"> <div id="eventContent${iterator}" class="panel-collapse collapse in" style="flex: 2">
<c:forEach items="${initialData.eventTypeMap}" var="mappedDigest"> <c:forEach items="${initialData.componentInfos}" var="componentInfos">
<c:if test="${mappedDigest.key == lEvent.getEventDigestStr()}"> <span class="mappedData">Manufacturer:</span> ${componentInfos.getComponentManufacturer()}<br />
<c:set var="event" value="${mappedDigest.value}" scope="page"/> <span class="mappedData">Model:</span> ${componentInfos.getComponentModel()}<br />
<c:forEach items="${mappedDigest.value}" var="event"> <span class="mappedData">Serial Number:</span> ${componentInfos.getComponentSerial()}<br />
<div class="mappedOverhead"> <span class="mappedData">Revision:</span> ${componentInfos.getComponentRevision()}<br />
<div><span class="mappedData">PCR Index:</span> ${event.getPcrIndex()}</div>
<div><span class="mappedData">Digest:</span> ${event.getEventDigestStr()}</div>
<div><span class="mappedData">Event Content:</span> ${event.getEventContentStr()}</div>
</div>
</c:forEach>
</c:if>
</c:forEach> </c:forEach>
</div> </div>
</div> </div>