Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9934c978
authored
May 20, 2025
by
Apple\Apple
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat: Add the `/console/*` route
parent
bf767d65
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
33 deletions
+33
-33
web/src/App.js
+16
-16
web/src/components/HeaderBar.js
+5
-5
web/src/components/SiderBar.js
+12
-12
No files found.
web/src/App.js
View file @
9934c978
...
...
@@ -55,7 +55,7 @@ function App() {
}
/
>
<
Route
path
=
'/channel'
path
=
'/c
onsole/c
hannel'
element
=
{
<
PrivateRoute
>
<
Channel
/>
...
...
@@ -63,7 +63,7 @@ function App() {
}
/
>
<
Route
path
=
'/channel/edit/:id'
path
=
'/c
onsole/c
hannel/edit/:id'
element
=
{
<
Suspense
fallback
=
{
<
Loading
><
/Loading>} key={location.pathname}
>
<
EditChannel
/>
...
...
@@ -71,7 +71,7 @@ function App() {
}
/
>
<
Route
path
=
'/channel/add'
path
=
'/c
onsole/c
hannel/add'
element
=
{
<
Suspense
fallback
=
{
<
Loading
><
/Loading>} key={location.pathname}
>
<
EditChannel
/>
...
...
@@ -79,7 +79,7 @@ function App() {
}
/
>
<
Route
path
=
'/token'
path
=
'/
console/
token'
element
=
{
<
PrivateRoute
>
<
Token
/>
...
...
@@ -87,7 +87,7 @@ function App() {
}
/
>
<
Route
path
=
'/playground'
path
=
'/
console/
playground'
element
=
{
<
PrivateRoute
>
<
Playground
/>
...
...
@@ -95,7 +95,7 @@ function App() {
}
/
>
<
Route
path
=
'/redemption'
path
=
'/
console/
redemption'
element
=
{
<
PrivateRoute
>
<
Redemption
/>
...
...
@@ -103,7 +103,7 @@ function App() {
}
/
>
<
Route
path
=
'/user'
path
=
'/
console/
user'
element
=
{
<
PrivateRoute
>
<
User
/>
...
...
@@ -111,7 +111,7 @@ function App() {
}
/
>
<
Route
path
=
'/user/edit/:id'
path
=
'/
console/
user/edit/:id'
element
=
{
<
Suspense
fallback
=
{
<
Loading
><
/Loading>} key={location.pathname}
>
<
EditUser
/>
...
...
@@ -119,7 +119,7 @@ function App() {
}
/
>
<
Route
path
=
'/user/edit'
path
=
'/
console/
user/edit'
element
=
{
<
Suspense
fallback
=
{
<
Loading
><
/Loading>} key={location.pathname}
>
<
EditUser
/>
...
...
@@ -183,7 +183,7 @@ function App() {
}
/
>
<
Route
path
=
'/setting'
path
=
'/
console/
setting'
element
=
{
<
PrivateRoute
>
<
Suspense
fallback
=
{
<
Loading
><
/Loading>} key={location.pathname}
>
...
...
@@ -193,7 +193,7 @@ function App() {
}
/
>
<
Route
path
=
'/personal'
path
=
'/
console/
personal'
element
=
{
<
PrivateRoute
>
<
Suspense
fallback
=
{
<
Loading
><
/Loading>} key={location.pathname}
>
...
...
@@ -203,7 +203,7 @@ function App() {
}
/
>
<
Route
path
=
'/topup'
path
=
'/
console/
topup'
element
=
{
<
PrivateRoute
>
<
Suspense
fallback
=
{
<
Loading
><
/Loading>} key={location.pathname}
>
...
...
@@ -213,7 +213,7 @@ function App() {
}
/
>
<
Route
path
=
'/log'
path
=
'/
console/
log'
element
=
{
<
PrivateRoute
>
<
Log
/>
...
...
@@ -221,7 +221,7 @@ function App() {
}
/
>
<
Route
path
=
'/
detail
'
path
=
'/
console
'
element
=
{
<
PrivateRoute
>
<
Suspense
fallback
=
{
<
Loading
><
/Loading>} key={location.pathname}
>
...
...
@@ -231,7 +231,7 @@ function App() {
}
/
>
<
Route
path
=
'/midjourney'
path
=
'/
console/
midjourney'
element
=
{
<
PrivateRoute
>
<
Suspense
fallback
=
{
<
Loading
><
/Loading>} key={location.pathname}
>
...
...
@@ -241,7 +241,7 @@ function App() {
}
/
>
<
Route
path
=
'/task'
path
=
'/
console/
task'
element
=
{
<
PrivateRoute
>
<
Suspense
fallback
=
{
<
Loading
><
/Loading>} key={location.pathname}
>
...
...
web/src/components/HeaderBar.js
View file @
9934c978
...
...
@@ -61,8 +61,8 @@ const HeaderBar = () => {
},
{
text
:
t
(
'控制台'
),
itemKey
:
'
detail
'
,
to
:
'/
detail
'
,
itemKey
:
'
console
'
,
to
:
'/
console
'
,
},
{
text
:
t
(
'定价'
),
...
...
@@ -216,7 +216,7 @@ const HeaderBar = () => {
<
Dropdown
.
Menu
className
=
"!bg-semi-color-bg-overlay !border-semi-color-border !shadow-lg !rounded-lg dark:!bg-gray-700 dark:!border-gray-600"
>
<
Dropdown
.
Item
onClick
=
{()
=>
{
navigate
(
'/personal'
);
navigate
(
'/
console/
personal'
);
setMobileMenuOpen
(
false
);
}}
className
=
"!px-3 !py-1.5 !text-sm !text-semi-color-text-0 hover:!bg-semi-color-fill-1 dark:!text-gray-200 dark:hover:!bg-blue-500 dark:hover:!text-white"
...
...
@@ -228,7 +228,7 @@ const HeaderBar = () => {
<
/Dropdown.Item
>
<
Dropdown
.
Item
onClick
=
{()
=>
{
navigate
(
'/token'
);
navigate
(
'/
console/
token'
);
setMobileMenuOpen
(
false
);
}}
className
=
"!px-3 !py-1.5 !text-sm !text-semi-color-text-0 hover:!bg-semi-color-fill-1 dark:!text-gray-200 dark:hover:!bg-blue-500 dark:hover:!text-white"
...
...
@@ -240,7 +240,7 @@ const HeaderBar = () => {
<
/Dropdown.Item
>
<
Dropdown
.
Item
onClick
=
{()
=>
{
navigate
(
'/topup'
);
navigate
(
'/
console/
topup'
);
setMobileMenuOpen
(
false
);
}}
className
=
"!px-3 !py-1.5 !text-sm !text-semi-color-text-0 hover:!bg-semi-color-fill-1 dark:!text-gray-200 dark:hover:!bg-blue-500 dark:hover:!text-white"
...
...
web/src/components/SiderBar.js
View file @
9934c978
...
...
@@ -77,20 +77,20 @@ const iconStyle = (itemKey, selectedKeys) => {
// Define routerMap as a constant outside the component
const
routerMap
=
{
home
:
'/'
,
channel
:
'/channel'
,
token
:
'/token'
,
redemption
:
'/redemption'
,
topup
:
'/topup'
,
user
:
'/user'
,
log
:
'/log'
,
midjourney
:
'/midjourney'
,
setting
:
'/setting'
,
channel
:
'/c
onsole/c
hannel'
,
token
:
'/
console/
token'
,
redemption
:
'/
console/
redemption'
,
topup
:
'/
console/
topup'
,
user
:
'/
console/
user'
,
log
:
'/
console/
log'
,
midjourney
:
'/
console/
midjourney'
,
setting
:
'/
console/
setting'
,
about
:
'/about'
,
detail
:
'/
detail
'
,
detail
:
'/
console
'
,
pricing
:
'/pricing'
,
task
:
'/task'
,
playground
:
'/playground'
,
personal
:
'/personal'
,
task
:
'/
console/
task'
,
playground
:
'/
console/
playground'
,
personal
:
'/
console/
personal'
,
};
const
SiderBar
=
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment