aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/FileEntry.vue
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-06-22 18:18:38 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-07-05 16:20:33 +0200
commitfb61e3a7613727a71123ceb8c8767b0110d49460 (patch)
treeef9a6807af29a784cabbde3d6f9ebf936e1eb474 /apps/files/src/components/FileEntry.vue
parent7f768012204c6b7a18f72a479049c36a5f459965 (diff)
downloadnextcloud-server-fb61e3a7613727a71123ceb8c8767b0110d49460.tar.gz
nextcloud-server-fb61e3a7613727a71123ceb8c8767b0110d49460.zip
feat: add modified column
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/src/components/FileEntry.vue')
-rw-r--r--apps/files/src/components/FileEntry.vue25
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index 5c17ada6e84..2153377cad8 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -125,6 +125,13 @@
<span>{{ size }}</span>
</td>
+ <!-- Mtime -->
+ <td v-if="isMtimeAvailable"
+ class="files-list__row-mtime"
+ @click="openDetailsIfAvailable">
+ <span>{{ mtime }}</span>
+ </td>
+
<!-- View columns -->
<td v-for="column in columns"
:key="column.id"
@@ -165,6 +172,7 @@ import { hashCode } from '../utils/hashUtils.ts'
import { isCachedPreview } from '../services/PreviewService.ts'
import { useActionsMenuStore } from '../store/actionsmenu.ts'
import { useFilesStore } from '../store/files.ts'
+import type moment from 'moment'
import { useKeyboardStore } from '../store/keyboard.ts'
import { useSelectionStore } from '../store/selection.ts'
import { useUserConfigStore } from '../store/userconfig.ts'
@@ -200,6 +208,10 @@ export default Vue.extend({
type: Boolean,
default: false,
},
+ isMtimeAvailable: {
+ type: Boolean,
+ default: false,
+ },
isSizeAvailable: {
type: Boolean,
default: false,
@@ -300,6 +312,19 @@ export default Vue.extend({
return minOpacity + (1 - minOpacity) * Math.pow((this.source.size / maxOpacitySize), 2)
},
+ mtime() {
+ if (this.source.mtime) {
+ return moment(this.source.mtime).fromNow()
+ }
+ return this.t('files_trashbin', 'A long time ago')
+ },
+ mtimeTitle() {
+ if (this.source.mtime) {
+ return moment(this.source.mtime).format('LLL')
+ }
+ return ''
+ },
+
linkTo() {
if (this.enabledDefaultActions.length > 0) {
const action = this.enabledDefaultActions[0]