Skip to content

Commit

Permalink
v1.4.1 1. Fix the format error of the downloaded file 2. Fixed the is…
Browse files Browse the repository at this point in the history
…sue where the file name in the history was displayed incorrectly 3. Enriched documentation
  • Loading branch information
llaoj committed Aug 20, 2024
1 parent c6174ba commit f097cf0
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 7 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ The tested browsers and its versions are listed below:
- At any given time, only one file can be synchronized.
- Due to limited server memory, the size of the files you synchronize must not exceed `--max-content-length` MB.

## Sponsor

[Buy me a coffee](docs/sponsor.md)

## Community

Welcome to join GCopy, whether you're a user or a contributor!
Expand All @@ -82,7 +86,7 @@ Server link: https://discord.gg/pyTrT3aAaC

Safari on iOS

<img width="300" alt="screenshot on ios safari" src="docs/screenshot-ios-safari.png">
<img width="300" alt="screenshot on ios safari" src="docs/screenshot-ios-safari.jpeg">

## More

Expand Down
Binary file added docs/alipay.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/screenshot-chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshot-ios-safari.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/screenshot-ios-safari.png
Binary file not shown.
5 changes: 5 additions & 0 deletions docs/sponsor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 微信打赏 ☕️ WechatPay
<img width="300" alt="screenshot on ios safari" src="wechatpay.jpeg">

## 支付宝打赏 ☕️ AliPay
<img width="300" alt="screenshot on ios safari" src="alipay.jpeg">
Binary file added docs/wechatpay.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/zh-CN/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ GCopy依赖浏览器的Clipboard API. 它的浏览器兼容性请参考: [browse
- 同时只能同步一个文件.
- 因为服务器内存有限, 您同步的文件不能超过`--max-content-length`MB.

## 感谢支持

[打赏杯咖啡吧](../sponsor.md)

## 社区

欢迎你参与到GCopy中来, 不管你是用户还是贡献者,
Expand All @@ -86,7 +90,7 @@ GCopy依赖浏览器的Clipboard API. 它的浏览器兼容性请参考: [browse

Safari on iOS

<img width="300" alt="screenshot on ios safari" src="../screenshot-ios-safari.png">
<img width="300" alt="screenshot on ios safari" src="../screenshot-ios-safari.jpeg">

## 更多

Expand Down
2 changes: 1 addition & 1 deletion frontend/components/history-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function HistoryItem({
)}
{item.type == "file" && (
<p className="line-clamp-1 opacity-70 break-all">
{"[" + t("file") + "]" + item.fileName}
{"[" + t("file") + "]" + decodeURI(item.fileName ?? "")}
</p>
)}
</td>
Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gcopy",
"version": "1.4.0",
"version": "1.4.1",
"private": true,
"scripts": {
"dev": "next dev -p 3375 --experimental-https",
Expand Down
1 change: 1 addition & 0 deletions internal/gcopy/gcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ type Clipboard struct {
CreatedAt time.Time
// The client where the clipboard data from, format: <os-name> <browser-name>
ClientName string
MIMEType string
}
2 changes: 2 additions & 0 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func (s *Server) getClipboardHandler(c *gin.Context) {
}

c.Status(http.StatusOK)
c.Header("Content-Type", cb.MIMEType)
c.Header("X-Index", strconv.Itoa(cb.Index))
c.Header("X-Type", cb.Type)
c.Header("X-FileName", cb.FileName)
Expand Down Expand Up @@ -179,6 +180,7 @@ func (s *Server) updateClipboardHandler(c *gin.Context) {
Data: data,
CreatedAt: time.Now(),
ClientName: clientName,
MIMEType: c.Request.Header.Get("Content-Type"),
}
s.log.Infof("[%s] Received %s(%v)", utils.StrMaskMiddle(sub), cb.Type, cb.Index)
s.wall.Set(sub, cb)
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.4.0
v1.4.1

0 comments on commit f097cf0

Please sign in to comment.