测试
This commit is contained in:
+35
-24
@@ -293,53 +293,63 @@ export default function Home() {
|
||||
editable={!activePage.isLocked}
|
||||
/>
|
||||
|
||||
<section className="ui-enter mt-6 space-y-3 md:mt-8 md:space-y-4">
|
||||
<div className="ui-card p-3 md:p-4">
|
||||
<h3 className="text-sm font-semibold text-foreground">关联页面</h3>
|
||||
<p className="mt-1 text-xs text-muted-foreground">在正文中使用 `[[页面名]]` 自动建立链接关系,支持 `Ctrl/Cmd + 点击` 跳转。</p>
|
||||
<div className="mt-3 flex flex-wrap gap-2">
|
||||
<section className="ui-enter mt-6 space-y-3 md:mt-7">
|
||||
<div className="grid gap-2 md:grid-cols-3">
|
||||
<div className="ui-card p-2.5 md:p-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-sm font-semibold text-foreground">关联页面</h3>
|
||||
<span className="rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground">{outgoingLinks.length}</span>
|
||||
</div>
|
||||
<p className="mt-1 text-[11px] text-muted-foreground">正文写 `[[页面名]]` 可自动关联。</p>
|
||||
<div className="mt-2 flex flex-wrap gap-1.5">
|
||||
{outgoingLinks.length > 0 ? (
|
||||
outgoingLinks.map((item) => (
|
||||
<button
|
||||
key={item.id}
|
||||
onClick={() => setActivePageId(item.id)}
|
||||
className="rounded-md border border-border/70 bg-muted/40 px-2.5 py-1 text-xs text-foreground transition-colors hover:bg-accent"
|
||||
className="rounded-md border border-border/70 bg-muted/40 px-2 py-0.5 text-[11px] text-foreground transition-colors hover:bg-accent"
|
||||
>
|
||||
{item.icon ? `${item.icon} ` : ""}
|
||||
{item.title}
|
||||
</button>
|
||||
))
|
||||
) : (
|
||||
<span className="text-xs text-muted-foreground">暂无关联页面</span>
|
||||
<span className="text-[11px] text-muted-foreground">暂无</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="ui-card p-3 md:p-4">
|
||||
<h3 className="text-sm font-semibold text-foreground">反向链接</h3>
|
||||
<p className="mt-1 text-xs text-muted-foreground">这些页面提到了当前页面。</p>
|
||||
<div className="mt-3 flex flex-wrap gap-2">
|
||||
<div className="ui-card p-2.5 md:p-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-sm font-semibold text-foreground">反向链接</h3>
|
||||
<span className="rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground">{backlinks.length}</span>
|
||||
</div>
|
||||
<p className="mt-1 text-[11px] text-muted-foreground">被哪些页面引用。</p>
|
||||
<div className="mt-2 flex flex-wrap gap-1.5">
|
||||
{backlinks.length > 0 ? (
|
||||
backlinks.map((item) => (
|
||||
<button
|
||||
key={item.id}
|
||||
onClick={() => setActivePageId(item.id)}
|
||||
className="rounded-md border border-border/70 bg-muted/40 px-2.5 py-1 text-xs text-foreground transition-colors hover:bg-accent"
|
||||
className="rounded-md border border-border/70 bg-muted/40 px-2 py-0.5 text-[11px] text-foreground transition-colors hover:bg-accent"
|
||||
>
|
||||
{item.icon ? `${item.icon} ` : ""}
|
||||
{item.title}
|
||||
</button>
|
||||
))
|
||||
) : (
|
||||
<span className="text-xs text-muted-foreground">暂无反向链接</span>
|
||||
<span className="text-[11px] text-muted-foreground">暂无</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="ui-card p-3 md:p-4">
|
||||
<h3 className="text-sm font-semibold text-foreground">未解析链接</h3>
|
||||
<p className="mt-1 text-xs text-muted-foreground">这些 `[[页面名]]` 还没有对应页面,可一键创建。</p>
|
||||
<div className="mt-3 flex flex-wrap gap-2">
|
||||
<div className="ui-card p-2.5 md:p-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-sm font-semibold text-foreground">未解析链接</h3>
|
||||
<span className="rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground">{unresolvedLinks.length}</span>
|
||||
</div>
|
||||
<p className="mt-1 text-[11px] text-muted-foreground">可一键创建缺失页面。</p>
|
||||
<div className="mt-2 flex flex-wrap gap-1.5">
|
||||
{unresolvedLinks.length > 0 ? (
|
||||
unresolvedLinks.map((title) => (
|
||||
<button
|
||||
@@ -347,19 +357,20 @@ export default function Home() {
|
||||
onClick={async () => {
|
||||
await addPage(null, "file", { title, content: "" });
|
||||
}}
|
||||
className="rounded-md border border-dashed border-border bg-muted/30 px-2.5 py-1 text-xs text-foreground transition-colors hover:bg-accent"
|
||||
className="rounded-md border border-dashed border-border bg-muted/30 px-2 py-0.5 text-[11px] text-foreground transition-colors hover:bg-accent"
|
||||
title={`创建页面:${title}`}
|
||||
>
|
||||
+ {title}
|
||||
</button>
|
||||
))
|
||||
) : (
|
||||
<span className="text-xs text-muted-foreground">全部链接已解析</span>
|
||||
<span className="text-[11px] text-muted-foreground">全部已解析</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="ui-card p-3 md:p-4">
|
||||
<div className="ui-card p-2.5 md:p-3">
|
||||
<button
|
||||
onClick={() => setIsHistoryOpen((v) => !v)}
|
||||
className="flex w-full items-center justify-between rounded-md px-1 py-1 text-left transition-colors hover:bg-muted/45"
|
||||
@@ -373,9 +384,9 @@ export default function Home() {
|
||||
</div>
|
||||
<ChevronDown size={15} className={cn("text-muted-foreground transition-transform", isHistoryOpen && "rotate-180")} />
|
||||
</button>
|
||||
<p className="mt-1 text-xs text-muted-foreground">自动保存最近修改快照(当前浏览器本地)。</p>
|
||||
<p className="mt-1 text-[11px] text-muted-foreground">自动保存最近修改快照(当前浏览器本地)。</p>
|
||||
{isHistoryOpen && (
|
||||
<div className="mt-3 space-y-3">
|
||||
<div className="mt-2 space-y-2.5">
|
||||
{localHistory.length > 0 ? (
|
||||
<>
|
||||
<div className="rounded-lg border border-border/60 bg-muted/20 p-2">
|
||||
|
||||
Reference in New Issue
Block a user