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

ui.sql.queryResult.ftl Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
<#-- @ftlvariable name="appUrl" type="com.infobip.kafkistry.webapp.url.AppUrl" -->
<#-- @ftlvariable name="result" type="com.infobip.kafkistry.sql.QueryResult" -->

<#function linkedTypeUrl type value>
    <#if value?is_string>
        <#assign valueStr = value>
    <#elseif value?is_boolean || value?is_number>
        <#assign valueStr = value?c>
    <#else>
        <#assign valueStr = "${value?no_esc?markup_string}">
    
    <#switch type>
        <#case "TOPIC">
            <#return appUrl.topics().showTopic(valueStr)>
        <#case "CLUSTER">
            <#return appUrl.clusters().showCluster(valueStr)>
        <#case "PRINCIPAL">
            <#return appUrl.acls().showAllPrincipalAcls(valueStr)>
        <#case "QUOTA_ENTITY">
            <#return appUrl.quotas().showEntity(valueStr)>
    
    <#return "">


<#function compoundLink type resource>
<#-- @ftlvariable name="resource" type="com.infobip.kafkistry.sql.LinkedResource" -->
    <#switch type.name()>
        <#case "CLUSTER_TOPIC">
            <#return appUrl.topics().showInspectTopicOnCluster(resource.topic, resource.cluster)>
        <#case "CLUSTER_GROUP">
            <#return appUrl.consumerGroups().showConsumerGroup(resource.cluster, resource.group)>
        <#case "PRINCIPAL_ACL">
            <#return appUrl.acls().showAllPrincipalAclsRule(resource.principal, resource.acl.toString())>
        <#case "PRINCIPAL_CLUSTER">
            <#return appUrl.acls().showAllPrincipalAclsCluster(resource.principal, resource.cluster)>
        <#case "KSTREAM_APP">
            <#return appUrl.kStream().showKStreamApp(resource.cluster, resource.kafkaStreamAppId)>
    
    <#return "">


<#function splitCamelCased string>
    <#return string?replace("(?<=[a-z])(?=[A-Z])", " ", "r")?split(" ")>


<#macro breakLongString string>
    <#assign parts = string?split("(?<=[,;-])", "r")>
    <#list parts as part>${part}


Got result set of ${result.count} rows<#if result.totalCount gt result.count>, total count without LIMIT would be ${result.totalCount}

<#list result.linkedCompoundTypes as type> <#list result.columns as column> <#if result.rows?size == 0> <#list result.rows as row> <#if result.linkedCompoundTypes??> <#list result.linkedCompoundTypes as type> <#list row.values as value> <#assign valueRaw><#t> <#if !(value??)><#t> null<#t> <#elseif value?is_string><#t> ${value}<#t> <#else><#t> ${value?c}<#t> <#t> <#assign columnMeta = result.columns[value?index]>
# ${type.name()?replace("_","-")?lower_case} <#assign parts = splitCamelCased(column.name)> <#list parts as part>${part}
(empty)
${row?index + 1} <#if row.linkedResource?? && row.linkedResource.types?seq_contains(type)> 🔍 <#else> --- <#if value??> <#assign valueDisplay> <#if value?is_boolean> ${value?c} <#elseif value?is_string> <@breakLongString string=value/> <#else> ${value} <#if result.columnLinkedType?keys?seq_contains(value?index)> <#assign columnLinkedType = result.columnLinkedType?api.get(value?index)> ${valueDisplay} <#else> ${valueDisplay} <#else> null




© 2015 - 2024 Weber Informatics LLC | Privacy Policy