Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for Grafana 11 #71

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## 4.0.0 (IN PROGRESS)

### Breaking changes

- Requires Grafana 10 and Grafana 11

### Features / Enhancements

- Add plugin e2e tests and remove cypress (#68)
- Prepare for Grafana 11 (#71)

## 3.1.0 (2023-02-12)

### Features / Enhancements
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RSS/Atom Data Source for Grafana
# Business News Data Source for Grafana

![Dashboard](https://raw.githubusercontent.com/VolkovLabs/volkovlabs-rss-datasource/main/src/img/dashboard.png)

Expand All @@ -10,19 +10,20 @@

## Introduction

The RSS/Atom data source is a plugin for Grafana that retrieves RSS/Atom feeds and allows visualizing them using Dynamic Text and other panels.
The Business News data source is a plugin for Grafana that retrieves RSS/Atom feeds and allows visualizing them using Dynamic Text and other panels.

[![RSS/Atom Data Source for Grafana | News feed tutorial for Grafana Dashboard](https://raw.githubusercontent.com/volkovlabs/volkovlabs-rss-datasource/main/img/video.png)](https://youtu.be/RAxqS2hpWkg)
[![Business News Data Source for Grafana | News feed tutorial for Grafana Dashboard](https://raw.githubusercontent.com/volkovlabs/volkovlabs-rss-datasource/main/img/video.png)](https://youtu.be/RAxqS2hpWkg)

## Requirements

- **Grafana 9** and **Grafana 10** are required for major version 3.
- **Grafana 8.5** and **Grafana 9** are required for major version 2.
- **Grafana 8** is required for major version 1.
- Business News Data Source 4.X requires **Grafana 10** or **Grafana 11**.
- Business News Data Source 3.X requires **Grafana 9** or **Grafana 10**.
- Business News Data Source 2.X requires **Grafana 8.5** or **Grafana 9**.
- Business News Data Source 1.X requires **Grafana 8**.

## Getting Started

RSS/Atom data source can be installed from the [Grafana Catalog](https://grafana.com/grafana/plugins/volkovlabs-rss-datasource/) or utilizing the Grafana command line tool.
The Business News data source can be installed from the [Grafana Catalog](https://grafana.com/grafana/plugins/volkovlabs-rss-datasource/) or utilizing the Grafana command line tool.

For the latter, please use the following command.

Expand All @@ -33,7 +34,7 @@ grafana-cli plugins install volkovlabs-rss-datasource
## Highlights

- Supports RSS 2.0, RSS 1.0 and Atom.
- Works great with Dynamic Text visualization panel.
- Works with Dynamic Text visualization panel.
- Returns Channel (Feed) data, Items (Entries) or both as separate data frames.
- Extract and parse as additional fields:
- Image from Meta.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"webpack-livereload-plugin": "^3.0.2"
},
"engines": {
"node": ">=18"
"node": ">=20"
},
"name": "volkovlabs-rss-datasource",
"scripts": {
Expand All @@ -71,5 +71,5 @@
"test:ci": "jest --maxWorkers 4 --coverage",
"upgrade": "npm upgrade --save"
},
"version": "3.1.0"
"version": "4.0.0"
}
14 changes: 7 additions & 7 deletions src/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DataSourceInstanceSettings, FieldType, MutableDataFrame, TimeRange } from '@grafana/data';
import { createDataFrame, DataFrame, DataSourceInstanceSettings, FieldType, TimeRange } from '@grafana/data';
import { getBackendSrv } from '@grafana/runtime';
import { XMLParser } from 'fast-xml-parser';
import { lastValueFrom } from 'rxjs';
Expand All @@ -23,13 +23,13 @@ export class Api {
* @param {Query} query Query
* @param {TimeRange} range Time Range
* @param {Record<string, any>} params URL parameters
* @returns {Promise<MutableDataFrame[]>} Feed
* @returns {Promise<DataFrame[]>} Feed
*/
async getFeed(
query: Query,
range: TimeRange | null = null,
params: Record<string, unknown> | undefined = undefined
): Promise<MutableDataFrame[]> {
): Promise<DataFrame[]> {
if (!params) {
params = {};
}
Expand Down Expand Up @@ -95,7 +95,7 @@ export class Api {
* Channel Data
*/
const channel = data.rss.channel;
const channelFrame = new MutableDataFrame({
const channelFrame = createDataFrame({
name: 'channel',
refId: query.refId,
fields: [
Expand Down Expand Up @@ -176,7 +176,7 @@ export class Api {
/**
* Create Items frame
*/
const itemsFrame = new MutableDataFrame({
const itemsFrame = createDataFrame({
name: 'items',
refId: query.refId,
fields: Object.keys(items).map((key) => {
Expand Down Expand Up @@ -211,7 +211,7 @@ export class Api {
* Channel Data
*/
const feed = data.feed;
const channelFrame = new MutableDataFrame({
const channelFrame = createDataFrame({
name: 'channel',
refId: query.refId,
fields: [
Expand Down Expand Up @@ -333,7 +333,7 @@ export class Api {
/**
* Create Items frame
*/
const itemsFrame = new MutableDataFrame({
const itemsFrame = createDataFrame({
name: 'items',
refId: query.refId,
fields: Object.keys(entries).map((key) => {
Expand Down
4 changes: 2 additions & 2 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/grafana/grafana/master/docs/sources/developers/plugins/plugin.schema.json",
"alerting": true,
"dependencies": {
"grafanaDependency": ">=9.0.0",
"grafanaDependency": ">=10.0.0",
"plugins": []
},
"id": "volkovlabs-rss-datasource",
Expand Down Expand Up @@ -37,7 +37,7 @@
"version": "%VERSION%"
},
"metrics": true,
"name": "RSS/Atom",
"name": "Business News",
"routes": [
{
"method": "*",
Expand Down
Loading