feat: add configuration file handling
- add helper function to parse configuration from a YAML file
- update command-line parameters to include a config file option
- remove hardcoded Pomodoro settings and use parsed config instead
- delete obsolete PomodoroSettings.go file
🤖
This commit is contained in:
parent
25e939f523
commit
bb790459c1
7 changed files with 69 additions and 26 deletions
|
@ -1,7 +1,6 @@
|
|||
package websocket
|
||||
|
||||
import (
|
||||
"ChronoTomato/config"
|
||||
"encoding/json"
|
||||
"git.smsvc.net/pomodoro/GoTomato/pkg/models"
|
||||
"github.com/charmbracelet/log"
|
||||
|
@ -32,11 +31,11 @@ func SendCmd(conn *websocket.Conn, pwd string, cmd string) {
|
|||
sendClientCommand(conn, message)
|
||||
}
|
||||
|
||||
func Send_updateSettings(conn *websocket.Conn, pwd string) {
|
||||
func Send_updateSettings(conn *websocket.Conn, pwd string, settings models.GoTomatoPomodoroConfig) {
|
||||
message := models.ClientCommand{
|
||||
Command: "updateSettings",
|
||||
Password: pwd,
|
||||
PomodoroSettings: config.PomodoroSettings,
|
||||
PomodoroSettings: settings,
|
||||
}
|
||||
|
||||
sendClientCommand(conn, message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue