diff --git a/ui/app/controllers/allocations/allocation/task/fs.js b/ui/app/controllers/allocations/allocation/task/fs.js index b8084fd63..d4b0f27d0 100644 --- a/ui/app/controllers/allocations/allocation/task/fs.js +++ b/ui/app/controllers/allocations/allocation/task/fs.js @@ -20,6 +20,16 @@ export default Controller.extend({ directories: filterBy('directoryEntries', 'IsDir'), files: filterBy('directoryEntries', 'IsDir', false), + pathWithLeadingSlash: computed('path', function() { + const path = this.path; + + if (path.startsWith('/')) { + return path; + } else { + return `/${path}`; + } + }), + sortedDirectoryEntries: computed( 'directoryEntries.[]', 'sortProperty', diff --git a/ui/app/templates/allocations/allocation/task/fs.hbs b/ui/app/templates/allocations/allocation/task/fs.hbs index 9854d7341..be5edc426 100644 --- a/ui/app/templates/allocations/allocation/task/fs.hbs +++ b/ui/app/templates/allocations/allocation/task/fs.hbs @@ -1,3 +1,4 @@ +{{title pathWithLeadingSlash " - Task " task.name " filesystem"}} {{task-subnav task=task}}
{{#if task.isRunning}} diff --git a/ui/tests/acceptance/task-fs-test.js b/ui/tests/acceptance/task-fs-test.js index 28d1d9ee2..1fea33b2f 100644 --- a/ui/tests/acceptance/task-fs-test.js +++ b/ui/tests/acceptance/task-fs-test.js @@ -49,12 +49,22 @@ module('Acceptance | task fs', function(hooks) { const paths = ['some-file.log', 'a/deep/path/to/a/file.log', '/', 'Unicode™®']; const testPath = async filePath => { + let pathWithLeadingSlash = filePath; + + if (!pathWithLeadingSlash.startsWith('/')) { + pathWithLeadingSlash = `/${filePath}`; + } + await FS.visitPath({ id: allocation.id, name: task.name, path: filePath }); assert.equal( currentURL(), `/allocations/${allocation.id}/${task.name}/fs/${encodeURIComponent(filePath)}`, 'No redirect' ); + assert.equal( + document.title, + `${pathWithLeadingSlash} - Task ${task.name} filesystem - Nomad` + ); assert.equal(FS.breadcrumbsText, `${task.name} ${filePath.replace(/\//g, ' ')}`.trim()); };