Skip to content

Commit e445746

Browse files
committed
页面规整
1 parent 0dc0cbc commit e445746

69 files changed

Lines changed: 90 additions & 135 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ go.work.sum
3333
/node_modules
3434
/package-lock.json
3535
/.angular
36+
/dist

main.go

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,30 @@ package iot_master
22

33
import (
44
"embed"
5-
"encoding/json"
65

7-
"github.com/god-jason/iot-master/apps"
86
"github.com/god-jason/iot-master/iot"
9-
_ "github.com/god-jason/iot-master/iot"
10-
"github.com/god-jason/iot-master/pkg/log"
7+
"github.com/god-jason/iot-master/pkg/menu"
8+
"github.com/god-jason/iot-master/pkg/page"
119
"github.com/god-jason/iot-master/pkg/store"
1210
)
1311

14-
//go:embed assets
15-
var assets embed.FS
12+
//go:embed menu.json
13+
var menuJson []byte
1614

17-
//go:embed public/pages
15+
//go:embed pages
1816
var pages embed.FS
1917

20-
//go:embed tables
21-
var tables embed.FS
22-
2318
//go:embed protocols
2419
var protocols embed.FS
2520

26-
//go:embed manifest.json
27-
var manifest []byte
28-
2921
func init() {
30-
//注册为内部插件
31-
var a apps.App
32-
err := json.Unmarshal(manifest, &a)
22+
23+
page.PagesFS = store.PrefixFS(&pages, "pages")
24+
25+
err := menu.Content(menuJson)
3326
if err != nil {
34-
log.Fatal(err)
27+
panic(err)
3528
}
36-
apps.Register(&a)
37-
38-
//注册资源
39-
a.AssetsFS = store.PrefixFS(&assets, "assets")
40-
a.PagesFS = store.PrefixFS(&pages, "pages")
41-
a.TablesFS = store.PrefixFS(&tables, "tables")
4229

4330
//加载协议
4431
iot.Protocols = store.PrefixFS(&protocols, "protocols")

manifest.json

Lines changed: 0 additions & 79 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)