All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ui.clusters.clusterNodesList.ftl Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
<#-- @ftlvariable name="clusterInfo" type="com.infobip.kafkistry.kafka.ClusterInfo" -->

<#macro clusterNodeId nodeId>
    <#assign online = clusterInfo.onlineNodeIds?seq_contains(nodeId)>
    <#assign controller = clusterInfo.controllerId == nodeId>
    <#assign rackSet = false>
    <#assign processRoles = []>
    <#list clusterInfo.nodes as node>
        <#if node.nodeId == nodeId>
            <#assign processRoles = node.roles>
            <#if node.rack??>
                <#assign rackSet = true>
                <#assign brokerRack = node.rack>
            
        
    
    <#if clusterInfo.kraftEnabled>
        <#assign voter = false>
        <#assign observer = false>
        <#list clusterInfo.quorumInfo.voters as replica>
            <#assign voter = voter || replica.replicaId == nodeId>
        
        <#list clusterInfo.quorumInfo.observers as replica>
            <#assign observer = observer || replica.replicaId == nodeId>
        
        <#assign quorumRole = voter?then("VOTER", observer?then("OBSERVER", "NONE"))>
        <#assign isBroker = processRoles?seq_contains("BROKER")>
        <#assign isController = processRoles?seq_contains("CONTROLLER")>
        <#assign availableStatus = online?then("ONLINE", "OFFLINE")>
        <#assign tooltip = processRoles?join("&")?lower_case + " ${availableStatus}, quorum role: ${quorumRole}">
        <#if !online>
            <#assign alertClass = "alert-danger">
        <#elseif isBroker && isController>
            <#assign alertClass = "alert-primary">
        <#elseif voter>
            <#assign alertClass = "alert-info">
        <#elseif observer>
            <#assign alertClass = "alert-success">
        <#else>
            <#assign alertClass = "alert-warning">
        
    <#else>
        <#assign alertClass = controller?then("alert-primary", online?then("alert-success", "alert-danger"))>
        <#assign tooltip = controller?then("node ${nodeId}: CONTROLLER", online?then("broker ${nodeId}: ONLINE", "node ${nodeId}: OFFLINE"))>
    
    
        ${nodeId?c}
        <#if rackSet>
            
${brokerRack}
<#list clusterInfo.nodeIds as nodeId> <@clusterNodeId nodeId=nodeId/>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy