github.com/aminovpavel/nomad@v0.11.8/ui/app/components/fs/directory-entry.js (about) 1 import Component from '@ember/component'; 2 import { computed } from '@ember/object'; 3 import { isEmpty } from '@ember/utils'; 4 5 export default Component.extend({ 6 tagName: '', 7 8 allocation: null, 9 task: null, 10 11 pathToEntry: computed('path', 'entry.Name', function() { 12 const pathWithNoLeadingSlash = this.get('path').replace(/^\//, ''); 13 const name = encodeURIComponent(this.get('entry.Name')); 14 15 if (isEmpty(pathWithNoLeadingSlash)) { 16 return name; 17 } else { 18 return `${pathWithNoLeadingSlash}/${name}`; 19 } 20 }), 21 });