Start of the web frontend and backend for config handling.
This commit is contained in:
@@ -7,27 +7,27 @@ import (
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
Port int `yaml:"port"`
|
||||
Address string `yaml:"address"`
|
||||
DownloadPath string `yaml:"download_path"`
|
||||
Port int `yaml:"port" json:"port"`
|
||||
Address string `yaml:"address" json:"address"`
|
||||
DownloadPath string `yaml:"download_path" json:"download_path"`
|
||||
}
|
||||
|
||||
type DownloadProfile struct {
|
||||
Name string `yaml:"name"`
|
||||
Command string `yaml:"command"`
|
||||
Args []string `yaml:"args"`
|
||||
Name string `yaml:"name" json:"name"`
|
||||
Command string `yaml:"command" json:"command"`
|
||||
Args []string `yaml:"args" json:"args"`
|
||||
}
|
||||
|
||||
type UI struct {
|
||||
PopupWidth int `yaml:"popup_width"`
|
||||
PopupHeight int `yaml:"popup_height"`
|
||||
PopupWidth int `yaml:"popup_width" json:"popup_width"`
|
||||
PopupHeight int `yaml:"popup_height" json:"popup_height"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Server Server `yaml:"server"`
|
||||
UI UI `yaml:"ui"`
|
||||
DownloadProfiles []DownloadProfile `yaml:"profiles"`
|
||||
ConfigVersion int `yaml:"config_version"`
|
||||
Server Server `yaml:"server" json:"server"`
|
||||
UI UI `yaml:"ui" json:"ui"`
|
||||
DownloadProfiles []DownloadProfile `yaml:"profiles" json:"profiles"`
|
||||
ConfigVersion int `yaml:"config_version" json:"config_version"`
|
||||
}
|
||||
|
||||
func DefaultConfig() Config {
|
||||
@@ -41,11 +41,14 @@ func DefaultConfig() Config {
|
||||
|
||||
defaultConfig.DownloadProfiles = append(defaultConfig.DownloadProfiles, stdProfile)
|
||||
defaultConfig.Server.Port = 6123
|
||||
defaultConfig.Server.Address = "localhost:6123"
|
||||
defaultConfig.Server.Address = "http://localhost:6123"
|
||||
defaultConfig.Server.DownloadPath = "./"
|
||||
|
||||
defaultConfig.UI.PopupWidth = 500
|
||||
defaultConfig.UI.PopupHeight = 500
|
||||
|
||||
defaultConfig.ConfigVersion = 1
|
||||
|
||||
return defaultConfig
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user