use monolith instead of singlefile
This commit is contained in:
@@ -29,7 +29,7 @@ export default async function Index(req: NextApiRequest, res: NextApiResponse) {
|
||||
else if (format === ArchivedFormat.jpeg) suffix = ".jpeg";
|
||||
else if (format === ArchivedFormat.pdf) suffix = ".pdf";
|
||||
else if (format === ArchivedFormat.readability) suffix = "_readability.json";
|
||||
else if (format === ArchivedFormat.singlefile) suffix = ".html";
|
||||
else if (format === ArchivedFormat.monolith) suffix = ".html";
|
||||
|
||||
//@ts-ignore
|
||||
if (!linkId || !suffix)
|
||||
|
||||
@@ -76,7 +76,7 @@ const deleteArchivedFiles = async (link: Link & { collection: Collection }) => {
|
||||
image: null,
|
||||
pdf: null,
|
||||
readable: null,
|
||||
singlefile: null,
|
||||
monolith: null,
|
||||
preview: null,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -59,7 +59,7 @@ export default function Index() {
|
||||
username: "",
|
||||
image: "",
|
||||
archiveAsScreenshot: undefined as unknown as boolean,
|
||||
archiveAsSinglefile: undefined as unknown as boolean,
|
||||
archiveAsMonolith: undefined as unknown as boolean,
|
||||
archiveAsPDF: undefined as unknown as boolean,
|
||||
});
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function Index() {
|
||||
username: account.username as string,
|
||||
image: account.image as string,
|
||||
archiveAsScreenshot: account.archiveAsScreenshot as boolean,
|
||||
archiveAsSinglefile: account.archiveAsScreenshot as boolean,
|
||||
archiveAsMonolith: account.archiveAsScreenshot as boolean,
|
||||
archiveAsPDF: account.archiveAsPDF as boolean,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ export default function Index() {
|
||||
{link && Number(router.query.format) === ArchivedFormat.readability && (
|
||||
<ReadableView link={link} />
|
||||
)}
|
||||
{link && Number(router.query.format) === ArchivedFormat.singlefile && (
|
||||
{link && Number(router.query.format) === ArchivedFormat.monolith && (
|
||||
<iframe
|
||||
src={`/api/v1/archives/${link.id}?format=${ArchivedFormat.singlefile}`}
|
||||
src={`/api/v1/archives/${link.id}?format=${ArchivedFormat.monolith}`}
|
||||
className="w-full h-screen border-none"
|
||||
></iframe>
|
||||
)}
|
||||
|
||||
@@ -42,7 +42,7 @@ export default function PublicCollections() {
|
||||
username: "",
|
||||
image: "",
|
||||
archiveAsScreenshot: undefined as unknown as boolean,
|
||||
archiveAsSinglefile: undefined as unknown as boolean,
|
||||
archiveAsMonolith: undefined as unknown as boolean,
|
||||
archiveAsPDF: undefined as unknown as boolean,
|
||||
});
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ export default function Appearance() {
|
||||
account.archiveAsPDF
|
||||
);
|
||||
|
||||
const [archiveAsSinglefile, setArchiveAsSinglefile] = useState<boolean>(
|
||||
account.archiveAsSinglefile
|
||||
const [archiveAsMonolith, setArchiveAsMonolith] = useState<boolean>(
|
||||
account.archiveAsMonolith
|
||||
);
|
||||
|
||||
const [archiveAsWaybackMachine, setArchiveAsWaybackMachine] =
|
||||
@@ -39,7 +39,7 @@ export default function Appearance() {
|
||||
setUser({
|
||||
...account,
|
||||
archiveAsScreenshot,
|
||||
archiveAsSinglefile,
|
||||
archiveAsMonolith,
|
||||
archiveAsPDF,
|
||||
archiveAsWaybackMachine,
|
||||
linksRouteTo,
|
||||
@@ -48,7 +48,7 @@ export default function Appearance() {
|
||||
}, [
|
||||
account,
|
||||
archiveAsScreenshot,
|
||||
archiveAsSinglefile,
|
||||
archiveAsMonolith,
|
||||
archiveAsPDF,
|
||||
archiveAsWaybackMachine,
|
||||
linksRouteTo,
|
||||
@@ -62,7 +62,7 @@ export default function Appearance() {
|
||||
useEffect(() => {
|
||||
if (!objectIsEmpty(account)) {
|
||||
setArchiveAsScreenshot(account.archiveAsScreenshot);
|
||||
setArchiveAsSinglefile(account.archiveAsSinglefile);
|
||||
setArchiveAsMonolith(account.archiveAsMonolith);
|
||||
setArchiveAsPDF(account.archiveAsPDF);
|
||||
setArchiveAsWaybackMachine(account.archiveAsWaybackMachine);
|
||||
setLinksRouteTo(account.linksRouteTo);
|
||||
@@ -136,9 +136,9 @@ export default function Appearance() {
|
||||
/>
|
||||
|
||||
<Checkbox
|
||||
label="Singlefile"
|
||||
state={archiveAsSinglefile}
|
||||
onClick={() => setArchiveAsSinglefile(!archiveAsSinglefile)}
|
||||
label={t("webpage")}
|
||||
state={archiveAsMonolith}
|
||||
onClick={() => setArchiveAsMonolith(!archiveAsMonolith)}
|
||||
/>
|
||||
|
||||
<Checkbox
|
||||
@@ -229,27 +229,13 @@ export default function Appearance() {
|
||||
type="radio"
|
||||
name="link-preference-radio"
|
||||
className="radio checked:bg-primary"
|
||||
value="Singlefile"
|
||||
checked={linksRouteTo === LinksRouteTo.SINGLEFILE}
|
||||
onChange={() => setLinksRouteTo(LinksRouteTo.SINGLEFILE)}
|
||||
value="Monolith"
|
||||
checked={linksRouteTo === LinksRouteTo.MONOLITH}
|
||||
onChange={() => setLinksRouteTo(LinksRouteTo.MONOLITH)}
|
||||
/>
|
||||
<span className="label-text">Open Singlefile, if available</span>
|
||||
</label>
|
||||
|
||||
<label
|
||||
className="label cursor-pointer flex gap-2 justify-start w-fit"
|
||||
tabIndex={0}
|
||||
role="button"
|
||||
>
|
||||
<input
|
||||
type="radio"
|
||||
name="link-preference-radio"
|
||||
className="radio checked:bg-primary"
|
||||
value="Singlefile"
|
||||
checked={linksRouteTo === LinksRouteTo.SINGLEFILE}
|
||||
onChange={() => setLinksRouteTo(LinksRouteTo.SINGLEFILE)}
|
||||
/>
|
||||
<span className="label-text">Open Singlefile, if available</span>
|
||||
<span className="label-text">
|
||||
{t("open_webpage_if_available")}
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<label
|
||||
|
||||
Reference in New Issue
Block a user