Vendored
+11
@@ -0,0 +1,11 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>OCI Portal</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>前端产物未嵌入:请从前端仓库 Release 下载 dist.zip 解压至此目录(或本地构建前端后拷入),此文件为仓库占位。</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,19 @@
|
||||
// Package webui 承载前端构建产物的 go:embed 嵌入。
|
||||
// dist 由构建脚本从 oci-portal-dash/dist 拷入覆盖;
|
||||
// 仓库只提交占位 index.html,保证裸 clone 后 go build 可过。
|
||||
package webui
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
)
|
||||
|
||||
// all: 前缀连同 _ / . 开头文件一并嵌入(vite 产物含下划线开头的 chunk)。
|
||||
//
|
||||
//go:embed all:dist
|
||||
var distFS embed.FS
|
||||
|
||||
// Dist 返回以 dist 为根的只读文件系统,供 HTTP 层直接伺服。
|
||||
func Dist() (fs.FS, error) {
|
||||
return fs.Sub(distFS, "dist")
|
||||
}
|
||||
Reference in New Issue
Block a user