feat: add admin panel, Replicate AI translation, and document translation
- Admin panel (/admin) with JWT auth: configure Replicate API token, JigsawStack API key, model version, enable/disable AI translation, change admin password. Settings persisted in data/settings.json. - Replicate AI translation: POST /api/translate/replicate uses JigsawStack text-translate model via Replicate API. Main page switches to client-side AI translation when enabled. - Document translation tab: supports PDF, DOCX, XLSX, XLS, CSV. Excel/Word formatting fully preserved (SheetJS + JSZip XML manipulation). PDF uses pdf-parse extraction + pdf-lib reconstruction. Column selector UI for tabular data (per-sheet, All/None toggles). - Updated README with full implementation documentation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import Head from "next/head";
|
||||
import NextLink from "next/link";
|
||||
import { Flex, HStack, IconButton, Link, useColorModeValue } from "@chakra-ui/react";
|
||||
import { FaGithub } from "react-icons/fa";
|
||||
import { FiSettings } from "react-icons/fi";
|
||||
import Image from "next/image";
|
||||
import { ColorModeToggler } from ".";
|
||||
|
||||
@@ -40,6 +41,15 @@ const Header: FC<Props> = (props) => (
|
||||
<ColorModeToggler
|
||||
variant={useColorModeValue("outline", "solid")}
|
||||
/>
|
||||
<NextLink href="/admin" passHref={true}>
|
||||
<IconButton
|
||||
as={Link}
|
||||
aria-label="Admin settings"
|
||||
icon={<FiSettings />}
|
||||
colorScheme="lingva"
|
||||
variant={useColorModeValue("outline", "solid")}
|
||||
/>
|
||||
</NextLink>
|
||||
<IconButton
|
||||
as={Link}
|
||||
href="https://github.com/thedaviddelta/lingva-translate"
|
||||
|
||||
Reference in New Issue
Block a user