Skip to content

Commit

Permalink
✏️ 修复 webgui 无法启动
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Nov 9, 2021
1 parent 34bc8e3 commit e2032cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
6 changes: 3 additions & 3 deletions control/web/gui.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package web
package webctrl

import (
"encoding/json"
Expand Down Expand Up @@ -36,8 +36,8 @@ var (
type logWriter struct {
}

// initGui 初始化gui
func initGui() {
// InitGui 初始化gui
func InitGui() {
// 将日志重定向到前端hook
writer := io.MultiWriter(l, os.Stderr)
log.SetOutput(writer)
Expand Down
11 changes: 0 additions & 11 deletions control/web/init.go

This file was deleted.

10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// 下列插件可与 wdvxdr1123/ZeroBot v1.1.2 以上配合单独使用

// 插件控制
// _ "github.com/FloatTech/ZeroBot-Plugin/control/web" // web 后端控制
// webctrl "github.com/FloatTech/ZeroBot-Plugin/control/web" // web 后端控制

// 词库类
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_atri" // ATRI词库
Expand Down Expand Up @@ -74,10 +74,14 @@ func init() {
d := flag.Bool("d", false, "Enable debug level log and higher.")
w := flag.Bool("w", false, "Enable warning level log and higher.")
h := flag.Bool("h", false, "Display this help.")
// 解析命令行参数,输入 `-g` 即可启用 gui
// g := flag.Bool("g", false, "Enable web gui.")

// 直接写死 AccessToken 时,请更改下面第二个参数
token = flag.String("t", "", "Set AccessToken of WSClient.")
// 直接写死 URL 时,请更改下面第二个参数
url = flag.String("u", "ws://127.0.0.1:6700", "Set Url of WSClient.")

flag.Parse()
if *h {
printBanner()
Expand All @@ -92,6 +96,10 @@ func init() {
logrus.SetLevel(logrus.WarnLevel)
}
}
// 解析命令行参数,输入 `-g` 即可启用 gui
// if *g {
// webctrl.InitGui()
// }
}

func printBanner() {
Expand Down

0 comments on commit e2032cd

Please sign in to comment.