Skip to content

Commit

Permalink
Add application type in Headers (#61)
Browse files Browse the repository at this point in the history
* fix: added Accept to fetch

* fix remove charset

* Update version

* Update RSS Feed

* Update Accept

---------

Co-authored-by: Mikhail Volkov <[email protected]>
  • Loading branch information
vitPinchuk and mikhail-vl authored Feb 8, 2024
1 parent b1c5b8a commit 7984367
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 22 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 3.1.0 (IN PROGRESS)

### Features / Enhancements

- Add application type in Headers (#61)

## 3.0.1 (2023-08-02)

### Bugfix
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@
"test:ci": "jest --maxWorkers 4 --coverage",
"upgrade": "npm upgrade --save"
},
"version": "3.0.1"
"version": "3.1.0"
}
150 changes: 132 additions & 18 deletions provisioning/dashboards/panels.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@
"type": "volkovlabs-rss-datasource",
"uid": "rZAdZdf82"
},
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 17,
"w": 12,
Expand All @@ -40,6 +59,7 @@
},
"id": 13,
"options": {
"afterRender": "",
"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>",
"defaultContent": "The query didn't return any results.",
"editor": {
Expand All @@ -48,11 +68,14 @@
"language": "markdown"
},
"editors": [],
"everyRow": true,
"externalScripts": [],
"externalStyles": [],
"helpers": "",
"styles": ""
"renderMode": "everyRow",
"styles": "",
"wrap": true
},
"pluginVersion": "8.3.3",
"pluginVersion": "4.3.0",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -91,6 +114,25 @@
"type": "volkovlabs-rss-datasource",
"uid": "P2C48277B5CA0E41B"
},
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 17,
"w": 12,
Expand All @@ -99,6 +141,7 @@
},
"id": 4,
"options": {
"afterRender": "",
"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>",
"defaultContent": "The query didn't return any results.",
"editor": {
Expand All @@ -107,11 +150,14 @@
"language": "markdown"
},
"editors": [],
"everyRow": true,
"externalScripts": [],
"externalStyles": [],
"helpers": "",
"styles": ""
"renderMode": "everyRow",
"styles": "",
"wrap": true
},
"pluginVersion": "8.3.3",
"pluginVersion": "4.3.0",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -146,6 +192,25 @@
"type": "volkovlabs-abc-datasource",
"uid": "rZAdZdf7a"
},
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 17,
"w": 12,
Expand All @@ -154,6 +219,7 @@
},
"id": 2,
"options": {
"afterRender": "",
"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>",
"defaultContent": "The query didn't return any results.",
"editor": {
Expand All @@ -162,11 +228,14 @@
"language": "markdown"
},
"editors": [],
"everyRow": true,
"externalScripts": [],
"externalStyles": [],
"helpers": "",
"styles": ""
"renderMode": "everyRow",
"styles": "",
"wrap": true
},
"pluginVersion": "8.3.3",
"pluginVersion": "4.3.0",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -202,6 +271,25 @@
"type": "volkovlabs-rss-datasource",
"uid": "rZAdZdf72"
},
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 17,
"w": 12,
Expand All @@ -210,6 +298,7 @@
},
"id": 9,
"options": {
"afterRender": "",
"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>",
"defaultContent": "The query didn't return any results.",
"editor": {
Expand All @@ -218,18 +307,21 @@
"language": "markdown"
},
"editors": [],
"everyRow": true,
"externalScripts": [],
"externalStyles": [],
"helpers": "",
"styles": ""
"renderMode": "everyRow",
"styles": "",
"wrap": true
},
"pluginVersion": "8.3.3",
"pluginVersion": "4.3.0",
"targets": [
{
"datasource": {
"type": "volkovlabs-rss-datasource",
"uid": "rZAdZdf72"
},
"dateField": "dc:date",
"dateField": "",
"feedType": "items",
"queryText": "test",
"refId": "A"
Expand Down Expand Up @@ -270,6 +362,25 @@
"type": "volkovlabs-rss-datasource",
"uid": "PE12154EB4CA97411"
},
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 17,
"w": 12,
Expand All @@ -278,6 +389,7 @@
},
"id": 7,
"options": {
"afterRender": "",
"content": "# {{date pubDate 'LLL'}} <a target=\"_blank\" style=\"color: blue\" href=\"{{link}}\">{{title}}</a>\n{{{summary}}}",
"defaultContent": "The query didn't return any results.",
"editor": {
Expand All @@ -286,11 +398,14 @@
"language": "markdown"
},
"editors": [],
"everyRow": true,
"externalScripts": [],
"externalStyles": [],
"helpers": "",
"styles": ""
"renderMode": "everyRow",
"styles": "",
"wrap": true
},
"pluginVersion": "8.3.3",
"pluginVersion": "4.3.0",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -323,8 +438,7 @@
],
"refresh": "",
"revision": 1,
"schemaVersion": 38,
"style": "dark",
"schemaVersion": 39,
"tags": [],
"templating": {
"list": [
Expand Down
2 changes: 1 addition & 1 deletion provisioning/datasources/datasource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ datasources:
version: 1
editable: true
jsonData:
feed: https://nvd.nist.gov/feeds/xml/cve/misc/nvd-rss.xml
feed: https://www.nist.gov/news-events/news/rss.xml
- name: Nexus
type: volkovlabs-rss-datasource
access: proxy
Expand Down
3 changes: 3 additions & 0 deletions src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export class Api {
const response = await lastValueFrom(
getBackendSrv().fetch({
method: 'GET',
headers: {
Accept: 'application/rss+xml, application/atom+xml',
},
url: `${this.instanceSettings.url}/feed`,
params,
})
Expand Down

0 comments on commit 7984367

Please sign in to comment.