|
|
|
@ -8,7 +8,7 @@ import {
|
|
|
|
|
Dashboard, |
|
|
|
|
} from '../types'; |
|
|
|
|
|
|
|
|
|
import { convertTimestampToDate, convertTimeZoneTypeToName, getDashboardUid } from '../../../utils'; |
|
|
|
|
import { convertTimestampToDate, convertTimeZoneTypeToName, getCurrentDashboardUid } from '../../../utils'; |
|
|
|
|
import { CLOSE_ICON_BASE_64, DOWNLOAD_ICON_BASE_64, SELECT_ICON_BASE_64, UNSELECT_ICON_BASE_64 } from '../../../icons'; |
|
|
|
|
|
|
|
|
|
import { deleteTask, getStaticFile, getTasks, queryApi } from '../../../services/api_service'; |
|
|
|
@ -83,7 +83,7 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) {
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
async function getCurrentDashboard(): Promise<any> { |
|
|
|
|
const currentDashboardUid = getDashboardUid(window.location.toString()); |
|
|
|
|
const currentDashboardUid = getCurrentDashboardUid(); |
|
|
|
|
|
|
|
|
|
return getDashboardByUid(currentDashboardUid); |
|
|
|
|
} |
|
|
|
@ -145,7 +145,9 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function fetchTasks(): void { |
|
|
|
|
getTasks() |
|
|
|
|
const dashboardUid = getCurrentDashboardUid(); |
|
|
|
|
|
|
|
|
|
getTasks(dashboardUid) |
|
|
|
|
.then((tasks) => { |
|
|
|
|
setTasks(tasks); |
|
|
|
|
setPanelStatusWithValidate(PanelStatus.OK); |
|
|
|
@ -187,7 +189,10 @@ export function Panel({ width, height, timeRange, eventBus, timeZone }: Props) {
|
|
|
|
|
const selectedQueries = _.filter(queries, (query: DashboardQuery) => query.selected); |
|
|
|
|
const timerange: [number, number] = [selectedTimeRange.from.unix(), selectedTimeRange.to.unix()]; |
|
|
|
|
|
|
|
|
|
const dashboardUid = getCurrentDashboardUid(); |
|
|
|
|
|
|
|
|
|
const task: ExportTask = { |
|
|
|
|
dashboardUid, |
|
|
|
|
// @ts-ignore
|
|
|
|
|
username: contextSrv.user.name, |
|
|
|
|
timeRange: { |
|
|
|
|