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
31e07c08
Commit
31e07c08
authored
May 13, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix types
parent
b8763905
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
20 deletions
+16
-20
StorageSection.tsx
web/src/components/Settings/StorageSection.tsx
+14
-18
Inboxes.tsx
web/src/pages/Inboxes.tsx
+2
-2
No files found.
web/src/components/Settings/StorageSection.tsx
View file @
31e07c08
...
...
@@ -28,11 +28,11 @@ const StorageSection = () => {
const
origin
=
WorkspaceStorageSetting
.
fromPartial
(
workspaceSettingStore
.
getWorkspaceSettingByKey
(
WorkspaceSettingKey
.
STORAGE
)?.
storageSetting
||
{},
);
if
(
workspaceStorageSetting
.
storageType
===
WorkspaceStorageSetting_StorageType
.
STORAGE_TYPE_
LOCAL
)
{
if
(
workspaceStorageSetting
.
storageType
===
WorkspaceStorageSetting_StorageType
.
LOCAL
)
{
if
(
workspaceStorageSetting
.
filepathTemplate
.
length
===
0
)
{
return
false
;
}
}
else
if
(
workspaceStorageSetting
.
storageType
===
WorkspaceStorageSetting_StorageType
.
S
TORAGE_TYPE_S
3
)
{
}
else
if
(
workspaceStorageSetting
.
storageType
===
WorkspaceStorageSetting_StorageType
.
S3
)
{
if
(
workspaceStorageSetting
.
s3Config
?.
accessKeyId
.
length
===
0
||
workspaceStorageSetting
.
s3Config
?.
accessKeySecret
.
length
===
0
||
...
...
@@ -124,9 +124,9 @@ const StorageSection = () => {
handleStorageTypeChanged
(
event
.
target
.
value
as
WorkspaceStorageSetting_StorageType
);
}
}
>
<
Radio
value=
{
WorkspaceStorageSetting_StorageType
.
STORAGE_TYPE_
DATABASE
}
label=
{
t
(
"setting.storage-section.type-database"
)
}
/>
<
Radio
value=
{
WorkspaceStorageSetting_StorageType
.
STORAGE_TYPE_
LOCAL
}
label=
{
t
(
"setting.storage-section.type-local"
)
}
/>
<
Radio
value=
{
WorkspaceStorageSetting_StorageType
.
S
TORAGE_TYPE_S
3
}
label=
{
"S3"
}
/>
<
Radio
value=
{
WorkspaceStorageSetting_StorageType
.
DATABASE
}
label=
{
t
(
"setting.storage-section.type-database"
)
}
/>
<
Radio
value=
{
WorkspaceStorageSetting_StorageType
.
LOCAL
}
label=
{
t
(
"setting.storage-section.type-local"
)
}
/>
<
Radio
value=
{
WorkspaceStorageSetting_StorageType
.
S3
}
label=
{
"S3"
}
/>
</
RadioGroup
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
div
className=
"flex flex-row items-center"
>
...
...
@@ -140,49 +140,45 @@ const StorageSection = () => {
sx=
{
{
fontFamily
:
"monospace"
,
}
}
defaultV
alue=
{
workspaceStorageSetting
.
uploadSizeLimitMb
}
v
alue=
{
workspaceStorageSetting
.
uploadSizeLimitMb
}
onChange=
{
handleMaxUploadSizeChanged
}
/>
</
div
>
{
workspaceStorageSetting
.
storageType
!==
WorkspaceStorageSetting_StorageType
.
STORAGE_TYPE_
DATABASE
&&
(
{
workspaceStorageSetting
.
storageType
!==
WorkspaceStorageSetting_StorageType
.
DATABASE
&&
(
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"text-gray-700 dark:text-gray-500 mr-1"
>
Filepath template
</
span
>
<
Input
defaultV
alue=
{
workspaceStorageSetting
.
filepathTemplate
}
v
alue=
{
workspaceStorageSetting
.
filepathTemplate
}
placeholder=
"assets/
{
timestamp
}
_
{
filename
}"
onChange=
{
handleFilepathTemplateChanged
}
/>
</
div
>
)
}
{
workspaceStorageSetting
.
storageType
===
WorkspaceStorageSetting_StorageType
.
S
TORAGE_TYPE_S
3
&&
(
{
workspaceStorageSetting
.
storageType
===
WorkspaceStorageSetting_StorageType
.
S3
&&
(
<>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"text-gray-700 dark:text-gray-500 mr-1"
>
Access key id
</
span
>
<
Input
defaultValue=
{
workspaceStorageSetting
.
s3Config
?.
accessKeyId
}
placeholder=
""
onChange=
{
handleS3ConfigAccessKeyIdChanged
}
/>
<
Input
value=
{
workspaceStorageSetting
.
s3Config
?.
accessKeyId
}
placeholder=
""
onChange=
{
handleS3ConfigAccessKeyIdChanged
}
/>
</
div
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"text-gray-700 dark:text-gray-500 mr-1"
>
Access key secret
</
span
>
<
Input
defaultV
alue=
{
workspaceStorageSetting
.
s3Config
?.
accessKeySecret
}
v
alue=
{
workspaceStorageSetting
.
s3Config
?.
accessKeySecret
}
placeholder=
""
onChange=
{
handleS3ConfigAccessKeySecretChanged
}
/>
</
div
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"text-gray-700 dark:text-gray-500 mr-1"
>
Endpoint
</
span
>
<
Input
defaultV
alue=
{
workspaceStorageSetting
.
s3Config
?.
endpoint
}
placeholder=
""
onChange=
{
handleS3ConfigEndpointChanged
}
/>
<
Input
v
alue=
{
workspaceStorageSetting
.
s3Config
?.
endpoint
}
placeholder=
""
onChange=
{
handleS3ConfigEndpointChanged
}
/>
</
div
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"text-gray-700 dark:text-gray-500 mr-1"
>
Region
</
span
>
<
Input
defaultV
alue=
{
workspaceStorageSetting
.
s3Config
?.
region
}
placeholder=
""
onChange=
{
handleS3ConfigRegionChanged
}
/>
<
Input
v
alue=
{
workspaceStorageSetting
.
s3Config
?.
region
}
placeholder=
""
onChange=
{
handleS3ConfigRegionChanged
}
/>
</
div
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
<
span
className=
"text-gray-700 dark:text-gray-500 mr-1"
>
Bucket
</
span
>
<
Input
defaultV
alue=
{
workspaceStorageSetting
.
s3Config
?.
bucket
}
placeholder=
""
onChange=
{
handleS3ConfigBucketChanged
}
/>
<
Input
v
alue=
{
workspaceStorageSetting
.
s3Config
?.
bucket
}
placeholder=
""
onChange=
{
handleS3ConfigBucketChanged
}
/>
</
div
>
</>
)
}
...
...
web/src/pages/Inboxes.tsx
View file @
31e07c08
...
...
@@ -42,9 +42,9 @@ const Inboxes = () => {
)
}
<
div
className=
"flex flex-col justify-start items-start w-full mt-4 gap-4"
>
{
inboxes
.
map
((
inbox
)
=>
{
if
(
inbox
.
type
===
Inbox_Type
.
TYPE_
MEMO_COMMENT
)
{
if
(
inbox
.
type
===
Inbox_Type
.
MEMO_COMMENT
)
{
return
<
MemoCommentMessage
key=
{
`${inbox.name}-${inbox.status}`
}
inbox=
{
inbox
}
/>;
}
else
if
(
inbox
.
type
===
Inbox_Type
.
TYPE_
VERSION_UPDATE
)
{
}
else
if
(
inbox
.
type
===
Inbox_Type
.
VERSION_UPDATE
)
{
return
<
VersionUpdateMessage
key=
{
`${inbox.name}-${inbox.status}`
}
inbox=
{
inbox
}
/>;
}
return
undefined
;
...
...
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