github.com/hernad/nomad@v1.6.112/ui/app/components/breadcrumbs/default.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 import { action } from '@ember/object'; 7 import Component from '@glimmer/component'; 8 import KeyboardShortcutModifier from 'nomad-ui/modifiers/keyboard-shortcut'; 9 import { inject as service } from '@ember/service'; 10 11 export default class BreadcrumbsTemplate extends Component { 12 @service router; 13 14 @action 15 traverseUpALevel(args) { 16 const [path, ...rest] = args; 17 this.router.transitionTo(path, ...rest); 18 } 19 20 get maybeKeyboardShortcut() { 21 return this.args.isOneCrumbUp() ? KeyboardShortcutModifier : null; 22 } 23 }