This commit is contained in:
expdsn 2025-03-04 16:13:41 +08:00
parent c96374ef1a
commit 63feb39dee
11 changed files with 75 additions and 32 deletions

40
.dockerignore Normal file
View File

@ -0,0 +1,40 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# env files (can opt-in for committing if needed)
.env.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts

View File

@ -1,11 +1,7 @@
import { getArticle } from "@/app/_lib/data/article"
import MarkdownView from "@/app/_ui/MarkdownView"
import { faArrowRight } from "@fortawesome/free-solid-svg-icons"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import Image from "next/image"
import { MDXRemote } from 'next-mdx-remote/rsc'
import Link from "next/link"
import { mdxComponent } from "@/app/_lib/MdxComponent"
import { CustomMDX } from "@/app/_ui/customComponent"
const PICTURE_PREFIX = 'https://newuitab.oss-cn-hangzhou.aliyuncs.com/ai_upload/downloads/'
export default async function Page({ params }: { params: Promise<{ id: string }> }) {

View File

@ -1,20 +1,23 @@
import { getLinkList, getLinkListAll } from "@/app/_lib/data/link";
import { getLinkList } from "@/app/_lib/data/link";
import { getLinkType } from "@/app/_lib/data/linkType";
import { LinkBlock } from "@/app/_ui/LinkListBox";
import Search from "@/app/_ui/Search";
import { use } from "react";
import { Suspense } from "react";
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
const id = (await params).id
const linkType = await getLinkType(id)
const { list: linkList } = await getLinkList({ typeId: id })
const { list: linkList } = await getLinkList({ filter: { type: id } })
return (
<>
{/* <HeaderNav></HeaderNav> */}
<main className="w-full p-5">
<Search></Search >
<Suspense fallback={<div>...</div>}>
<Search></Search >
</Suspense>
<h1 className="text-3xl font-bold mb-6 flex justify-center">{linkType?.label}</h1>
<div className=" grid grid-cols-3 lg:grid-cols-6 gap-4 ">
{

View File

@ -4,6 +4,7 @@ import LinkListBox from "../_ui/LinkListBox";
import { getLinkTypeList } from "../_lib/data/linkType";
import { getLinkList } from "../_lib/data/link";
import Footer from "../_ui/footer";
import { Suspense } from "react";
export default async function Page() {
@ -16,7 +17,9 @@ export default async function Page() {
<SiderNav linkList={linkTypeList} />
<div className="w-full">
<main className="flex-1 relative flex flex-col p-5 gap-y-4">
<Search></Search>
<Suspense fallback={<></>}>
<Search></Search>
</Suspense>
<LinkListBox linkList={linkList} linkTypeList={linkTypeList} showHot showRecent></LinkListBox>
</main>
<Footer></Footer>

View File

@ -1,9 +1,12 @@
import Search from "@/app/_ui/Search";
import ResultBox from "./ResultBox";
import { Suspense } from "react";
export default function Page() {
return <div>
<Search></Search>
<ResultBox />
<Suspense fallback={<div>...</div>}>
<Search></Search>
<ResultBox />
</Suspense>
</div>
}

View File

@ -4,7 +4,7 @@ import { LinkType } from "../_lib/data/linkType";
import { Link as _Link } from "../_lib/data/link";
import { useEffect, useMemo, useState } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowRight, faClock, faFire, faRightFromBracket, faRightLong, faTimeline, faTimesCircle, faTimesRectangle, faVolumeTimes } from "@fortawesome/free-solid-svg-icons";
import { faArrowRight, faClock, faFire} from "@fortawesome/free-solid-svg-icons";
import { useAtom } from "jotai";
import { linkTypeAtom } from "../_lib/atom";
import Image from "next/image";

View File

@ -33,7 +33,7 @@ export default function LinkTable(props: { id: string }) {
({ current, pageSize }) => {
console.log(current, pageSize);
return getLinkList({ page: current, pageSize, typeId: props.id })
return getLinkList({ page: current, pageSize, filter: { type: props.id } })
}
@ -196,7 +196,7 @@ export default function LinkTable(props: { id: string }) {
value: item._id
}))}></Select>
</Form.Item>
<Form.Item name="priority" label="优先级"
rules={[{ required: true, message: "请输入优先级" }]}

View File

@ -5,7 +5,6 @@ import { useRouter } from "next/navigation";
import { useAntdTable } from "ahooks";
import { deleteArticle, getArticleList } from "@/app/_lib/data/article";
import { PICTURE_PREFIX } from "@/app/_lib/utils";
import Item from "antd/es/list/Item";
export default function Page() {
const router = useRouter()

View File

@ -55,7 +55,7 @@ export default function Page() {
dataIndex: "icon",
render: (_, item) => (
<>
<Image width={70} src={item.icon?.startsWith('https') ? item.icon : PICTURE_PREFIX + item.icon} ></Image>
<Image width={70} alt="1" src={item.icon?.startsWith('https') ? item.icon : PICTURE_PREFIX + item.icon} ></Image>
</>
)
},

View File

@ -11,9 +11,9 @@ export async function GET(req: NextRequest) {
const pageSize = parseInt(req.nextUrl.searchParams.get('pageSize') || '10') || 10;
const typeId = req.nextUrl.searchParams.get('typeId') || ''
const res = await getLinkList({ page, pageSize, typeId })
const res = await getLinkList({ page, pageSize, filter: { type: typeId } })
return Response.json(res)
} catch {
} catch {
return Response.error()
}
}

View File

@ -1,21 +1,20 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
import { FlatCompat } from '@eslint/eslintrc'
const compat = new FlatCompat({
baseDirectory: __dirname,
});
// import.meta.dirname is available after Node.js v20.11.0
baseDirectory: import.meta.dirname,
})
const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
{
...compat.config({
extends: ['next'],
rules: {
'react/no-unescaped-entities': 'off',
'@next/next/no-page-custom-font': 'off',
"@typescript-eslint/no-explicit-any": "off", // 禁用对显式 any 类型的检查
},
},
];
export default eslintConfig;
},
}),
]
export default eslintConfig