Add new connect form, closes #7
This commit is contained in:
parent
f502fea5c1
commit
6fd5235ec9
16 changed files with 524 additions and 231 deletions
|
@ -11,9 +11,10 @@ import (
|
|||
)
|
||||
|
||||
type connectDefaults struct {
|
||||
Name string `json:"name"`
|
||||
Address string `json:"address"`
|
||||
Channels []string `json:"channels"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Host string `json:"host,omitempty"`
|
||||
Port int `json:"port,omitempty"`
|
||||
Channels []string `json:"channels,omitempty"`
|
||||
Password bool `json:"password,omitempty"`
|
||||
SSL bool `json:"ssl,omitempty"`
|
||||
ReadOnly bool `json:"readonly,omitempty"`
|
||||
|
@ -81,7 +82,8 @@ func getIndexData(r *http.Request, session *Session) *indexData {
|
|||
|
||||
data.Defaults = connectDefaults{
|
||||
Name: viper.GetString("defaults.name"),
|
||||
Address: viper.GetString("defaults.address"),
|
||||
Host: viper.GetString("defaults.host"),
|
||||
Port: viper.GetInt("defaults.port"),
|
||||
Channels: viper.GetStringSlice("defaults.channels"),
|
||||
Password: viper.GetString("defaults.password") != "",
|
||||
SSL: viper.GetBool("defaults.ssl"),
|
||||
|
|
|
@ -85,7 +85,7 @@ func (h *wsHandler) connect(b []byte) {
|
|||
json.Unmarshal(b, &data)
|
||||
|
||||
if _, ok := h.session.getIRC(data.Host); !ok {
|
||||
log.Println(h.addr, "[IRC] Add server", data.Server)
|
||||
log.Println(h.addr, "[IRC] Add server", data.Host)
|
||||
|
||||
connectIRC(data.Server, h.session)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue