-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Splits Settings into 2 sections, sign-in/profile and user settings (#…
- Loading branch information
1 parent
cd8bacc
commit 3877fbf
Showing
14 changed files
with
147 additions
and
66 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
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
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,28 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
// @ts-check | ||
import Controller from '@ember/controller'; | ||
import { inject as service } from '@ember/service'; | ||
import { alias } from '@ember/object/computed'; | ||
|
||
export default class SettingsController extends Controller { | ||
@service keyboard; | ||
@service token; | ||
@service system; | ||
|
||
@alias('token.selfToken') tokenRecord; | ||
|
||
// Show sign-in if: | ||
// - User can't load agent config (meaning ACLs are enabled but they're not signed in) | ||
// - User can load agent config in and ACLs are enabled (meaning ACLs are enabled and they're signed in) | ||
// The excluded case here is if there is both an agent config and ACLs are disabled | ||
get shouldShowProfileLink() { | ||
return ( | ||
!this.system.agent?.get('config') || | ||
this.system.agent?.get('config.ACL.Enabled') === true | ||
); | ||
} | ||
} |
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
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,13 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
// @ts-check | ||
import Controller from '@ember/controller'; | ||
import localStorageProperty from 'nomad-ui/utils/properties/local-storage'; | ||
|
||
export default class SettingsUserSettingsController extends Controller { | ||
@localStorageProperty('nomadShouldWrapCode', false) wordWrap; | ||
@localStorageProperty('nomadLiveUpdateJobsIndex', true) liveUpdateJobsIndex; | ||
} |
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
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
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
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
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
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
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
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,35 @@ | ||
{{! | ||
Copyright (c) HashiCorp, Inc. | ||
SPDX-License-Identifier: BUSL-1.1 | ||
~}} | ||
|
||
{{page-title "User Settings"}} | ||
<section class="section"> | ||
<Hds::Alert @type="inline" @title="Local Storage Settings" as |A|> | ||
<A.Title>User Settings</A.Title> | ||
<A.Description>These settings will be saved to your browser settings via Local Storage.</A.Description> | ||
<A.Generic> | ||
<Hds::Separator/> | ||
<Hds::Form::Toggle::Group as |G|> | ||
<G.Toggle::Field | ||
name="word-wrap" | ||
@id="word-wrap" | ||
checked={{this.wordWrap}} | ||
{{on "change" (action (mut this.wordWrap) (not this.wordWrap))}} | ||
as |F|> | ||
<F.Label>Word Wrap</F.Label> | ||
<F.HelperText>Wrap lines of text in logs and exec terminals in the UI</F.HelperText> | ||
</G.Toggle::Field> | ||
<G.Toggle::Field | ||
name="jostle" | ||
@id="jostle" | ||
checked={{this.liveUpdateJobsIndex}} | ||
{{on "change" (action (mut this.liveUpdateJobsIndex) (not this.liveUpdateJobsIndex))}} | ||
as |F|> | ||
<F.Label>Live Updates to <LinkTo @route="jobs.index">Jobs Index</LinkTo></F.Label> | ||
<F.HelperText>When enabled, new or removed jobs will pop into and out of view on your jobs page. When disabled, you will be notified that changes are pending.</F.HelperText> | ||
</G.Toggle::Field> | ||
</Hds::Form::Toggle::Group> | ||
</A.Generic> | ||
</Hds::Alert> | ||
</section> |
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