Skip to content

Commit

Permalink
refactor: 更新依赖项和翻译错误
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Nov 25, 2024
1 parent a17c46d commit f28852a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/issue9/logs/v7 v7.6.4
github.com/issue9/mux/v9 v9.1.0
github.com/issue9/rands/v3 v3.0.1
github.com/issue9/web v0.99.1
github.com/issue9/web v0.99.3
github.com/shirou/gopsutil/v4 v4.24.10
golang.org/x/text v0.20.0
gopkg.in/yaml.v3 v3.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ github.com/issue9/term/v3 v3.3.2 h1:heyRhfA6EMztqh5UHUZyKr/LatFZXbJ7YhE5RI5fPTs=
github.com/issue9/term/v3 v3.3.2/go.mod h1:n5XiDESqvPeaLgHeG7H0JdIXU8/H5IZPEaH++0aHE5Q=
github.com/issue9/unique/v2 v2.1.0 h1:lE9hstenrbBgDM/Iulv7d75qAYpgoDV8rSRoLmEBHOk=
github.com/issue9/unique/v2 v2.1.0/go.mod h1:qZoDKnfu+7Q0yxhifVseRKD2Wea9Tc9zdXwALnFc54A=
github.com/issue9/web v0.99.1 h1:zwqxCDQIMeMETN+c9f4IbT6nNjOt4VNY6xsZWdQAX0A=
github.com/issue9/web v0.99.1/go.mod h1:mCpNxTkg+1pXh1Tqg3mnns88nUNaTg7230mayTFCq1E=
github.com/issue9/web v0.99.3 h1:NqP760ssc3jWBQs3c8rmMK9Se6D4Jj4BPXOW2x74kWk=
github.com/issue9/web v0.99.3/go.mod h1:mCpNxTkg+1pXh1Tqg3mnns88nUNaTg7230mayTFCq1E=
github.com/jellydator/ttlcache/v3 v3.3.0 h1:BdoC9cE81qXfrxeb9eoJi9dWrdhSuwXMAnHTbnBm4Wc=
github.com/jellydator/ttlcache/v3 v3.3.0/go.mod h1:bj2/e0l4jRnQdrnSTaGTsh4GSXvMjQcy41i7th0GVGw=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
Expand Down
3 changes: 2 additions & 1 deletion locales/zh.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
languages:
- zh-Hans
- cmn-Hans
- zh-CN
messages:
- key: access token
message:
Expand All @@ -25,7 +26,7 @@ messages:
msg: 创建时间
- key: enable compression base on cpu used
message:
msg: 基于 CPU 使用率决定是否启用压缩功能:w
msg: 基于 CPU 使用率决定是否启用压缩功能
- key: gen session id
message:
msg: 生成 session id
Expand Down
10 changes: 7 additions & 3 deletions plugins/openapi/swagger/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,20 @@ var tpl embed.FS
const CDNAssets = "https://unpkg.com/swagger-ui-dist@5.18.2"

// Install 安装模板
func Install(s web.Server) { html.Install(s, internal.Funcs, "*.html", tpl) }
//
// NOTE: 此操作会同时安装 json 和 yaml 两个方法用于解决 openapi 对象
func Install(s web.Server) { html.Install(s, internal.Funcs, nil, "*.html", tpl) }

// WithHTML 指定 [swagger] 的 HTML 模板
//
// 可用来代替 [openapi.WithHTML]
//
// assets swagger 的页面资源,可以直接引用 [CDNAssets],也可以指向自有的服务器;
// logo 图标
// assets swagger 的页面资源,可以直接引用 [CDNAssets],
// 或是采用 [files] 与 [static] 搭建一个本地的静态文件服务
//
// [swagger]: https://swagger.io/docs/open-source-tools/swagger-ui/usage/installation/
// [static]: github.com/issue9/webuse/handlers/static
// [files]: https://github.com/swaggo/files
func WithHTML(assets, logo string) openapi.Option {
return openapi.WithHTML("swagger", assets, logo)
}
Expand Down

0 comments on commit f28852a

Please sign in to comment.