Separate official website page
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
VITE_API_URL=https://api.fatweb.top
|
||||
VITE_API_URL=${PRODUCT_API_URL}
|
||||
VITE_API_TOKEN_URL=${VITE_API_URL}/token
|
||||
@@ -1,3 +1,3 @@
|
||||
NODE_ENV=development
|
||||
VITE_API_URL=https://api-test.fatweb.top
|
||||
VITE_API_URL=${TEST_API_URL}
|
||||
VITE_API_TOKEN_URL=${VITE_API_URL}/token
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>FatWeb</title>
|
||||
<title>Oxygen Toolbox</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "fatweb-ui",
|
||||
"name": "oxygen-ui",
|
||||
"version": "0.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "fatweb-ui",
|
||||
"name": "oxygen-ui",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^5.2.6",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "fatweb-ui",
|
||||
"name": "oxygen-ui",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
@use "@/assets/css/constants" as constants;
|
||||
|
||||
.icons {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
|
||||
.icon {
|
||||
font-size: 8em;
|
||||
color: constants.$origin-color;
|
||||
}
|
||||
}
|
||||
|
||||
.links {
|
||||
font-size: 2em;
|
||||
text-decoration: underline;
|
||||
color: constants.$origin-color;
|
||||
|
||||
> * {
|
||||
color: constants.$origin-color;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
[data-component=home].indicator {
|
||||
position: fixed;
|
||||
margin: {
|
||||
right: 20px;
|
||||
};
|
||||
width: 20px;
|
||||
height: 100px;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
@use "@/assets/css/mixins" as mixins;
|
||||
|
||||
.center-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.big-logo {
|
||||
font: {
|
||||
size: 5em;
|
||||
weight: bold;
|
||||
};
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.slogan {
|
||||
font: {
|
||||
size: 1.3em;
|
||||
style: italic;
|
||||
};
|
||||
color: #666;
|
||||
|
||||
.cursor {
|
||||
font-style: normal;
|
||||
animation: 1s infinite;
|
||||
|
||||
@include mixins.unique-keyframes {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
50% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-down {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
padding: 20px;
|
||||
cursor: pointer;
|
||||
animation: 1.5s infinite;
|
||||
@include mixins.unique-keyframes {
|
||||
0%,
|
||||
100% {
|
||||
-ms-filter: none;
|
||||
filter: none;
|
||||
opacity: 1;
|
||||
transform: translateY(10px);
|
||||
}
|
||||
|
||||
50% {
|
||||
-ms-filter: alpha(opacity=40);
|
||||
filter: alpha(opacity=40);
|
||||
opacity: .4;
|
||||
transform: translateY(-10px);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
@use "@/assets/css/mixins" as mixins;
|
||||
@use "@/assets/css/constants" as constants;
|
||||
|
||||
[data-component=home-framework] {
|
||||
.nav {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
align-items: center;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
height: 70px;
|
||||
background-color: constants.$origin-color;
|
||||
border: {
|
||||
bottom: {
|
||||
width: 1px;
|
||||
style: solid;
|
||||
color: constants.$border-color;
|
||||
}
|
||||
}
|
||||
animation: .5s ease both;
|
||||
|
||||
@include mixins.unique-keyframes {
|
||||
0% {
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.logo {
|
||||
padding: 0 40px;
|
||||
|
||||
.title {
|
||||
font-size: 2.8em;
|
||||
font-family: century gothic, texgyreadventor, stheiti, sans-serif;
|
||||
}
|
||||
}
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
flex: 1;
|
||||
transition: {
|
||||
property: all;
|
||||
duration: .5s;
|
||||
};
|
||||
|
||||
.menu {
|
||||
padding: 0 30px;
|
||||
|
||||
.item {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
font-size: 1.5em;
|
||||
transition: {
|
||||
property: all;
|
||||
duration: .3s;
|
||||
};
|
||||
|
||||
a {
|
||||
padding: 5px 20px;
|
||||
color: constants.$url-color;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
border: {
|
||||
bottom: {
|
||||
width: 2px;
|
||||
style: solid;
|
||||
color: constants.$url-active-color;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
.item:hover {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.item:hover .submenu {
|
||||
display: block;
|
||||
border: {
|
||||
width: 1px;
|
||||
color: constants.$border-color;
|
||||
style: solid;
|
||||
};
|
||||
animation: 0.3s;
|
||||
|
||||
@include mixins.unique-keyframes {
|
||||
0% {
|
||||
transform: translateY(-10px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.submenu {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
background-color: constants.$origin-color;
|
||||
overflow: hidden;
|
||||
|
||||
.item {
|
||||
display: block;
|
||||
font-size: 0.8em;
|
||||
transition: all 0s;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
padding: 8px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.item:hover {
|
||||
transform: none;
|
||||
|
||||
a {
|
||||
background-color: constants.$focus-color !important;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
font-weight: bold;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-menu-button {
|
||||
display: none;
|
||||
margin: 0 20px;
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.dropdown-menu-button.active {
|
||||
background-color: transparentize(constants.$focus-color, 0.8);
|
||||
border: {
|
||||
width: 1px;
|
||||
color: constants.$focus-color;
|
||||
style: solid;
|
||||
};
|
||||
}
|
||||
|
||||
@media screen and (max-width: 900px) {
|
||||
.menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.dropdown-menu-button {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-menu-content {
|
||||
display: none;
|
||||
|
||||
@media screen and (max-width: 900px) {
|
||||
display: none;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
top: 70px;
|
||||
border: {
|
||||
width: 1px;
|
||||
color: constants.$border-color;
|
||||
style: solid;
|
||||
};
|
||||
background-color: constants.$origin-color;
|
||||
z-index: 1;
|
||||
|
||||
ul {
|
||||
li {
|
||||
font-size: 1.2em;
|
||||
text-align: center;
|
||||
|
||||
a {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
:hover {
|
||||
background-color: constants.$focus-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 900px) {
|
||||
.dropdown-menu-content.show {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.nav.hide {
|
||||
animation: .5s ease both;
|
||||
|
||||
@include mixins.unique-keyframes {
|
||||
0% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
100% {
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ const FullscreenLoadingMask: React.FC = () => {
|
||||
const loadingIcon = (
|
||||
<>
|
||||
<Icon
|
||||
component={IconFatwebLoading}
|
||||
component={IconOxygenLoading}
|
||||
style={{ fontSize: 24, color: COLOR_FONT_MAIN }}
|
||||
spin
|
||||
/>
|
||||
|
||||
@@ -11,7 +11,7 @@ const LoadingMask: React.FC<LoadingMaskProps> = (props) => {
|
||||
const loadingIcon = (
|
||||
<>
|
||||
<Icon
|
||||
component={IconFatwebLoading}
|
||||
component={IconOxygenLoading}
|
||||
style={{ fontSize: 24, color: COLOR_FONT_MAIN }}
|
||||
spin
|
||||
/>
|
||||
|
||||
@@ -33,7 +33,7 @@ const SidebarFooter: React.FC = () => {
|
||||
removeToken()
|
||||
notification.info({
|
||||
message: '已退出登录',
|
||||
icon: <Icon component={IconFatwebExit} style={{ color: COLOR_ERROR }} />
|
||||
icon: <Icon component={IconOxygenExit} style={{ color: COLOR_ERROR }} />
|
||||
})
|
||||
setTimeout(() => {
|
||||
window.location.reload()
|
||||
@@ -65,7 +65,7 @@ const SidebarFooter: React.FC = () => {
|
||||
{avatar ? (
|
||||
<img src={avatar} alt={'Avatar'} />
|
||||
) : (
|
||||
<Icon viewBox={'-20 0 1024 1024'} component={IconFatwebUser} />
|
||||
<Icon viewBox={'-20 0 1024 1024'} component={IconOxygenUser} />
|
||||
)}
|
||||
</span>
|
||||
<span hidden={getLoginStatus()} className={'text'}>
|
||||
@@ -84,7 +84,7 @@ const SidebarFooter: React.FC = () => {
|
||||
<div className={'content'}>
|
||||
<span hidden={!getLoginStatus()} className={'icon-exit'} onClick={handleLogout}>
|
||||
<Icon
|
||||
component={exiting ? IconFatwebLoading : IconFatwebExit}
|
||||
component={exiting ? IconOxygenLoading : IconOxygenExit}
|
||||
spin={exiting}
|
||||
/>
|
||||
</span>
|
||||
|
||||
@@ -29,7 +29,7 @@ const Sidebar: React.FC<SidebarProps> = (props) => {
|
||||
>
|
||||
<div className={'title'}>
|
||||
<span className={'icon-box'} onClick={switchSidebar}>
|
||||
<Icon component={IconFatwebExpand} />
|
||||
<Icon component={IconOxygenExpand} />
|
||||
</span>
|
||||
<span className={'text'}>{props.title}</span>
|
||||
</div>
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
import React from 'react'
|
||||
import Icon from '@ant-design/icons'
|
||||
import '@/assets/css/components/home/footer.scss'
|
||||
import FitCenter from '@/components/common/FitCenter'
|
||||
import FitFullscreen from '@/components/common/FitFullscreen'
|
||||
|
||||
const Footer: React.FC = () => {
|
||||
return (
|
||||
<>
|
||||
<FitFullscreen backgroundColor={'#333'}>
|
||||
<FitCenter vertical={true} style={{ gap: 20 }}>
|
||||
<div className={'icons'}>
|
||||
<NavLink to={'https://github.com/FatttSnake'}>
|
||||
<Icon component={IconFatwebGithub} className={'icon'} />
|
||||
</NavLink>
|
||||
<NavLink to={'https://ci.fatweb.top'}>
|
||||
<Icon component={IconFatwebJenkins} className={'icon'} />
|
||||
</NavLink>
|
||||
</div>
|
||||
<div className={'links'}>
|
||||
<NavLink to={'mailto:fatttsnake@fatweb.top'}>Mail</NavLink>
|
||||
</div>
|
||||
</FitCenter>
|
||||
</FitFullscreen>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Footer
|
||||
@@ -1,17 +0,0 @@
|
||||
import React from 'react'
|
||||
import FitCenter from '@/components/common/FitCenter'
|
||||
|
||||
const OxygenToolbox: React.FC = () => {
|
||||
return (
|
||||
<>
|
||||
<FitCenter vertical>
|
||||
<div>
|
||||
<div style={{ fontSize: '4.5em', fontWeight: 'bold' }}>Oxygen Toolbox</div>
|
||||
<div style={{ fontSize: '1.4em', textAlign: 'end' }}>is coming soon...</div>
|
||||
</div>
|
||||
</FitCenter>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default OxygenToolbox
|
||||
@@ -1,50 +0,0 @@
|
||||
import React from 'react'
|
||||
import Icon from '@ant-design/icons'
|
||||
import '@/assets/css/components/home/slogan.scss'
|
||||
import FitCenter from '@/components/common/FitCenter'
|
||||
|
||||
interface SloganProps {
|
||||
onClickScrollDown: (event: React.MouseEvent) => void
|
||||
}
|
||||
|
||||
const Slogan: React.FC<SloganProps> = (props) => {
|
||||
const [slogan, setSlogan] = useState('')
|
||||
const [sloganType, setSloganType] = useState(true)
|
||||
|
||||
const typeText = '因为热爱 所以折腾'
|
||||
if (sloganType) {
|
||||
setTimeout(() => {
|
||||
if (slogan.length < typeText.length) {
|
||||
setSlogan(typeText.substring(0, slogan.length + 1))
|
||||
} else {
|
||||
setSloganType(false)
|
||||
}
|
||||
}, 250)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
if (slogan.length > 0) {
|
||||
setSlogan(typeText.substring(0, slogan.length - 1))
|
||||
} else {
|
||||
setSloganType(true)
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<FitCenter>
|
||||
<div className={'center-box'}>
|
||||
<div className={'big-logo'}>FatWeb</div>
|
||||
<span id={'slogan'} className={'slogan'}>
|
||||
/* {slogan || <> </>} <span className={'cursor'}>|</span> */
|
||||
</span>
|
||||
</div>
|
||||
<div className={'scroll-down'} onClick={props.onClickScrollDown}>
|
||||
<Icon component={IconFatwebDown} style={{ fontSize: '1.8em', color: '#666' }} />
|
||||
</div>
|
||||
</FitCenter>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Slogan
|
||||
@@ -1,4 +1,4 @@
|
||||
export const PRODUCTION_NAME = 'FatWeb'
|
||||
export const PRODUCTION_NAME = 'Oxygen Toolbox'
|
||||
export const STORAGE_TOKEN_KEY = 'JWT_TOKEN'
|
||||
export const STORAGE_USER_INFO_KEY = 'USER_INFO'
|
||||
export const COLOR_ORIGIN = 'white'
|
||||
|
||||
@@ -1,223 +0,0 @@
|
||||
import React from 'react'
|
||||
import Icon from '@ant-design/icons'
|
||||
import '@/assets/css/pages/home-framework.scss'
|
||||
import { COLOR_FONT_SECONDARY } from '@/constants/common.constants'
|
||||
import { getRouter } from '@/router'
|
||||
import FullscreenLoadingMask from '@/components/common/FullscreenLoadingMask'
|
||||
import HideScrollbar, { HideScrollbarElement } from '@/components/common/HideScrollbar'
|
||||
|
||||
export const HomeFrameworkContext = createContext<{
|
||||
navbarHiddenState: {
|
||||
navbarHidden: boolean
|
||||
setNavbarHidden: (newValue: boolean) => void
|
||||
}
|
||||
preventScrollState: {
|
||||
preventScroll: boolean
|
||||
setPreventScroll: (newValue: boolean) => void
|
||||
}
|
||||
showVerticalScrollbarState: {
|
||||
showVerticalScrollbar: boolean
|
||||
setShowVerticalScrollbar: (newValue: boolean) => void
|
||||
}
|
||||
showHorizontalScrollbarState: {
|
||||
showHorizontalScrollbar: boolean
|
||||
setShowHorizontalScrollbar: (newValue: boolean) => void
|
||||
}
|
||||
showDropdownMenuState: {
|
||||
showDropdownMenu: boolean
|
||||
setShowDropdownMenu: (newValue: boolean) => void
|
||||
}
|
||||
hideScrollbarRef: React.RefObject<HideScrollbarElement>
|
||||
}>({
|
||||
navbarHiddenState: {
|
||||
navbarHidden: false,
|
||||
setNavbarHidden: () => undefined
|
||||
},
|
||||
preventScrollState: {
|
||||
preventScroll: false,
|
||||
setPreventScroll: () => undefined
|
||||
},
|
||||
showVerticalScrollbarState: {
|
||||
showVerticalScrollbar: false,
|
||||
setShowVerticalScrollbar: () => undefined
|
||||
},
|
||||
showHorizontalScrollbarState: {
|
||||
showHorizontalScrollbar: false,
|
||||
setShowHorizontalScrollbar: () => undefined
|
||||
},
|
||||
showDropdownMenuState: {
|
||||
showDropdownMenu: false,
|
||||
setShowDropdownMenu: () => undefined
|
||||
},
|
||||
hideScrollbarRef: createRef()
|
||||
})
|
||||
|
||||
const HomeFramework: React.FC = () => {
|
||||
const routeId = useMatches()[1].id
|
||||
const routeChildren = getRouter().routes[0].children?.find((value) => value.id === routeId)
|
||||
?.children
|
||||
|
||||
const pathname = useLocation().pathname
|
||||
|
||||
const hideScrollbarRef = useRef<HideScrollbarElement>(null)
|
||||
|
||||
const [navbarHidden, setNavbarHidden] = useState(true)
|
||||
const [preventScroll, setPreventScroll] = useState(false)
|
||||
const [showVerticalScrollbar, setShowVerticalScrollbar] = useState(false)
|
||||
const [showHorizontalScrollbar, setShowHorizontalScrollbar] = useState(false)
|
||||
const [showDropdownMenu, setShowDropdownMenu] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setNavbarHidden(false)
|
||||
}, [pathname])
|
||||
|
||||
const handleMenuDropdownButtonClick = () => {
|
||||
setShowDropdownMenu(!showDropdownMenu)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<HideScrollbar
|
||||
data-component={'home-framework'}
|
||||
ref={hideScrollbarRef}
|
||||
isPreventVerticalScroll={preventScroll}
|
||||
isShowHorizontalScrollbar={true}
|
||||
minWidth={900}
|
||||
>
|
||||
<div className={'body'}>
|
||||
<div>
|
||||
<header className={`nav${navbarHidden ? ' hide' : ''}`}>
|
||||
<a className={'logo'} href={'https://fatweb.top'}>
|
||||
<span className={'title'}>FatWeb</span>
|
||||
</a>
|
||||
<nav>
|
||||
<ul className={'menu'}>
|
||||
{routeChildren?.map((route) => {
|
||||
return (route.handle as RouteHandle).menu ? (
|
||||
<li className={'item'} key={route.id}>
|
||||
<NavLink
|
||||
to={route.path ?? ''}
|
||||
className={({ isActive, isPending }) =>
|
||||
isPending
|
||||
? 'pending'
|
||||
: isActive
|
||||
? 'active'
|
||||
: ''
|
||||
}
|
||||
>
|
||||
{(route.handle as RouteHandle).name}
|
||||
</NavLink>
|
||||
{route.children ? (
|
||||
<ul className={'submenu'}>
|
||||
{route.children.map((subRoute) => {
|
||||
return (subRoute.handle as RouteHandle)
|
||||
.menu ? (
|
||||
<li
|
||||
className={'item'}
|
||||
key={subRoute.id}
|
||||
>
|
||||
<NavLink
|
||||
to={`${route.path ?? ''}/${
|
||||
subRoute.path ?? ''
|
||||
}`}
|
||||
className={({
|
||||
isActive,
|
||||
isPending
|
||||
}) =>
|
||||
isPending
|
||||
? 'pending'
|
||||
: isActive
|
||||
? 'active'
|
||||
: ''
|
||||
}
|
||||
>
|
||||
{
|
||||
(
|
||||
subRoute.handle as RouteHandle
|
||||
).name
|
||||
}
|
||||
</NavLink>
|
||||
</li>
|
||||
) : (
|
||||
<></>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</li>
|
||||
) : (
|
||||
<></>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
<div
|
||||
className={`dropdown-menu-button${
|
||||
showDropdownMenu ? ' active' : ''
|
||||
}`}
|
||||
>
|
||||
<Icon
|
||||
component={IconFatwebMenu}
|
||||
style={{ fontSize: '2.6em', color: COLOR_FONT_SECONDARY }}
|
||||
onClick={handleMenuDropdownButtonClick}
|
||||
/>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<div className={`dropdown-menu-content${showDropdownMenu ? ' show' : ''}`}>
|
||||
<ul>
|
||||
{routeChildren?.map((route) => {
|
||||
return (
|
||||
<li className={'item'} key={route.id}>
|
||||
<NavLink
|
||||
to={route.path ?? ''}
|
||||
className={({ isActive, isPending }) =>
|
||||
isPending ? 'pending' : isActive ? 'active' : ''
|
||||
}
|
||||
>
|
||||
{(route.handle as RouteHandle).name}
|
||||
</NavLink>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<HomeFrameworkContext.Provider
|
||||
value={{
|
||||
navbarHiddenState: { navbarHidden, setNavbarHidden },
|
||||
preventScrollState: { preventScroll, setPreventScroll },
|
||||
showVerticalScrollbarState: {
|
||||
showVerticalScrollbar,
|
||||
setShowVerticalScrollbar
|
||||
},
|
||||
showHorizontalScrollbarState: {
|
||||
showHorizontalScrollbar,
|
||||
setShowHorizontalScrollbar
|
||||
},
|
||||
showDropdownMenuState: {
|
||||
showDropdownMenu,
|
||||
setShowDropdownMenu
|
||||
},
|
||||
hideScrollbarRef
|
||||
}}
|
||||
>
|
||||
<Suspense
|
||||
fallback={
|
||||
<>
|
||||
<FullscreenLoadingMask />
|
||||
</>
|
||||
}
|
||||
>
|
||||
<Outlet />
|
||||
</Suspense>
|
||||
</HomeFrameworkContext.Provider>
|
||||
</div>
|
||||
</HideScrollbar>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default HomeFramework
|
||||
@@ -142,7 +142,7 @@ const SignUp: React.FC = () => {
|
||||
]}
|
||||
>
|
||||
<AntdInput
|
||||
prefix={<Icon component={IconFatwebUser} />}
|
||||
prefix={<Icon component={IconOxygenUser} />}
|
||||
placeholder={'用户名'}
|
||||
maxLength={39}
|
||||
showCount={true}
|
||||
@@ -158,7 +158,7 @@ const SignUp: React.FC = () => {
|
||||
>
|
||||
<AntdInput
|
||||
type={'email'}
|
||||
prefix={<Icon component={IconFatwebEmail} />}
|
||||
prefix={<Icon component={IconOxygenEmail} />}
|
||||
placeholder={'邮箱'}
|
||||
disabled={isSigningUp}
|
||||
/>
|
||||
@@ -172,7 +172,7 @@ const SignUp: React.FC = () => {
|
||||
]}
|
||||
>
|
||||
<AntdInput.Password
|
||||
prefix={<Icon component={IconFatwebPassword} />}
|
||||
prefix={<Icon component={IconOxygenPassword} />}
|
||||
placeholder={'密码'}
|
||||
disabled={isSigningUp}
|
||||
/>
|
||||
@@ -194,7 +194,7 @@ const SignUp: React.FC = () => {
|
||||
]}
|
||||
>
|
||||
<AntdInput.Password
|
||||
prefix={<Icon component={IconFatwebPassword} />}
|
||||
prefix={<Icon component={IconOxygenPassword} />}
|
||||
placeholder={'确认密码'}
|
||||
disabled={isSigningUp}
|
||||
/>
|
||||
@@ -531,7 +531,7 @@ const Forget: React.FC = () => {
|
||||
]}
|
||||
>
|
||||
<AntdInput
|
||||
prefix={<Icon component={IconFatwebEmail} />}
|
||||
prefix={<Icon component={IconOxygenEmail} />}
|
||||
placeholder={'邮箱'}
|
||||
disabled={isSending}
|
||||
/>
|
||||
@@ -724,7 +724,7 @@ const SignIn: React.FC = () => {
|
||||
rules={[{ required: true, message: '请输入账号' }]}
|
||||
>
|
||||
<AntdInput
|
||||
prefix={<Icon component={IconFatwebUser} />}
|
||||
prefix={<Icon component={IconOxygenUser} />}
|
||||
placeholder={'邮箱/用户名'}
|
||||
disabled={isSigningIn}
|
||||
/>
|
||||
@@ -734,7 +734,7 @@ const SignIn: React.FC = () => {
|
||||
rules={[{ required: true, message: '请输入密码' }]}
|
||||
>
|
||||
<AntdInput.Password
|
||||
prefix={<Icon component={IconFatwebPassword} />}
|
||||
prefix={<Icon component={IconOxygenPassword} />}
|
||||
placeholder={'密码'}
|
||||
disabled={isSigningIn}
|
||||
/>
|
||||
|
||||
@@ -20,15 +20,11 @@ const ToolsFramework: React.FC = () => {
|
||||
{hasPathPermission('/system') ? (
|
||||
<SidebarItem
|
||||
path={'/system'}
|
||||
icon={IconFatwebSetting}
|
||||
icon={IconOxygenSetting}
|
||||
text={'系统配置'}
|
||||
/>
|
||||
) : undefined}
|
||||
<SidebarItem
|
||||
path={'/tools'}
|
||||
icon={IconFatwebBack}
|
||||
text={'回到氧工具'}
|
||||
/>
|
||||
<SidebarItem path={'/'} icon={IconOxygenBack} text={'回到氧工具'} />
|
||||
</SidebarItemList>
|
||||
}
|
||||
>
|
||||
|
||||
@@ -1,174 +0,0 @@
|
||||
import React from 'react'
|
||||
import '@/assets/css/components/home/home.scss'
|
||||
import { HomeFrameworkContext } from '@/pages/HomeFramework'
|
||||
import FitFullscreen from '@/components/common/FitFullscreen'
|
||||
import Slogan from '@/components/home/Slogan'
|
||||
import OxygenToolbox from '@/components/home/OxygenToolbox'
|
||||
import Indicator from '@/components/common/Indicator'
|
||||
import Footer from '@/components/home/Footer'
|
||||
|
||||
const Home: React.FC = () => {
|
||||
const {
|
||||
hideScrollbarRef,
|
||||
navbarHiddenState: { navbarHidden, setNavbarHidden },
|
||||
showDropdownMenuState: { setShowDropdownMenu },
|
||||
preventScrollState: { setPreventScroll }
|
||||
} = useContext(HomeFrameworkContext)
|
||||
|
||||
const fitFullScreenRef = useRef<HTMLDivElement>(null)
|
||||
const scrollTimeout = useRef(0)
|
||||
const clickStart = useRef(0)
|
||||
|
||||
const [currentContent, setCurrentContent] = useState(0)
|
||||
|
||||
useEffect(() => {
|
||||
setTimeout(() => {
|
||||
setNavbarHidden(true)
|
||||
setPreventScroll(true)
|
||||
})
|
||||
}, [setNavbarHidden, setPreventScroll])
|
||||
|
||||
useLayoutEffect(() => {
|
||||
const handleWindowResize = () => {
|
||||
handleScrollToContent(currentContent)()
|
||||
}
|
||||
window.addEventListener('resize', handleWindowResize)
|
||||
return () => window.removeEventListener('resize', handleWindowResize)
|
||||
})
|
||||
|
||||
const handleScrollToContent = (index: number) => {
|
||||
return () => {
|
||||
setShowDropdownMenu(false)
|
||||
if (!index) {
|
||||
setNavbarHidden(true)
|
||||
hideScrollbarRef.current?.scrollY(0)
|
||||
} else {
|
||||
hideScrollbarRef.current?.scrollY(
|
||||
(fitFullScreenRef.current?.offsetHeight ?? 0) * index
|
||||
)
|
||||
setNavbarHidden(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const handleScrollUp = () => {
|
||||
if (currentContent <= 0) {
|
||||
return
|
||||
}
|
||||
handleScrollToContent(currentContent - 1)()
|
||||
clearTimeout(scrollTimeout.current)
|
||||
scrollTimeout.current = setTimeout(() => {
|
||||
setCurrentContent(currentContent - 1)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
const handleScrollDown = () => {
|
||||
if (currentContent >= content.length - 1) {
|
||||
return
|
||||
}
|
||||
handleScrollToContent(currentContent + 1)()
|
||||
clearTimeout(scrollTimeout.current)
|
||||
scrollTimeout.current = setTimeout(() => {
|
||||
setCurrentContent(currentContent + 1)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
const handleWheel = (event: React.WheelEvent) => {
|
||||
if (event.altKey || event.ctrlKey || event.shiftKey || event.deltaY === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
if (event.deltaY > 0) {
|
||||
handleScrollDown()
|
||||
} else {
|
||||
handleScrollUp()
|
||||
}
|
||||
}
|
||||
|
||||
const handleTouchStart = (event: React.TouchEvent) => {
|
||||
clickStart.current = event.touches[0].clientY
|
||||
}
|
||||
|
||||
const handleTouchEnd = (event: React.TouchEvent) => {
|
||||
const moveLength = clickStart.current - event.changedTouches[0].clientY
|
||||
if (Math.abs(moveLength) < 100) {
|
||||
return
|
||||
}
|
||||
|
||||
if (moveLength > 0) {
|
||||
handleScrollDown()
|
||||
} else {
|
||||
handleScrollUp()
|
||||
}
|
||||
}
|
||||
|
||||
const handleMouseDown = (event: React.MouseEvent) => {
|
||||
clickStart.current = event.clientY
|
||||
}
|
||||
|
||||
const handleMouseUp = (event: React.MouseEvent) => {
|
||||
const moveLength = clickStart.current - event.clientY
|
||||
if (Math.abs(moveLength) < 100) {
|
||||
return
|
||||
}
|
||||
|
||||
if (moveLength > 0) {
|
||||
handleScrollDown()
|
||||
} else {
|
||||
handleScrollUp()
|
||||
}
|
||||
}
|
||||
|
||||
const handleKeyDown = (event: React.KeyboardEvent) => {
|
||||
if (event.key === 'ArrowUp') {
|
||||
handleScrollUp()
|
||||
}
|
||||
if (event.key === 'ArrowDown') {
|
||||
handleScrollDown()
|
||||
}
|
||||
}
|
||||
|
||||
const handleIndicatorSwitch = (index: number) => {
|
||||
setCurrentContent(index)
|
||||
handleScrollToContent(index)()
|
||||
}
|
||||
|
||||
const content = [
|
||||
{
|
||||
backgroundColor: '#FBFBFB',
|
||||
ref: fitFullScreenRef,
|
||||
children: <Slogan onClickScrollDown={handleScrollDown} />
|
||||
},
|
||||
{ children: <OxygenToolbox /> },
|
||||
{ children: <Footer /> }
|
||||
]
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
data-component={'home'}
|
||||
tabIndex={0}
|
||||
onWheel={handleWheel}
|
||||
onTouchStart={handleTouchStart}
|
||||
onTouchEnd={handleTouchEnd}
|
||||
onMouseDown={handleMouseDown}
|
||||
onMouseUp={handleMouseUp}
|
||||
onKeyDown={handleKeyDown}
|
||||
>
|
||||
{content.map((element, index) => {
|
||||
return <FitFullscreen key={index} {...element} />
|
||||
})}
|
||||
</div>
|
||||
|
||||
<div data-component={'home'} hidden={navbarHidden} className={'indicator'}>
|
||||
<Indicator
|
||||
total={content.length}
|
||||
current={currentContent}
|
||||
onSwitch={handleIndicatorSwitch}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Home
|
||||
@@ -503,7 +503,7 @@ const Group: React.FC = () => {
|
||||
style={{ padding: '4px 8px' }}
|
||||
onClick={handleOnAddBtnClick}
|
||||
>
|
||||
<Icon component={IconFatwebPlus} style={{ fontSize: '1.2em' }} />
|
||||
<Icon component={IconOxygenPlus} style={{ fontSize: '1.2em' }} />
|
||||
</AntdButton>
|
||||
</Card>
|
||||
</Permission>
|
||||
@@ -512,7 +512,7 @@ const Group: React.FC = () => {
|
||||
style={{ overflow: 'inherit', flex: '0 0 auto' }}
|
||||
>
|
||||
<AntdButton style={{ padding: '4px 8px' }} onClick={handleOnListDeleteBtnClick}>
|
||||
<Icon component={IconFatwebDelete} style={{ fontSize: '1.2em' }} />
|
||||
<Icon component={IconOxygenDelete} style={{ fontSize: '1.2em' }} />
|
||||
</AntdButton>
|
||||
</Card>
|
||||
<Card style={{ overflow: 'inherit' }}>
|
||||
@@ -577,7 +577,7 @@ const Group: React.FC = () => {
|
||||
<AntdSpace>
|
||||
<AntdTooltip title={'刷新角色列表'}>
|
||||
<AntdButton onClick={getRoleData} disabled={isSubmitting}>
|
||||
<Icon component={IconFatwebRefresh} />
|
||||
<Icon component={IconOxygenRefresh} />
|
||||
</AntdButton>
|
||||
</AntdTooltip>
|
||||
<AntdButton onClick={handleOnDrawerClose} disabled={isSubmitting}>
|
||||
|
||||
@@ -512,7 +512,7 @@ const Role: React.FC = () => {
|
||||
style={{ padding: '4px 8px' }}
|
||||
onClick={handleOnAddBtnClick}
|
||||
>
|
||||
<Icon component={IconFatwebPlus} style={{ fontSize: '1.2em' }} />
|
||||
<Icon component={IconOxygenPlus} style={{ fontSize: '1.2em' }} />
|
||||
</AntdButton>
|
||||
</Card>
|
||||
</Permission>
|
||||
@@ -521,7 +521,7 @@ const Role: React.FC = () => {
|
||||
style={{ overflow: 'inherit', flex: '0 0 auto' }}
|
||||
>
|
||||
<AntdButton style={{ padding: '4px 8px' }} onClick={handleOnListDeleteBtnClick}>
|
||||
<Icon component={IconFatwebDelete} style={{ fontSize: '1.2em' }} />
|
||||
<Icon component={IconOxygenDelete} style={{ fontSize: '1.2em' }} />
|
||||
</AntdButton>
|
||||
</Card>
|
||||
<Card style={{ overflow: 'inherit' }}>
|
||||
@@ -586,7 +586,7 @@ const Role: React.FC = () => {
|
||||
<AntdSpace>
|
||||
<AntdTooltip title={'刷新权限列表'}>
|
||||
<AntdButton onClick={getPowerTreeData} disabled={isSubmitting}>
|
||||
<Icon component={IconFatwebRefresh} />
|
||||
<Icon component={IconOxygenRefresh} />
|
||||
</AntdButton>
|
||||
</AntdTooltip>
|
||||
<AntdButton onClick={handleOnDrawerClose} disabled={isSubmitting}>
|
||||
|
||||
@@ -37,10 +37,10 @@ const SettingsCard: React.FC<SettingsCardProps> = (props) => {
|
||||
<Permission operationCode={props.modifyOperationCode}>
|
||||
{props.expand}
|
||||
<AntdButton onClick={props.onReset} title={'重置'}>
|
||||
<Icon component={IconFatwebBack} />
|
||||
<Icon component={IconOxygenBack} />
|
||||
</AntdButton>
|
||||
<AntdButton className={'bt-save'} onClick={props.onSave} title={'保存'}>
|
||||
<Icon component={IconFatwebSave} />
|
||||
<Icon component={IconOxygenSave} />
|
||||
</AntdButton>
|
||||
</Permission>
|
||||
) : undefined}
|
||||
@@ -145,7 +145,7 @@ const MailSettings: React.FC = () => {
|
||||
return (
|
||||
<>
|
||||
<SettingsCard
|
||||
icon={IconFatwebEmail}
|
||||
icon={IconOxygenEmail}
|
||||
title={'邮件'}
|
||||
loading={loading}
|
||||
onReset={handleOnReset}
|
||||
@@ -153,7 +153,7 @@ const MailSettings: React.FC = () => {
|
||||
modifyOperationCode={'system:settings:modify:mail'}
|
||||
expand={
|
||||
<AntdButton onClick={handleOnTest} title={'测试'}>
|
||||
<Icon component={IconFatwebTest} />
|
||||
<Icon component={IconOxygenTest} />
|
||||
</AntdButton>
|
||||
}
|
||||
>
|
||||
@@ -238,7 +238,7 @@ const BaseSettings: React.FC = () => {
|
||||
return (
|
||||
<>
|
||||
<SettingsCard
|
||||
icon={IconFatwebEmail}
|
||||
icon={IconOxygenEmail}
|
||||
title={'基础'}
|
||||
loading={loading}
|
||||
onReset={handleOnReset}
|
||||
|
||||
@@ -267,7 +267,7 @@ const OnlineInfo: React.FC = () => {
|
||||
|
||||
return (
|
||||
<CommonCard
|
||||
icon={IconFatwebOnline}
|
||||
icon={IconOxygenOnline}
|
||||
title={
|
||||
<>
|
||||
<FlexBox gap={10} direction={'horizontal'}>
|
||||
@@ -298,7 +298,7 @@ const OnlineInfo: React.FC = () => {
|
||||
<AntdSelect.Option key={'ALL'}>全部</AntdSelect.Option>
|
||||
</AntdSelect>
|
||||
<AntdButton title={'刷新'} onClick={handleOnRefresh} disabled={isLoading}>
|
||||
<Icon component={IconFatwebRefresh} />
|
||||
<Icon component={IconOxygenRefresh} />
|
||||
</AntdButton>
|
||||
</>
|
||||
}
|
||||
@@ -452,7 +452,7 @@ const ActiveInfo: React.FC = () => {
|
||||
|
||||
return (
|
||||
<CommonCard
|
||||
icon={IconFatwebAnalysis}
|
||||
icon={IconOxygenAnalysis}
|
||||
title={
|
||||
<>
|
||||
<FlexBox gap={10} direction={'horizontal'}>
|
||||
@@ -479,7 +479,7 @@ const ActiveInfo: React.FC = () => {
|
||||
<AntdSelect.Option key={'ALL'}>全部</AntdSelect.Option>
|
||||
</AntdSelect>
|
||||
<AntdButton title={'刷新'} onClick={handleOnRefresh} disabled={isLoading}>
|
||||
<Icon component={IconFatwebRefresh} />
|
||||
<Icon component={IconOxygenRefresh} />
|
||||
</AntdButton>
|
||||
</>
|
||||
}
|
||||
@@ -507,7 +507,7 @@ const SoftwareInfo: React.FC = () => {
|
||||
|
||||
return (
|
||||
<CommonCard
|
||||
icon={IconFatwebSoftware}
|
||||
icon={IconOxygenSoftware}
|
||||
title={'软件信息'}
|
||||
loading={softwareInfoData === undefined}
|
||||
>
|
||||
@@ -569,7 +569,7 @@ const HardwareInfo: React.FC = () => {
|
||||
|
||||
return (
|
||||
<CommonCard
|
||||
icon={IconFatwebHardware}
|
||||
icon={IconOxygenHardware}
|
||||
title={'硬件信息'}
|
||||
loading={hardwareInfoData === undefined}
|
||||
>
|
||||
@@ -745,7 +745,7 @@ const CPUInfo: React.FC = () => {
|
||||
return (
|
||||
<>
|
||||
<CommonCard
|
||||
icon={IconFatwebCpu}
|
||||
icon={IconOxygenCpu}
|
||||
title={'CPU 信息'}
|
||||
loading={isLoading}
|
||||
expand={
|
||||
@@ -931,7 +931,7 @@ const StorageInfo: React.FC = () => {
|
||||
return (
|
||||
<>
|
||||
<CommonCard
|
||||
icon={IconFatwebMemory}
|
||||
icon={IconOxygenMemory}
|
||||
title={'内存信息'}
|
||||
loading={isLoading}
|
||||
expand={
|
||||
|
||||
@@ -89,7 +89,7 @@ const User: React.FC = () => {
|
||||
<AntdAvatar
|
||||
src={
|
||||
<AntdImage
|
||||
preview={{ mask: <Icon component={IconFatwebEye}></Icon> }}
|
||||
preview={{ mask: <Icon component={IconOxygenEye}></Icon> }}
|
||||
src={`data:image/png;base64,${value}`}
|
||||
alt={'Avatar'}
|
||||
/>
|
||||
@@ -333,7 +333,7 @@ const User: React.FC = () => {
|
||||
<>
|
||||
<Icon
|
||||
style={{ color: COLOR_PRODUCTION, marginRight: 10 }}
|
||||
component={IconFatwebSetting}
|
||||
component={IconOxygenSetting}
|
||||
/>
|
||||
修改用户 {value.username} 的密码
|
||||
</>
|
||||
@@ -913,7 +913,7 @@ const User: React.FC = () => {
|
||||
style={{ padding: '4px 8px' }}
|
||||
onClick={handleOnAddBtnClick}
|
||||
>
|
||||
<Icon component={IconFatwebPlus} style={{ fontSize: '1.2em' }} />
|
||||
<Icon component={IconOxygenPlus} style={{ fontSize: '1.2em' }} />
|
||||
</AntdButton>
|
||||
</Card>
|
||||
</Permission>
|
||||
@@ -922,7 +922,7 @@ const User: React.FC = () => {
|
||||
style={{ overflow: 'inherit', flex: '0 0 auto' }}
|
||||
>
|
||||
<AntdButton style={{ padding: '4px 8px' }} onClick={handleOnListDeleteBtnClick}>
|
||||
<Icon component={IconFatwebDelete} style={{ fontSize: '1.2em' }} />
|
||||
<Icon component={IconOxygenDelete} style={{ fontSize: '1.2em' }} />
|
||||
</AntdButton>
|
||||
</Card>
|
||||
<Card style={{ overflow: 'inherit' }}>
|
||||
@@ -992,7 +992,7 @@ const User: React.FC = () => {
|
||||
<AntdSpace>
|
||||
<AntdTooltip title={'刷新角色和用户组列表'}>
|
||||
<AntdButton onClick={handleOnDrawerRefresh} disabled={isDrawerSubmitting}>
|
||||
<Icon component={IconFatwebRefresh} />
|
||||
<Icon component={IconOxygenRefresh} />
|
||||
</AntdButton>
|
||||
</AntdTooltip>
|
||||
<AntdButton onClick={handleOnDrawerClose} disabled={isDrawerSubmitting}>
|
||||
|
||||
@@ -66,32 +66,32 @@ const System: React.FC = () => {
|
||||
<HideScrollbar isShowVerticalScrollbar autoHideWaitingTime={500}>
|
||||
<FlexBox direction={'horizontal'} className={'root-content'}>
|
||||
<Permission path={'/system/statistics'}>
|
||||
<CommonCard icon={IconFatwebAnalysis} url={'statistics'}>
|
||||
<CommonCard icon={IconOxygenAnalysis} url={'statistics'}>
|
||||
系统概况
|
||||
</CommonCard>
|
||||
</Permission>
|
||||
<Permission path={'/system/settings'}>
|
||||
<CommonCard icon={IconFatwebOption} url={'settings'}>
|
||||
<CommonCard icon={IconOxygenOption} url={'settings'}>
|
||||
系统设置
|
||||
</CommonCard>
|
||||
</Permission>
|
||||
<Permission path={'/system/user'}>
|
||||
<CommonCard icon={IconFatwebUser} url={'user'}>
|
||||
<CommonCard icon={IconOxygenUser} url={'user'}>
|
||||
用户管理
|
||||
</CommonCard>
|
||||
</Permission>
|
||||
<Permission path={'/system/role'}>
|
||||
<CommonCard icon={IconFatwebRole} url={'role'}>
|
||||
<CommonCard icon={IconOxygenRole} url={'role'}>
|
||||
角色管理
|
||||
</CommonCard>
|
||||
</Permission>
|
||||
<Permission path={'/system/group'}>
|
||||
<CommonCard icon={IconFatwebGroup} url={'group'}>
|
||||
<CommonCard icon={IconOxygenGroup} url={'group'}>
|
||||
群组管理
|
||||
</CommonCard>
|
||||
</Permission>
|
||||
<Permission path={'/system/log'}>
|
||||
<CommonCard icon={IconFatwebLog} url={'log'}>
|
||||
<CommonCard icon={IconOxygenLog} url={'log'}>
|
||||
系统日志
|
||||
</CommonCard>
|
||||
</Permission>
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
import React from 'react'
|
||||
|
||||
const home: RouteJsonObject[] = [
|
||||
{
|
||||
path: '',
|
||||
absolutePath: '/',
|
||||
id: 'home',
|
||||
component: React.lazy(() => import('@/pages/home')),
|
||||
name: '主页',
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'https://blog.fatweb.top',
|
||||
absolutePath: 'https://blog.fatweb.top',
|
||||
id: 'url-blog',
|
||||
name: '博客',
|
||||
menu: true
|
||||
},
|
||||
{
|
||||
path: '/tools',
|
||||
absolutePath: '/tools',
|
||||
id: 'url-tools',
|
||||
name: '工具',
|
||||
menu: true,
|
||||
children: [
|
||||
{
|
||||
path: 'translation',
|
||||
absolutePath: '/tools/translation',
|
||||
id: 'url-tools-translation',
|
||||
name: '翻译',
|
||||
menu: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
export default home
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from 'react'
|
||||
import _ from 'lodash'
|
||||
import system from '@/router/system'
|
||||
import home from '@/router/home'
|
||||
import user from '@/router/user'
|
||||
import tools from '@/router/tools'
|
||||
import { getAuthRoute, mapJsonToRoute, setTitle } from '@/util/route'
|
||||
@@ -44,15 +43,6 @@ const root: RouteJsonObject[] = [
|
||||
id: 'loading',
|
||||
component: React.lazy(() => import('@/components/common/FullscreenLoadingMask'))
|
||||
},
|
||||
{
|
||||
path: 'tools',
|
||||
absolutePath: '/tools',
|
||||
id: 'toolsFramework',
|
||||
component: React.lazy(() => import('@/pages/ToolsFramework')),
|
||||
children: setTitle(tools, '氧工具'),
|
||||
name: '工具',
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
absolutePath: '/user',
|
||||
@@ -75,9 +65,11 @@ const root: RouteJsonObject[] = [
|
||||
{
|
||||
path: '',
|
||||
absolutePath: '/',
|
||||
id: 'homeFramework',
|
||||
component: React.lazy(() => import('@/pages/HomeFramework')),
|
||||
children: home
|
||||
id: 'toolsFramework',
|
||||
component: React.lazy(() => import('@/pages/ToolsFramework')),
|
||||
children: setTitle(tools, '氧工具'),
|
||||
name: '工具',
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: '*',
|
||||
|
||||
@@ -8,7 +8,7 @@ const system: RouteJsonObject[] = [
|
||||
id: 'system',
|
||||
component: React.lazy(() => import('@/pages/system')),
|
||||
name: '系统管理',
|
||||
icon: React.lazy(() => import('~icons/fatweb/setting.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/setting.jsx')),
|
||||
menu: true
|
||||
},
|
||||
{
|
||||
@@ -17,7 +17,7 @@ const system: RouteJsonObject[] = [
|
||||
id: 'system-statistics',
|
||||
component: React.lazy(() => import('@/pages/system/Statistics')),
|
||||
name: '系统概况',
|
||||
icon: React.lazy(() => import('~icons/fatweb/chart.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/chart.jsx')),
|
||||
menu: true,
|
||||
autoHide: true
|
||||
},
|
||||
@@ -27,7 +27,7 @@ const system: RouteJsonObject[] = [
|
||||
id: 'system-settings',
|
||||
component: React.lazy(() => import('@/pages/system/Settings')),
|
||||
name: '系统设置',
|
||||
icon: React.lazy(() => import('~icons/fatweb/option.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/option.jsx')),
|
||||
menu: true,
|
||||
autoHide: true
|
||||
},
|
||||
@@ -37,7 +37,7 @@ const system: RouteJsonObject[] = [
|
||||
id: 'system-user',
|
||||
component: React.lazy(() => import('@/pages/system/User')),
|
||||
name: '用户管理',
|
||||
icon: React.lazy(() => import('~icons/fatweb/user.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/user.jsx')),
|
||||
menu: true,
|
||||
autoHide: true
|
||||
},
|
||||
@@ -47,7 +47,7 @@ const system: RouteJsonObject[] = [
|
||||
id: 'system-role',
|
||||
component: React.lazy(() => import('@/pages/system/Role')),
|
||||
name: '角色管理',
|
||||
icon: React.lazy(() => import('~icons/fatweb/role.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/role.jsx')),
|
||||
menu: true,
|
||||
autoHide: true
|
||||
},
|
||||
@@ -57,7 +57,7 @@ const system: RouteJsonObject[] = [
|
||||
id: 'system-group',
|
||||
component: React.lazy(() => import('@/pages/system/Group')),
|
||||
name: '群组管理',
|
||||
icon: React.lazy(() => import('~icons/fatweb/group.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/group.jsx')),
|
||||
menu: true,
|
||||
autoHide: true
|
||||
},
|
||||
@@ -67,7 +67,7 @@ const system: RouteJsonObject[] = [
|
||||
id: 'system-log',
|
||||
component: React.lazy(() => import('@/pages/system/Log')),
|
||||
name: '系统日志',
|
||||
icon: React.lazy(() => import('~icons/fatweb/log.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/log.jsx')),
|
||||
menu: true,
|
||||
autoHide: true
|
||||
},
|
||||
|
||||
@@ -3,47 +3,47 @@ import React from 'react'
|
||||
export const tools: RouteJsonObject[] = [
|
||||
{
|
||||
path: '',
|
||||
absolutePath: '/tools',
|
||||
absolutePath: '/',
|
||||
id: 'tools',
|
||||
component: React.lazy(() => import('@/pages/tools')),
|
||||
name: '主页',
|
||||
icon: React.lazy(() => import('~icons/fatweb/home.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/home.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'all',
|
||||
absolutePath: '/tools/all',
|
||||
absolutePath: '/all',
|
||||
id: 'tools-all',
|
||||
component: React.lazy(() => import('@/pages/tools')),
|
||||
name: '全部工具',
|
||||
titlePostfix: ' - 全部工具',
|
||||
icon: React.lazy(() => import('~icons/fatweb/tool.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/tool.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation',
|
||||
absolutePath: '/tools/translation',
|
||||
absolutePath: '/translation',
|
||||
id: 'tools-translation',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false,
|
||||
children: [
|
||||
{
|
||||
path: '1',
|
||||
absolutePath: '/tools/translation/1',
|
||||
absolutePath: '/translation/1',
|
||||
id: '1',
|
||||
name: '翻译1',
|
||||
icon: React.lazy(() => import('~icons/fatweb/logo.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/logo.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: '2',
|
||||
absolutePath: '/tools/translation/2',
|
||||
absolutePath: '/translation/2',
|
||||
id: '2',
|
||||
name: '翻译2',
|
||||
menu: true,
|
||||
@@ -53,17 +53,17 @@ export const tools: RouteJsonObject[] = [
|
||||
},
|
||||
{
|
||||
path: 'translation-',
|
||||
absolutePath: '/tools/translation-',
|
||||
absolutePath: '/translation-',
|
||||
id: 'tools-translation-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false,
|
||||
children: [
|
||||
{
|
||||
path: '1-',
|
||||
absolutePath: '/tools/translation-/1-',
|
||||
absolutePath: '/translation-/1-',
|
||||
id: '1-',
|
||||
name: '翻译1-',
|
||||
menu: true,
|
||||
@@ -71,7 +71,7 @@ export const tools: RouteJsonObject[] = [
|
||||
},
|
||||
{
|
||||
path: '2-',
|
||||
absolutePath: '/tools/translation-/2-',
|
||||
absolutePath: '/translation-/2-',
|
||||
id: '2-',
|
||||
name: '翻译2-',
|
||||
menu: true,
|
||||
@@ -81,217 +81,217 @@ export const tools: RouteJsonObject[] = [
|
||||
},
|
||||
{
|
||||
path: 'translation--',
|
||||
absolutePath: '/tools/translation--',
|
||||
absolutePath: '/translation--',
|
||||
id: 'tools-translation--',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--1',
|
||||
absolutePath: '/tools/translation--1',
|
||||
absolutePath: '/translation--1',
|
||||
id: 'tools-translation--1',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--1',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--2',
|
||||
absolutePath: '/tools/translation--2',
|
||||
absolutePath: '/translation--2',
|
||||
id: 'tools-translation--2',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--2',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--3',
|
||||
absolutePath: '/tools/translation--3',
|
||||
absolutePath: '/translation--3',
|
||||
id: 'tools-translation--3',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--3',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--4',
|
||||
absolutePath: '/tools/translation--4',
|
||||
absolutePath: '/translation--4',
|
||||
id: 'tools-translation--4',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--4',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--5',
|
||||
absolutePath: '/tools/translation--5',
|
||||
absolutePath: '/translation--5',
|
||||
id: 'tools-translation--5',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--5',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--6',
|
||||
absolutePath: '/tools/translation--6',
|
||||
absolutePath: '/translation--6',
|
||||
id: 'tools-translation--6',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--6',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--7',
|
||||
absolutePath: '/tools/translation--7',
|
||||
absolutePath: '/translation--7',
|
||||
id: 'tools-translation--7',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--7',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--8',
|
||||
absolutePath: '/tools/translation--8',
|
||||
absolutePath: '/translation--8',
|
||||
id: 'tools-translation--8',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--8',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--9',
|
||||
absolutePath: '/tools/translation--9',
|
||||
absolutePath: '/translation--9',
|
||||
id: 'tools-translation--9',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--9',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--10',
|
||||
absolutePath: '/tools/translation--10',
|
||||
absolutePath: '/translation--10',
|
||||
id: 'tools-translation--10',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--10',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--1-',
|
||||
absolutePath: '/tools/translation--1-',
|
||||
absolutePath: '/translation--1-',
|
||||
id: 'tools-translation--1-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--1-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--2-',
|
||||
absolutePath: '/tools/translation--2-',
|
||||
absolutePath: '/translation--2-',
|
||||
id: 'tools-translation--2-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--2-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--3-',
|
||||
absolutePath: '/tools/translation--3-',
|
||||
absolutePath: '/translation--3-',
|
||||
id: 'tools-translation--3-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--3-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--4-',
|
||||
absolutePath: '/tools/translation--4-',
|
||||
absolutePath: '/translation--4-',
|
||||
id: 'tools-translation--4-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--4-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--5-',
|
||||
absolutePath: '/tools/translation--5-',
|
||||
absolutePath: '/translation--5-',
|
||||
id: 'tools-translation--5-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--5-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--6-',
|
||||
absolutePath: '/tools/translation--6-',
|
||||
absolutePath: '/translation--6-',
|
||||
id: 'tools-translation--6-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--6-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--7-',
|
||||
absolutePath: '/tools/translation--7-',
|
||||
absolutePath: '/translation--7-',
|
||||
id: 'tools-translation--7-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--7-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--8-',
|
||||
absolutePath: '/tools/translation--8-',
|
||||
absolutePath: '/translation--8-',
|
||||
id: 'tools-translation--8-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--8-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--9-',
|
||||
absolutePath: '/tools/translation--9-',
|
||||
absolutePath: '/translation--9-',
|
||||
id: 'tools-translation--9-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--9-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation--10-',
|
||||
absolutePath: '/tools/translation--10-',
|
||||
absolutePath: '/translation--10-',
|
||||
id: 'tools-translation--10-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--10-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false,
|
||||
children: [
|
||||
{
|
||||
path: '1-1',
|
||||
absolutePath: '/tools/translation--10-/1-1',
|
||||
absolutePath: '/translation--10-/1-1',
|
||||
id: '1-1',
|
||||
name: '翻译1-',
|
||||
menu: true,
|
||||
@@ -299,7 +299,7 @@ export const tools: RouteJsonObject[] = [
|
||||
},
|
||||
{
|
||||
path: '2-1',
|
||||
absolutePath: '/tools/translation--10-/2-1',
|
||||
absolutePath: '/translation--10-/2-1',
|
||||
id: '2-1',
|
||||
name: '翻译2-',
|
||||
menu: true,
|
||||
@@ -310,7 +310,7 @@ export const tools: RouteJsonObject[] = [
|
||||
{
|
||||
path: '*',
|
||||
absolutePath: '*',
|
||||
element: <Navigate to="/tools" replace />
|
||||
element: <Navigate to="/" replace />
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ const user: RouteJsonObject[] = [
|
||||
id: 'user',
|
||||
component: React.lazy(() => import('@/pages/user')),
|
||||
name: '个人档案',
|
||||
icon: React.lazy(() => import('~icons/fatweb/user.jsx')),
|
||||
icon: React.lazy(() => import('~icons/oxygen/user.jsx')),
|
||||
menu: true
|
||||
},
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ export default defineConfig({
|
||||
IconsResolver({
|
||||
prefix: 'icon',
|
||||
extension: 'jsx',
|
||||
customCollections: ['fatweb']
|
||||
customCollections: ['oxygen']
|
||||
}),
|
||||
AntDesignResolver({
|
||||
resolveIcons: true
|
||||
@@ -69,7 +69,7 @@ export default defineConfig({
|
||||
jsx: 'react',
|
||||
autoInstall: true,
|
||||
customCollections: {
|
||||
fatweb: FileSystemIconLoader('src/assets/svg', (svg) =>
|
||||
oxygen: FileSystemIconLoader('src/assets/svg', (svg) =>
|
||||
svg.replace(/^svg /, '<svg fill="currentColor"')
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user