filesTab = async (req) => {
  const files = await File.find({}, { orderBy: "filename", cached: true });
  return div(
    files.length === 0
      ? p(req.__("No files"))
      : mkTable(
          [
            {
              label: req.__("Filename"),
              key: (r) =>
                r.isDirectory
                  ? r.filename
                  : link(`/files/serve/${r.path_to_serve}`, r.filename),
            },
            { label: req.__("Size (KiB)"), key: "size_kb", align: "right" },
            { label: req.__("Media type"), key: (r) => r.mimetype },
          ],
          files
        ),
    fileUploadForm(req)
  );
}
Files Tab
@param {object} req
@returns {Promise<div>}