Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Vũ Hoàng Anh
canifa_note
Commits
771fe394
Commit
771fe394
authored
Oct 05, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix initial guide
parent
d474d1ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
system.go
api/v1/system.go
+9
-18
App.tsx
web/src/App.tsx
+9
-0
No files found.
api/v1/system.go
View file @
771fe394
...
@@ -72,26 +72,17 @@ func (s *APIV1Service) GetSystemStatus(c echo.Context) error {
...
@@ -72,26 +72,17 @@ func (s *APIV1Service) GetSystemStatus(c echo.Context) error {
ctx
:=
c
.
Request
()
.
Context
()
ctx
:=
c
.
Request
()
.
Context
()
systemStatus
:=
SystemStatus
{
systemStatus
:=
SystemStatus
{
Profile
:
*
s
.
Profile
,
Profile
:
*
s
.
Profile
,
DBSize
:
0
,
// Allow sign up by default.
AllowSignUp
:
false
,
AllowSignUp
:
true
,
DisablePasswordLogin
:
false
,
MaxUploadSizeMiB
:
32
,
DisablePublicMemos
:
false
,
MaxUploadSizeMiB
:
32
,
AutoBackupInterval
:
0
,
AdditionalStyle
:
""
,
AdditionalScript
:
""
,
CustomizedProfile
:
CustomizedProfile
{
CustomizedProfile
:
CustomizedProfile
{
Name
:
"memos"
,
Name
:
"memos"
,
LogoURL
:
""
,
Locale
:
"en"
,
Description
:
""
,
Appearance
:
"system"
,
Locale
:
"en"
,
Appearance
:
"system"
,
ExternalURL
:
""
,
},
},
StorageServiceID
:
DefaultStorage
,
StorageServiceID
:
DefaultStorage
,
LocalStoragePath
:
"assets/{timestamp}_{filename}"
,
LocalStoragePath
:
"assets/{timestamp}_{filename}"
,
MemoDisplayWithUpdatedTs
:
false
,
}
}
hostUserType
:=
store
.
RoleHost
hostUserType
:=
store
.
RoleHost
...
...
web/src/App.tsx
View file @
771fe394
...
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
...
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
import
{
Outlet
}
from
"react-router-dom"
;
import
{
Outlet
}
from
"react-router-dom"
;
import
storage
from
"./helpers/storage"
;
import
storage
from
"./helpers/storage"
;
import
{
getSystemColorScheme
}
from
"./helpers/utils"
;
import
{
getSystemColorScheme
}
from
"./helpers/utils"
;
import
useNavigateTo
from
"./hooks/useNavigateTo"
;
import
Loading
from
"./pages/Loading"
;
import
Loading
from
"./pages/Loading"
;
import
store
from
"./store"
;
import
store
from
"./store"
;
import
{
useGlobalStore
}
from
"./store/module"
;
import
{
useGlobalStore
}
from
"./store/module"
;
...
@@ -11,12 +12,20 @@ import { useUserV1Store } from "./store/v1";
...
@@ -11,12 +12,20 @@ import { useUserV1Store } from "./store/v1";
const
App
=
()
=>
{
const
App
=
()
=>
{
const
{
i18n
}
=
useTranslation
();
const
{
i18n
}
=
useTranslation
();
const
navigateTo
=
useNavigateTo
();
const
globalStore
=
useGlobalStore
();
const
globalStore
=
useGlobalStore
();
const
{
mode
,
setMode
}
=
useColorScheme
();
const
{
mode
,
setMode
}
=
useColorScheme
();
const
userV1Store
=
useUserV1Store
();
const
userV1Store
=
useUserV1Store
();
const
[
loading
,
setLoading
]
=
useState
(
true
);
const
[
loading
,
setLoading
]
=
useState
(
true
);
const
{
appearance
,
locale
,
systemStatus
}
=
globalStore
.
state
;
const
{
appearance
,
locale
,
systemStatus
}
=
globalStore
.
state
;
// Redirect to sign up page if no host.
useEffect
(()
=>
{
if
(
!
systemStatus
.
host
)
{
navigateTo
(
"/auth/signup"
);
}
},
[
systemStatus
.
host
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
const
initialState
=
async
()
=>
{
const
initialState
=
async
()
=>
{
const
{
user
}
=
store
.
getState
().
user
;
const
{
user
}
=
store
.
getState
().
user
;
...
...
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