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