docs-v2/layouts/partials/footer/modals/influxdb-url.html

119 lines
5.9 KiB
HTML

{{ $latestInfluxDBVersion := cond (isset .Site.Data.products.influxdb "latest_override" ) .Site.Data.products.influxdb.latest_override .Site.Data.products.influxdb.latest }}
{{ $latestEnterpriseVersion := .Site.Data.products.enterprise_influxdb.latest }}
{{ $OSSLink := print "/influxdb/" $latestInfluxDBVersion "/reference/urls/ "}}
{{ $CloudLink := "/influxdb/cloud/reference/regions/" }}
{{ $EnterpriseLink := print "/enterprise_influxdb/" $latestEnterpriseVersion "/administration/config-data-nodes/#http-endpoint-settings" }}
{{ $isInfluxDB := cond (gt (len (findRE `^/influxdb/|^/enterprise_influxdb/` .RelPermalink)) 0) true false }}
{{ $isOSS := cond (in .RelPermalink "/influxdb/v") true false }}
{{ $isCloud := cond (in .RelPermalink "/influxdb/cloud/") true false }}
{{ $isEnterprise := cond (in .RelPermalink "/enterprise_influxdb/") true false }}
{{ .Scratch.Set "modalTitle" "Where are you running InfluxDB?" }}
{{ if $isOSS }}
{{ .Scratch.Set "modalTitle" "What is your InfluxDB OSS URL?"}}
{{ else if $isCloud }}
{{ .Scratch.Set "modalTitle" "Select your InfluxDB Cloud region" }}
{{ end }}
{{ .Scratch.Set "modalMessage" "Select your **InfluxDB Cloud region and cluster** or your **InfluxDB OSS URL** and we'll customize code examples for you. _[Identify your InfluxDB Cloud cluster](/influxdb/cloud/reference/regions/#regions-with-multiple-clusters)_." }}
{{ if $isOSS }}
{{ .Scratch.Set "modalMessage" "Customize your **InfluxDB OSS URL** and we'll update code examples for you." }}
{{ else if $isEnterprise }}
{{ .Scratch.Set "modalMessage" "Customize your **InfluxDB Enterprise URL** and we'll update code examples for you." }}
{{ else if $isCloud }}
{{ .Scratch.Set "modalMessage" "Select your **InfluxDB Cloud region and cluster** and we'll customize code examples for you. _[Identify your InfluxDB Cloud cluster](/influxdb/cloud/reference/regions/#regions-with-multiple-clusters)_." }}
{{ end }}
{{ .Scratch.Set "modalRefLinks" (print "[InfluxDB Cloud regions](" $CloudLink ") or [InfluxDB OSS URLs](" $OSSLink ")") }}
{{ if $isOSS }}
{{ .Scratch.Set "modalRefLinks" (print "[InfluxDB OSS URLs](" $OSSLink ")") }}
{{ else if $isEnterprise }}
{{ .Scratch.Set "modalRefLinks" (print "[InfluxDB Enterprise HTTP settings](" $EnterpriseLink ")") }}
{{ else if $isCloud }}
{{ .Scratch.Set "modalRefLinks" (print "[InfluxDB Cloud regions](" $CloudLink ")") }}
{{ end }}
{{ $modalTitle := .Scratch.Get "modalTitle" }}
{{ $modalMessage := .Scratch.Get "modalMessage" }}
{{ $modalRefLinks := .Scratch.Get "modalRefLinks" }}
{{ define "productSection" }}
{{ $p := .product }}
{{ $formID := .formID }}
{{ $initialState := .initialState | default "" }}
<div class="product {{ $initialState }}" id="{{ $formID }}-urls">
<div class="providers">
{{ range $p.providers }}
<div class="provider">
{{ if eq .name "Custom" }}
<h5>Custom</h5>
<ul>
<li class="custom">
<label for="{{ anchorize .name }}">
<input type="radio" name="influxdb-{{ $formID }}-url" id="{{ anchorize .name }}" value="{{ .url }}" checked>
<span class="radio"></span>
</label>
<form action="#" id="custom-url" data-message="">
<input type="text" name="custom-url-field" id="custom-url-field" placeholder="{{ .url }}">
</form>
</li>
</ul>
{{ else }}
<h5>{{ if .short_name}}{{ .short_name }}{{ else }}{{ .name }}{{ end }}</h5>
<ul>
{{ range .regions }}
<li class="region-group">
{{ if .clusters }}
<p class="region">
<span class="fake-radio"></span>
{{ .name }}
</p>
<ul class="clusters">
{{ range .clusters }}
<li>
<label for="{{ anchorize .name }}" {{ if .status }}class="{{ .status }}"{{ end }}>
<input type="radio" name="influxdb-{{ $formID }}-url" id="{{ anchorize .name }}" value="{{ .url }}" checked>
<span class="radio"></span>
{{ .name }}
</label>
</li>
{{ end }}
</ul>
{{ else }}
<label for="{{ anchorize .name }}" {{ if .status }}class="{{ .status }}"{{ end }}>
<input type="radio" name="influxdb-{{ $formID }}-url" id="{{ anchorize .name }}" value="{{ .url }}" checked>
<span class="radio"></span>
{{ .name }}
</label>
{{ end }}
</li>
{{ end }}
{{ end }}
</ul>
</div>
{{ end }}
</div>
</div>
{{ end }}
<div class="modal-content" id="influxdb-url-list">
<h3>{{ $modalTitle }}</h3>
<p>{{ $modalMessage | markdownify }}</p>
<div class="products">
{{ if not $isInfluxDB }}
<ul id="pref-tabs">
<li class="pref-tab active" id="pref-cloud"><span class="ephemeral">InfluxDB </span>Cloud</li>
<li class="pref-tab" id="pref-oss"><span class="ephemeral">InfluxDB </span>OSS or <span class="abbr">Ent</span><span class="ephemeral">erprise</span></li>
</ul>
{{ template "productSection" dict "product" .Site.Data.influxdb_urls.cloud "formID" "cloud" "initialState" "active"}}
{{ template "productSection" dict "product" .Site.Data.influxdb_urls.oss "formID" "oss" "initialState" "inactive"}}
{{ else if $isCloud }}
{{ template "productSection" dict "product" .Site.Data.influxdb_urls.cloud "formID" "cloud" }}
{{ else if or $isOSS $isEnterprise }}
{{ template "productSection" dict "product" .Site.Data.influxdb_urls.oss "formID" "oss" }}
{{ end }}
</div>
<p class="note">For more information, see {{ $modalRefLinks | markdownify }}.</p>
</div>