ui.clusters.dryRunInspect.ftl Maven / Gradle / Ivy
<#-- @ftlvariable name="appUrl" type="com.infobip.kafkistry.webapp.url.AppUrl" -->
<#-- @ftlvariable name="clusterIdentifier" type="java.lang.String" -->
<#-- @ftlvariable name="clusterDryRunInspect" type="com.infobip.kafkistry.service.cluster.ClusterDryRunInspect" -->
<#import "../common/util.ftl" as util>
<#import "../quotas/util.ftl" as quotaUtil>
<#if clusterDryRunInspect.errors?size gt 0>
WARNING Having ${clusterDryRunInspect.errors?size} errors
<#list clusterDryRunInspect.errors as error>
${error}
#list>
#if>
Current disk resource usage
<#assign clusterResources = clusterDryRunInspect.clusterDiskUsageBefore>
<#include "resourcesInspect.ftl">
Effective disk resource usage
<#assign clusterResources = clusterDryRunInspect.clusterDiskUsageAfter>
<#include "resourcesInspect.ftl">
Diff disk resource usage (effective vs. current)
<#assign clusterResources = clusterDryRunInspect.clusterDiskUsageDiff>
<#assign diffModeEnabled = true>
<#include "resourcesInspect.ftl">
<#assign diffModeEnabled = false>
<#macro showDiff diff stateClass>
<#switch stateClass>
<#case "alert-danger">
<#case "alert-warnig">
<#assign sentiment = "NEGATIVE">
<#break>
<#case "alert-success">
<#assign sentiment = "POSITIVE">
<#break>
<#default>
<#assign sentiment = "NEUTRAL">
#switch>
<#assign textClass = "">
<#if sentiment == "NEGATIVE" && (diff gt 0)>
<#assign textClass = "text-danger">
<#elseif sentiment == "NEGATIVE" && (diff lt 0)>
<#assign textClass = "text-success">
<#elseif sentiment == "POSITIVE" && (diff gt 0)>
<#assign textClass = "text-success">
<#elseif sentiment == "POSITIVE" && (diff lt 0)>
<#assign textClass = "text-danger">
<#else>
<#if diff gt 0>
<#assign textClass = "text-primary">
<#else>
<#assign textClass = "text-info">
#if>
#if>
<#if diff gt 0>
+${diff}
<#elseif diff lt 0>
${diff}
<#else>
---
#if>
#macro>
<#macro topicsList topics title topicDisks>
<#-- @ftlvariable name="topicDisks" type="java.util.Map>" -->
▼
△
Topic
Replica count diff
Actual usage diff
Possible usage diff
Unbounded usage diff
<#list topics as topic>
${topic}
<#if (topicDisks[topic].value)??>
<#assign topicDisk = topicDisks[topic].value>
<#assign diffModeEnabled = true>
${util.numberToString(topicDisk.combined.replicasCount, true)}
<#if topicDisk.combined.actualUsedBytes??>
${util.prettyDataSize(topicDisk.combined.actualUsedBytes, true)}
<#else>
---
#if>
<#if topicDisk.combined.retentionBoundedBytes??>
${util.prettyDataSize(topicDisk.combined.retentionBoundedBytes, true)}
<#else>
---
#if>
<#if topicDisk.combined.unboundedUsageBytes??>
${util.prettyDataSize(topicDisk.combined.unboundedUsageBytes, true)}
<#else>
---
#if>
<#assign diffModeEnabled = false>
<#else>
<#if (topicDisks[topic].absentReason)??>
${topicDisks[topic].absentReason}
<#else>
---
#if>
#if>
#list>
#macro>
<#macro aclsList acls title>
▼
△
<#list acls as acl>
-
${acl.toString()}
#list>
#macro>
<#macro quotasList quotas title>
▼
△
<#list quotas as entity>
-
<@quotaUtil.entity entity = entity/>
#list>
#macro>
<#assign topicsDiff = clusterDryRunInspect.topicsDiff>
Topics diff
<#if topicsDiff.problems?size gt 0>
WARNING Having ${topicsDiff.problems?size} problems
<#list topicsDiff.problems as problem>
${problem}
#list>
#if>
Topic status type
Current count
Count after
Diff
<#list topicsDiff.statusCounts as stateTypeCountDiff>
<#assign stateType = stateTypeCountDiff.type>
<#assign countDiff = stateTypeCountDiff.quantity>
<#assign stateClass = util.levelToHtmlClass(stateType.level)>
${stateType.name}
${countDiff.before}
${countDiff.after}
<@showDiff diff = countDiff.diff stateClass = stateClass/>
#list>
<#if topicsDiff.topicsToCreate?size gt 0>
<@topicsList topics=topicsDiff.topicsToCreate title="topics to create" topicDisks=topicsDiff.topicDiskUsages/>
#if>
<#if topicsDiff.topicsToDelete?size gt 0>
<@topicsList topics=clusterDryRunInspect.topicsDiff.topicsToDelete title="topics to delete" topicDisks=topicsDiff.topicDiskUsages/>
#if>
<#if topicsDiff.topicsToReconfigure?size gt 0>
<@topicsList topics=topicsDiff.topicsToReconfigure title="topics to re-configure" topicDisks=topicsDiff.topicDiskUsages/>
#if>
<#if clusterDryRunInspect.topicsDiff.topicsToReScale?size gt 0>
<@topicsList topics=topicsDiff.topicsToReScale title="topics to re-scale" topicDisks=topicsDiff.topicDiskUsages/>
#if>
ACLs diff
ACL status type
Current count
Count after
Diff
<#list clusterDryRunInspect.aclsDiff.statusCounts as stateTypeCountDiff>
<#assign stateType = stateTypeCountDiff.type>
<#assign countDiff = stateTypeCountDiff.quantity>
<#assign stateClass = util.levelToHtmlClass(stateType.level)>
${stateType.name}
${countDiff.before}
${countDiff.after}
<@showDiff diff = countDiff.diff stateClass = stateClass/>
#list>
<#if clusterDryRunInspect.aclsDiff.aclsToCreate?size gt 0>
<@aclsList acls=clusterDryRunInspect.aclsDiff.aclsToCreate title="ACLs to create"/>
#if>
<#if clusterDryRunInspect.aclsDiff.aclsToDelete?size gt 0>
<@aclsList acls=clusterDryRunInspect.aclsDiff.aclsToDelete title="ACLs to delete"/>
#if>
Quotas diff
Entity quotas status type
Current count
Count after
Diff
<#list clusterDryRunInspect.quotasDiff.statusCounts as stateTypeCountDiff>
<#assign stateType = stateTypeCountDiff.type>
<#assign countDiff = stateTypeCountDiff.quantity>
<#assign stateClass = util.levelToHtmlClass(stateType.level)>
${stateType.name}
${countDiff.before}
${countDiff.after}
<@showDiff diff = countDiff.diff stateClass = stateClass/>
#list>
<#if clusterDryRunInspect.quotasDiff.quotasToCreate?size gt 0>
<@quotasList quotas=clusterDryRunInspect.quotasDiff.quotasToCreate title="quotas to create"/>
#if>
<#if clusterDryRunInspect.quotasDiff.quotasToDelete?size gt 0>
<@quotasList quotas=clusterDryRunInspect.quotasDiff.quotasToDelete title="quotas to delete"/>
#if>
<#if clusterDryRunInspect.quotasDiff.quotasToReconfigure?size gt 0>
<@quotasList quotas=clusterDryRunInspect.quotasDiff.quotasToReconfigure title="quotas to re-configure"/>
#if>