Commit aee4af21 by Daniel Lee

api: omit unused fields for /api/datasources

Fixes #7822
parent 4720216e
...@@ -20,7 +20,7 @@ func GetDataSources(c *middleware.Context) Response { ...@@ -20,7 +20,7 @@ func GetDataSources(c *middleware.Context) Response {
result := make(dtos.DataSourceList, 0) result := make(dtos.DataSourceList, 0)
for _, ds := range query.Result { for _, ds := range query.Result {
dsItem := dtos.DataSource{ dsItem := dtos.DataSourceListItemDTO{
Id: ds.Id, Id: ds.Id,
OrgId: ds.OrgId, OrgId: ds.OrgId,
Name: ds.Name, Name: ds.Name,
......
...@@ -84,7 +84,23 @@ type DataSource struct { ...@@ -84,7 +84,23 @@ type DataSource struct {
SecureJsonFields map[string]bool `json:"secureJsonFields"` SecureJsonFields map[string]bool `json:"secureJsonFields"`
} }
type DataSourceList []DataSource type DataSourceListItemDTO struct {
Id int64 `json:"id"`
OrgId int64 `json:"orgId"`
Name string `json:"name"`
Type string `json:"type"`
TypeLogoUrl string `json:"typeLogoUrl"`
Access m.DsAccess `json:"access"`
Url string `json:"url"`
Password string `json:"password"`
User string `json:"user"`
Database string `json:"database"`
BasicAuth bool `json:"basicAuth"`
IsDefault bool `json:"isDefault"`
JsonData *simplejson.Json `json:"jsonData,omitempty"`
}
type DataSourceList []DataSourceListItemDTO
func (slice DataSourceList) Len() int { func (slice DataSourceList) Len() int {
return len(slice) return len(slice)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment