ui.common.topicOnClusterStatus.ftl Maven / Gradle / Ivy
<#-- @ftlvariable name="topicOnClusterStatus" type="com.infobip.kafkistry.service.topic.TopicOnClusterInspectionResult" -->
<#import "../common/util.ftl" as util>
<#assign detailedStatuses = []>
<#list (topicOnClusterStatus.wrongValues)![] as wrongValue>
<#assign detailedStatuses = detailedStatuses + [wrongValue.type]>
#list>
<#list (topicOnClusterStatus.updateValues)![] as updateValue>
<#assign detailedStatuses = detailedStatuses + [updateValue.type]>
#list>
<#list (topicOnClusterStatus.ruleViolations)![] as ruleViolation>
<#assign detailedStatuses = detailedStatuses + [ruleViolation.type]>
#list>
<#list (topicOnClusterStatus.currentConfigRuleViolations)![] as ruleViolation>
<#assign detailedStatuses = detailedStatuses + [ruleViolation.type]>
#list>
<#list topicOnClusterStatus.typeDescriptions as typeDescription>
<#assign detailedStatuses = detailedStatuses + [typeDescription.type]>
#list>
<#list topicOnClusterStatus.types as statusType>
<#if !(detailedStatuses?seq_contains(statusType))>
<@util.namedTypeStatusAlert type=statusType/>
#if>
#list>
<#assign alertInline = false>
<#macro valueAssertDetail valueAssertion>
<#-- @ftlvariable name="valueAssertion" type="com.infobip.kafkistry.service.topic.WrongValueAssertion" -->
<#assign statusType = valueAssertion.type>
<@util.namedTypeStatusAlert type=statusType alertInline=false/>
<#assign wrongStatusType = !statusType.valid>
What: "${valueAssertion.key}"
<#if wrongStatusType>
Expected:
<#else>
New:
#if>
<#if valueAssertion.expectedDefault>
(to be default / not-overridden)
<#else>
${valueAssertion.expected}
#if>
<#if wrongStatusType>
Actual:
<#else>
Old:
#if>
${valueAssertion.actual}
<#if valueAssertion.message??>
Message: ${valueAssertion.message}
#if>
#macro>
<#if topicOnClusterStatus.wrongValues??>
<#list topicOnClusterStatus.wrongValues as wrongValue>
<#if wrongValue?is_first>
#if>
<@valueAssertDetail valueAssertion=wrongValue/>
#list>
#if>
<#if topicOnClusterStatus.updateValues??>
<#list topicOnClusterStatus.updateValues as updateValue>
<#if updateValue?is_first>
#if>
<@valueAssertDetail valueAssertion=updateValue/>
#list>
#if>
<#import "violaton.ftl" as violatonUtil>
<#if topicOnClusterStatus.ruleViolations??>
<#list topicOnClusterStatus.ruleViolations as ruleViolation>
<@util.namedTypeStatusAlert type=ruleViolation.type alertInline=false/>
<@violatonUtil.interpretMessage violation=ruleViolation.violation/>
#list>
#if>
<#if topicOnClusterStatus.currentConfigRuleViolations??>
<#list topicOnClusterStatus.currentConfigRuleViolations as ruleViolation>
<@util.namedTypeStatusAlert type=ruleViolation.type alertInline=false/>
<@violatonUtil.interpretMessage violation=ruleViolation.violation/>
#list>
#if>
<#if topicOnClusterStatus.typeDescriptions?size gt 0>
<#list topicOnClusterStatus.typeDescriptions as typeDescription>
<@util.namedTypeStatusAlert type=typeDescription.type alertInline=false/>
<@violatonUtil.richMessage message=typeDescription.message placeholders=typeDescription.placeholders/>
#list>
#if>