diff options
| author | Shulhan <ms@kilabit.info> | 2021-09-19 01:42:06 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-09-19 01:42:06 +0700 |
| commit | 29c3898ec03adaf7f6e1dd80f82d02b032f3979b (patch) | |
| tree | a3daf2eb6a79e1dd0c3de84970f013b01ba948e2 /http_target.go | |
| parent | 8fa18a28d3f378dba8b5fddf19021c9849b7de7e (diff) | |
| download | gorankusu-29c3898ec03adaf7f6e1dd80f82d02b032f3979b.tar.xz | |
all: add option to set description (Hint) on any inputs element
This changes refactor the KeyValue from map[string]string into
map[string]FormInput, where FormInput is a struct with Label, Hint,
Kind, Value, Max, and Min.
With the available of Hint field, the web user interface can render it
as description of input.
This changes also make all input hint to be displayed on the first render.
Diffstat (limited to 'http_target.go')
| -rw-r--r-- | http_target.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/http_target.go b/http_target.go index 1eb3b18..13c7445 100644 --- a/http_target.go +++ b/http_target.go @@ -49,8 +49,8 @@ type HttpTarget struct { Method libhttp.RequestMethod Path string RequestType libhttp.RequestType - Headers KeyValue - Params KeyValue + Headers KeyFormInput + Params KeyFormInput Run HttpRunHandler `json:"-"` ConvertParams HttpConvertParams `json:"-"` @@ -81,10 +81,10 @@ func (ht *HttpTarget) init() (err error) { ht.ID = generateID(ht.Name) } if ht.Headers == nil { - ht.Headers = KeyValue{} + ht.Headers = KeyFormInput{} } if ht.Params == nil { - ht.Params = KeyValue{} + ht.Params = KeyFormInput{} } if len(ht.Path) == 0 { ht.Path = "/" |
