Show file content for non-binary files

This commit is contained in:
2017-11-27 21:33:58 +01:00
parent f190b6aabb
commit 7263f092d0
9 changed files with 92 additions and 6 deletions

View File

@@ -85,11 +85,16 @@ export default Service.extend({
Object.keys(listing).forEach(name => {
let item = listing[name];
let type = item['Content-Type'] || 'folder';
if (type !== 'folder') { type = simpleContentType(type); }
let isBinary = false;
if (type !== 'folder') {
isBinary = !!type.match(/charset=binary/);
type = simpleContentType(type);
}
items.push(EmberObject.create({
name: name,
type: type,
isBinary: isBinary,
isFolder: type === 'folder',
size: item['Content-Length'] || null,
path: path + name,