mirror of
https://github.com/Threnklyn/wg-ui.git
synced 2026-06-07 14:03:33 +02:00
Add Notes field to client config
This commit is contained in:
@@ -27,6 +27,7 @@ type ClientConfig struct {
|
|||||||
PrivateKey string
|
PrivateKey string
|
||||||
PublicKey string
|
PublicKey string
|
||||||
IP net.IP
|
IP net.IP
|
||||||
|
Notes string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewServerConfig(cfgPath string) *ServerConfig {
|
func NewServerConfig(cfgPath string) *ServerConfig {
|
||||||
@@ -92,6 +93,7 @@ func NewClientConfig(ip net.IP) *ClientConfig {
|
|||||||
PrivateKey: key.String(),
|
PrivateKey: key.String(),
|
||||||
PublicKey: key.PublicKey().String(),
|
PublicKey: key.PublicKey().String(),
|
||||||
IP: ip,
|
IP: ip,
|
||||||
|
Notes: "",
|
||||||
}
|
}
|
||||||
|
|
||||||
return &cfg
|
return &cfg
|
||||||
|
|||||||
@@ -451,6 +451,10 @@ func (s *Server) EditClient(w http.ResponseWriter, r *http.Request, ps httproute
|
|||||||
client.Name = cfg.Name
|
client.Name = cfg.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cfg.Notes != "" {
|
||||||
|
client.Notes = cfg.Notes
|
||||||
|
}
|
||||||
|
|
||||||
s.reconfigure()
|
s.reconfigure()
|
||||||
|
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
|
|||||||
@@ -61,6 +61,12 @@ margin-top: 1em;
|
|||||||
<span class="bmd-help">Friendly name of client.</span>
|
<span class="bmd-help">Friendly name of client.</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="notes" class="bmd-label-floating">Notes</label>
|
||||||
|
<textarea class="form-control" id="notes" rows="3" bind:value={client.Notes}/>
|
||||||
|
<span class="bmd-help">Notes about client.</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-raised btn-primary">Save Changes</button>
|
<button type="submit" class="btn btn-raised btn-primary">Save Changes</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user