2020-07-28 17:59:14 +00:00
|
|
|
<nav class="navbar is-primary" title="navigation">
|
2017-12-20 15:34:46 +00:00
|
|
|
<div class="navbar-brand">
|
2021-11-22 21:54:00 +00:00
|
|
|
<span
|
|
|
|
data-test-header-gutter-toggle
|
|
|
|
class="gutter-toggle"
|
|
|
|
aria-label="menu"
|
|
|
|
onclick={{action this.onHamburgerClick}}
|
|
|
|
>
|
2020-07-09 16:37:00 +00:00
|
|
|
<HamburgerMenu />
|
2018-07-26 00:06:39 +00:00
|
|
|
</span>
|
2020-07-28 17:59:14 +00:00
|
|
|
<LinkTo @route="jobs" class="navbar-item is-logo" aria-label="Home">
|
2020-07-09 16:37:00 +00:00
|
|
|
<NomadLogo />
|
2020-06-01 19:03:56 +00:00
|
|
|
</LinkTo>
|
2017-09-19 14:47:10 +00:00
|
|
|
</div>
|
ui: Change global search to use fuzzy search API (#10412)
This updates the UI to use the new fuzzy search API. Itās a drop-in
replacement so the / shortcut to jump to search is preserved, and
results can be cycled through and chosen via arrow keys and the
enter key.
It doesnāt use everything returned by the API:
* deployments and evaluations: these match by id, doesnāt seem like
people would know those or benefit from quick navigation to them
* namespaces: doesnāt seem useful as they currently function
* scaling policies
* tasks: the response doesnāt include an allocation id, which means they
canāt be navigated to in the UI without an additional query
* CSI volumes: arenāt actually returned by the API
Since thereās no API to check the server configuration and know whether
the feature has been disabled, this adds another query in
route:application#beforeModel that acts as feature detection: if the
attempt to query fails (500), the global search field is hidden.
Upon having added another query on load, I realised that beforeModel was
being triggered any time service:router#transitionTo was being called,
which happens upon navigating to a search result, for instance, because
of refreshModel being present on the region query parameter. This PR
adds a check for transition.queryParamsOnly and skips rerunning the
onload queries (token permissions check, license check, fuzzy search
feature detection).
Implementation notes:
* there are changes to unrelated tests to ignore the on-load feature
detection query
* some lifecycle-related guards against undefined were required to
address failures when navigating to an allocation
* the minimum search length of 2 characters is hard-coded as thereās
currently no way to determine min_term_length in the UI
2021-04-28 18:31:05 +00:00
|
|
|
{{#if this.system.fuzzySearchEnabled}}
|
|
|
|
{{#unless (media "isMobile")}}
|
|
|
|
<GlobalSearch::Control />
|
|
|
|
{{/unless}}
|
|
|
|
{{/if}}
|
2017-12-20 15:34:46 +00:00
|
|
|
<div class="navbar-end">
|
2020-12-07 14:33:49 +00:00
|
|
|
{{#if this.config.APP.showStorybookLink}}
|
2021-11-22 21:54:00 +00:00
|
|
|
<a href="/storybook/" class="navbar-item">
|
|
|
|
Storybook
|
|
|
|
</a>
|
2020-12-07 14:33:49 +00:00
|
|
|
{{/if}}
|
2021-11-30 18:20:29 +00:00
|
|
|
{{#if this.system.agent.config.UI.Consul.BaseUIURL}}
|
2022-02-10 15:55:32 +00:00
|
|
|
<a
|
|
|
|
data-test-header-consul-link
|
|
|
|
href={{this.system.agent.config.UI.Consul.BaseUIURL}}
|
|
|
|
class="navbar-item"
|
|
|
|
>
|
2021-11-22 21:54:00 +00:00
|
|
|
Consul
|
|
|
|
</a>
|
|
|
|
{{/if}}
|
2021-11-30 18:20:29 +00:00
|
|
|
{{#if this.system.agent.config.UI.Vault.BaseUIURL}}
|
2022-02-10 15:55:32 +00:00
|
|
|
<a
|
|
|
|
data-test-header-vault-link
|
|
|
|
href={{this.system.agent.config.UI.Vault.BaseUIURL}}
|
|
|
|
class="navbar-item"
|
|
|
|
>
|
2021-11-22 21:54:00 +00:00
|
|
|
Vault
|
|
|
|
</a>
|
|
|
|
{{/if}}
|
|
|
|
<a href="https://nomadproject.io/docs" class="navbar-item">
|
|
|
|
Documentation
|
|
|
|
</a>
|
|
|
|
<LinkTo @route="settings.tokens" class="navbar-item">
|
|
|
|
ACL Tokens
|
|
|
|
</LinkTo>
|
2017-09-19 14:47:10 +00:00
|
|
|
</div>
|
|
|
|
</nav>
|
2017-12-20 15:34:46 +00:00
|
|
|
<div class="navbar is-secondary">
|
2018-08-03 17:11:47 +00:00
|
|
|
<div class="navbar-item is-gutter">
|
2020-06-01 19:03:56 +00:00
|
|
|
<RegionSwitcher @decoration="is-outlined" />
|
2018-08-03 17:11:47 +00:00
|
|
|
</div>
|
2020-07-28 17:59:14 +00:00
|
|
|
<nav class="breadcrumb is-large" title="breadcrumb navigation">
|
2017-12-20 01:25:35 +00:00
|
|
|
<ul>
|
2017-09-19 14:47:10 +00:00
|
|
|
{{yield}}
|
2017-12-20 01:25:35 +00:00
|
|
|
</ul>
|
|
|
|
</nav>
|
2022-02-10 15:55:32 +00:00
|
|
|
</div>
|