Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
72de8abe
Commit
72de8abe
authored
May 24, 2023
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no stats endpoint -- no stats page
parent
f8eeafb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
useNavItems.tsx
lib/hooks/useNavItems.tsx
+6
-1
stats.tsx
pages/stats.tsx
+12
-2
No files found.
lib/hooks/useNavItems.tsx
View file @
72de8abe
...
@@ -154,7 +154,12 @@ export default function useNavItems(): ReturnType {
...
@@ -154,7 +154,12 @@ export default function useNavItems(): ReturnType {
icon
:
appsIcon
,
icon
:
appsIcon
,
isActive
:
pathname
.
startsWith
(
'
/app
'
),
isActive
:
pathname
.
startsWith
(
'
/app
'
),
}
:
null
,
}
:
null
,
{
text
:
'
Charts & stats
'
,
nextRoute
:
{
pathname
:
'
/stats
'
as
const
},
icon
:
statsIcon
,
isActive
:
pathname
===
'
/stats
'
},
appConfig
.
statsApi
.
endpoint
?
{
text
:
'
Charts & stats
'
,
nextRoute
:
{
pathname
:
'
/stats
'
as
const
},
icon
:
statsIcon
,
isActive
:
pathname
===
'
/stats
'
,
}
:
null
,
{
{
text
:
'
API
'
,
text
:
'
API
'
,
icon
:
apiDocsIcon
,
icon
:
apiDocsIcon
,
...
...
pages/stats.tsx
View file @
72de8abe
import
type
{
NextPage
}
from
'
next
'
;
import
type
{
NextPage
,
GetServerSideProps
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
appConfig
from
'
configs/app/config
'
;
import
appConfig
from
'
configs/app/config
'
;
import
type
{
Props
}
from
'
lib/next/getServerSideProps
'
;
import
{
getServerSideProps
as
getServerSidePropsBase
}
from
'
lib/next/getServerSideProps
'
;
import
Stats
from
'
../ui/pages/Stats
'
;
import
Stats
from
'
../ui/pages/Stats
'
;
...
@@ -17,4 +19,12 @@ const StatsPage: NextPage = () => {
...
@@ -17,4 +19,12 @@ const StatsPage: NextPage = () => {
export
default
StatsPage
;
export
default
StatsPage
;
export
{
getServerSideProps
}
from
'
lib/next/getServerSideProps
'
;
export
const
getServerSideProps
:
GetServerSideProps
<
Props
>
=
async
(
args
)
=>
{
if
(
!
appConfig
.
statsApi
.
endpoint
)
{
return
{
notFound
:
true
,
};
}
return
getServerSidePropsBase
(
args
);
};
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