docs-v2/layouts/shortcodes/cloud_regions.html

103 lines
3.3 KiB
HTML

{{ $type := .Get "type" | default "table" }}
{{ $scratch := newScratch }}
{{ if eq $type "table"}}
{{ range .Site.Data.influxdb_urls.cloud.providers }}
{{ $scratch.Set "title" .name }}
{{ if not (in .name .short_name) }}
{{ $scratch.Set "title" (print .name " (" .short_name ")")}}
{{ end }}
{{ $title := $scratch.Get "title" }}
{{ $titleID := anchorize $title }}
<h3 id="{{ $titleID }}">{{ $title }}</h3>
<table class="cloud-urls">
<thead>
<th align="left">Region</th>
<th align="left">Location</th>
<th align="left">URL(s)</th>
</thead>
{{ range .regions }}
<tr>
<td {{ if .status }}class="{{ .status }}"{{ end }}>{{ .name }}</td>
<td>{{ .location }}</td>
<td>
{{ if .clusters }}
{{ range .clusters }}
<p><span class="cluster-name">{{ .name }}:</span> <a href="{{ .url }}">{{ .url }}</a></p>
{{ end }}
{{ else }}
<a href="{{ .url }}">{{ .url }}</a>
{{ end }}
</td>
</tr>
{{ end }}
</table>
{{ end }}
{{ else if eq $type "list" }}
<ul>
{{ range .Site.Data.influxdb_urls.cloud.providers }}
{{ $scratch.Set "title" .name }}
{{ if not (in .name .short_name) }}
{{ $scratch.Set "title" (print .name " (" .short_name ")")}}
{{ end }}
{{ $title := $scratch.Get "title" }}
<li><strong>{{ $title }}</strong>
<ul>
{{ range .regions }}
<li {{ if .status }}class="{{ .status }}"{{ end }}>{{ .name }}</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
{{ else if eq $type "iox-list" }}
<ul>
{{ range where .Site.Data.influxdb_urls.cloud.providers "iox" true }}
{{ $scratch.Set "title" .name }}
{{ if not (in .name .short_name) }}
{{ $scratch.Set "title" (print .name " (" .short_name ")")}}
{{ end }}
{{ $title := $scratch.Get "title" }}
<li><strong>{{ $title }}</strong>
<ul>
{{ range where .regions "iox" true }}
<li {{ if .status }}class="{{ .status }}"{{ end }}>{{ .name }}</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
{{ else if eq $type "iox-table"}}
{{ range where .Site.Data.influxdb_urls.cloud.providers "iox" true }}
{{ $scratch.Set "title" .name }}
{{ if not (in .name .short_name) }}
{{ $scratch.Set "title" (print .name " (" .short_name ")")}}
{{ end }}
{{ $title := $scratch.Get "title" }}
{{ $titleID := anchorize $title }}
<h3 id="{{ $titleID }}">{{ $title }}</h3>
<table class="cloud-urls">
<thead>
<th align="left">Region</th>
<th align="left">Location</th>
<th align="left">URL(s)</th>
</thead>
{{ range where .regions "iox" true }}
<tr>
<td {{ if .status }}class="{{ .status }}"{{ end }}>{{ .name }}</td>
<td>{{ .location }}</td>
<td>
{{ if .clusters }}
{{ range .clusters }}
<p><span class="cluster-name">{{ .name }}:</span> <a href="{{ .url }}">{{ .url }}</a></p>
{{ end }}
{{ else }}
<a href="{{ .url }}">{{ .url }}</a>
{{ end }}
</td>
</tr>
{{ end }}
</table>
{{ end }}
{{ end }}