diff --git a/custom/js/helper.js b/custom/js/helper.js index d98eacb..6f32900 100644 --- a/custom/js/helper.js +++ b/custom/js/helper.js @@ -38,6 +38,11 @@ function renderClientList(data) { subnetRangesString = obj.Client.subnet_ranges.join(',') } + let additionalNotesHtml = ""; + if (obj.Client.additional_notes && obj.Client.additional_notes.length > 0) { + additionalNotesHtml = `` + } + // render client html content let html = `
@@ -81,6 +86,7 @@ function renderClientList(data) { ${telegramHtml} + ${additionalNotesHtml} ${obj.Client.email} ${prettyDateTime(obj.Client.created_at)} diff --git a/handler/routes.go b/handler/routes.go index ef01d08..42047dc 100644 --- a/handler/routes.go +++ b/handler/routes.go @@ -720,6 +720,7 @@ func UpdateClient(db store.IStore) echo.HandlerFunc { client.PublicKey = _client.PublicKey client.PresharedKey = _client.PresharedKey client.UpdatedAt = time.Now().UTC() + client.AdditionalNotes = strings.ReplaceAll(strings.Trim(_client.AdditionalNotes, "\r\n"), "\r\n", "\n") // write to the database if err := db.SaveClient(client); err != nil { diff --git a/model/client.go b/model/client.go index cb00016..d835124 100644 --- a/model/client.go +++ b/model/client.go @@ -18,6 +18,7 @@ type Client struct { AllowedIPs []string `json:"allowed_ips"` ExtraAllowedIPs []string `json:"extra_allowed_ips"` Endpoint string `json:"endpoint"` + AdditionalNotes string `json:"additional_notes"` UseServerDNS bool `json:"use_server_dns"` Enabled bool `json:"enabled"` CreatedAt time.Time `json:"created_at"` diff --git a/templates/base.html b/templates/base.html index 0c2b9ee..3640699 100644 --- a/templates/base.html +++ b/templates/base.html @@ -288,6 +288,10 @@
+
+ + +
+
+ + +