-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sidebranch: Setup Replication Page as component to be consumed in all…
… pages for project (#8661) * setup, not complete * update routing * clean up * add test * add link from status menu * clean up * fixes per pr comments * setup dashboard with contextual components, and toggle * setup option to show tabs or not * handle conditional nav menu * pass in whole model object * rename to replication-page * clean up * clean up based on pr feedback * fix linting error
- Loading branch information
1 parent
e51ba17
commit 72f2743
Showing
7 changed files
with
106 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
checkedValue: false, | ||
}); |
10 changes: 10 additions & 0 deletions
10
ui/app/routes/vault/cluster/replication-dr-promote/details.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { inject as service } from '@ember/service'; | ||
import Base from '../cluster-route-base'; | ||
|
||
export default Base.extend({ | ||
replicationMode: service(), | ||
beforeModel() { | ||
this._super(...arguments); | ||
this.get('replicationMode').setMode('dr'); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{{yield (hash | ||
header=(component 'replication-page/replication-header') | ||
toggle=(component 'replication-page/replication-toggle') | ||
)}} |
66 changes: 66 additions & 0 deletions
66
ui/app/templates/components/replication-page/replication-header.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{!-- DR Secondary has a different Nav Header with access only to the Status menu --}} | ||
{{!-- ARG TODO all links are hard coded as well as titles right now, they will need to by dynamic --}} | ||
{{#if (and (eq model.rm.mode 'dr') (eq model.dr.mode 'secondary') )}} | ||
<NavHeader as |Nav|> | ||
<Nav.home> | ||
<HomeLink @class="navbar-item splash-page-logo has-text-white"> | ||
<LogoEdition /> | ||
</HomeLink> | ||
</Nav.home> | ||
<Nav.items> | ||
<div class="navbar-item status-indicator-button" data-status="{{if model.unsealed "good" "bad"}}"> | ||
<StatusMenu @label="Status" @onLinkClick={{action Nav.closeDrawer}} /> | ||
</div> | ||
</Nav.items> | ||
</NavHeader> | ||
{{/if}} | ||
|
||
<PageHeader as |p|> | ||
<p.top> | ||
{{#key-value-header | ||
baseKey=baseKey | ||
path="vault.cluster.replication-dr-promote" | ||
root=backendCrumb | ||
}} | ||
<li> | ||
<span class="sep"> | ||
/ | ||
</span> | ||
{{#link-to "vault.cluster.replication-dr-promote"}} | ||
Disaster Recovery | ||
{{/link-to}} | ||
</li> | ||
{{/key-value-header}} | ||
</p.top> | ||
<p.levelLeft> | ||
<h1 class="title is-3"> | ||
Details | ||
<span class="tag"> | ||
{{model.dr.mode}} | ||
</span> | ||
<span class="tag"> | ||
{{model.dr.clusterIdDisplay}} | ||
</span> | ||
</h1> | ||
</p.levelLeft> | ||
</PageHeader> | ||
|
||
{{#if showTabs}} | ||
<div class="tabs-container box is-bottomless is-marginless is-fullwidth is-paddingless"> | ||
<nav class="tabs"> | ||
<ul> | ||
{{!-- TODO should map over array of options with link and title --}} | ||
{{#link-to | ||
"vault.cluster.replication-dr-promote" | ||
tagName="li" | ||
activeClass="is-active" | ||
current-when="" | ||
}} | ||
{{#link-to "vault.cluster.replication-dr-promote"}} | ||
Details | ||
{{/link-to}} | ||
{{/link-to}} | ||
</ul> | ||
</nav> | ||
</div> | ||
{{/if}} |
5 changes: 5 additions & 0 deletions
5
ui/app/templates/components/replication-page/replication-toggle.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Toolbar> | ||
<ToolbarActions> | ||
<Toggle @tagName="name" @checked={{checkedValue}} @onChange={{action (mut checkedValue)}}> Auto-refresh {{if checkedValue 'on' 'off'}}</Toggle> | ||
</ToolbarActions> | ||
</Toolbar> |
26 changes: 13 additions & 13 deletions
26
ui/app/templates/vault/cluster/replication-dr-promote/details.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<SplashPage as |Page|> | ||
<Page.header> | ||
<h1 class="title is-4"> | ||
Disaster Recovery | ||
</h1> | ||
</Page.header> | ||
<Page.content> | ||
<LinkTo | ||
@params={{array "vault.cluster.replication-dr-promote"}} | ||
class="is-block">MEEP | ||
</LinkTo> | ||
</Page.content> | ||
</SplashPage> | ||
<section class="section"> | ||
<div class="container is-widescreen"> | ||
{{!-- ARG TODO setup error state and return --}} | ||
<ReplicationPage as |Page|> | ||
<Page.header | ||
@showTabs={{false}} | ||
@model={{model}} | ||
/> | ||
<Page.toggle /> | ||
<Page.content /> | ||
</ReplicationPage> | ||
</div> | ||
</section> |