Files
UHD_Media_Tool/apps/web/app/routes/console/sources.tsx
T
rootandClaude Opus 5.5 614262378e feat(web): nav regroup, site RSS tab and site types (IA-2)
- sidebar: 概览 / 获取 / 整理 / 系统. Tasks moves to 系统; sites,
  subscriptions and rules form the 获取 group (ACQUIRE_GROUP_TITLE in
  nav.ts, the single place to rename it); standalone RSS nav item removed
- site detail gets an RSS tab with everything the RSS page had (create,
  edit, enable, fetch now, fetch state) plus recent items; tabs and
  header actions follow the site's capabilities
- old /console/sources links redirect to the site's RSS tab (?feed= looks
  up the owning site) or the site list; task links to RSS point at sites
- site list shows and filters by type; add-site wizard starts with a type
  step (PT still picks from the definition library; public BT / custom
  RSS source only need name, URL and RSS URL)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-30 00:29:56 +08:00

26 lines
1.1 KiB
TypeScript

import { FeedSource } from "@umt/contracts";
import { redirect } from "react-router";
import { apiParsed } from "~/api/parse.ts";
import { consolePath } from "~/components/console/nav.ts";
import { legacyRedirect } from "./redirects.ts";
// IA-2:独立 RSS 页取消,RSS 属于站点(站点详情的 RSS Tab)。这里只做旧链接跳转,深链不失效:
// ?siteId= → 该站点 RSS Tab;?feed=<id> → 查 RSS 所属站点后打开它的详情;其余 → 站点列表。
export const meta = () => [{ title: "RSS · UHD 媒体自动化控制台" }];
export async function clientLoader({ request }: { request: Request }) {
const url = new URL(request.url);
const feed = url.searchParams.get("feed");
if (feed) {
const f = await apiParsed(FeedSource, "/api/v1/feed-sources/:id", { pathParams: { id: feed } }).catch(() => null);
if (f?.siteId) return redirect(`${consolePath("sites", f.siteId)}?tab=rss&feed=${encodeURIComponent(feed)}`);
return redirect(consolePath("sites"));
}
return redirect(legacyRedirect(url.pathname, url.search) ?? consolePath("sites"));
}
export default function LegacySourcesRedirect() {
return null;
}