Add file importer

This commit is contained in:
2024-02-13 13:13:44 +01:00
parent accc842f99
commit a4c91f0879
5 changed files with 71 additions and 1 deletions

View File

@@ -117,3 +117,13 @@ export const fs_timeseries = async (path, start, end, interval = 60) => {
)
)
}
export const fs_import = async (parent_dir_path = "", filelist = []) => {
const form = new FormData()
form.append("action", "import")
form.append("files", JSON.stringify(filelist))
return await fs_check_response(
await fetch(fs_path_url(parent_dir_path), { method: "POST", body: form })
)
}