2022-03-08 17:28:36 +00:00
|
|
|
{{! template-lint-disable no-duplicate-landmark-elements }}
|
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}}
|
2022-03-08 17:28:36 +00:00
|
|
|
{{! template-lint-disable simple-unless }}
|
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
|
|
|
{{#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}}
|
2022-02-25 14:24:37 +00:00
|
|
|
<a
|
|
|
|
href="/storybook/"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="navbar-item"
|
|
|
|
>
|
2021-11-22 21:54:00 +00:00
|
|
|
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}}
|
2022-02-25 14:24:37 +00:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
2022-02-10 15:55:32 +00:00
|
|
|
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}}
|
2022-02-25 14:24:37 +00:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
2022-02-10 15:55:32 +00:00
|
|
|
class="navbar-item"
|
|
|
|
>
|
2021-11-22 21:54:00 +00:00
|
|
|
Vault
|
|
|
|
</a>
|
|
|
|
{{/if}}
|
2022-02-25 14:24:37 +00:00
|
|
|
<a
|
|
|
|
href="https://nomadproject.io/docs"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
class="navbar-item"
|
|
|
|
>
|
2021-11-22 21:54:00 +00:00
|
|
|
Documentation
|
|
|
|
</a>
|
2022-11-28 15:44:52 +00:00
|
|
|
{{#if this.shouldShowProfileNav}}
|
|
|
|
<ProfileNavbarItem />
|
|
|
|
{{/if}}
|
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>
|