Skip to content

Commit

Permalink
Remove task state adapter
Browse files Browse the repository at this point in the history
It makes more sense to concentrate these functions in the
allocation adapter.
  • Loading branch information
backspace committed May 28, 2020
1 parent 6b0667f commit 8d688b2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 49 deletions.
39 changes: 0 additions & 39 deletions ui/app/adapters/task-state.js

This file was deleted.

8 changes: 0 additions & 8 deletions ui/app/models/task-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,4 @@ export default Fragment.extend({
restart() {
return this.allocation.restart(this.name);
},

ls(path) {
return this.store.adapterFor('task-state').ls(this, path);
},

stat(path) {
return this.store.adapterFor('task-state').stat(this, path);
},
});
5 changes: 3 additions & 2 deletions ui/app/routes/allocations/allocation/task/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default Route.extend({
model({ path = '/' }) {
const decodedPath = decodeURIComponent(path);
const task = this.modelFor('allocations.allocation.task');
const allocation = task.allocation;

const pathWithTaskName = `${task.name}${decodedPath.startsWith('/') ? '' : '/'}${decodedPath}`;

Expand All @@ -16,13 +17,13 @@ export default Route.extend({
};
}

return RSVP.all([task.stat(pathWithTaskName), task.get('allocation.node')])
return RSVP.all([allocation.stat(pathWithTaskName), task.get('allocation.node')])
.then(([statJson]) => {
if (statJson.IsDir) {
return RSVP.hash({
path: decodedPath,
task,
directoryEntries: task.ls(pathWithTaskName).catch(notifyError(this)),
directoryEntries: allocation.ls(pathWithTaskName).catch(notifyError(this)),
isFile: false,
});
} else {
Expand Down

0 comments on commit 8d688b2

Please sign in to comment.