mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-22 09:00:10 +00:00
Tray: Add button to open logs
This commit is contained in:
parent
62c29d55cc
commit
7035a3fe9c
1
go.mod
1
go.mod
@ -39,6 +39,7 @@ require (
|
||||
github.com/mailgun/mailgun-go/v4 v4.5.1
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
|
||||
github.com/smartystreets/goconvey v1.6.4 // indirect
|
||||
github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14
|
||||
github.com/swaggo/gin-swagger v1.3.0
|
||||
|
2
go.sum
2
go.sum
@ -221,6 +221,8 @@ github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA=
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
|
||||
|
2
main.go
2
main.go
@ -723,7 +723,7 @@ func logOutput() func() {
|
||||
old := os.Stdout
|
||||
log.Printf("Logging to \"%s\"", logPath)
|
||||
f, err := os.OpenFile(logPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
|
||||
if err == nil {
|
||||
if err != nil {
|
||||
return func() {}
|
||||
}
|
||||
writer := io.MultiWriter(old, f)
|
||||
|
4
tray.go
4
tray.go
@ -9,6 +9,7 @@ import (
|
||||
"syscall"
|
||||
|
||||
"github.com/getlantern/systray"
|
||||
"github.com/skratchdot/open-golang/open"
|
||||
// "github.com/getlantern/systray"
|
||||
)
|
||||
|
||||
@ -36,6 +37,7 @@ func onReady() {
|
||||
mStart := systray.AddMenuItem("Start", "Start jfa-go")
|
||||
mStop := systray.AddMenuItem("Stop", "Stop jfa-go")
|
||||
mRestart := systray.AddMenuItem("Restart", "Restart jfa-go")
|
||||
mOpenLogs := systray.AddMenuItem("Open logs", "Open jfa-go log file.")
|
||||
as := NewAutostart("jfa-go", "A user management system for Jellyfin", "Run on login", "Run jfa-go on user login.")
|
||||
mQuit := systray.AddMenuItem("Quit", "Quit jfa-go")
|
||||
|
||||
@ -88,6 +90,8 @@ func onReady() {
|
||||
mStop.Enable()
|
||||
mRestart.Enable()
|
||||
}
|
||||
case <-mOpenLogs.ClickedCh:
|
||||
open.Start(logPath)
|
||||
case <-mQuit.ClickedCh:
|
||||
systray.Quit()
|
||||
// case <-mOnLogin.ClickedCh:
|
||||
|
Loading…
Reference in New Issue
Block a user