mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-09-27 01:15:52 +08:00
重启脚本修改
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,6 @@
|
||||
*.exe
|
||||
.vscode
|
||||
.idea
|
||||
resource
|
||||
resource
|
||||
*.log
|
||||
/monibuca
|
||||
|
3
main.go
3
main.go
@@ -209,8 +209,7 @@ func initInstance(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
sse.WriteEvent("step", []byte("1:参数解析成功!"))
|
||||
err = instanceDesc.CreateDir(sse, clearDir)
|
||||
if err != nil {
|
||||
if err = instanceDesc.CreateDir(sse, clearDir); err != nil {
|
||||
return
|
||||
}
|
||||
sse.WriteEvent("step", []byte("6:实例创建成功!"))
|
||||
|
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
var ConfigRaw []byte
|
||||
var Version = "0.3.0"
|
||||
var Version = "0.3.1"
|
||||
var EngineInfo = &struct {
|
||||
Version string
|
||||
StartTime time.Time
|
||||
|
@@ -51,6 +51,9 @@ func (ts *TS) run() {
|
||||
// AACFrameLength(13)
|
||||
// xx xxxxxxxx xxx
|
||||
frameLen := (int(data[3]&3) << 11) | (int(data[4]) << 3) | (int(data[5]) >> 5)
|
||||
if frameLen > remainLen {
|
||||
break
|
||||
}
|
||||
av := avformat.NewAVPacket(avformat.FLV_TAG_TYPE_AUDIO)
|
||||
av.Payload = data[:frameLen]
|
||||
ts.PushAudio(av)
|
||||
|
2
pm/dist/index.html
vendored
2
pm/dist/index.html
vendored
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>Monibuca Instance Manager</title><script src=ajax.js></script><link href=/css/app.200d2f8f.css rel=preload as=style><link href=/css/chunk-vendors.22ebf426.css rel=preload as=style><link href=/js/app.13e2de5f.js rel=preload as=script><link href=/js/chunk-vendors.2e3b192a.js rel=preload as=script><link href=/css/chunk-vendors.22ebf426.css rel=stylesheet><link href=/css/app.200d2f8f.css rel=stylesheet></head><body><noscript><strong>We're sorry but pm doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.2e3b192a.js></script><script src=/js/app.13e2de5f.js></script></body></html>
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>Monibuca Instance Manager</title><script src=ajax.js></script><link href=/css/app.200d2f8f.css rel=preload as=style><link href=/css/chunk-vendors.22ebf426.css rel=preload as=style><link href=/js/app.facdf5c9.js rel=preload as=script><link href=/js/chunk-vendors.2e3b192a.js rel=preload as=script><link href=/css/chunk-vendors.22ebf426.css rel=stylesheet><link href=/css/app.200d2f8f.css rel=stylesheet></head><body><noscript><strong>We're sorry but pm doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.2e3b192a.js></script><script src=/js/app.facdf5c9.js></script></body></html>
|
2
pm/dist/js/app.13e2de5f.js
vendored
2
pm/dist/js/app.13e2de5f.js
vendored
File diff suppressed because one or more lines are too long
1
pm/dist/js/app.13e2de5f.js.map
vendored
1
pm/dist/js/app.13e2de5f.js.map
vendored
File diff suppressed because one or more lines are too long
2
pm/dist/js/app.facdf5c9.js
vendored
Normal file
2
pm/dist/js/app.facdf5c9.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
pm/dist/js/app.facdf5c9.js.map
vendored
Normal file
1
pm/dist/js/app.facdf5c9.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -41,6 +41,10 @@ func (p *InstanceDesc) RestartCmd() *exec.Cmd {
|
||||
return p.Command("sh", "restart.sh")
|
||||
}
|
||||
func (p *InstanceDesc) CreateRestartFile(binFile string) error {
|
||||
return ioutil.WriteFile(path.Join(p.Path, "restart.sh"), []byte(fmt.Sprintf(`./shutdown.sh
|
||||
%s &`, binFile)), 0777)
|
||||
restartCmd := `if [ -f "shutdown.sh" ];then
|
||||
./shutdown.sh
|
||||
fi
|
||||
nohup ./%s > /dev/null &
|
||||
`
|
||||
return ioutil.WriteFile(path.Join(p.Path, "restart.sh"), []byte(fmt.Sprintf(restartCmd, binFile)), 0777)
|
||||
}
|
||||
|
@@ -3,9 +3,9 @@
|
||||
<List border>
|
||||
<ListItem v-for="item in instances" :key="item.Name">
|
||||
<ListItemMeta :title="item.Name" :description="item.Path"></ListItemMeta>
|
||||
<template v-if>{{typeof item.Info == "string"}}</template>
|
||||
<template v-else-if="item.Info">
|
||||
引擎版本:{{item.Info.Version}} <br>启动时间:
|
||||
<template v-if="typeof item.Info == 'string'">{{item.Info}}</template>
|
||||
<template v-else-if="item.Info!=null">
|
||||
引擎版本:{{item.Info.Version}} 启动时间:
|
||||
<StartTime :value="item.Info.StartTime"></StartTime>
|
||||
</template>
|
||||
<template slot="action">
|
||||
@@ -123,6 +123,8 @@
|
||||
es.onmessage = evt => {
|
||||
if (evt.data == "success") {
|
||||
this.$Message.success("重启成功!")
|
||||
es.onerror = null
|
||||
es.close()
|
||||
msg()
|
||||
} else {
|
||||
this.$Message.info(evt.data)
|
||||
@@ -133,7 +135,7 @@
|
||||
msg()
|
||||
})
|
||||
es.onerror = e => {
|
||||
if (e && e.toString()) this.$Message.error(e);
|
||||
this.$Message.error(e.toString());
|
||||
msg()
|
||||
es.close()
|
||||
}
|
||||
|
@@ -25,13 +25,13 @@ func HomeDir() (string, error) {
|
||||
return home, nil
|
||||
}
|
||||
func (p *InstanceDesc) ShutDownCmd() *exec.Cmd {
|
||||
return p.Command("cmd", "/c", "shutdown.bat")
|
||||
return p.Command("cmd", "/C", "shutdown.bat")
|
||||
}
|
||||
|
||||
func (p *InstanceDesc) RestartCmd() *exec.Cmd {
|
||||
return p.Command("cmd", "/c", "restart.bat")
|
||||
return p.Command("cmd", "/C", "restart.bat")
|
||||
}
|
||||
func (p *InstanceDesc) CreateRestartFile(binFile string) error {
|
||||
return ioutil.WriteFile(path.Join(p.Path, "restart.bat"), []byte(fmt.Sprintf(`shutdown.bat
|
||||
return ioutil.WriteFile(path.Join(p.Path, "restart.bat"), []byte(fmt.Sprintf(`call shutdown.bat
|
||||
start %s`, binFile)), 0777)
|
||||
}
|
||||
|
Reference in New Issue
Block a user