|
61 | 61 | Refresh *BoolString `json:"refresh,omitempty"`
|
62 | 62 | SchemaVersion uint `json:"schemaVersion"`
|
63 | 63 | Version uint `json:"version"`
|
64 |
| - Links []link `json:"links"` |
| 64 | + Links []Link `json:"links"` |
65 | 65 | Time Time `json:"time"`
|
66 | 66 | Timepicker Timepicker `json:"timepicker"`
|
67 | 67 | GraphTooltip int `json:"graphTooltip,omitempty"`
|
@@ -124,25 +124,24 @@ type (
|
124 | 124 | Tags []string `json:"tags"`
|
125 | 125 | Type string `json:"type"`
|
126 | 126 | }
|
| 127 | + // Link represents link to another dashboard or external weblink |
| 128 | + Link struct { |
| 129 | + Title string `json:"title"` |
| 130 | + Type string `json:"type"` |
| 131 | + AsDropdown *bool `json:"asDropdown,omitempty"` |
| 132 | + DashURI *string `json:"dashUri,omitempty"` |
| 133 | + Dashboard *string `json:"dashboard,omitempty"` |
| 134 | + Icon *string `json:"icon,omitempty"` |
| 135 | + IncludeVars bool `json:"includeVars"` |
| 136 | + KeepTime *bool `json:"keepTime,omitempty"` |
| 137 | + Params *string `json:"params,omitempty"` |
| 138 | + Tags []string `json:"tags,omitempty"` |
| 139 | + TargetBlank *bool `json:"targetBlank,omitempty"` |
| 140 | + Tooltip *string `json:"tooltip,omitempty"` |
| 141 | + URL *string `json:"url,omitempty"` |
| 142 | + } |
127 | 143 | )
|
128 | 144 |
|
129 |
| -// link represents link to another dashboard or external weblink |
130 |
| -type link struct { |
131 |
| - Title string `json:"title"` |
132 |
| - Type string `json:"type"` |
133 |
| - AsDropdown *bool `json:"asDropdown,omitempty"` |
134 |
| - DashURI *string `json:"dashUri,omitempty"` |
135 |
| - Dashboard *string `json:"dashboard,omitempty"` |
136 |
| - Icon *string `json:"icon,omitempty"` |
137 |
| - IncludeVars bool `json:"includeVars"` |
138 |
| - KeepTime *bool `json:"keepTime,omitempty"` |
139 |
| - Params *string `json:"params,omitempty"` |
140 |
| - Tags []string `json:"tags,omitempty"` |
141 |
| - TargetBlank *bool `json:"targetBlank,omitempty"` |
142 |
| - Tooltip *string `json:"tooltip,omitempty"` |
143 |
| - URL *string `json:"url,omitempty"` |
144 |
| -} |
145 |
| - |
146 | 145 | // Height of rows maybe passed as number (ex 200) or
|
147 | 146 | // as string (ex "200px") or empty string
|
148 | 147 | type Height string
|
@@ -175,6 +174,10 @@ func NewBoard(title string) *Board {
|
175 | 174 | }
|
176 | 175 | }
|
177 | 176 |
|
| 177 | +func (b *Board) AddLink(link Link) { |
| 178 | + b.Links = append(b.Links, link) |
| 179 | +} |
| 180 | + |
178 | 181 | func (b *Board) RemoveTags(tags ...string) {
|
179 | 182 | // order might change after removing the tags
|
180 | 183 | for _, toRemoveTag := range tags {
|
|
0 commit comments