Zim/Kiwix (Wikipedia) feature

* A new zim module has been added, this module allows several things to interact with Zim files.
  * Allow searching of Zim files using libzim.
  * Allow downloading of Kiwix projects (wikipedia, wikibooks, etc) on a schedule which replaces the outdated files.
  * Creation of a new zim docker container which allows viewing of the Zim file contents.

* This commit also adds move/rename/mkdir features in the File Browser.
  * File tags are preserved when moving/renaming.
This commit is contained in:
Roland 2023-05-29 18:04:03 -06:00
parent cc5ab4e339
commit 03a2df217d
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
117 changed files with 6393 additions and 1100 deletions

View file

@ -34,7 +34,7 @@ import {
textEllipsis,
useTitle
} from "./Common";
import {addTag, deleteArchives, postDownload, removeTag} from "../api";
import {deleteArchives, postDownload, tagFileGroup, untagFileGroup} from "../api";
import {Link, Route, Routes, useNavigate, useParams} from "react-router-dom";
import Message from "semantic-ui-react/dist/commonjs/collections/Message";
import {useArchive, useDomains, useSearchArchives, useSearchDomain} from "../hooks/customHooks";
@ -146,12 +146,12 @@ function ArchivePage() {
}
const localAddTag = async (name) => {
await addTag(archiveFile, name);
await tagFileGroup(archiveFile, name);
await fetchArchive();
}
const localRemoveTag = async (name) => {
await removeTag(archiveFile, name);
await untagFileGroup(archiveFile, name);
await fetchArchive();
}
@ -359,7 +359,8 @@ function Archives() {
const onDelete = async (e) => {
e.preventDefault();
setDeleteOpen(false);
const archiveIds = archives.filter(i => selectedArchives.indexOf(i['path']) >= 0).map(i => i['archive']['id']);
const archiveIds = archives.filter(i => selectedArchives.indexOf(i['primary_path']) >= 0)
.map(i => i['archive']['id']);
await deleteArchives(archiveIds);
await fetchArchives();
setSelectedArchives([]);