Skip to content

Commit

Permalink
fix Filter param (can accept array or single value)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Jan 14, 2020
1 parent 72cca28 commit a7a72f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ func (p *zabbixParamOutput) UnmarshalJSON(data []byte) error {
}

type ZabbixAPIParams struct {
Output *zabbixParamOutput `json:"output,omitempty"`
SortField string `json:"sortfield,omitempty"`
SortOrder string `json:"sortorder,omitempty"`
Filter map[string][]int `json:"filter,omitempty"`
Output *zabbixParamOutput `json:"output,omitempty"`
SortField string `json:"sortfield,omitempty"`
SortOrder string `json:"sortorder,omitempty"`
Filter map[string]interface{} `json:"filter,omitempty"`

// Login
User string `json:"user,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/zabbix_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func (ds *ZabbixDatasource) getAllItems(ctx context.Context, dsInfo *datasource.
Output: &zabbixParamOutput{Fields: []string{"itemid", "name", "key_", "value_type", "hostid", "status", "state"}},
SortField: "name",
WebItems: true,
Filter: map[string][]int{},
Filter: map[string]interface{}{},
SelectHosts: []string{"hostid", "name"},
HostIDs: hostids,
AppIDs: appids,
Expand Down

0 comments on commit a7a72f5

Please sign in to comment.