mirror of
https://github.com/yuruotong1/autoMate.git
synced 2025-12-26 05:16:21 +08:00
🐛 修复(server.ts):将端口变量从小写port改为大写PORT
✨ 功能(server.ts):添加对process.env.PORT环境变量的支持
This commit is contained in:
parent
e5321f2368
commit
6950d90b22
@ -0,0 +1,19 @@
|
||||
import { FolderClose } from "@icon-park/react"
|
||||
import { NavLink } from "react-router-dom"
|
||||
|
||||
interface Props {
|
||||
category: CategoryType
|
||||
}
|
||||
|
||||
export const CategoryItem = ({category}: Props) => {
|
||||
return (
|
||||
<NavLink
|
||||
to={`/config/category/contentList/${category.id}`}
|
||||
key={category.id} >
|
||||
<div className="flex items-center gap-1">
|
||||
<FolderClose theme="outline" size="12" strokeWidth={3}></FolderClose>
|
||||
<div className="truncate">{category.name}</div>
|
||||
</div>
|
||||
</NavLink>
|
||||
)
|
||||
}
|
||||
12
ui/autoMate/src/renderer/src/components/FooterMenu/index.tsx
Normal file
12
ui/autoMate/src/renderer/src/components/FooterMenu/index.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
import { Add, DatabaseConfig } from '@icon-park/react'
|
||||
|
||||
export const FooterMenu = () => {
|
||||
return (
|
||||
<>
|
||||
<div className="nav">
|
||||
<Add theme="outline" size="20" fill="#333"/>
|
||||
<DatabaseConfig theme="outline" size="20" fill="#333"/>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
23
ui/autoMate/src/renderer/src/components/QuickNav/index.tsx
Normal file
23
ui/autoMate/src/renderer/src/components/QuickNav/index.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
import { AllApplication } from "@icon-park/react"
|
||||
import { NavLink } from "react-router-dom"
|
||||
|
||||
export const QuickNav = () => {
|
||||
return (
|
||||
<>
|
||||
<div className="px-2 mt-2 opacity-90 mb-1">快捷操作</div>
|
||||
<NavLink to={`/config/category/contentList`} end className="font-blod mb-1">
|
||||
<div className="flex items-center gap-1">
|
||||
<AllApplication theme="outline" size="12" strokeWidth={3}/>
|
||||
<div className="truncate">所有内容</div>
|
||||
</div>
|
||||
</NavLink>
|
||||
<NavLink to={`/config/category/contentList/0`} end className="font-blod mb-1">
|
||||
<div className="flex items-center gap-1">
|
||||
<AllApplication theme="outline" size="12" strokeWidth={3}/>
|
||||
<div className="truncate">未分类</div>
|
||||
</div>
|
||||
</NavLink>
|
||||
</>
|
||||
)
|
||||
|
||||
}
|
||||
@ -1,42 +1,21 @@
|
||||
import { NavLink, Outlet, useLoaderData } from "react-router-dom"
|
||||
import { Outlet, useLoaderData } from "react-router-dom"
|
||||
import "./category.scss"
|
||||
import { Add, AllApplication, DatabaseConfig, FolderClose } from "@icon-park/react"
|
||||
import { CategoryItem } from "@renderer/components/CategoryItem"
|
||||
import { QuickNav } from "@renderer/components/QuickNav"
|
||||
import { FooterMenu } from "@renderer/components/FooterMenu"
|
||||
|
||||
export const Category = () => {
|
||||
const categories = useLoaderData() as CategoryType[]
|
||||
return (
|
||||
<main className="category-page">
|
||||
<div className="categories">
|
||||
<div className="px-2 mt-2 opacity-90 mb-1">快捷操作</div>
|
||||
{/* 加 end 表示路径完全匹配时,才会被选中 */}
|
||||
<NavLink to={`/config/category/contentList`} end className="font-blod mb-1">
|
||||
<div className="flex items-center gap-1">
|
||||
<AllApplication theme="outline" size="12" strokeWidth={3}/>
|
||||
<div className="truncate">所有内容</div>
|
||||
</div>
|
||||
</NavLink>
|
||||
<NavLink to={`/config/category/contentList/0`} end className="font-blod mb-1">
|
||||
<div className="flex items-center gap-1">
|
||||
<AllApplication theme="outline" size="12" strokeWidth={3}/>
|
||||
<div className="truncate">未分类</div>
|
||||
</div>
|
||||
</NavLink>
|
||||
<QuickNav/>
|
||||
{categories.map((category) => (
|
||||
<NavLink
|
||||
to={`/config/category/contentList/${category.id}`}
|
||||
key={category.id} >
|
||||
<div className="flex items-center gap-1">
|
||||
<FolderClose theme="outline" size="12" strokeWidth={3}></FolderClose>
|
||||
<div className="truncate">{category.name}</div>
|
||||
</div>
|
||||
</NavLink>
|
||||
<CategoryItem category={category} key={category.id}/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="nav">
|
||||
<Add theme="outline" size="20" fill="#333"/>
|
||||
<DatabaseConfig theme="outline" size="20" fill="#333"/>
|
||||
</div>
|
||||
<FooterMenu/>
|
||||
|
||||
<div className="content">
|
||||
<Outlet></Outlet>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user