Skip to content

Commit 8d688b2

Browse files
committed
Remove task state adapter
It makes more sense to concentrate these functions in the allocation adapter.
1 parent 6b0667f commit 8d688b2

File tree

3 files changed

+3
-49
lines changed

3 files changed

+3
-49
lines changed

ui/app/adapters/task-state.js

-39
This file was deleted.

ui/app/models/task-state.js

-8
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,4 @@ export default Fragment.extend({
5151
restart() {
5252
return this.allocation.restart(this.name);
5353
},
54-
55-
ls(path) {
56-
return this.store.adapterFor('task-state').ls(this, path);
57-
},
58-
59-
stat(path) {
60-
return this.store.adapterFor('task-state').stat(this, path);
61-
},
6254
});

ui/app/routes/allocations/allocation/task/fs.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default Route.extend({
66
model({ path = '/' }) {
77
const decodedPath = decodeURIComponent(path);
88
const task = this.modelFor('allocations.allocation.task');
9+
const allocation = task.allocation;
910

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

@@ -16,13 +17,13 @@ export default Route.extend({
1617
};
1718
}
1819

19-
return RSVP.all([task.stat(pathWithTaskName), task.get('allocation.node')])
20+
return RSVP.all([allocation.stat(pathWithTaskName), task.get('allocation.node')])
2021
.then(([statJson]) => {
2122
if (statJson.IsDir) {
2223
return RSVP.hash({
2324
path: decodedPath,
2425
task,
25-
directoryEntries: task.ls(pathWithTaskName).catch(notifyError(this)),
26+
directoryEntries: allocation.ls(pathWithTaskName).catch(notifyError(this)),
2627
isFile: false,
2728
});
2829
} else {

0 commit comments

Comments
 (0)