feat: export feeds, close #873

This commit is contained in:
Stephen Zhou 2024-10-11 18:19:25 +08:00
parent f7961edc29
commit eae857d25e
No known key found for this signature in database
2 changed files with 15 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import { IN_ELECTRON } from "@follow/shared/constants"
import { env } from "@follow/shared/env"
import { useQuery } from "@tanstack/react-query"
import { useAtom } from "jotai"
import { useCallback, useEffect } from "react"
@ -159,6 +160,17 @@ export const SettingGeneral = () => {
description: t("general.rebuild_database.description"),
buttonText: t("general.rebuild_database.button"),
},
{
label: t("general.export.label"),
description: t("general.export.description"),
buttonText: t("general.export.button"),
action: () => {
const link = document.createElement("a")
link.href = `${env.VITE_API_URL}/subscriptions/export`
link.download = "follow.opml"
link.click()
},
},
{ type: "title", value: t("general.network"), disabled: !IN_ELECTRON },
IN_ELECTRON && NettingSetting,

View File

@ -89,6 +89,9 @@
"general.app": "App",
"general.data_persist.description": "Persist data locally to enable offline access and local search.",
"general.data_persist.label": "Persist data for offline usage",
"general.export.button": "Export",
"general.export.description": "Export your feeds to an OPML file.",
"general.export.label": "Export Feeds",
"general.group_by_date.description": "Group entries by date.",
"general.group_by_date.label": "Group by date",
"general.language": "Language",