Skip to content

Commit 7984367

Browse files
Add application type in Headers (#61)
* fix: added Accept to fetch * fix remove charset * Update version * Update RSS Feed * Update Accept --------- Co-authored-by: Mikhail Volkov <[email protected]>
1 parent b1c5b8a commit 7984367

File tree

6 files changed

+145
-22
lines changed

6 files changed

+145
-22
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## 3.1.0 (IN PROGRESS)
4+
5+
### Features / Enhancements
6+
7+
- Add application type in Headers (#61)
8+
39
## 3.0.1 (2023-08-02)
410

511
### Bugfix

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@
6969
"test:ci": "jest --maxWorkers 4 --coverage",
7070
"upgrade": "npm upgrade --save"
7171
},
72-
"version": "3.0.1"
72+
"version": "3.1.0"
7373
}

provisioning/dashboards/panels.json

+132-18
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,25 @@
3232
"type": "volkovlabs-rss-datasource",
3333
"uid": "rZAdZdf82"
3434
},
35+
"fieldConfig": {
36+
"defaults": {
37+
"thresholds": {
38+
"mode": "absolute",
39+
"steps": [
40+
{
41+
"color": "green",
42+
"value": null
43+
},
44+
{
45+
"color": "red",
46+
"value": 80
47+
}
48+
]
49+
},
50+
"unitScale": true
51+
},
52+
"overrides": []
53+
},
3554
"gridPos": {
3655
"h": 17,
3756
"w": 12,
@@ -40,6 +59,7 @@
4059
},
4160
"id": 13,
4261
"options": {
62+
"afterRender": "",
4363
"content": "<table width=100% style='border:0'>\n<tr>\n<td width=\"*\" style='border:0'><h3><a target=\"_blank\" style=\"color: blue\" href=\"{{link}}\">{{title}}</a></h3>\n{{{content:h4}}}</td>\n<td rowspan=2 style='border:0' width=\"30%\">\n<div><img src=\"{{media:group:media:thumbnail:url}}\"></div></td>\n</tr>\n<tr>\n<td style='border:0'><b>{{date updated 'MMM, DD YYYY'}} by {{author}}</b></td>\n</table>",
4464
"defaultContent": "The query didn't return any results.",
4565
"editor": {
@@ -48,11 +68,14 @@
4868
"language": "markdown"
4969
},
5070
"editors": [],
51-
"everyRow": true,
71+
"externalScripts": [],
72+
"externalStyles": [],
5273
"helpers": "",
53-
"styles": ""
74+
"renderMode": "everyRow",
75+
"styles": "",
76+
"wrap": true
5477
},
55-
"pluginVersion": "8.3.3",
78+
"pluginVersion": "4.3.0",
5679
"targets": [
5780
{
5881
"datasource": {
@@ -91,6 +114,25 @@
91114
"type": "volkovlabs-rss-datasource",
92115
"uid": "P2C48277B5CA0E41B"
93116
},
117+
"fieldConfig": {
118+
"defaults": {
119+
"thresholds": {
120+
"mode": "absolute",
121+
"steps": [
122+
{
123+
"color": "green",
124+
"value": null
125+
},
126+
{
127+
"color": "red",
128+
"value": 80
129+
}
130+
]
131+
},
132+
"unitScale": true
133+
},
134+
"overrides": []
135+
},
94136
"gridPos": {
95137
"h": 17,
96138
"w": 12,
@@ -99,6 +141,7 @@
99141
},
100142
"id": 4,
101143
"options": {
144+
"afterRender": "",
102145
"content": "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style='border:0px !important'>\n<tr style='border:0px'>\n<td width=\"40%\" style='border:0px;'><img src=\"{{og:image}}\"></td>\n<td width=\"*\" style='border:0px'><b>{{date pubDate 'MMM DD'}}</b><h3><a style='color:blue' target=\"_blank\" href=\"{{link}}\">{{title}}</a></h3>{{description}}\n</td>\n</tr>\n</table>",
103146
"defaultContent": "The query didn't return any results.",
104147
"editor": {
@@ -107,11 +150,14 @@
107150
"language": "markdown"
108151
},
109152
"editors": [],
110-
"everyRow": true,
153+
"externalScripts": [],
154+
"externalStyles": [],
111155
"helpers": "",
112-
"styles": ""
156+
"renderMode": "everyRow",
157+
"styles": "",
158+
"wrap": true
113159
},
114-
"pluginVersion": "8.3.3",
160+
"pluginVersion": "4.3.0",
115161
"targets": [
116162
{
117163
"datasource": {
@@ -146,6 +192,25 @@
146192
"type": "volkovlabs-abc-datasource",
147193
"uid": "rZAdZdf7a"
148194
},
195+
"fieldConfig": {
196+
"defaults": {
197+
"thresholds": {
198+
"mode": "absolute",
199+
"steps": [
200+
{
201+
"color": "green",
202+
"value": null
203+
},
204+
{
205+
"color": "red",
206+
"value": 80
207+
}
208+
]
209+
},
210+
"unitScale": true
211+
},
212+
"overrides": []
213+
},
149214
"gridPos": {
150215
"h": 17,
151216
"w": 12,
@@ -154,6 +219,7 @@
154219
},
155220
"id": 2,
156221
"options": {
222+
"afterRender": "",
157223
"content": "<table width=100% style='border:0'>\n<tr>\n<td width=\"*\" style='border:0'><h3><a target=\"_blank\" style=\"color: blue\" href=\"{{link}}\">{{title}}</a></h3>\n{{{content:h4}}}</td>\n<td rowspan=2 style='border:0' width=\"30%\">\n<div><img src=\"https://volkovlabs.io/{{content:img-src}}\"></div></td>\n</tr>\n<tr>\n<td style='border:0'><b>{{date pubDate 'MMM, DD YYYY'}} in {{category}}</b></td>\n</table>",
158224
"defaultContent": "The query didn't return any results.",
159225
"editor": {
@@ -162,11 +228,14 @@
162228
"language": "markdown"
163229
},
164230
"editors": [],
165-
"everyRow": true,
231+
"externalScripts": [],
232+
"externalStyles": [],
166233
"helpers": "",
167-
"styles": ""
234+
"renderMode": "everyRow",
235+
"styles": "",
236+
"wrap": true
168237
},
169-
"pluginVersion": "8.3.3",
238+
"pluginVersion": "4.3.0",
170239
"targets": [
171240
{
172241
"datasource": {
@@ -202,6 +271,25 @@
202271
"type": "volkovlabs-rss-datasource",
203272
"uid": "rZAdZdf72"
204273
},
274+
"fieldConfig": {
275+
"defaults": {
276+
"thresholds": {
277+
"mode": "absolute",
278+
"steps": [
279+
{
280+
"color": "green",
281+
"value": null
282+
},
283+
{
284+
"color": "red",
285+
"value": 80
286+
}
287+
]
288+
},
289+
"unitScale": true
290+
},
291+
"overrides": []
292+
},
205293
"gridPos": {
206294
"h": 17,
207295
"w": 12,
@@ -210,6 +298,7 @@
210298
},
211299
"id": 9,
212300
"options": {
301+
"afterRender": "",
213302
"content": "<table width=100% style='border:0'>\n<tr>\n<td style='border:0'><h3><a target=\"_blank\" style=\"color: blue\" href=\"{{link}}\">{{title}}</a> on {{date dc:date 'MMM, DD YYYY'}}</h3>\n{{{description}}}</td>\n</tr>\n</table>",
214303
"defaultContent": "The query didn't return any results.",
215304
"editor": {
@@ -218,18 +307,21 @@
218307
"language": "markdown"
219308
},
220309
"editors": [],
221-
"everyRow": true,
310+
"externalScripts": [],
311+
"externalStyles": [],
222312
"helpers": "",
223-
"styles": ""
313+
"renderMode": "everyRow",
314+
"styles": "",
315+
"wrap": true
224316
},
225-
"pluginVersion": "8.3.3",
317+
"pluginVersion": "4.3.0",
226318
"targets": [
227319
{
228320
"datasource": {
229321
"type": "volkovlabs-rss-datasource",
230322
"uid": "rZAdZdf72"
231323
},
232-
"dateField": "dc:date",
324+
"dateField": "",
233325
"feedType": "items",
234326
"queryText": "test",
235327
"refId": "A"
@@ -270,6 +362,25 @@
270362
"type": "volkovlabs-rss-datasource",
271363
"uid": "PE12154EB4CA97411"
272364
},
365+
"fieldConfig": {
366+
"defaults": {
367+
"thresholds": {
368+
"mode": "absolute",
369+
"steps": [
370+
{
371+
"color": "green",
372+
"value": null
373+
},
374+
{
375+
"color": "red",
376+
"value": 80
377+
}
378+
]
379+
},
380+
"unitScale": true
381+
},
382+
"overrides": []
383+
},
273384
"gridPos": {
274385
"h": 17,
275386
"w": 12,
@@ -278,6 +389,7 @@
278389
},
279390
"id": 7,
280391
"options": {
392+
"afterRender": "",
281393
"content": "# {{date pubDate 'LLL'}} <a target=\"_blank\" style=\"color: blue\" href=\"{{link}}\">{{title}}</a>\n{{{summary}}}",
282394
"defaultContent": "The query didn't return any results.",
283395
"editor": {
@@ -286,11 +398,14 @@
286398
"language": "markdown"
287399
},
288400
"editors": [],
289-
"everyRow": true,
401+
"externalScripts": [],
402+
"externalStyles": [],
290403
"helpers": "",
291-
"styles": ""
404+
"renderMode": "everyRow",
405+
"styles": "",
406+
"wrap": true
292407
},
293-
"pluginVersion": "8.3.3",
408+
"pluginVersion": "4.3.0",
294409
"targets": [
295410
{
296411
"datasource": {
@@ -323,8 +438,7 @@
323438
],
324439
"refresh": "",
325440
"revision": 1,
326-
"schemaVersion": 38,
327-
"style": "dark",
441+
"schemaVersion": 39,
328442
"tags": [],
329443
"templating": {
330444
"list": [

provisioning/datasources/datasource.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ datasources:
6060
version: 1
6161
editable: true
6262
jsonData:
63-
feed: https://nvd.nist.gov/feeds/xml/cve/misc/nvd-rss.xml
63+
feed: https://www.nist.gov/news-events/news/rss.xml
6464
- name: Nexus
6565
type: volkovlabs-rss-datasource
6666
access: proxy

src/api/api.ts

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ export class Api {
5252
const response = await lastValueFrom(
5353
getBackendSrv().fetch({
5454
method: 'GET',
55+
headers: {
56+
Accept: 'application/rss+xml, application/atom+xml',
57+
},
5558
url: `${this.instanceSettings.url}/feed`,
5659
params,
5760
})

0 commit comments

Comments
 (0)