2019-07-02 21:42:38 +00:00
|
|
|
import Controller from '@ember/controller';
|
|
|
|
import { computed } from '@ember/object';
|
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class FsController extends Controller {
|
|
|
|
queryParams = {
|
2019-07-23 20:37:34 +00:00
|
|
|
sortProperty: 'sort',
|
|
|
|
sortDescending: 'desc',
|
2020-06-10 13:49:16 +00:00
|
|
|
};
|
2019-07-23 20:37:34 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
sortProperty = 'Name';
|
|
|
|
sortDescending = false;
|
2019-07-23 20:37:34 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
path = null;
|
|
|
|
taskState = null;
|
|
|
|
directoryEntries = null;
|
|
|
|
isFile = null;
|
|
|
|
stat = null;
|
2019-07-02 21:42:38 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@computed('path')
|
|
|
|
get pathWithLeadingSlash() {
|
2019-08-01 16:17:46 +00:00
|
|
|
const path = this.path;
|
|
|
|
|
|
|
|
if (path.startsWith('/')) {
|
|
|
|
return path;
|
|
|
|
} else {
|
|
|
|
return `/${path}`;
|
|
|
|
}
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
|
|
|
}
|