2020-06-01 13:15:59 +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 = {
|
2020-06-01 13:15:59 +00:00
|
|
|
sortProperty: 'sort',
|
|
|
|
sortDescending: 'desc',
|
2020-06-10 13:49:16 +00:00
|
|
|
};
|
2020-06-01 13:15:59 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
sortProperty = 'Name';
|
|
|
|
sortDescending = false;
|
2020-06-01 13:15:59 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
path = null;
|
|
|
|
allocation = null;
|
|
|
|
directoryEntries = null;
|
|
|
|
isFile = null;
|
|
|
|
stat = null;
|
2020-06-01 13:15:59 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@computed('path')
|
|
|
|
get pathWithLeadingSlash() {
|
2020-06-01 13:15:59 +00:00
|
|
|
const path = this.path;
|
|
|
|
|
|
|
|
if (path.startsWith('/')) {
|
|
|
|
return path;
|
|
|
|
} else {
|
|
|
|
return `/${path}`;
|
|
|
|
}
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
|
|
|
}
|