@samitouri / QOSami-HFS / commits / f79ee856

size and timestamp in file-menu

Massimo Melina committed May 19, 2023 at 23:37 UTC f79ee856e53935954d866c8a4618d10261244686
3 files changed +10 -4
frontend/src/fileMenu.ts
+4 -2
@@ -1,5 +1,5 @@
1 import { t, useI18N } from './i18n'
2 -import { dontBotherWithKeys, hfsEvent, hIcon, isMobile, newDialog } from './misc'
2 +import { dontBotherWithKeys, formatBytes, hfsEvent, hIcon, isMobile, newDialog } from './misc'
3 import { createElement as h, Fragment, isValidElement, MouseEventHandler, ReactNode } from 'react'
4 import _ from 'lodash'
5 import { DirEntry, getEntryIcon, MISSING_PERM } from './BrowseFiles'
@@ -20,7 +20,9 @@ export function openFileMenu(entry: DirEntry, ev: MouseEvent, addToMenu: FileMen
20 isFolder && { label: t`Get list`, href: uri + '?get=list&folders=*', icon: 'menu' }
21 ]
22 const props = [
23 - [t(`Name`), entry.name]
23 + [t`Name`, entry.name],
24 + typeof entry.s === 'number' && [t`Size`, formatBytes(entry.s)],
25 + entry.t && [t`Timestamp`, entry.t.toLocaleString()],
26 ]
27 const res = hfsEvent('fileMenu', { entry, menu, props })
28 if (res)
src/langs/hfs-lang-en.json
+3 -1
@@ -112,6 +112,8 @@
112 "Missing permission": "Missing permission",
113 "Reload": "Reload",
114 "Get list": "Get list",
115 - "Skip existing files": "Skip existing files"
115 + "Skip existing files": "Skip existing files",
116 + "Size": "Size",
117 + "Timestamp": "Timestamp"
118 }
119 }
src/langs/hfs-lang-it.json
+3 -1
@@ -106,6 +106,8 @@
106 "Missing permission": "Permesso mancante",
107 "Reload": "Ricarica",
108 "Get list": "Lista",
109 - "Skip existing files": "Salta file esistenti"
109 + "Skip existing files": "Salta file esistenti",
110 + "Size": "Dimensione",
111 + "Timestamp": "Data/ora"
112 }
113 }