@@ -34,6 +34,7 @@ public function createElements(array $formData)
34
34
'required ' => true
35
35
]
36
36
);
37
+
37
38
$ this ->addElement (
38
39
'select ' ,
39
40
'grafana_protocol ' ,
@@ -48,6 +49,7 @@ public function createElements(array $formData)
48
49
]
49
50
);
50
51
52
+ // TLS configuration
51
53
if (isset ($ formData ['grafana_protocol ' ]) && $ formData ['grafana_protocol ' ] === 'https ' ) {
52
54
$ this ->addElement (
53
55
'checkbox ' ,
@@ -69,6 +71,8 @@ public function createElements(array $formData)
69
71
]
70
72
);
71
73
}
74
+
75
+ // Timerange configuration
72
76
$ this ->addElement (
73
77
'select ' ,
74
78
'grafana_timerange ' ,
@@ -88,6 +92,8 @@ public function createElements(array $formData)
88
92
'description ' => $ this ->translate ('The default timerange to use for show all graphs. ' )
89
93
]
90
94
);
95
+
96
+ // Custom Variable configuration
91
97
$ this ->addElement (
92
98
'text ' ,
93
99
'grafana_custvardisable ' ,
@@ -104,6 +110,8 @@ public function createElements(array $formData)
104
110
'description ' => $ this ->translate ('Name of the custom variable that, if set, hold the config name to be used. ' ),
105
111
]
106
112
);
113
+
114
+ // Grafana dashboard configuration
107
115
$ this ->addElement (
108
116
'text ' ,
109
117
'grafana_defaultdashboard ' ,
@@ -141,6 +149,8 @@ public function createElements(array $formData)
141
149
'description ' => $ this ->translate ('ID of the default organization. ' ),
142
150
]
143
151
);
152
+
153
+ // Graphs shadow configuration
144
154
$ this ->addElement (
145
155
'checkbox ' ,
146
156
'grafana_shadows ' ,
@@ -150,6 +160,8 @@ public function createElements(array $formData)
150
160
'description ' => $ this ->translate ('Show shadows around the graph. ' ),
151
161
]
152
162
);
163
+
164
+ // Grafana datasource configuration
153
165
$ this ->addElement (
154
166
'select ' ,
155
167
'grafana_datasource ' ,
@@ -162,6 +174,8 @@ public function createElements(array $formData)
162
174
'description ' => $ this ->translate ('Select the Grafana datasource. ' )
163
175
]
164
176
);
177
+
178
+ // Grafana access mode configuration
165
179
$ this ->addElement (
166
180
'select ' ,
167
181
'grafana_accessmode ' ,
@@ -177,6 +191,7 @@ public function createElements(array $formData)
177
191
]
178
192
);
179
193
194
+ // Indirect proxy mode configuration
180
195
if (isset ($ formData ['grafana_accessmode ' ]) && $ formData ['grafana_accessmode ' ] === 'indirectproxy ' ) {
181
196
$ this ->addElement (
182
197
'number ' ,
@@ -202,6 +217,8 @@ public function createElements(array $formData)
202
217
'class ' => 'autosubmit '
203
218
]
204
219
);
220
+
221
+ // Indirect proxy mode authentication configuration
205
222
if (isset ($ formData ['grafana_authentication ' ]) && $ formData ['grafana_authentication ' ] === 'basic ' ) {
206
223
$ this ->addElement (
207
224
'text ' ,
@@ -236,6 +253,7 @@ public function createElements(array $formData)
236
253
}
237
254
}
238
255
256
+ // Indirect proxy mode cache configuration
239
257
if (isset ($ formData ['grafana_accessmode ' ]) && $ formData ['grafana_accessmode ' ] === 'indirectproxy ' ) {
240
258
$ this ->addElement (
241
259
'select ' ,
@@ -252,6 +270,7 @@ public function createElements(array $formData)
252
270
);
253
271
}
254
272
273
+ // iFrame mode configuration
255
274
if (isset ($ formData ['grafana_accessmode ' ]) && ( $ formData ['grafana_accessmode ' ] != 'iframe ' )) {
256
275
$ this ->addElement (
257
276
'number ' ,
@@ -271,8 +290,6 @@ public function createElements(array $formData)
271
290
'description ' => $ this ->translate ('The default graph width in pixels. ' )
272
291
]
273
292
);
274
- }
275
- if (( $ formData ['grafana_accessmode ' ] != 'iframe ' )) {
276
293
$ this ->addElement (
277
294
'select ' ,
278
295
'grafana_usepublic ' ,
@@ -288,6 +305,8 @@ public function createElements(array $formData)
288
305
]
289
306
);
290
307
}
308
+
309
+ // iFrame mode public link configuration
291
310
if (isset ($ formData ['grafana_usepublic ' ]) && ( $ formData ['grafana_usepublic ' ] === 'yes ' ) && ( $ formData ['grafana_accessmode ' ] != 'iframe ' )) {
292
311
$ this ->addElement (
293
312
'text ' ,
0 commit comments