diff options
-rw-r--r-- | app/filedetails-html.lsp | 2 | ||||
-rw-r--r-- | lib/modelfunctions.lua | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/filedetails-html.lsp b/app/filedetails-html.lsp index 2dd90e5..59c6a91 100644 --- a/app/filedetails-html.lsp +++ b/app/filedetails-html.lsp @@ -14,7 +14,7 @@ htmlviewfunctions.displayinfo(form) header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="File Details"}), page_info, htmlviewfunctions.incrementheader(header_level)) htmlviewfunctions.displayitem(form.value.filename) -htmlviewfunctions.displayitem(form.value.filesize) +htmlviewfunctions.displayitem(form.value.size) htmlviewfunctions.displayitem(form.value.mtime) if form.value.grep and form.value.grep.value and form.value.grep.value ~= "" then htmlviewfunctions.displayitem(form.value.grep) diff --git a/lib/modelfunctions.lua b/lib/modelfunctions.lua index 2819911..3345dce 100644 --- a/lib/modelfunctions.lua +++ b/lib/modelfunctions.lua @@ -82,9 +82,9 @@ end function mymodule.getfiledetails(file, validatefilename, validatefiledetails) local filename = cfe({ value=file or "", label="File name" }) local filecontent = cfe({ type="longtext", label="File content" }) - local filesize = cfe({ value="0", label="File size" }) + local size = cfe({ value="0", label="File size" }) local mtime = cfe({ value="---", label="File date" }) - local filedetails = cfe({ type="group", value={filename=filename, filecontent=filecontent, filesize=filesize, mtime=mtime}, label="Config file details" }) + local filedetails = cfe({ type="group", value={filename=filename, filecontent=filecontent, size=size, mtime=mtime}, label="Config file details" }) local success = true if type(validatefilename) == "function" then success = validatefilename(filedetails.value.filename.value) @@ -103,10 +103,10 @@ function mymodule.getfiledetails(file, validatefilename, validatefiledetails) end if success then if fs.is_file(file) then - local filedetails = fs.stat(file) + local filedetails = posix.stat(file) filecontent.value = fs.read_file(file) or "" - filesize.value = filedetails.size - mtime.value = filedetails.mtime + size.value = format.formatfilesize(filedetails.size) + mtime.value = format.formattime(filedetails.mtime) else filename.errtxt = "File not found" end |