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

161 lines
8.1 KiB
HTML

{{ $OSSLink := print "/influxdb/v2/reference/urls/ "}}
{{ $CloudLink := "/influxdb/cloud/reference/regions/" }}
{{ $ServerlessLink := "/influxdb/cloud-serverless/reference/regions/" }}
{{ $EnterpriseLink := print "/enterprise_influxdb/v1/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 }}
{{ $isServerless := cond (in .RelPermalink "/influxdb/cloud-serverless/") true false }}
{{ $isDedicated := cond (in .RelPermalink "/influxdb/cloud-dedicated/") true false }}
{{ $isClustered := cond (in .RelPermalink "/influxdb/clustered/") 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" }}
{{ else if $isServerless }}
{{ .Scratch.Set "modalTitle" "Select your InfluxDB Cloud Serverless region" }}
{{ else if $isDedicated }}
{{ .Scratch.Set "modalTitle" "What is your InfluxDB Cloud Dedicated cluster URL?" }}
{{ else if $isClustered }}
{{ .Scratch.Set "modalTitle" "What is your InfluxDB cluster URL?" }}
{{ 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)_." }}
{{ else if $isServerless }}
{{ .Scratch.Set "modalMessage" "Select your **InfluxDB Cloud Serverless region** and we'll customize code examples for you." }}
{{ else if $isDedicated }}
{{ .Scratch.Set "modalMessage" "Enter your **InfluxDB Cloud Dedicated cluster URL** and we'll update code examples for you." }}
{{ else if $isClustered }}
{{ .Scratch.Set "modalMessage" "Enter your **InfluxDB cluster URL** and we'll update code examples for you." }}
{{ 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 $isServerless }}
{{ .Scratch.Set "modalRefLinks" (print "[InfluxDB Cloud Serverless regions](" $ServerlessLink ")") }}
{{ 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 }}
{{ $filterServerless := .filterServerless | default false }}
{{ $formID := .formID }}
{{ $initialState := .initialState | default "" }}
<div class="product {{ $initialState }}" id="{{ $formID }}-urls">
<div class="providers">
{{ $providers := cond ($filterServerless) (where $p.providers "iox" true) $p.providers }}
{{ range $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>
{{ $regions := cond ($filterServerless) (where .regions "iox" true) .regions }}
{{ 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 }}
{{ define "productSpecificForm" }}
{{ $p := .product }}
{{ $formID := .formID }}
{{ $placeholder := .placeholder }}
{{ $initialState := .initialState | default "" }}
<div class="product {{ $initialState }}" id="{{ $formID }}-urls">
<div class="providers">
<div class="provider">
<h5>Enter cluster URL</h5>
<form action="#" id="custom-url" data-message="">
<input type="text" name="influxdb-{{ $formID }}-url" id="{{ $formID }}-url-field" placeholder="{{ $placeholder}}">
</form>
</div>
</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" "filterServerless" $isServerless }}
{{ 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" "filterServerless" $isServerless }}
{{ else if or $isOSS $isEnterprise }}
{{ template "productSection" dict "product" .Site.Data.influxdb_urls.oss "formID" "oss" }}
{{ else if $isServerless }}
{{ template "productSection" dict "product" .Site.Data.influxdb_urls.cloud "formID" "serverless" "filterServerless" true }}
{{ else if $isDedicated }}
{{ template "productSpecificForm" dict "product" nil "formID" "dedicated" "placeholder" "cluster-id.a.influxdb.io" }}
{{ else if $isClustered }}
{{ template "productSpecificForm" dict "product" nil "formID" "clustered" "placeholder" "cluster-host.com" }}
{{ end }}
</div>
{{ if not (or $isDedicated $isClustered) }}<p class="note">For more information, see {{ $modalRefLinks | markdownify }}.</p>{{ end }}
</div>