build-in app xiang -> yao
This commit is contained in:
parent
05f4596dea
commit
8daba92c6b
35 changed files with 377 additions and 291 deletions
49
Makefile
49
Makefile
|
|
@ -106,7 +106,7 @@ plugin-mac:
|
|||
pack:
|
||||
mkdir -p .tmp/data
|
||||
cp -r ui .tmp/data/
|
||||
cp -r xiang .tmp/data/
|
||||
cp -r yao .tmp/data/
|
||||
go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/...
|
||||
rm -rf .tmp/data
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ artifacts-linux: clean
|
|||
# Packing
|
||||
mkdir -p .tmp/data
|
||||
cp -r ../ui/dist .tmp/data/ui
|
||||
cp -r xiang .tmp/data/
|
||||
cp -r yao .tmp/data/
|
||||
go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/...
|
||||
rm -rf .tmp/data
|
||||
rm -rf .tmp/ui
|
||||
|
|
@ -151,15 +151,15 @@ artifacts-macos: clean
|
|||
# Packing
|
||||
mkdir -p .tmp/data
|
||||
cp -r ../ui/dist .tmp/data/ui
|
||||
cp -r xiang .tmp/data/
|
||||
cp -r yao .tmp/data/
|
||||
go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/...
|
||||
rm -rf .tmp/data
|
||||
rm -rf .tmp/ui
|
||||
|
||||
# Making artifacts
|
||||
mkdir -p dist
|
||||
CGO_ENABLED=1 CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -o dist/yao-${VERSION}-darwin-amd64
|
||||
CGO_ENABLED=1 CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -v -o dist/yao-${VERSION}-darwin-arm64
|
||||
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -o dist/yao-${VERSION}-darwin-amd64
|
||||
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -v -o dist/yao-${VERSION}-darwin-arm64
|
||||
|
||||
mkdir -p dist/release
|
||||
mv dist/yao-*-* dist/release/
|
||||
|
|
@ -167,6 +167,45 @@ artifacts-macos: clean
|
|||
ls -l dist/release/
|
||||
dist/release/yao-${VERSION}-darwin-amd64 version
|
||||
|
||||
.PHONY: debug
|
||||
debug: clean
|
||||
mkdir -p dist/release
|
||||
|
||||
# Packing
|
||||
mkdir -p .tmp/data
|
||||
cp -r ui .tmp/data/ui
|
||||
cp -r yao .tmp/data/
|
||||
go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/...
|
||||
rm -rf .tmp/data
|
||||
|
||||
# Making artifacts
|
||||
mkdir -p dist
|
||||
CGO_ENABLED=1 go build -v -o dist/release/yao-debug
|
||||
chmod +x dist/release/yao-debug
|
||||
|
||||
.PHONY: release
|
||||
release: clean
|
||||
mkdir -p dist/release
|
||||
mkdir .tmp
|
||||
|
||||
# Building UI
|
||||
git clone https://github.com/YaoApp/xgen.git .tmp/ui
|
||||
sed -ie "s/url('\/icon/url('\/xiang\/icon/g" .tmp/ui/public/icon/md_icon.css
|
||||
cd .tmp/ui && npm install && npm run build
|
||||
|
||||
# Packing
|
||||
mkdir -p .tmp/data
|
||||
cp -r .tmp/ui/dist .tmp/data/ui
|
||||
cp -r yao .tmp/data/
|
||||
go-bindata -fs -pkg data -o data/bindata.go -prefix ".tmp/data/" .tmp/data/...
|
||||
rm -rf .tmp/data
|
||||
rm -rf .tmp/ui
|
||||
|
||||
# Making artifacts
|
||||
mkdir -p dist
|
||||
CGO_ENABLED=1 go build -v -o dist/release/yao
|
||||
chmod +x dist/release/yao
|
||||
|
||||
# make clean
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
|
|
|||
24
app/app.go
24
app/app.go
|
|
@ -94,16 +94,16 @@ func LoadInfo(root string) {
|
|||
}
|
||||
}
|
||||
|
||||
if fs.MustExists("/xiang/icons/icon.icns") {
|
||||
info.Icons.Set("icns", xfs.Encode(fs.MustReadFile("/xiang/icons/icon.icns")))
|
||||
if fs.MustExists("/yao/icons/icon.icns") {
|
||||
info.Icons.Set("icns", xfs.Encode(fs.MustReadFile("/yao/icons/icon.icns")))
|
||||
}
|
||||
|
||||
if fs.MustExists("/xiang/icons/icon.ico") {
|
||||
info.Icons.Set("ico", xfs.Encode(fs.MustReadFile("/xiang/icons/icon.ico")))
|
||||
if fs.MustExists("/yao/icons/icon.ico") {
|
||||
info.Icons.Set("ico", xfs.Encode(fs.MustReadFile("/yao/icons/icon.ico")))
|
||||
}
|
||||
|
||||
if fs.MustExists("/xiang/icons/icon.png") {
|
||||
info.Icons.Set("png", xfs.Encode(fs.MustReadFile("/xiang/icons/icon.png")))
|
||||
if fs.MustExists("/yao/icons/icon.png") {
|
||||
info.Icons.Set("png", xfs.Encode(fs.MustReadFile("/yao/icons/icon.png")))
|
||||
}
|
||||
|
||||
share.App = info
|
||||
|
|
@ -114,9 +114,9 @@ func LoadLang(cfg config.Config) error {
|
|||
|
||||
var defaults = []share.Script{}
|
||||
if os.Getenv("YAO_DEV") != "" {
|
||||
defaults = share.GetFilesFS(filepath.Join(os.Getenv("YAO_DEV"), "xiang"), ".json")
|
||||
defaults = share.GetFilesFS(filepath.Join(os.Getenv("YAO_DEV"), "yao"), ".json")
|
||||
} else {
|
||||
defaults = share.GetFilesBin("xiang", ".json")
|
||||
defaults = share.GetFilesBin("yao", ".json")
|
||||
}
|
||||
|
||||
for _, lang := range defaults {
|
||||
|
|
@ -176,14 +176,14 @@ func defaultInfo() share.AppInfo {
|
|||
info := share.AppInfo{
|
||||
Icons: maps.MakeSync(),
|
||||
}
|
||||
err := jsoniter.Unmarshal(data.MustAsset("xiang/data/app.json"), &info)
|
||||
err := jsoniter.Unmarshal(data.MustAsset("yao/data/app.json"), &info)
|
||||
if err != nil {
|
||||
exception.New("解析默认应用失败 %s", 500, err).Throw()
|
||||
}
|
||||
|
||||
info.Icons.Set("icns", xfs.Encode(data.MustAsset("xiang/data/icons/icon.icns")))
|
||||
info.Icons.Set("ico", xfs.Encode(data.MustAsset("xiang/data/icons/icon.ico")))
|
||||
info.Icons.Set("png", xfs.Encode(data.MustAsset("xiang/data/icons/icon.png")))
|
||||
info.Icons.Set("icns", xfs.Encode(data.MustAsset("yao/data/icons/icon.icns")))
|
||||
info.Icons.Set("ico", xfs.Encode(data.MustAsset("yao/data/icons/icon.ico")))
|
||||
info.Icons.Set("png", xfs.Encode(data.MustAsset("yao/data/icons/icon.png")))
|
||||
|
||||
return info
|
||||
}
|
||||
|
|
|
|||
575
data/bindata.go
575
data/bindata.go
File diff suppressed because one or more lines are too long
|
|
@ -43,7 +43,7 @@ func Load(cfg config.Config) (err error) {
|
|||
|
||||
// 加载应用引擎
|
||||
if os.Getenv("YAO_DEV") != "" {
|
||||
LoadEngine(filepath.Join(os.Getenv("YAO_DEV"), "/xiang"))
|
||||
LoadEngine(filepath.Join(os.Getenv("YAO_DEV"), "/yao"))
|
||||
} else {
|
||||
LoadEngine()
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ func LoadEngine(from ...string) {
|
|||
if len(from) > 0 {
|
||||
scripts = share.GetFilesFS(from[0], ".json")
|
||||
} else {
|
||||
scripts = share.GetFilesBin("xiang", ".json")
|
||||
scripts = share.GetFilesBin("yao", ".json")
|
||||
}
|
||||
|
||||
if scripts == nil {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ func TestLoad(t *testing.T) {
|
|||
// 从文件系统载入引擎文件
|
||||
func TestLoadEngineFS(t *testing.T) {
|
||||
defer Load(config.Conf)
|
||||
root := path.Join(os.Getenv("YAO_DEV"), "/xiang")
|
||||
root := path.Join(os.Getenv("YAO_DEV"), "/yao")
|
||||
assert.NotPanics(t, func() {
|
||||
LoadEngine(root)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Xiang Admin
|
||||
Yao web services mode
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func init() {
|
|||
share.DBConnect(config.Conf.DB)
|
||||
share.Load(config.Conf)
|
||||
model.Load(config.Conf)
|
||||
engineModels := path.Join(os.Getenv("YAO_DEV"), "xiang", "models")
|
||||
engineModels := path.Join(os.Getenv("YAO_DEV"), "yao", "models")
|
||||
model.LoadFrom(engineModels, "xiang.")
|
||||
query.Load(config.Conf)
|
||||
flow.Load(config.Conf)
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 31 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
|
|
@ -3,7 +3,7 @@
|
|||
"version": "1.0.0",
|
||||
"description": "数据分析接口API",
|
||||
"group": "xiang/chart",
|
||||
"guard": "in-process",
|
||||
"guard": "bearer-jwt",
|
||||
"paths": [
|
||||
{
|
||||
"path": "/:name/data",
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
"version": "1.0.0",
|
||||
"description": "页面接口API",
|
||||
"group": "xiang/page",
|
||||
"guard": "in-process",
|
||||
"guard": "bearer-jwt",
|
||||
"paths": [
|
||||
{
|
||||
"path": "/:name/data",
|
||||
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
BIN
yao/data/icons/icon.icns
Normal file
BIN
yao/data/icons/icon.icns
Normal file
Binary file not shown.
BIN
yao/data/icons/icon.ico
Normal file
BIN
yao/data/icons/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
BIN
yao/data/icons/icon.png
Normal file
BIN
yao/data/icons/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
|
|
@ -2,9 +2,9 @@
|
|||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>象传智慧 | iqka.com</title>
|
||||
<title>Yao App Engine</title>
|
||||
</head>
|
||||
<body class="overscroll-none">
|
||||
It works! <a href="https://www.iqka.com"> 象传应用引擎官网 </a>
|
||||
It works! <a href="https://yaoapps.com"> Yao App Engine </a>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Reference in a new issue