From b4957048cb71f471690e499f388f34c6430e83ac Mon Sep 17 00:00:00 2001 From: vargburz Date: Fri, 7 Apr 2023 17:27:06 +0300 Subject: [PATCH 1/3] support grafana 9.4.0 --- src/panels/corpglory-dataexporter-panel/components/Panel.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/panels/corpglory-dataexporter-panel/components/Panel.tsx b/src/panels/corpglory-dataexporter-panel/components/Panel.tsx index f79dd14..e1cf511 100644 --- a/src/panels/corpglory-dataexporter-panel/components/Panel.tsx +++ b/src/panels/corpglory-dataexporter-panel/components/Panel.tsx @@ -261,6 +261,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) { custom: { filterable: false, displayMode: 'image', + cellOptions: { type: 'image' }, }, links: [ { @@ -330,6 +331,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) { custom: { filterable: false, displayMode: 'image', + cellOptions: { type: 'image' }, }, links: [ { @@ -373,7 +375,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) { }, { name: 'Delete', - type: FieldType.string, + type: FieldType.other, values: _.map(sortedTasks, (task) => { switch (task.progress?.status) { case ExportStatus.FINISHED: @@ -394,6 +396,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) { custom: { filterable: false, displayMode: 'image', + cellOptions: { type: 'image' }, }, links: [ { From 1e121c4b75827efbc4b6f779af0791732fb6562d Mon Sep 17 00:00:00 2001 From: vargburz Date: Mon, 10 Apr 2023 17:08:00 +0300 Subject: [PATCH 2/3] generate api token on each task creation --- src/panels/corpglory-dataexporter-panel/components/Panel.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/panels/corpglory-dataexporter-panel/components/Panel.tsx b/src/panels/corpglory-dataexporter-panel/components/Panel.tsx index e1cf511..31f3d40 100644 --- a/src/panels/corpglory-dataexporter-panel/components/Panel.tsx +++ b/src/panels/corpglory-dataexporter-panel/components/Panel.tsx @@ -55,6 +55,7 @@ import { RefreshEvent } from '@grafana/runtime'; import React, { useState, useEffect } from 'react'; import * as _ from 'lodash'; +import PluginState from 'plugin_state'; const PANEL_ID = 'corpglory-dataexporter-panel'; const APP_ID = 'corpglory-dataexporter-app'; @@ -215,6 +216,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) { queries: selectedQueries, csvDelimiter, }; + const token = await PluginState.createGrafanaToken(); // TODO: move this function to API Service await queryApi('/task', { method: 'POST', @@ -222,6 +224,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) { task, url: window.location.toString(), timeZoneName, + apiKey: token.key, }, }); From a57f704113ff503a36f9bee77111846b769cb7dc Mon Sep 17 00:00:00 2001 From: rozetko Date: Mon, 10 Apr 2023 18:05:59 +0300 Subject: [PATCH 3/3] hotfix --- src/panels/corpglory-dataexporter-panel/components/Panel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/corpglory-dataexporter-panel/components/Panel.tsx b/src/panels/corpglory-dataexporter-panel/components/Panel.tsx index 31f3d40..1420c20 100644 --- a/src/panels/corpglory-dataexporter-panel/components/Panel.tsx +++ b/src/panels/corpglory-dataexporter-panel/components/Panel.tsx @@ -378,7 +378,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) { }, { name: 'Delete', - type: FieldType.other, + type: FieldType.string, values: _.map(sortedTasks, (task) => { switch (task.progress?.status) { case ExportStatus.FINISHED: