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
4f2adfef
Unverified
Commit
4f2adfef
authored
Apr 03, 2023
by
boojack
Committed by
GitHub
Apr 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update system setting name convention (#1448)
parent
8a332907
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
135 additions
and
105 deletions
+135
-105
system_setting.go
api/system_setting.go
+32
-32
rss.go
server/rss.go
+18
-48
system.go
server/system.go
+3
-3
00__user_setting.sql
store/db/migration/prod/0.12/00__user_setting.sql
+3
-12
01__system_setting.sql
store/db/migration/prod/0.12/01__system_setting.sql
+69
-0
10005__system_setting.sql
store/db/seed/10005__system_setting.sql
+1
-1
StorageSection.tsx
web/src/components/Settings/StorageSection.tsx
+1
-1
SystemSection.tsx
web/src/components/Settings/SystemSection.tsx
+6
-6
UpdateCustomizedProfileDialog.tsx
web/src/components/UpdateCustomizedProfileDialog.tsx
+1
-1
UpdateLocalStorageDialog.tsx
web/src/components/UpdateLocalStorageDialog.tsx
+1
-1
No files found.
api/system_setting.go
View file @
4f2adfef
...
@@ -11,26 +11,26 @@ import (
...
@@ -11,26 +11,26 @@ import (
type
SystemSettingName
string
type
SystemSettingName
string
const
(
const
(
// SystemSettingServerID is the
key typ
e of server id.
// SystemSettingServerID is the
nam
e of server id.
SystemSettingServerID
SystemSettingName
=
"serverI
d"
SystemSettingServerID
Name
SystemSettingName
=
"server-i
d"
// SystemSettingSecretSessionName is the
key type of secret session name
.
// SystemSettingSecretSessionName is the
name of secret session
.
SystemSettingSecretSessionName
SystemSettingName
=
"secret
SessionName
"
SystemSettingSecretSessionName
SystemSettingName
=
"secret
-session
"
// SystemSettingAllowSignUpName is the
key typ
e of allow signup setting.
// SystemSettingAllowSignUpName is the
nam
e of allow signup setting.
SystemSettingAllowSignUpName
SystemSettingName
=
"allow
SignU
p"
SystemSettingAllowSignUpName
SystemSettingName
=
"allow
-signu
p"
// SystemSettingDisablePublicMemosName is the
key typ
e of disable public memos setting.
// SystemSettingDisablePublicMemosName is the
nam
e of disable public memos setting.
SystemSettingDisablePublicMemosName
SystemSettingName
=
"disable
PublicM
emos"
SystemSettingDisablePublicMemosName
SystemSettingName
=
"disable
-public-m
emos"
// SystemSettingAdditionalStyleName is the
key typ
e of additional style.
// SystemSettingAdditionalStyleName is the
nam
e of additional style.
SystemSettingAdditionalStyleName
SystemSettingName
=
"additional
S
tyle"
SystemSettingAdditionalStyleName
SystemSettingName
=
"additional
-s
tyle"
// SystemSettingAdditionalScriptName is the
key typ
e of additional script.
// SystemSettingAdditionalScriptName is the
nam
e of additional script.
SystemSettingAdditionalScriptName
SystemSettingName
=
"additional
S
cript"
SystemSettingAdditionalScriptName
SystemSettingName
=
"additional
-s
cript"
// SystemSettingCustomizedProfileName is the
key typ
e of customized server profile.
// SystemSettingCustomizedProfileName is the
nam
e of customized server profile.
SystemSettingCustomizedProfileName
SystemSettingName
=
"customized
P
rofile"
SystemSettingCustomizedProfileName
SystemSettingName
=
"customized
-p
rofile"
// SystemSettingStorageServiceIDName is the
key typ
e of storage service ID.
// SystemSettingStorageServiceIDName is the
nam
e of storage service ID.
SystemSettingStorageServiceIDName
SystemSettingName
=
"storage
ServiceI
d"
SystemSettingStorageServiceIDName
SystemSettingName
=
"storage
-service-i
d"
// SystemSettingLocalStoragePathName is the
key typ
e of local storage path.
// SystemSettingLocalStoragePathName is the
nam
e of local storage path.
SystemSettingLocalStoragePathName
SystemSettingName
=
"local
StorageP
ath"
SystemSettingLocalStoragePathName
SystemSettingName
=
"local
-storage-p
ath"
// SystemSettingOpenAIConfigName is the
key typ
e of OpenAI config.
// SystemSettingOpenAIConfigName is the
nam
e of OpenAI config.
SystemSettingOpenAIConfigName
SystemSettingName
=
"open
AIC
onfig"
SystemSettingOpenAIConfigName
SystemSettingName
=
"open
ai-c
onfig"
)
)
// CustomizedProfile is the struct definition for SystemSettingCustomizedProfileName system setting item.
// CustomizedProfile is the struct definition for SystemSettingCustomizedProfileName system setting item.
...
@@ -56,26 +56,26 @@ type OpenAIConfig struct {
...
@@ -56,26 +56,26 @@ type OpenAIConfig struct {
func
(
key
SystemSettingName
)
String
()
string
{
func
(
key
SystemSettingName
)
String
()
string
{
switch
key
{
switch
key
{
case
SystemSettingServerID
:
case
SystemSettingServerID
Name
:
return
"server
I
d"
return
"server
-i
d"
case
SystemSettingSecretSessionName
:
case
SystemSettingSecretSessionName
:
return
"secret
SessionName
"
return
"secret
-session
"
case
SystemSettingAllowSignUpName
:
case
SystemSettingAllowSignUpName
:
return
"allow
SignU
p"
return
"allow
-signu
p"
case
SystemSettingDisablePublicMemosName
:
case
SystemSettingDisablePublicMemosName
:
return
"disable
PublicM
emos"
return
"disable
-public-m
emos"
case
SystemSettingAdditionalStyleName
:
case
SystemSettingAdditionalStyleName
:
return
"additional
S
tyle"
return
"additional
-s
tyle"
case
SystemSettingAdditionalScriptName
:
case
SystemSettingAdditionalScriptName
:
return
"additional
S
cript"
return
"additional
-s
cript"
case
SystemSettingCustomizedProfileName
:
case
SystemSettingCustomizedProfileName
:
return
"customized
P
rofile"
return
"customized
-p
rofile"
case
SystemSettingStorageServiceIDName
:
case
SystemSettingStorageServiceIDName
:
return
"storage
ServiceI
d"
return
"storage
-service-i
d"
case
SystemSettingLocalStoragePathName
:
case
SystemSettingLocalStoragePathName
:
return
"local
StorageP
ath"
return
"local
-storage-p
ath"
case
SystemSettingOpenAIConfigName
:
case
SystemSettingOpenAIConfigName
:
return
"open
AIC
onfig"
return
"open
ai-c
onfig"
}
}
return
""
return
""
}
}
...
@@ -94,7 +94,7 @@ type SystemSettingUpsert struct {
...
@@ -94,7 +94,7 @@ type SystemSettingUpsert struct {
}
}
func
(
upsert
SystemSettingUpsert
)
Validate
()
error
{
func
(
upsert
SystemSettingUpsert
)
Validate
()
error
{
if
upsert
.
Name
==
SystemSettingServerID
{
if
upsert
.
Name
==
SystemSettingServerID
Name
{
return
errors
.
New
(
"update server id is not allowed"
)
return
errors
.
New
(
"update server id is not allowed"
)
}
else
if
upsert
.
Name
==
SystemSettingAllowSignUpName
{
}
else
if
upsert
.
Name
==
SystemSettingAllowSignUpName
{
value
:=
false
value
:=
false
...
...
server/rss.go
View file @
4f2adfef
...
@@ -35,7 +35,7 @@ func (s *Server) registerRSSRoutes(g *echo.Group) {
...
@@ -35,7 +35,7 @@ func (s *Server) registerRSSRoutes(g *echo.Group) {
}
}
baseURL
:=
c
.
Scheme
()
+
"://"
+
c
.
Request
()
.
Host
baseURL
:=
c
.
Scheme
()
+
"://"
+
c
.
Request
()
.
Host
rss
,
err
:=
generateRSSFromMemoList
(
memoList
,
baseURL
,
&
systemCustomizedProfile
)
rss
,
err
:=
generateRSSFromMemoList
(
memoList
,
baseURL
,
systemCustomizedProfile
)
if
err
!=
nil
{
if
err
!=
nil
{
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to generate rss"
)
.
SetInternal
(
err
)
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to generate rss"
)
.
SetInternal
(
err
)
}
}
...
@@ -72,7 +72,7 @@ func (s *Server) registerRSSRoutes(g *echo.Group) {
...
@@ -72,7 +72,7 @@ func (s *Server) registerRSSRoutes(g *echo.Group) {
baseURL
:=
c
.
Scheme
()
+
"://"
+
c
.
Request
()
.
Host
baseURL
:=
c
.
Scheme
()
+
"://"
+
c
.
Request
()
.
Host
rss
,
err
:=
generateRSSFromMemoList
(
memoList
,
baseURL
,
&
systemCustomizedProfile
)
rss
,
err
:=
generateRSSFromMemoList
(
memoList
,
baseURL
,
systemCustomizedProfile
)
if
err
!=
nil
{
if
err
!=
nil
{
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to generate rss"
)
.
SetInternal
(
err
)
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to generate rss"
)
.
SetInternal
(
err
)
}
}
...
@@ -114,57 +114,27 @@ func generateRSSFromMemoList(memoList []*api.Memo, baseURL string, profile *api.
...
@@ -114,57 +114,27 @@ func generateRSSFromMemoList(memoList []*api.Memo, baseURL string, profile *api.
return
rss
,
nil
return
rss
,
nil
}
}
func
getSystemCustomizedProfile
(
ctx
context
.
Context
,
s
*
Server
)
(
api
.
CustomizedProfile
,
error
)
{
func
getSystemCustomizedProfile
(
ctx
context
.
Context
,
s
*
Server
)
(
*
api
.
CustomizedProfile
,
error
)
{
systemStatus
:=
api
.
SystemStatus
{
customizedProfile
:=
&
api
.
CustomizedProfile
{
CustomizedProfile
:
api
.
CustomizedProfile
{
Name
:
"memos"
,
Name
:
"memos"
,
LogoURL
:
""
,
LogoURL
:
""
,
Description
:
""
,
Description
:
""
,
Locale
:
"en"
,
Locale
:
"en"
,
Appearance
:
"system"
,
Appearance
:
"system"
,
ExternalURL
:
""
,
ExternalURL
:
""
,
},
}
}
systemSetting
,
err
:=
s
.
Store
.
FindSystemSetting
(
ctx
,
&
api
.
SystemSettingFind
{
systemSettingList
,
err
:=
s
.
Store
.
FindSystemSettingList
(
ctx
,
&
api
.
SystemSettingFind
{})
Name
:
api
.
SystemSettingCustomizedProfileName
,
})
if
err
!=
nil
{
if
err
!=
nil
{
return
api
.
CustomizedProfile
{}
,
err
return
customizedProfile
,
err
}
}
for
_
,
systemSetting
:=
range
systemSettingList
{
if
systemSetting
.
Name
==
api
.
SystemSettingServerID
||
systemSetting
.
Name
==
api
.
SystemSettingSecretSessionName
{
continue
}
var
value
any
err
:=
json
.
Unmarshal
([]
byte
(
systemSetting
.
Value
),
&
value
)
if
err
!=
nil
{
return
api
.
CustomizedProfile
{},
err
}
if
systemSetting
.
Name
==
api
.
SystemSettingCustomizedProfileName
{
err
=
json
.
Unmarshal
([]
byte
(
systemSetting
.
Value
),
customizedProfile
)
valueMap
:=
value
.
(
map
[
string
]
any
)
if
err
!=
nil
{
systemStatus
.
CustomizedProfile
=
api
.
CustomizedProfile
{}
return
customizedProfile
,
err
if
v
:=
valueMap
[
"name"
];
v
!=
nil
{
systemStatus
.
CustomizedProfile
.
Name
=
v
.
(
string
)
}
if
v
:=
valueMap
[
"logoUrl"
];
v
!=
nil
{
systemStatus
.
CustomizedProfile
.
LogoURL
=
v
.
(
string
)
}
if
v
:=
valueMap
[
"description"
];
v
!=
nil
{
systemStatus
.
CustomizedProfile
.
Description
=
v
.
(
string
)
}
if
v
:=
valueMap
[
"locale"
];
v
!=
nil
{
systemStatus
.
CustomizedProfile
.
Locale
=
v
.
(
string
)
}
if
v
:=
valueMap
[
"appearance"
];
v
!=
nil
{
systemStatus
.
CustomizedProfile
.
Appearance
=
v
.
(
string
)
}
if
v
:=
valueMap
[
"externalUrl"
];
v
!=
nil
{
systemStatus
.
CustomizedProfile
.
ExternalURL
=
v
.
(
string
)
}
}
}
}
return
systemStatus
.
C
ustomizedProfile
,
nil
return
c
ustomizedProfile
,
nil
}
}
func
min
(
a
,
b
int
)
int
{
func
min
(
a
,
b
int
)
int
{
...
...
server/system.go
View file @
4f2adfef
...
@@ -60,7 +60,7 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
...
@@ -60,7 +60,7 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to find system setting list"
)
.
SetInternal
(
err
)
return
echo
.
NewHTTPError
(
http
.
StatusInternalServerError
,
"Failed to find system setting list"
)
.
SetInternal
(
err
)
}
}
for
_
,
systemSetting
:=
range
systemSettingList
{
for
_
,
systemSetting
:=
range
systemSettingList
{
if
systemSetting
.
Name
==
api
.
SystemSettingServerID
||
systemSetting
.
Name
==
api
.
SystemSettingSecretSessionName
||
systemSetting
.
Name
==
api
.
SystemSettingOpenAIConfigName
{
if
systemSetting
.
Name
==
api
.
SystemSettingServerID
Name
||
systemSetting
.
Name
==
api
.
SystemSettingSecretSessionName
||
systemSetting
.
Name
==
api
.
SystemSettingOpenAIConfigName
{
continue
continue
}
}
...
@@ -194,14 +194,14 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
...
@@ -194,14 +194,14 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
func
(
s
*
Server
)
getSystemServerID
(
ctx
context
.
Context
)
(
string
,
error
)
{
func
(
s
*
Server
)
getSystemServerID
(
ctx
context
.
Context
)
(
string
,
error
)
{
serverIDValue
,
err
:=
s
.
Store
.
FindSystemSetting
(
ctx
,
&
api
.
SystemSettingFind
{
serverIDValue
,
err
:=
s
.
Store
.
FindSystemSetting
(
ctx
,
&
api
.
SystemSettingFind
{
Name
:
api
.
SystemSettingServerID
,
Name
:
api
.
SystemSettingServerID
Name
,
})
})
if
err
!=
nil
&&
common
.
ErrorCode
(
err
)
!=
common
.
NotFound
{
if
err
!=
nil
&&
common
.
ErrorCode
(
err
)
!=
common
.
NotFound
{
return
""
,
err
return
""
,
err
}
}
if
serverIDValue
==
nil
||
serverIDValue
.
Value
==
""
{
if
serverIDValue
==
nil
||
serverIDValue
.
Value
==
""
{
serverIDValue
,
err
=
s
.
Store
.
UpsertSystemSetting
(
ctx
,
&
api
.
SystemSettingUpsert
{
serverIDValue
,
err
=
s
.
Store
.
UpsertSystemSetting
(
ctx
,
&
api
.
SystemSettingUpsert
{
Name
:
api
.
SystemSettingServerID
,
Name
:
api
.
SystemSettingServerID
Name
,
Value
:
uuid
.
NewString
(),
Value
:
uuid
.
NewString
(),
})
})
if
err
!=
nil
{
if
err
!=
nil
{
...
...
store/db/migration/prod/0.12/00__user_setting.sql
View file @
4f2adfef
INSERT
INTO
UPDATE
user_setting
(
user_id
,
key
,
value
)
SELECT
user_id
,
'memo-visibility'
,
value
FROM
user_setting
WHERE
key
=
'memoVisibility'
;
DELETE
FROM
user_setting
user_setting
SET
key
=
'memo-visibility'
WHERE
WHERE
key
=
'memoVisibility'
;
key
=
'memoVisibility'
;
\ No newline at end of file
store/db/migration/prod/0.12/01__system_setting.sql
0 → 100644
View file @
4f2adfef
UPDATE
system_setting
SET
key
=
'server-id'
WHERE
key
=
'serverId'
;
UPDATE
system_setting
SET
key
=
'secret-session'
WHERE
key
=
'secretSessionName'
;
UPDATE
system_setting
SET
key
=
'allow-signup'
WHERE
key
=
'allowSignUp'
;
UPDATE
system_setting
SET
key
=
'disable-public-memos'
WHERE
key
=
'disablePublicMemos'
;
UPDATE
system_setting
SET
key
=
'additional-style'
WHERE
key
=
'additionalStyle'
;
UPDATE
system_setting
SET
key
=
'additional-script'
WHERE
key
=
'additionalScript'
;
UPDATE
system_setting
SET
key
=
'customized-profile'
WHERE
key
=
'customizedProfile'
;
UPDATE
system_setting
SET
key
=
'storage-service-id'
WHERE
key
=
'storageServiceId'
;
UPDATE
system_setting
SET
key
=
'local-storage-path'
WHERE
key
=
'localStoragePath'
;
UPDATE
system_setting
SET
key
=
'openai-config'
WHERE
key
=
'openAIConfig'
;
\ No newline at end of file
store/db/seed/10005__system_setting.sql
View file @
4f2adfef
INSERT
INTO
INSERT
INTO
system_setting
(
`name`
,
`value`
,
`description`
)
system_setting
(
`name`
,
`value`
,
`description`
)
VALUES
VALUES
(
'allowSignUp'
,
'true'
,
''
);
(
'allow-signup'
,
'true'
,
''
);
\ No newline at end of file
\ No newline at end of file
web/src/components/Settings/StorageSection.tsx
View file @
4f2adfef
...
@@ -29,7 +29,7 @@ const StorageSection = () => {
...
@@ -29,7 +29,7 @@ const StorageSection = () => {
const
handleActiveStorageServiceChanged
=
async
(
storageId
:
StorageId
)
=>
{
const
handleActiveStorageServiceChanged
=
async
(
storageId
:
StorageId
)
=>
{
await
api
.
upsertSystemSetting
({
await
api
.
upsertSystemSetting
({
name
:
"storage
ServiceI
d"
,
name
:
"storage
-service-i
d"
,
value
:
JSON
.
stringify
(
storageId
),
value
:
JSON
.
stringify
(
storageId
),
});
});
await
globalStore
.
fetchSystemStatus
();
await
globalStore
.
fetchSystemStatus
();
...
...
web/src/components/Settings/SystemSection.tsx
View file @
4f2adfef
...
@@ -57,7 +57,7 @@ const SystemSection = () => {
...
@@ -57,7 +57,7 @@ const SystemSection = () => {
useEffect
(()
=>
{
useEffect
(()
=>
{
api
.
getSystemSetting
().
then
(({
data
:
{
data
:
systemSettings
}
})
=>
{
api
.
getSystemSetting
().
then
(({
data
:
{
data
:
systemSettings
}
})
=>
{
const
openAIConfigSetting
=
systemSettings
.
find
((
setting
)
=>
setting
.
name
===
"open
AIC
onfig"
);
const
openAIConfigSetting
=
systemSettings
.
find
((
setting
)
=>
setting
.
name
===
"open
ai-c
onfig"
);
if
(
openAIConfigSetting
)
{
if
(
openAIConfigSetting
)
{
setOpenAIConfig
(
JSON
.
parse
(
openAIConfigSetting
.
value
));
setOpenAIConfig
(
JSON
.
parse
(
openAIConfigSetting
.
value
));
}
}
...
@@ -70,7 +70,7 @@ const SystemSection = () => {
...
@@ -70,7 +70,7 @@ const SystemSection = () => {
allowSignUp
:
value
,
allowSignUp
:
value
,
});
});
await
api
.
upsertSystemSetting
({
await
api
.
upsertSystemSetting
({
name
:
"allow
SignU
p"
,
name
:
"allow
-signu
p"
,
value
:
JSON
.
stringify
(
value
),
value
:
JSON
.
stringify
(
value
),
});
});
};
};
...
@@ -100,7 +100,7 @@ const SystemSection = () => {
...
@@ -100,7 +100,7 @@ const SystemSection = () => {
const
handleSaveOpenAIConfig
=
async
()
=>
{
const
handleSaveOpenAIConfig
=
async
()
=>
{
try
{
try
{
await
api
.
upsertSystemSetting
({
await
api
.
upsertSystemSetting
({
name
:
"open
AIC
onfig"
,
name
:
"open
ai-c
onfig"
,
value
:
JSON
.
stringify
(
openAIConfig
),
value
:
JSON
.
stringify
(
openAIConfig
),
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -127,7 +127,7 @@ const SystemSection = () => {
...
@@ -127,7 +127,7 @@ const SystemSection = () => {
const
handleSaveAdditionalStyle
=
async
()
=>
{
const
handleSaveAdditionalStyle
=
async
()
=>
{
try
{
try
{
await
api
.
upsertSystemSetting
({
await
api
.
upsertSystemSetting
({
name
:
"additional
S
tyle"
,
name
:
"additional
-s
tyle"
,
value
:
JSON
.
stringify
(
state
.
additionalStyle
),
value
:
JSON
.
stringify
(
state
.
additionalStyle
),
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -147,7 +147,7 @@ const SystemSection = () => {
...
@@ -147,7 +147,7 @@ const SystemSection = () => {
const
handleSaveAdditionalScript
=
async
()
=>
{
const
handleSaveAdditionalScript
=
async
()
=>
{
try
{
try
{
await
api
.
upsertSystemSetting
({
await
api
.
upsertSystemSetting
({
name
:
"additional
S
cript"
,
name
:
"additional
-s
cript"
,
value
:
JSON
.
stringify
(
state
.
additionalScript
),
value
:
JSON
.
stringify
(
state
.
additionalScript
),
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -164,7 +164,7 @@ const SystemSection = () => {
...
@@ -164,7 +164,7 @@ const SystemSection = () => {
});
});
globalStore
.
setSystemStatus
({
disablePublicMemos
:
value
});
globalStore
.
setSystemStatus
({
disablePublicMemos
:
value
});
await
api
.
upsertSystemSetting
({
await
api
.
upsertSystemSetting
({
name
:
"disable
PublicM
emos"
,
name
:
"disable
-public-m
emos"
,
value
:
JSON
.
stringify
(
value
),
value
:
JSON
.
stringify
(
value
),
});
});
};
};
...
...
web/src/components/UpdateCustomizedProfileDialog.tsx
View file @
4f2adfef
...
@@ -83,7 +83,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
...
@@ -83,7 +83,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
try
{
try
{
await
api
.
upsertSystemSetting
({
await
api
.
upsertSystemSetting
({
name
:
"customized
P
rofile"
,
name
:
"customized
-p
rofile"
,
value
:
JSON
.
stringify
(
state
),
value
:
JSON
.
stringify
(
state
),
});
});
await
globalStore
.
fetchSystemStatus
();
await
globalStore
.
fetchSystemStatus
();
...
...
web/src/components/UpdateLocalStorageDialog.tsx
View file @
4f2adfef
...
@@ -23,7 +23,7 @@ const UpdateLocalStorageDialog: React.FC<Props> = (props: Props) => {
...
@@ -23,7 +23,7 @@ const UpdateLocalStorageDialog: React.FC<Props> = (props: Props) => {
const
handleConfirmBtnClick
=
async
()
=>
{
const
handleConfirmBtnClick
=
async
()
=>
{
try
{
try
{
await
api
.
upsertSystemSetting
({
await
api
.
upsertSystemSetting
({
name
:
"local
StorageP
ath"
,
name
:
"local
-storage-p
ath"
,
value
:
JSON
.
stringify
(
path
),
value
:
JSON
.
stringify
(
path
),
});
});
await
globalStore
.
fetchSystemStatus
();
await
globalStore
.
fetchSystemStatus
();
...
...
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