github.com/hernad/nomad@v1.6.112/ui/app/components/global-header.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 import Component from '@ember/component'; 7 import classic from 'ember-classic-decorator'; 8 import { inject as service } from '@ember/service'; 9 import { attributeBindings } from '@ember-decorators/component'; 10 import { htmlSafe } from '@ember/template'; 11 12 @classic 13 @attributeBindings('data-test-global-header') 14 export default class GlobalHeader extends Component { 15 @service config; 16 @service system; 17 18 'data-test-global-header' = true; 19 onHamburgerClick() {} 20 21 // Show sign-in if: 22 // - User can't load agent config (meaning ACLs are enabled but they're not signed in) 23 // - User can load agent config in and ACLs are enabled (meaning ACLs are enabled and they're signed in) 24 // The excluded case here is if there is both an agent config and ACLs are disabled 25 get shouldShowProfileNav() { 26 return ( 27 !this.system.agent?.get('config') || 28 this.system.agent?.get('config.ACL.Enabled') === true 29 ); 30 } 31 32 get labelStyles() { 33 return htmlSafe( 34 ` 35 color: ${this.system.agent.get('config')?.UI?.Label?.TextColor}; 36 background-color: ${ 37 this.system.agent.get('config')?.UI?.Label?.BackgroundColor 38 }; 39 ` 40 ); 41 } 42 }