mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-10-27 17:03:49 +08:00
Merge pull request #43 from RuoJi6/fix/issues-34-38
fix: 修复发现返回导航(#34)与情报内容搜索及查看对话(#38)
This commit is contained in:
5 files changed
+20
-13
No files matched your search
@@ -58,6 +58,7 @@ function FindingDetailInner() {
|
||||
const searchParams = useSearchParams();
|
||||
const id = searchParams.get("id") ?? "";
|
||||
const contextTaskId = searchParams.get("context_task") ?? "";
|
||||
const backHref = contextTaskId ? `/function/tasks/detail?id=${contextTaskId}&tab=findings` : "/function/findings";
|
||||
const [finding, setFinding] = React.useState<Finding | null>(null);
|
||||
const [loaded, setLoaded] = React.useState(false);
|
||||
const [tab, setTab] = React.useState("overview");
|
||||
@@ -117,7 +118,7 @@ function FindingDetailInner() {
|
||||
<p className="text-muted-foreground">{loaded ? `未找到发现 ${id}` : "加载中…"}</p>
|
||||
{loaded && (
|
||||
<Button asChild variant="outline">
|
||||
<Link href="/function/findings">
|
||||
<Link href={backHref}>
|
||||
<ArrowLeftIcon /> 返回发现列表
|
||||
</Link>
|
||||
</Button>
|
||||
@@ -135,7 +136,7 @@ function FindingDetailInner() {
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<SidebarTrigger className="-ml-1" />
|
||||
<Button asChild variant="ghost" size="icon" className="size-7">
|
||||
<Link href="/function/findings">
|
||||
<Link href={backHref}>
|
||||
<ArrowLeftIcon />
|
||||
</Link>
|
||||
</Button>
|
||||
|
||||
@@ -113,11 +113,7 @@ function Row({
|
||||
</span>
|
||||
{f.finding_id && (
|
||||
<Link
|
||||
href={
|
||||
f.inherited
|
||||
? `/function/findings/detail?id=${f.finding_id}&context_task=${contextTaskId}`
|
||||
: `/function/findings/detail?id=${f.finding_id}`
|
||||
}
|
||||
href={`/function/findings/detail?id=${f.finding_id}&context_task=${contextTaskId}`}
|
||||
className="text-muted-foreground hover:text-primary inline-flex shrink-0 items-center gap-0.5 text-xs"
|
||||
title="查看漏洞详情"
|
||||
>
|
||||
@@ -190,7 +186,7 @@ export function FindingsTab({ taskId }: { taskId: string }) {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4">
|
||||
<FindingCaseList query={{ task: taskId, sort: "time" }} />
|
||||
<FindingCaseList query={{ task: taskId, sort: "time" }} contextTask={taskId} />
|
||||
{[
|
||||
...new Set(
|
||||
items
|
||||
|
||||
@@ -354,7 +354,17 @@ function TaskDetailInner() {
|
||||
);
|
||||
|
||||
return (
|
||||
<Tabs value={tab} onValueChange={setTab} className="flex flex-1 flex-col gap-0">
|
||||
<Tabs
|
||||
value={tab}
|
||||
onValueChange={(value) => {
|
||||
setTab(value);
|
||||
const params = new URLSearchParams(searchParams.toString());
|
||||
params.set("tab", value);
|
||||
params.delete("session");
|
||||
router.replace(`/function/tasks/detail?${params.toString()}`, { scroll: false });
|
||||
}}
|
||||
className="flex flex-1 flex-col gap-0"
|
||||
>
|
||||
{/* Top fixed area */}
|
||||
<header className="sticky top-0 z-10 flex flex-col gap-2 border-b bg-background/95 px-4 py-2.5 backdrop-blur lg:px-6">
|
||||
<div className="flex items-center gap-2">
|
||||
|
||||
@@ -193,8 +193,8 @@ export function IntelligencePanel({
|
||||
</Tabs>
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<Input
|
||||
aria-label="搜索情报标题或上报者"
|
||||
placeholder="搜索标题或上报者"
|
||||
aria-label="搜索情报标题、内容或上报者"
|
||||
placeholder="搜索标题、内容或上报者"
|
||||
value={search}
|
||||
maxLength={200}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
|
||||
Reference in new issue
Block a user