ui: Checks env CONSUL_UI_DISABLE_REALTIME to show/hide blocking queries toggle (#7099)

Adds a conditional that checks env CONSUL_UI_DISABLE_REALTIME to show/hide the Blocking Queries toggle in the Settings page.
This commit is contained in:
Kenia 2020-01-22 09:19:01 -05:00 committed by GitHub
parent afafe677a3
commit b836a772fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -2,7 +2,7 @@
{{#app-view class="settings show"}} {{#app-view class="settings show"}}
{{#block-slot name='header'}} {{#block-slot name='header'}}
<h1> <h1>
Settings Settings
</h1> </h1>
{{/block-slot}} {{/block-slot}}
{{#block-slot name='content'}} {{#block-slot name='content'}}
@ -16,24 +16,26 @@
<fieldset> <fieldset>
<h2>Dashboard Links</h2> <h2>Dashboard Links</h2>
<p> <p>
Add a link to the service detail page in the UI to get quick access to a service-wide metrics dashboard. Enter the dashboard URL into the field below. You can use the placeholders <code>{{'{{Datacenter}}'}}</code> and <code>{{'{{Service.Name}}'}}</code> which will be replaced with the name of the datacenter/service currently being viewed. Add a link to the service detail page in the UI to get quick access to a service-wide metrics dashboard. Enter the dashboard URL into the field below. You can use the placeholders <code>{{'{{Datacenter}}'}}</code> and <code>{{'{{Service.Name}}'}}</code> which will be replaced with the name of the datacenter/service currently being viewed.
</p> </p>
<label class={{concat (if confirming 'confirming') ' type-text'}} id="urls_service"> <label class={{concat (if confirming 'confirming') ' type-text'}} id="urls_service">
<span>Link template for services</span> <span>Link template for services</span>
<input type="text" name="urls[service]" value={{item.urls.service}} onchange={{action 'change'}} onkeypress={{action 'key'}} onkeydown={{action 'key'}} /> <input type="text" name="urls[service]" value={{item.urls.service}} onchange={{action 'change'}} onkeypress={{action 'key'}} onkeydown={{action 'key'}} />
<em>e.g. https://grafana.example.com/d/1/consul-service-mesh&amp;orgid=1&amp;datacenter={{ '{{Datacenter}}' }}&amp;service-name={{ '{{Service.Name}}' }}</em> <em>e.g. https://grafana.example.com/d/1/consul-service-mesh&amp;orgid=1&amp;datacenter={{'{{Datacenter}}'}}&amp;service-name={{'{{Service.Name}}'}}</em>
</label> </label>
</fieldset> </fieldset>
{{#if (not (env 'CONSUL_UI_DISABLE_REALTIME'))}}
<fieldset> <fieldset>
<h2>Blocking Queries</h2> <h2>Blocking Queries</h2>
<p>Keep catalog info up-to-date without refreshing the page. Any changes made to services and nodes would be reflected in real time.</p> <p>Keep catalog info up-to-date without refreshing the page. Any changes made to services and nodes would be reflected in real time.</p>
<div class="type-toggle"> <div class="type-toggle">
<label> <label>
<input type="checkbox" name="client[blocking]" checked={{if item.client.blocking 'checked' }} onchange={{action 'change'}} /> <input type="checkbox" name="client[blocking]" checked={{if item.client.blocking 'checked'}} onchange={{action 'change'}} />
<span>{{if item.client.blocking 'On' 'Off' }}</span> <span>{{if item.client.blocking 'On' 'Off'}}</span>
</label> </label>
</div> </div>
</fieldset> </fieldset>
{{/if}}
</form> </form>
{{/block-slot}} {{/block-slot}}
{{/app-view}} {{/app-view}}