Skip to content

Commit e9572e2

Browse files
committed
feat(layout): 修改layout
1 parent 91f8af8 commit e9572e2

File tree

122 files changed

+201
-208
lines changed

Some content is hidden

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

122 files changed

+201
-208
lines changed

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@ GOBUILD=$(GOCMD) build
33
GOCLEAN=$(GOCMD) clean
44
BASEPATH := $(shell pwd)
55
BUILDDIR=$(BASEPATH)/dist/bin
6-
MAIN= $(BASEPATH)/main.go
6+
UIDIR=$(BASEPATH)/ui
7+
TERMINALDIR=$(BASEPATH)/terminal
8+
9+
MAIN= $(BASEPATH)/cmd/server/main.go
710

811
APP_NAME=ekko
912

1013
GOPROXY="https://goproxy.cn,direct"
1114

12-
build_darwin:
15+
build_web:
16+
cd $(UIDIR) && npm install && npm run-script build
17+
cd $(TERMINALDIR) && npm install && npm run-script build
18+
19+
20+
build_bin_darwin: build_web
21+
cd $(BASEPATH)
1322
GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(BUILDDIR)/darwin/amd64/$(APP_NAME) $(MAIN)

api/.gitkeep

Whitespace-only changes.

build/.gitkeep

Whitespace-only changes.

cmd/params/rules.go

Lines changed: 0 additions & 23 deletions
This file was deleted.

cmd/params/validator.go

Lines changed: 0 additions & 37 deletions
This file was deleted.

cmd/root.go renamed to cmd/server/main.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
package cmd
1+
package main
22

33
import (
4-
"github.com/KubeOperator/ekko/pkg/route"
5-
"github.com/KubeOperator/ekko/pkg/server"
4+
"embed"
5+
"github.com/KubeOperator/ekko/internal/route"
6+
"github.com/KubeOperator/ekko/internal/server"
67
"github.com/spf13/cobra"
78
)
89

@@ -12,6 +13,12 @@ var (
1213
serverBindPort int
1314
)
1415

16+
//go:embed web/terminal
17+
var embedWebTerminal embed.FS
18+
19+
//go:embed web/dashboard
20+
var embedWebDashboard embed.FS
21+
1522
func init() {
1623
RootCmd.Flags().StringVar(&serverBindHost, "server-bind-host", "", "ekko bind address")
1724
RootCmd.Flags().IntVar(&serverBindPort, "server-bind-port", 0, "ekko bind port")
@@ -22,6 +29,14 @@ var RootCmd = &cobra.Command{
2229
Use: "ekko",
2330
Short: "A dashboard for kubernetes",
2431
RunE: func(cmd *cobra.Command, args []string) error {
32+
server.EmbedWebDashboard = embedWebDashboard
33+
server.EmbedWebTerminal = embedWebTerminal
2534
return server.Listen(route.InitRoute)
2635
},
2736
}
37+
38+
func main() {
39+
if err := RootCmd.Execute(); err != nil {
40+
panic(err)
41+
}
42+
}
File renamed without changes.

pkg/api/v1/session/session.go renamed to internal/api/v1/session/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package session
22

33
import (
4-
"github.com/KubeOperator/ekko/pkg/service/v1/user"
4+
"github.com/KubeOperator/ekko/internal/service/v1/user"
55
"github.com/kataras/iris/v12"
66
"github.com/kataras/iris/v12/context"
77
)

pkg/api/v1/v1.go renamed to internal/api/v1/v1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package v1
22

33
import (
4-
"github.com/KubeOperator/ekko/pkg/api/v1/session"
4+
"github.com/KubeOperator/ekko/internal/api/v1/session"
55
"github.com/kataras/iris/v12"
66
)
77

pkg/config/config.go renamed to internal/config/config.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ package config
33
import (
44
"encoding/json"
55
"fmt"
6-
v1 "github.com/KubeOperator/ekko/pkg/model/v1"
7-
"github.com/KubeOperator/ekko/pkg/model/v1/config"
6+
v1 "github.com/KubeOperator/ekko/internal/model/v1"
7+
"github.com/KubeOperator/ekko/internal/model/v1/config"
88
"github.com/coreos/etcd/pkg/fileutil"
99
"github.com/spf13/viper"
1010
)
1111

12-
const configErr = "can not parse config file , %s"
1312
const configNotFoundSkipErr = "config file not found in %s, skip"
1413
const configReadErr = "can not read config file %s ,%s"
1514
const configMergeErr = "can not merge config file, %s"
File renamed without changes.

pkg/model/v1/config/config.go renamed to internal/model/v1/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package config
22

3-
import v1 "github.com/KubeOperator/ekko/pkg/model/v1"
3+
import v1 "github.com/KubeOperator/ekko/internal/model/v1"
44

55
type Config struct {
66
v1.BaseModel

pkg/model/v1/user/user.go renamed to internal/model/v1/user/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package user
22

3-
import v1 "github.com/KubeOperator/ekko/pkg/model/v1"
3+
import v1 "github.com/KubeOperator/ekko/internal/model/v1"
44

55
type User struct {
66
v1.BaseModel `storm:"inline"`
File renamed without changes.
File renamed without changes.

pkg/route/route.go renamed to internal/route/route.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package route
22

33
import (
4-
v1 "github.com/KubeOperator/ekko/pkg/api/v1"
4+
v1 "github.com/KubeOperator/ekko/internal/api/v1"
55
"github.com/kataras/iris/v12"
66
)
77

pkg/route/terminal/terminal.go renamed to internal/route/terminal/terminal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package terminal
22

33
import (
4-
shell "github.com/KubeOperator/ekko/pkg/terminal"
4+
shell "github.com/KubeOperator/ekko/internal/terminal"
55
"github.com/kataras/iris/v12"
66
)
77

pkg/route/ws/ws.go renamed to internal/route/ws/ws.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package ws
22

33
import (
4-
shell "github.com/KubeOperator/ekko/pkg/terminal"
4+
shell "github.com/KubeOperator/ekko/internal/terminal"
55
"github.com/kataras/iris/v12"
66
"github.com/kataras/iris/v12/context"
77
)

pkg/server/server.go renamed to internal/server/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package server
33
import (
44
"embed"
55
"fmt"
6-
"github.com/KubeOperator/ekko/pkg/config"
7-
v1Config "github.com/KubeOperator/ekko/pkg/model/v1/config"
6+
"github.com/KubeOperator/ekko/internal/config"
7+
v1Config "github.com/KubeOperator/ekko/internal/model/v1/config"
88
"github.com/asdine/storm/v3"
99
"github.com/kataras/iris/v12"
1010
"github.com/kataras/iris/v12/sessions"
File renamed without changes.

pkg/service/v1/user/user.go renamed to internal/service/v1/user/user.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package user
22

33
import (
4-
"github.com/KubeOperator/ekko/pkg/model/v1/user"
5-
"github.com/KubeOperator/ekko/pkg/server"
4+
"github.com/KubeOperator/ekko/internal/model/v1/user"
5+
"github.com/KubeOperator/ekko/internal/server"
66
)
77

88
type Service interface {

pkg/service/v1/user/user_test.go renamed to internal/service/v1/user/user_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package user
22

33
import (
44
"fmt"
5-
"github.com/KubeOperator/ekko/pkg/model/v1/user"
5+
"github.com/KubeOperator/ekko/internal/model/v1/user"
66
"github.com/asdine/storm/v3"
77
"testing"
88
)

main.go

Lines changed: 0 additions & 20 deletions
This file was deleted.

terminal/angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"build": {
2121
"builder": "@angular-devkit/build-angular:browser",
2222
"options": {
23-
"outputPath": "../web/terminal",
23+
"outputPath": "../cmd/server/web/terminal",
2424
"index": "src/index.html",
2525
"main": "src/main.ts",
2626
"polyfills": "src/polyfills.ts",

0 commit comments

Comments
 (0)