diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a5456bb..8e1ab6c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "ConvertX Development Environment", + "name": "ConvertX", "build": { "dockerfile": "Dockerfile" }, @@ -46,5 +46,8 @@ }, "postCreateCommand": "bun install", "remoteUser": "root", - "mounts": ["source=${localWorkspaceFolder}/data,target=/app/data,type=bind"] + "mounts": ["source=${localWorkspaceFolder}/data,target=/app/data,type=bind"], + "containerEnv": { + "JWT_SECRET": "jwt_secret_only_used_in_testing_for_easier_hot_reloading" + } } diff --git a/public/results.js b/public/results.js index b125e93..d1aee96 100644 --- a/public/results.js +++ b/public/results.js @@ -22,3 +22,17 @@ const refreshData = () => { }; refreshData(); + +window.downloadAll = function () { + // Get all download links + const downloadLinks = document.querySelectorAll("a[download]"); + + // Trigger download for each link + downloadLinks.forEach((link, index) => { + // We add a delay for each download to prevent them from starting at the same time + setTimeout(() => { + const event = new MouseEvent("click"); + link.dispatchEvent(event); + }, index * 300); + }); +}; diff --git a/reset.d.ts b/reset.d.ts deleted file mode 100644 index a3d4a03..0000000 --- a/reset.d.ts +++ /dev/null @@ -1 +0,0 @@ -import "@total-typescript/ts-reset"; diff --git a/src/components/base.tsx b/src/components/base.tsx index 9804813..c44d1f6 100644 --- a/src/components/base.tsx +++ b/src/components/base.tsx @@ -1,4 +1,3 @@ -import { Html } from "@elysiajs/html"; import { version } from "../../package.json"; export const BaseHtml = ({ diff --git a/src/components/header.tsx b/src/components/header.tsx index 75fa627..7f72fea 100644 --- a/src/components/header.tsx +++ b/src/components/header.tsx @@ -1,5 +1,3 @@ -import { Html } from "@kitajs/html"; - export const Header = ({ loggedIn, accountRegistration, diff --git a/src/icons/download.tsx b/src/icons/download.tsx new file mode 100644 index 0000000..f4c44c3 --- /dev/null +++ b/src/icons/download.tsx @@ -0,0 +1,18 @@ +export function DownloadIcon() { + return ( + + + + ); +} diff --git a/src/icons/eye.tsx b/src/icons/eye.tsx new file mode 100644 index 0000000..02bcd49 --- /dev/null +++ b/src/icons/eye.tsx @@ -0,0 +1,19 @@ +export function EyeIcon() { + return ( + + + + + ); +} diff --git a/src/pages/chooseConverter.tsx b/src/pages/chooseConverter.tsx index 8e7a3f8..98b5f8c 100644 --- a/src/pages/chooseConverter.tsx +++ b/src/pages/chooseConverter.tsx @@ -1,4 +1,3 @@ -import { Html } from "@elysiajs/html"; import Elysia, { t } from "elysia"; import { getPossibleTargets } from "../converters/main"; import { userService } from "./user"; diff --git a/src/pages/history.tsx b/src/pages/history.tsx index 82ce6f6..7229b85 100644 --- a/src/pages/history.tsx +++ b/src/pages/history.tsx @@ -1,4 +1,3 @@ -import { Html } from "@elysiajs/html"; import { Elysia } from "elysia"; import { BaseHtml } from "../components/base"; import { Header } from "../components/header"; diff --git a/src/pages/listConverters.tsx b/src/pages/listConverters.tsx index 1950b46..71343b8 100644 --- a/src/pages/listConverters.tsx +++ b/src/pages/listConverters.tsx @@ -1,4 +1,3 @@ -import { Html } from "@elysiajs/html"; import Elysia from "elysia"; import { BaseHtml } from "../components/base"; import { Header } from "../components/header"; diff --git a/src/pages/results.tsx b/src/pages/results.tsx index 9293071..8b9a773 100644 --- a/src/pages/results.tsx +++ b/src/pages/results.tsx @@ -1,4 +1,3 @@ -import { Html } from "@elysiajs/html"; import { JWTPayloadSpec } from "@elysiajs/jwt"; import { Elysia } from "elysia"; import { BaseHtml } from "../components/base"; @@ -6,6 +5,8 @@ import { Header } from "../components/header"; import db from "../db/db"; import { Filename, Jobs } from "../db/types"; import { ALLOW_UNAUTHENTICATED, WEBROOT } from "../helpers/env"; +import { DownloadIcon } from "../icons/download"; +import { EyeIcon } from "../icons/eye"; import { userService } from "./user"; function ResultsArticle({ @@ -25,25 +26,24 @@ function ResultsArticle({

Results

-
+
- View - - - Download + Actions @@ -103,7 +95,7 @@ function ResultsArticle({ {file.output_file_name} {file.status} - + - View + - - - Download + diff --git a/src/pages/root.tsx b/src/pages/root.tsx index fdf7f2f..f2a83de 100644 --- a/src/pages/root.tsx +++ b/src/pages/root.tsx @@ -1,5 +1,4 @@ import { randomInt } from "node:crypto"; -import { Html } from "@elysiajs/html"; import { JWTPayloadSpec } from "@elysiajs/jwt"; import { Elysia, t } from "elysia"; import { BaseHtml } from "../components/base"; diff --git a/src/pages/user.tsx b/src/pages/user.tsx index 29dae0a..0fd9065 100644 --- a/src/pages/user.tsx +++ b/src/pages/user.tsx @@ -1,5 +1,4 @@ import { randomUUID } from "node:crypto"; -import { Html } from "@elysiajs/html"; import { jwt } from "@elysiajs/jwt"; import { Elysia, t } from "elysia"; import { BaseHtml } from "../components/base"; diff --git a/tests/converters/dvisvgm.test.ts b/tests/converters/dvisvgm.test.ts index 2723801..a8e0738 100644 --- a/tests/converters/dvisvgm.test.ts +++ b/tests/converters/dvisvgm.test.ts @@ -1,5 +1,5 @@ -import type { ExecFileException } from "node:child_process"; import { beforeEach, expect, test } from "bun:test"; +import type { ExecFileException } from "node:child_process"; import { convert } from "../../src/converters/dvisvgm"; import { ExecFileFn } from "../../src/converters/types"; import { runCommonTests } from "./helpers/commonTests"; diff --git a/tests/converters/helpers/converters.ts b/tests/converters/helpers/converters.ts index 12942f6..912f6e2 100644 --- a/tests/converters/helpers/converters.ts +++ b/tests/converters/helpers/converters.ts @@ -1,5 +1,5 @@ -import type { ExecFileException } from "node:child_process"; import { expect } from "bun:test"; +import type { ExecFileException } from "node:child_process"; import { ConvertFnWithExecFile, ExecFileFn } from "../../../src/converters/types"; export async function runConvertSuccessTest(convertFn: ConvertFnWithExecFile) { diff --git a/tests/converters/imagemagick.test.ts b/tests/converters/imagemagick.test.ts index dd47b7a..e7b17aa 100644 --- a/tests/converters/imagemagick.test.ts +++ b/tests/converters/imagemagick.test.ts @@ -1,5 +1,5 @@ -import type { ExecFileException } from "node:child_process"; import { beforeEach, expect, test } from "bun:test"; +import type { ExecFileException } from "node:child_process"; import { convert } from "../../src/converters/imagemagick"; import { ExecFileFn } from "../../src/converters/types"; import { runCommonTests } from "./helpers/commonTests"; diff --git a/tests/converters/libjxl.test.ts b/tests/converters/libjxl.test.ts index 7171bdb..c1a27af 100644 --- a/tests/converters/libjxl.test.ts +++ b/tests/converters/libjxl.test.ts @@ -1,5 +1,5 @@ -import type { ExecFileException } from "node:child_process"; import { beforeEach, expect, test } from "bun:test"; +import type { ExecFileException } from "node:child_process"; import { convert } from "../../src/converters/libjxl"; import { ExecFileFn } from "../../src/converters/types"; import { runCommonTests } from "./helpers/commonTests"; diff --git a/tests/converters/msgconvert.test.ts b/tests/converters/msgconvert.test.ts index 7ef0dca..2a6631b 100644 --- a/tests/converters/msgconvert.test.ts +++ b/tests/converters/msgconvert.test.ts @@ -1,5 +1,5 @@ -import type { ExecFileException } from "node:child_process"; import { expect, test } from "bun:test"; +import type { ExecFileException } from "node:child_process"; import { convert } from "../../src/converters/msgconvert"; import { ExecFileFn } from "../../src/converters/types"; diff --git a/tests/converters/vips.test.ts b/tests/converters/vips.test.ts index b97be81..9f94449 100644 --- a/tests/converters/vips.test.ts +++ b/tests/converters/vips.test.ts @@ -1,5 +1,5 @@ -import type { ExecFileException } from "node:child_process"; import { beforeEach, expect, test } from "bun:test"; +import type { ExecFileException } from "node:child_process"; import { ExecFileFn } from "../../src/converters/types"; import { convert } from "../../src/converters/vips"; import { runCommonTests } from "./helpers/commonTests"; diff --git a/tsconfig.json b/tsconfig.json index ffd5668..ac50753 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,9 +12,8 @@ "strict": true, "downlevelIteration": true, "skipLibCheck": true, - "jsx": "react", - "jsxFactory": "Html.createElement", - "jsxFragmentFactory": "Html.Fragment", + "jsx": "react-jsx", + "jsxImportSource": "@kitajs/html", "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "allowJs": true, @@ -30,5 +29,5 @@ "esModuleInterop": true // "noImplicitReturns": true }, - "include": ["src", "tests", "package.json", "reset.d.ts"] + "include": ["src", "tests", "package.json"] }