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]>
This commit is contained in:
1 parent
ec65435328
commit
614262378e
20 files changed
+772
-304
No files matched your search
@@ -6,6 +6,7 @@ import {
|
||||
type FeedSourceCreate,
|
||||
type FeedSourceUpdate,
|
||||
Id,
|
||||
Observation,
|
||||
} from "@umt/contracts";
|
||||
import { z } from "zod";
|
||||
import { TTL_SECOND } from "~/lib/api.ts";
|
||||
@@ -40,6 +41,18 @@ export function useFeed(id: string | null, poll = false) {
|
||||
});
|
||||
}
|
||||
|
||||
const ObservationPage = cursorPage(Observation);
|
||||
|
||||
/** RSS 最近条目(观察记录,新的在前);只在详情打开时请求 */
|
||||
export function useFeedObservations(feedId: string | null, limit = 20) {
|
||||
return useQuery({
|
||||
queryKey: [...feedKeys.all, "observations", feedId, limit] as const,
|
||||
enabled: !!feedId,
|
||||
queryFn: ({ signal }) =>
|
||||
apiParsed(ObservationPage, "/api/v1/observations", { params: { feedId: feedId ?? "", limit }, signal }),
|
||||
});
|
||||
}
|
||||
|
||||
/** 同站判定的主机键(与服务端 feedDefaultsForSite 一致):去 www.,取最后两级;IP 原样 */
|
||||
export function feedHostKey(u: string): string | null {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user