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
fbce4387
Commit
fbce4387
authored
Sep 08, 2022
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update resource base url
parent
b1e69564
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
6 deletions
+13
-6
server.go
server/server.go
+5
-2
MemoEditor.tsx
web/src/components/MemoEditor.tsx
+1
-1
ResourcesDialog.tsx
web/src/components/ResourcesDialog.tsx
+2
-2
vite.config.ts
web/vite.config.ts
+5
-1
No files found.
server/server.go
View file @
fbce4387
...
@@ -56,8 +56,11 @@ func NewServer(profile *profile.Profile) *Server {
...
@@ -56,8 +56,11 @@ func NewServer(profile *profile.Profile) *Server {
Profile
:
profile
,
Profile
:
profile
,
}
}
publicRouteGroup
:=
e
.
Group
(
"/h"
)
webhookGroup
:=
e
.
Group
(
"/h"
)
s
.
registerResourcePublicRoutes
(
publicRouteGroup
)
s
.
registerResourcePublicRoutes
(
webhookGroup
)
publicGroup
:=
e
.
Group
(
"/o"
)
s
.
registerResourcePublicRoutes
(
publicGroup
)
apiGroup
:=
e
.
Group
(
"/api"
)
apiGroup
:=
e
.
Group
(
"/api"
)
apiGroup
.
Use
(
func
(
next
echo
.
HandlerFunc
)
echo
.
HandlerFunc
{
apiGroup
.
Use
(
func
(
next
echo
.
HandlerFunc
)
echo
.
HandlerFunc
{
...
...
web/src/components/MemoEditor.tsx
View file @
fbce4387
...
@@ -116,7 +116,7 @@ const MemoEditor = () => {
...
@@ -116,7 +116,7 @@ const MemoEditor = () => {
try
{
try
{
const
image
=
await
resourceService
.
upload
(
file
);
const
image
=
await
resourceService
.
upload
(
file
);
const
url
=
`/
h
/r/
${
image
.
id
}
/
${
image
.
filename
}
`
;
const
url
=
`/
o
/r/
${
image
.
id
}
/
${
image
.
filename
}
`
;
return
url
;
return
url
;
}
catch
(
error
:
any
)
{
}
catch
(
error
:
any
)
{
console
.
error
(
error
);
console
.
error
(
error
);
...
...
web/src/components/ResourcesDialog.tsx
View file @
fbce4387
...
@@ -90,11 +90,11 @@ const ResourcesDialog: React.FC<Props> = (props: Props) => {
...
@@ -90,11 +90,11 @@ const ResourcesDialog: React.FC<Props> = (props: Props) => {
};
};
const
handlPreviewBtnClick
=
(
resource
:
Resource
)
=>
{
const
handlPreviewBtnClick
=
(
resource
:
Resource
)
=>
{
showPreviewImageDialog
(
`
${
window
.
location
.
origin
}
/
h
/r/
${
resource
.
id
}
/
${
resource
.
filename
}
`
);
showPreviewImageDialog
(
`
${
window
.
location
.
origin
}
/
o
/r/
${
resource
.
id
}
/
${
resource
.
filename
}
`
);
};
};
const
handleCopyResourceLinkBtnClick
=
(
resource
:
Resource
)
=>
{
const
handleCopyResourceLinkBtnClick
=
(
resource
:
Resource
)
=>
{
utils
.
copyTextToClipboard
(
`
${
window
.
location
.
origin
}
/
h
/r/
${
resource
.
id
}
/
${
resource
.
filename
}
`
);
utils
.
copyTextToClipboard
(
`
${
window
.
location
.
origin
}
/
o
/r/
${
resource
.
id
}
/
${
resource
.
filename
}
`
);
toastHelper
.
success
(
"Succeed to copy resource link to clipboard"
);
toastHelper
.
success
(
"Succeed to copy resource link to clipboard"
);
};
};
...
...
web/vite.config.ts
View file @
fbce4387
...
@@ -6,13 +6,17 @@ import { resolve } from "path";
...
@@ -6,13 +6,17 @@ import { resolve } from "path";
export
default
defineConfig
({
export
default
defineConfig
({
plugins
:
[
react
()],
plugins
:
[
react
()],
server
:
{
server
:
{
cors
:
true
,
host
:
"0.0.0.0"
,
port
:
3000
,
port
:
3000
,
proxy
:
{
proxy
:
{
"/api"
:
{
"/api"
:
{
target
:
"http://localhost:8080/"
,
target
:
"http://localhost:8080/"
,
changeOrigin
:
true
,
changeOrigin
:
true
,
},
},
"/o/"
:
{
target
:
"http://localhost:8080/"
,
changeOrigin
:
true
,
},
"/h/"
:
{
"/h/"
:
{
target
:
"http://localhost:8080/"
,
target
:
"http://localhost:8080/"
,
changeOrigin
:
true
,
changeOrigin
:
true
,
...
...
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