ui.quotas.entity.ftl Maven / Gradle / Ivy
<#-- @ftlvariable name="lastCommit" type="java.lang.String" -->
<#-- @ftlvariable name="appUrl" type="com.infobip.kafkistry.webapp.url.AppUrl" -->
<#-- @ftlvariable name="entityInspection" type="com.infobip.kafkistry.service.quotas.EntityQuotasInspection" -->
<#-- @ftlvariable name="pendingEntityQuotasRequests" type="java.util.List" -->
<#-- @ftlvariable name="gitStorageEnabled" type="java.lang.Boolean" -->
<#include "../commonResources.ftl"/>
Kafkistry: Quotas entity
<#include "../commonMenu.ftl">
<#import "../common/util.ftl" as util>
<#import "util.ftl" as quotaUtil>
<#include "../common/backBtn.ftl">
Client entity quotas over clusters
<#assign entityID = entityInspection.entity.asID()>
<#assign existInRegistry = entityInspection.quotaDescription??>
Quotas entity
<@quotaUtil.entity entity = entityInspection.entity/>
Entity in registry
<@util.inRegistry flag = existInRegistry/>
OK
<@util.ok ok = entityInspection.status.ok/>
Owner
<#if existInRegistry>
${entityInspection.quotaDescription.owner}
<#else>
[none]
#if>
<#if existInRegistry>
Presence
<@util.presence presence = entityInspection.quotaDescription.presence/>
#if>
Actions
<#if existInRegistry>
Delete from registry...
Edit entity quotas...
#if>
<#assign entityActions = util.enumListToStringList(entityInspection.availableOperations)>
<#if !existInRegistry && entityActions?seq_contains("IMPORT_CLIENT_QUOTAS")>
Import to registry...
#if>
<#if existInRegistry && entityActions?seq_contains("EDIT_CLIENT_QUOTAS")>
Suggest edit...
#if>
<#if existInRegistry && entityActions?seq_contains("CREATE_MISSING_QUOTAS")>
Create quotas where missing...
#if>
<#if existInRegistry && entityActions?seq_contains("ALTER_WRONG_QUOTAS")>
Alter all wrong quotas...
#if>
<#if entityActions?seq_contains("DELETE_UNWANTED_QUOTAS")>
Delete all unwanted quotas...
#if>
<#if gitStorageEnabled>
Pending changes
<#assign pendingRequests = pendingEntityQuotasRequests>
<#include "../common/pendingChanges.ftl">
#if>
Status per cluster
Cluster
Status
Producer rate
Consumer rate
Request percentage
<#macro quotaValues inspection name suffix>
<#assign expected>
<@quotaUtil.quotaValue inspection=inspection source="expectedQuota" name=name suffix=suffix/>
#assign>
<#assign actual>
<@quotaUtil.quotaValue inspection=inspection source="actualQuota" name=name suffix=suffix/>
#assign>
<#if expected?markup_string == actual?markup_string>
${expected}
<#else>
Expected: ${expected}
Actual: ${actual}
#if>
#macro>
<#list entityInspection.clusterInspections as inspection>
${inspection.clusterIdentifier}
<@util.namedTypeStatusAlert type = inspection.statusType/>
<#assign hasWrongValue = inspection.statusType.name == "WRONG_VALUE">
<#assign producerByteRateMismatched = hasWrongValue && !inspection.valuesInspection.producerByteRateOk>
<#assign consumerByteRateMismatched = hasWrongValue && !inspection.valuesInspection.consumerByteRateOk>
<#assign requestPercentageMismatched = hasWrongValue && !inspection.valuesInspection.requestPercentageOk>
<@quotaValues inspection=inspection name="producerByteRate" suffix=""/>
<@quotaValues inspection=inspection name="consumerByteRate" suffix=""/>
<@quotaValues inspection=inspection name="requestPercentage" suffix="%"/>
#list>
Affected principals
<#if entityInspection.affectedPrincipals?size == 0>
(none)
<#else>
Principal
Affected on clusters
<#list entityInspection.affectedPrincipals as principal, presence>
${principal}
<@util.presence presence=presence/>
#list>
#if>
<#if existInRegistry>
<#if gitStorageEnabled>
<#assign historyUrl = appUrl.quotas().showEntityHistory(entityID)>
<#include "../git/entityHistoryContainer.ftl">
#if>
#if>
<#include "../common/pageBottom.ftl">