[#ftl/]
[#-- @ftlvariable name="instance" type="io.fusionauth.api.domain.Instance" --]
[#-- @ftlvariable name="productInformation" type="io.fusionauth.api.domain.ProductInformation" --]
[#import "../../_layouts/admin.ftl" as layout/]
[#import "../../_utils/panel.ftl" as panel/]
[#import "../../_utils/properties.ftl" as properties/]
[#import "../../_utils/message.ftl" as message/]

[@layout.html]
  [@layout.head/]
  [@layout.body]
    [@layout.pageHeader breadcrumbs={"": "system", "/admin/system/about": "about"}/]
    [@layout.main]
      [@panel.full titleKey="support-information"]
        <fieldset>
          [@properties.table]
            [@properties.row nameKey="support-id" value=properties.display(instance, "supportId", "No support contract in place" false)/]
          [/@properties.table]
        </fieldset>
      [/@panel.full]

      [@panel.full titleKey="product-information"]
        <fieldset>
          [@properties.table]
            [@properties.rowEval nameKey="version" object=productInformation propertyName="currentProductVersion"/]
            [#if productInformation.productUpdateAvailable]
              [@properties.row nameKey="latest-version" value="${productInformation.latestProductVersion}"/]
            [#else]
              [@properties.row nameKey="latest-version" value="<i class=\"fa fa-check green-text\"></i>"/]
            [/#if]
            [@properties.row nameKey="nodes" value=productInformation.nodes?size /]
          [/@properties.table]
        </fieldset>

        [#list productInformation.nodes as node]
          <h3>[@message.print key="node"/][#if productInformation.nodes?size > 1]${node?index + 1}[/#if]</h3>
          <fieldset>
            [@properties.table]
              [#list productInformation.nodes as node]
                  [@properties.rowEval nameKey="startup" object=node propertyName="insertInstant" /]
                  [@properties.rowEval nameKey="uptime" object=node propertyName="uptimeInDays" /]
                   [#if productInformation.nodes?size > 1]
                     [@properties.rowEval nameKey="me" object=node propertyName="me" /]
                   [/#if]
              [/#list]
            [/@properties.table]
          </fieldset>
        [/#list]
      [/@panel.full]

      [@panel.full titleKey="system-information"]
        <fieldset>
          [@properties.table]
            [@properties.row nameKey="dbEngine" value=message.inline(productInformation.dbEngine)/]
          [/@properties.table]
        </fieldset>
      [/@panel.full]

    [/@layout.main]
  [/@layout.body]
[/@layout.html]