diff --git a/src/filemanager.html b/src/filemanager.html index 3ae3c290d..41f2133d0 100644 --- a/src/filemanager.html +++ b/src/filemanager.html @@ -338,7 +338,7 @@ - + @@ -359,8 +359,9 @@ - diff --git a/src/js/client.js b/src/js/client.js index 274071d86..e9df940f8 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -3085,6 +3085,11 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout if (type === 'volume') return 'volumes/' + id; } + Client.prototype.filesGetLink = function (id, type, path) { + var objpath = getObjpath(id, type); + return client.apiOrigin + '/api/v1/' + objpath + '/files/' + path + '?download=false&access_token=' + token; + }; + Client.prototype.filesGet = function (id, type, path, mode, callback) { var objpath = getObjpath(id, type); @@ -3094,8 +3099,6 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout } else if (mode === 'open') { window.open(client.apiOrigin + '/api/v1/' + objpath + '/files/' + path + '?download=false&access_token=' + token); callback(null); - } else if (mode === 'link') { - callback(null, client.apiOrigin + '/api/v1/' + objpath + '/files/' + path + '?download=false&access_token=' + token); } else { function responseHandler(data, headers, status) { if (headers()['content-type'] && headers()['content-type'].indexOf('application/json') !== -1) return JSON.parse(data); diff --git a/src/js/filemanager.js b/src/js/filemanager.js index 4d7d8b293..1f3795daf 100644 --- a/src/js/filemanager.js +++ b/src/js/filemanager.js @@ -378,6 +378,7 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl // amend icons result.entries.forEach(function (e) { e.icon = 'fa-file'; + e.previewUrl = null; if (e.isDirectory) e.icon = 'fa-folder'; if (e.isSymbolicLink) e.icon = 'fa-link'; @@ -385,7 +386,11 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl var mimeType = Mimer().get(e.fileName); var mimeGroup = mimeType.split('/')[0]; if (mimeGroup === 'text') e.icon = 'fa-file-alt'; - if (mimeGroup === 'image') e.icon = 'fa-file-image'; + // if (mimeGroup === 'image') e.icon = 'fa-file-image'; + if (mimeGroup === 'image') { + e.icon = 'fa-file-image'; + e.previewUrl = Client.filesGetLink($scope.id, $scope.type, sanitize($scope.cwd + '/' + e.fileName)); + } if (mimeGroup === 'video') e.icon = 'fa-file-video'; if (mimeGroup === 'audio') e.icon = 'fa-file-audio'; if (mimeType === 'text/csv') e.icon = 'fa-file-csv'; @@ -811,15 +816,9 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl $scope.mediaViewer.entry = entry; $scope.mediaViewer.type = Mimer().get(entry.fileName).split('/')[0]; - $scope.mediaViewer.src = ''; + $scope.mediaViewer.src = Client.filesGetLink($scope.id, $scope.type, filePath); - Client.filesGet($scope.id, $scope.type, filePath, 'link', function (error, result) { - if (error) return Client.error(error); - - $scope.mediaViewer.src = result; - - $('#mediaViewerModal').modal('show'); - }); + $('#mediaViewerModal').modal('show'); }, close: function () { diff --git a/src/theme.scss b/src/theme.scss index 1ed98f1b7..7fa63759a 100644 --- a/src/theme.scss +++ b/src/theme.scss @@ -1853,6 +1853,10 @@ tag-input { .table-hover > tbody > tr:hover { background-color: #0000000a; } + + .table td { + vertical-align: middle; + } } .file-list-header {
   {{ 'filemanager.list.name' | tr }} {{ 'filemanager.list.owner' | tr }} {{ 'filemanager.list.size' | tr }}{{ 'filemanager.list.empty' | tr }}
- + + + {{ entry.fileName }}{{ 'filemanager.list.symlink' | tr:{ target: entry.target } }} {{ entry.uid | prettyOwner }}