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KzB,yB,gEA1PEuO,EAAAA,cACU,eA8PhB,MAAMpP,EAAS,IAAIsT,EAAAA,YAAY,MACtCtT,EAAOuT,iBAAmBnE,EAC1BpP,EAAOwT,gB,oLC1QP,MAAM9Y,GAAY+Y,EAAAA,EAAAA,wBAAuBC,EAAAA,GACnCjZ,GAAmBgZ,EAAAA,EAAAA,wBAAuBE,EAAAA,GAC1CvR,GAAYqR,EAAAA,EAAAA,wBAAuBG,EAAAA","sources":["webpack://grafana/./public/app/angular/AngularLocationWrapper.ts","webpack://grafana/./public/app/angular/panel/metrics_panel_ctrl.ts","webpack://grafana/./public/app/angular/panel/panel_ctrl.ts","webpack://grafana/./public/app/angular/panel/query_ctrl.ts","webpack://grafana/./public/app/plugins/panel/table-old/column_options.ts","webpack://grafana/./public/app/plugins/panel/table-old/transformers.ts","webpack://grafana/./public/app/plugins/panel/table-old/editor.ts","webpack://grafana/./public/app/plugins/panel/table-old/renderer.ts","webpack://grafana/./public/app/plugins/panel/table-old/module.ts","webpack://grafana/./public/app/plugins/sdk.ts"],"sourcesContent":["import { deprecationWarning, urlUtil } from '@grafana/data';\nimport { locationSearchToObject, locationService, navigationLogger } from '@grafana/runtime';\n\n// Ref: https://github.com/angular/angular.js/blob/ae8e903edf88a83fedd116ae02c0628bf72b150c/src/ng/location.js#L5\nconst DEFAULT_PORTS: Record<string, number> = { http: 80, https: 443, ftp: 21 };\n\nexport class AngularLocationWrapper {\n constructor() {\n this.absUrl = this.wrapInDeprecationWarning(this.absUrl);\n this.hash = this.wrapInDeprecationWarning(this.hash);\n this.host = this.wrapInDeprecationWarning(this.host);\n this.path = this.wrapInDeprecationWarning(this.path);\n this.port = this.wrapInDeprecationWarning(this.port, 'window.location');\n this.protocol = this.wrapInDeprecationWarning(this.protocol, 'window.location');\n this.replace = this.wrapInDeprecationWarning(this.replace);\n this.search = this.wrapInDeprecationWarning(this.search);\n this.state = this.wrapInDeprecationWarning(this.state);\n this.url = this.wrapInDeprecationWarning(this.url);\n }\n\n wrapInDeprecationWarning(fn: Function, replacement?: string) {\n let self = this;\n\n return function wrapper() {\n deprecationWarning('$location', fn.name, replacement || 'locationService');\n return fn.apply(self, arguments);\n };\n }\n\n absUrl(): string {\n return `${window.location.origin}${this.url()}`;\n }\n\n hash(newHash?: string | null) {\n navigationLogger('AngularLocationWrapper', false, 'Angular compat layer: hash');\n\n if (!newHash) {\n return locationService.getLocation().hash.slice(1);\n } else {\n throw new Error('AngularLocationWrapper method not implemented.');\n }\n }\n\n host(): string {\n return new URL(window.location.href).hostname;\n }\n\n path(pathname?: any) {\n navigationLogger('AngularLocationWrapper', false, 'Angular compat layer: path');\n\n const location = locationService.getLocation();\n\n if (pathname !== undefined && pathname !== null) {\n let parsedPath = String(pathname);\n parsedPath = parsedPath.startsWith('/') ? parsedPath : `/${parsedPath}`;\n const url = new URL(`${window.location.origin}${parsedPath}`);\n\n locationService.push({\n pathname: url.pathname,\n search: url.search.length > 0 ? url.search : location.search,\n hash: url.hash.length > 0 ? url.hash : location.hash,\n });\n return this;\n }\n\n if (pathname === null) {\n locationService.push('/');\n return this;\n }\n\n return location.pathname;\n }\n\n port(): number | null {\n const url = new URL(window.location.href);\n return parseInt(url.port, 10) || DEFAULT_PORTS[url.protocol] || null;\n }\n\n protocol(): string {\n return new URL(window.location.href).protocol.slice(0, -1);\n }\n\n replace() {\n throw new Error('AngularLocationWrapper method not implemented.');\n }\n\n search(search?: any, paramValue?: any) {\n navigationLogger('AngularLocationWrapper', false, 'Angular compat layer: search');\n if (!search) {\n return locationService.getSearchObject();\n }\n\n if (search && arguments.length > 1) {\n locationService.partial({\n [search]: paramValue,\n });\n\n return this;\n }\n\n if (search) {\n let newQuery;\n\n if (typeof search === 'object') {\n newQuery = { ...search };\n } else {\n newQuery = locationSearchToObject(search);\n }\n\n for (const key of Object.keys(newQuery)) {\n // removing params with null | undefined\n if (newQuery[key] === null || newQuery[key] === undefined) {\n delete newQuery[key];\n }\n }\n\n const updatedUrl = urlUtil.renderUrl(locationService.getLocation().pathname, newQuery);\n locationService.push(updatedUrl);\n }\n\n return this;\n }\n\n state(state?: any) {\n navigationLogger('AngularLocationWrapper', false, 'Angular compat layer: state');\n throw new Error('AngularLocationWrapper method not implemented.');\n }\n\n url(newUrl?: any) {\n navigationLogger('AngularLocationWrapper', false, 'Angular compat layer: url');\n\n if (newUrl !== undefined) {\n if (newUrl.startsWith('#')) {\n locationService.push({ ...locationService.getLocation(), hash: newUrl });\n } else if (newUrl.startsWith('?')) {\n locationService.push({ ...locationService.getLocation(), search: newUrl });\n } else if (newUrl.trim().length === 0) {\n locationService.push('/');\n } else {\n locationService.push(newUrl);\n }\n\n return locationService;\n }\n\n const location = locationService.getLocation();\n return `${location.pathname}${location.search}${location.hash}`;\n }\n}\n","import { isArray } from 'lodash';\nimport { Unsubscribable } from 'rxjs';\n\nimport {\n DataFrame,\n DataQueryResponse,\n DataSourceApi,\n LegacyResponseData,\n LoadingState,\n PanelData,\n PanelEvents,\n TimeRange,\n toDataFrameDTO,\n toLegacyResponseData,\n} from '@grafana/data';\nimport { PanelCtrl } from 'app/angular/panel/panel_ctrl';\nimport { ContextSrv } from 'app/core/services/context_srv';\nimport { PanelModel } from 'app/features/dashboard/state';\nimport { applyPanelTimeOverrides } from 'app/features/dashboard/utils/panel';\n\nimport { PanelQueryRunner } from '../../features/query/state/PanelQueryRunner';\n\nclass MetricsPanelCtrl extends PanelCtrl {\n declare datasource: DataSourceApi;\n declare range: TimeRange;\n\n contextSrv: ContextSrv;\n datasourceSrv: any;\n timeSrv: any;\n templateSrv: any;\n interval: any;\n intervalMs: any;\n resolution: any;\n timeInfo?: string;\n skipDataOnInit = false;\n dataList: LegacyResponseData[] = [];\n querySubscription?: Unsubscribable | null;\n useDataFrames = false;\n panelData?: PanelData;\n\n constructor($scope: any, $injector: any) {\n super($scope, $injector);\n\n this.contextSrv = $injector.get('contextSrv');\n this.datasourceSrv = $injector.get('datasourceSrv');\n this.timeSrv = $injector.get('timeSrv');\n this.templateSrv = $injector.get('templateSrv');\n this.panel.datasource = this.panel.datasource || null;\n\n this.events.on(PanelEvents.refresh, this.onMetricsPanelRefresh.bind(this));\n this.events.on(PanelEvents.panelTeardown, this.onPanelTearDown.bind(this));\n this.events.on(PanelEvents.componentDidMount, this.onMetricsPanelMounted.bind(this));\n }\n\n private onMetricsPanelMounted() {\n const queryRunner = this.panel.getQueryRunner() as PanelQueryRunner;\n this.querySubscription = queryRunner\n .getData({ withTransforms: true, withFieldConfig: true })\n .subscribe(this.panelDataObserver);\n }\n\n private onPanelTearDown() {\n if (this.querySubscription) {\n this.querySubscription.unsubscribe();\n this.querySubscription = null;\n }\n }\n\n private onMetricsPanelRefresh() {\n // ignore fetching data if another panel is in fullscreen\n if (this.otherPanelInFullscreenMode()) {\n return;\n }\n\n // if we have snapshot data use that\n if (this.panel.snapshotData) {\n this.updateTimeRange();\n let data = this.panel.snapshotData;\n // backward compatibility\n if (!isArray(data)) {\n data = data.data;\n }\n\n this.panelData = {\n state: LoadingState.Done,\n series: data,\n timeRange: this.range,\n };\n\n // Defer panel rendering till the next digest cycle.\n // For some reason snapshot panels don't init at this time, so this helps to avoid rendering issues.\n return this.$timeout(() => {\n this.events.emit(PanelEvents.dataSnapshotLoad, data);\n });\n }\n\n // clear loading/error state\n delete this.error;\n this.loading = true;\n\n // load datasource service\n return this.datasourceSrv\n .get(this.panel.datasource, this.panel.scopedVars)\n .then(this.issueQueries.bind(this))\n .catch((err: any) => {\n this.processDataError(err);\n });\n }\n\n processDataError(err: any) {\n // if canceled keep loading set to true\n if (err.cancelled) {\n console.log('Panel request cancelled', err);\n return;\n }\n\n this.error = err.message || 'Request Error';\n\n if (err.data) {\n if (err.data.message) {\n this.error = err.data.message;\n } else if (err.data.error) {\n this.error = err.data.error;\n }\n }\n\n this.angularDirtyCheck();\n }\n\n angularDirtyCheck() {\n if (!this.$scope.$root.$$phase) {\n this.$scope.$digest();\n }\n }\n\n // Updates the response with information from the stream\n panelDataObserver = {\n next: (data: PanelData) => {\n this.panelData = data;\n\n if (data.state === LoadingState.Error) {\n this.loading = false;\n this.processDataError(data.error);\n }\n\n // Ignore data in loading state\n if (data.state === LoadingState.Loading) {\n this.loading = true;\n this.angularDirtyCheck();\n return;\n }\n\n if (data.request) {\n const { timeInfo } = data.request;\n if (timeInfo) {\n this.timeInfo = timeInfo;\n }\n }\n\n if (data.timeRange) {\n this.range = data.timeRange;\n }\n\n if (this.useDataFrames) {\n this.handleDataFrames(data.series);\n } else {\n // Make the results look as if they came directly from a <6.2 datasource request\n const legacy = data.series.map((v) => toLegacyResponseData(v));\n this.handleQueryResult({ data: legacy });\n }\n\n this.angularDirtyCheck();\n },\n };\n\n updateTimeRange(datasource?: DataSourceApi) {\n this.datasource = datasource || this.datasource;\n this.range = this.timeSrv.timeRange();\n\n const newTimeData = applyPanelTimeOverrides(this.panel, this.range);\n this.timeInfo = newTimeData.timeInfo;\n this.range = newTimeData.timeRange;\n }\n\n issueQueries(datasource: DataSourceApi) {\n this.updateTimeRange(datasource);\n\n this.datasource = datasource;\n\n const panel = this.panel as PanelModel;\n const queryRunner = panel.getQueryRunner();\n\n return queryRunner.run({\n datasource: panel.datasource,\n queries: panel.targets,\n panelId: panel.id,\n dashboardId: this.dashboard.id,\n timezone: this.dashboard.getTimezone(),\n timeInfo: this.timeInfo,\n timeRange: this.range,\n maxDataPoints: panel.maxDataPoints || this.width,\n minInterval: panel.interval,\n scopedVars: panel.scopedVars,\n cacheTimeout: panel.cacheTimeout,\n transformations: panel.transformations,\n });\n }\n\n handleDataFrames(data: DataFrame[]) {\n this.loading = false;\n\n if (this.dashboard && this.dashboard.snapshot) {\n this.panel.snapshotData = data.map((frame) => toDataFrameDTO(frame));\n }\n\n try {\n this.events.emit(PanelEvents.dataFramesReceived, data);\n } catch (err) {\n this.processDataError(err);\n }\n }\n\n handleQueryResult(result: DataQueryResponse) {\n this.loading = false;\n\n if (this.dashboard.snapshot) {\n this.panel.snapshotData = result.data;\n }\n\n if (!result || !result.data) {\n console.log('Data source query result invalid, missing data field:', result);\n result = { data: [] };\n }\n\n try {\n this.events.emit(PanelEvents.dataReceived, result.data);\n } catch (err) {\n this.processDataError(err);\n }\n }\n}\n\nexport { MetricsPanelCtrl };\n","import { auto } from 'angular';\nimport { isString } from 'lodash';\n\nimport {\n AppEvent,\n PanelEvents,\n PanelPluginMeta,\n AngularPanelMenuItem,\n EventBusExtended,\n EventBusSrv,\n} from '@grafana/data';\nimport { AngularLocationWrapper } from 'app/angular/AngularLocationWrapper';\nimport config from 'app/core/config';\nimport { profiler } from 'app/core/core';\n\nimport { DashboardModel } from '../../features/dashboard/state';\n\nexport class PanelCtrl {\n panel: any;\n error: any;\n declare dashboard: DashboardModel;\n pluginName = '';\n pluginId = '';\n editorTabs: any;\n $scope: any;\n $injector: auto.IInjectorService;\n $timeout: any;\n editModeInitiated = false;\n declare height: number;\n declare width: number;\n containerHeight: any;\n events: EventBusExtended;\n loading = false;\n timing: any;\n $location: AngularLocationWrapper;\n\n constructor($scope: any, $injector: auto.IInjectorService) {\n this.panel = this.panel ?? $scope.$parent.panel;\n this.dashboard = this.dashboard ?? $scope.$parent.dashboard;\n this.$injector = $injector;\n this.$scope = $scope;\n this.$timeout = $injector.get('$timeout');\n this.editorTabs = [];\n this.$location = new AngularLocationWrapper();\n this.events = new EventBusSrv();\n this.timing = {}; // not used but here to not break plugins\n\n const plugin = config.panels[this.panel.type];\n if (plugin) {\n this.pluginId = plugin.id;\n this.pluginName = plugin.name;\n }\n\n $scope.$on(PanelEvents.componentDidMount.name, () => this.panelDidMount());\n }\n\n panelDidMount() {\n this.events.emit(PanelEvents.componentDidMount);\n this.events.emit(PanelEvents.initialized);\n this.dashboard.panelInitialized(this.panel);\n }\n\n renderingCompleted() {\n profiler.renderingCompleted();\n }\n\n refresh() {\n this.panel.refresh();\n }\n\n publishAppEvent<T>(event: AppEvent<T>, payload?: T) {\n this.$scope.$root.appEvent(event, payload);\n }\n\n initEditMode() {\n if (!this.editModeInitiated) {\n this.editModeInitiated = true;\n this.events.emit(PanelEvents.editModeInitialized);\n }\n }\n\n addEditorTab(title: string, directiveFn: any, index?: number, icon?: any) {\n const editorTab = { title, directiveFn, icon };\n\n if (isString(directiveFn)) {\n editorTab.directiveFn = () => {\n return { templateUrl: directiveFn };\n };\n }\n\n if (index) {\n this.editorTabs.splice(index, 0, editorTab);\n } else {\n this.editorTabs.push(editorTab);\n }\n }\n\n getExtendedMenu() {\n const menu: AngularPanelMenuItem[] = [];\n this.events.emit(PanelEvents.initPanelActions, menu);\n return menu;\n }\n\n // Override in sub-class to add items before extended menu\n async getAdditionalMenuItems(): Promise<any[]> {\n return [];\n }\n\n otherPanelInFullscreenMode() {\n return this.dashboard.otherPanelInFullscreen(this.panel);\n }\n\n render(payload?: any) {\n this.events.emit(PanelEvents.render, payload);\n }\n\n // overriden from react\n onPluginTypeChange = (plugin: PanelPluginMeta) => {};\n}\n","import { auto } from 'angular';\nimport { indexOf } from 'lodash';\n\nexport class QueryCtrl<T = any> {\n target!: T;\n datasource!: any;\n panelCtrl!: any;\n panel: any;\n hasRawMode!: boolean;\n error?: string | null;\n isLastQuery: boolean;\n\n constructor(public $scope: any, public $injector: auto.IInjectorService) {\n this.panelCtrl = this.panelCtrl ?? $scope.ctrl.panelCtrl;\n this.target = this.target ?? $scope.ctrl.target;\n this.datasource = this.datasource ?? $scope.ctrl.datasource;\n this.panel = this.panelCtrl?.panel ?? $scope.ctrl.panelCtrl.panel;\n this.isLastQuery = indexOf(this.panel.targets, this.target) === this.panel.targets.length - 1;\n }\n\n refresh() {\n this.panelCtrl.refresh();\n }\n}\n","import { map, without } from 'lodash';\n\nimport { getValueFormats } from '@grafana/data';\n\nexport class ColumnOptionsCtrl {\n panel: any;\n panelCtrl: any;\n colorModes: any;\n columnStyles: any;\n columnTypes: any;\n fontSizes: any;\n dateFormats: any;\n addColumnSegment: any;\n unitFormats: any;\n getColumnNames: any;\n activeStyleIndex: number;\n mappingTypes: any;\n\n alignTypes: any;\n static readonly alignTypesEnum = [\n { text: 'auto', value: '' },\n { text: 'left', value: 'left' },\n { text: 'center', value: 'center' },\n { text: 'right', value: 'right' },\n ];\n\n /** @ngInject */\n constructor($scope: any) {\n $scope.editor = this;\n\n this.activeStyleIndex = 0;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.unitFormats = getValueFormats();\n this.colorModes = [\n { text: 'Disabled', value: null },\n { text: 'Cell', value: 'cell' },\n { text: 'Value', value: 'value' },\n { text: 'Row', value: 'row' },\n ];\n this.columnTypes = [\n { text: 'Number', value: 'number' },\n { text: 'String', value: 'string' },\n { text: 'Date', value: 'date' },\n { text: 'Hidden', value: 'hidden' },\n ];\n this.fontSizes = ['80%', '90%', '100%', '110%', '120%', '130%', '150%', '160%', '180%', '200%', '220%', '250%'];\n this.dateFormats = [\n { text: 'YYYY-MM-DD HH:mm:ss', value: 'YYYY-MM-DD HH:mm:ss' },\n { text: 'YYYY-MM-DD HH:mm:ss.SSS', value: 'YYYY-MM-DD HH:mm:ss.SSS' },\n { text: 'MM/DD/YY h:mm:ss a', value: 'MM/DD/YY h:mm:ss a' },\n { text: 'MMMM D, YYYY LT', value: 'MMMM D, YYYY LT' },\n { text: 'YYYY-MM-DD', value: 'YYYY-MM-DD' },\n ];\n this.mappingTypes = [\n { text: 'Value to text', value: 1 },\n { text: 'Range to text', value: 2 },\n ];\n this.alignTypes = ColumnOptionsCtrl.alignTypesEnum;\n\n this.getColumnNames = () => {\n if (!this.panelCtrl.table) {\n return [];\n }\n return map(this.panelCtrl.table.columns, (col: any) => {\n return col.text;\n });\n };\n\n this.onColorChange = this.onColorChange.bind(this);\n }\n\n render() {\n this.panelCtrl.render();\n }\n\n setUnitFormat(column: any) {\n return (value: any) => {\n column.unit = value;\n this.panelCtrl.render();\n };\n }\n\n addColumnStyle() {\n const newStyleRule: object = {\n unit: 'short',\n type: 'number',\n alias: '',\n decimals: 2,\n colors: ['rgba(245, 54, 54, 0.9)', 'rgba(237, 129, 40, 0.89)', 'rgba(50, 172, 45, 0.97)'],\n colorMode: null,\n pattern: '',\n dateFormat: 'YYYY-MM-DD HH:mm:ss',\n thresholds: [],\n mappingType: 1,\n align: 'auto',\n };\n\n const styles = this.panel.styles;\n const stylesCount = styles.length;\n let indexToInsert = stylesCount;\n\n // check if last is a catch all rule, then add it before that one\n if (stylesCount > 0) {\n const last = styles[stylesCount - 1];\n if (last.pattern === '/.*/') {\n indexToInsert = stylesCount - 1;\n }\n }\n\n styles.splice(indexToInsert, 0, newStyleRule);\n this.activeStyleIndex = indexToInsert;\n }\n\n removeColumnStyle(style: any) {\n this.panel.styles = without(this.panel.styles, style);\n }\n\n invertColorOrder(index: number) {\n const ref = this.panel.styles[index].colors;\n const copy = ref[0];\n ref[0] = ref[2];\n ref[2] = copy;\n this.panelCtrl.render();\n }\n\n onColorChange(style: any, colorIndex: number) {\n return (newColor: string) => {\n style.colors[colorIndex] = newColor;\n this.render();\n };\n }\n\n addValueMap(style: any) {\n if (!style.valueMaps) {\n style.valueMaps = [];\n }\n style.valueMaps.push({ value: '', text: '' });\n this.panelCtrl.render();\n }\n\n removeValueMap(style: any, index: number) {\n style.valueMaps.splice(index, 1);\n this.panelCtrl.render();\n }\n\n addRangeMap(style: any) {\n if (!style.rangeMaps) {\n style.rangeMaps = [];\n }\n style.rangeMaps.push({ from: '', to: '', text: '' });\n this.panelCtrl.render();\n }\n\n removeRangeMap(style: any, index: number) {\n style.rangeMaps.splice(index, 1);\n this.panelCtrl.render();\n }\n}\n\nexport function columnOptionsTab() {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/table-old/column_options.html',\n controller: ColumnOptionsCtrl,\n };\n}\n","import { findIndex, isObject, map } from 'lodash';\n\nimport { Column, TableData } from '@grafana/data';\nimport TableModel, { mergeTablesIntoModel } from 'app/core/table_model';\nimport TimeSeries from 'app/core/time_series2';\nimport flatten from 'app/core/utils/flatten';\n\nimport { TableTransform } from './types';\n\nconst transformers: { [key: string]: TableTransform } = {};\nexport const timeSeriesFormatFilterer = (data: any): any[] => {\n if (!Array.isArray(data)) {\n return data.datapoints ? [data] : [];\n }\n\n return data.reduce((acc, series) => {\n if (!series.datapoints) {\n return acc;\n }\n\n return acc.concat(series);\n }, []);\n};\n\nexport const tableDataFormatFilterer = (data: any): any[] => {\n if (!Array.isArray(data)) {\n return data.columns ? [data] : [];\n }\n\n return data.reduce((acc, series) => {\n if (!series.columns) {\n return acc;\n }\n\n return acc.concat(series);\n }, []);\n};\n\ntransformers['timeseries_to_rows'] = {\n description: 'Time series to rows',\n getColumns: () => {\n return [];\n },\n transform: (data, panel, model) => {\n model.columns = [{ text: 'Time', type: 'date' }, { text: 'Metric' }, { text: 'Value' }];\n const filteredData = timeSeriesFormatFilterer(data);\n\n for (let i = 0; i < filteredData.length; i++) {\n const series = filteredData[i];\n for (let y = 0; y < series.datapoints.length; y++) {\n const dp = series.datapoints[y];\n model.rows.push([dp[1], series.target, dp[0]]);\n }\n }\n },\n};\n\ntransformers['timeseries_to_columns'] = {\n description: 'Time series to columns',\n getColumns: () => {\n return [];\n },\n transform: (data, panel, model) => {\n model.columns.push({ text: 'Time', type: 'date' });\n\n // group by time\n const points: any = {};\n const filteredData = timeSeriesFormatFilterer(data);\n\n for (let i = 0; i < filteredData.length; i++) {\n const series = filteredData[i];\n model.columns.push({ text: series.target });\n\n for (let y = 0; y < series.datapoints.length; y++) {\n const dp = series.datapoints[y];\n const timeKey = dp[1].toString();\n\n if (!points[timeKey]) {\n points[timeKey] = { time: dp[1] };\n points[timeKey][i] = dp[0];\n } else {\n points[timeKey][i] = dp[0];\n }\n }\n }\n\n for (const time in points) {\n const point = points[time];\n const values = [point.time];\n\n for (let i = 0; i < filteredData.length; i++) {\n const value = point[i];\n values.push(value);\n }\n\n model.rows.push(values);\n }\n },\n};\n\ntransformers['timeseries_aggregations'] = {\n description: 'Time series aggregations',\n getColumns: () => {\n return [\n { text: 'Avg', value: 'avg' },\n { text: 'Min', value: 'min' },\n { text: 'Max', value: 'max' },\n { text: 'Total', value: 'total' },\n { text: 'Current', value: 'current' },\n { text: 'Count', value: 'count' },\n ];\n },\n transform: (data, panel, model) => {\n let i, y;\n model.columns.push({ text: 'Metric' });\n\n for (i = 0; i < panel.columns.length; i++) {\n model.columns.push({ text: panel.columns[i].text });\n }\n\n const filteredData = timeSeriesFormatFilterer(data);\n\n for (i = 0; i < filteredData.length; i++) {\n const series = new TimeSeries({\n datapoints: filteredData[i].datapoints,\n alias: filteredData[i].target,\n });\n\n series.getFlotPairs('connected');\n const cells = [series.alias];\n\n for (y = 0; y < panel.columns.length; y++) {\n cells.push(series.stats[panel.columns[y].value]);\n }\n\n model.rows.push(cells);\n }\n },\n};\n\ntransformers['annotations'] = {\n description: 'Annotations',\n getColumns: () => {\n return [];\n },\n transform: (data, panel, model) => {\n model.columns.push({ text: 'Time', type: 'date' });\n model.columns.push({ text: 'Title' });\n model.columns.push({ text: 'Text' });\n model.columns.push({ text: 'Tags' });\n\n if (!data || !data.annotations || data.annotations.length === 0) {\n return;\n }\n\n for (let i = 0; i < data.annotations.length; i++) {\n const evt = data.annotations[i];\n model.rows.push([evt.time, evt.title, evt.text, evt.tags]);\n }\n },\n};\n\ntransformers['table'] = {\n description: 'Table',\n getColumns: (data) => {\n if (!data || data.length === 0) {\n return [];\n }\n\n // Single query returns data columns as is\n if (data.length === 1) {\n return [...data[0].columns];\n }\n\n const filteredData = tableDataFormatFilterer(data);\n\n // Track column indexes: name -> index\n const columnNames: any = {};\n\n // Union of all columns\n const columns = filteredData.reduce((acc: Column[], series: TableData) => {\n series.columns.forEach((col) => {\n const { text } = col;\n if (columnNames[text] === undefined) {\n columnNames[text] = acc.length;\n acc.push(col);\n }\n });\n return acc;\n }, []);\n\n return columns;\n },\n transform: (data: any[], panel, model) => {\n if (!data || data.length === 0) {\n return;\n }\n const filteredData = tableDataFormatFilterer(data);\n const noTableIndex = findIndex(filteredData, (d) => 'columns' in d && 'rows' in d);\n if (noTableIndex < 0) {\n throw {\n message: `Result of query #${String.fromCharCode(\n 65 + noTableIndex\n )} is not in table format, try using another transform.`,\n };\n }\n\n mergeTablesIntoModel(model, ...filteredData);\n },\n};\n\ntransformers['json'] = {\n description: 'JSON Data',\n getColumns: (data) => {\n if (!data || data.length === 0) {\n return [];\n }\n\n const names: any = {};\n for (let i = 0; i < data.length; i++) {\n const series = data[i];\n if (series.type !== 'docs') {\n continue;\n }\n\n // only look at 100 docs\n const maxDocs = Math.min(series.datapoints.length, 100);\n for (let y = 0; y < maxDocs; y++) {\n const doc = series.datapoints[y];\n const flattened = flatten(doc, {});\n for (const propName in flattened) {\n names[propName] = true;\n }\n }\n }\n\n return map(names, (value, key) => {\n return { text: key, value: key };\n });\n },\n transform: (data, panel, model) => {\n let i, y, z;\n\n for (const column of panel.columns) {\n const tableCol: any = { text: column.text };\n\n // if filterable data then set columns to filterable\n if (data.length > 0 && data[0].filterable) {\n tableCol.filterable = true;\n }\n\n model.columns.push(tableCol);\n }\n\n if (model.columns.length === 0) {\n model.columns.push({ text: 'JSON' });\n }\n\n for (i = 0; i < data.length; i++) {\n const series = data[i];\n\n for (y = 0; y < series.datapoints.length; y++) {\n const dp = series.datapoints[y];\n const values = [];\n\n if (isObject(dp) && panel.columns.length > 0) {\n const flattened = flatten(dp);\n for (z = 0; z < panel.columns.length; z++) {\n values.push(flattened[panel.columns[z].value]);\n }\n } else {\n values.push(JSON.stringify(dp));\n }\n\n model.rows.push(values);\n }\n }\n },\n};\n\nfunction transformDataToTable(data: any, panel: any) {\n const model = new TableModel();\n\n if (!data || data.length === 0) {\n return model;\n }\n\n const transformer = transformers[panel.transform];\n if (!transformer) {\n throw { message: 'Transformer ' + panel.transform + ' not found' };\n }\n\n transformer.transform(data, panel, model);\n return model;\n}\n\nexport { transformers, transformDataToTable };\n","import { find, map, without } from 'lodash';\n\nimport { transformers } from './transformers';\nimport { ColumnStyle } from './types';\n\nexport class TablePanelEditorCtrl {\n panel: any;\n panelCtrl: any;\n transformers: any;\n fontSizes: any;\n addColumnSegment: any;\n getColumnNames: any;\n canSetColumns = false;\n columnsHelpMessage = '';\n\n /** @ngInject */\n constructor($scope: any, private uiSegmentSrv: any) {\n $scope.editor = this;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.transformers = transformers;\n this.fontSizes = ['80%', '90%', '100%', '110%', '120%', '130%', '150%', '160%', '180%', '200%', '220%', '250%'];\n this.addColumnSegment = uiSegmentSrv.newPlusButton();\n this.updateTransformHints();\n }\n\n updateTransformHints() {\n this.canSetColumns = false;\n this.columnsHelpMessage = '';\n\n switch (this.panel.transform) {\n case 'timeseries_aggregations': {\n this.canSetColumns = true;\n break;\n }\n case 'json': {\n this.canSetColumns = true;\n break;\n }\n case 'table': {\n this.columnsHelpMessage = 'Columns and their order are determined by the data query';\n }\n }\n }\n\n getColumnOptions() {\n if (!this.panelCtrl.dataRaw) {\n return Promise.resolve([]);\n }\n const columns = this.transformers[this.panel.transform].getColumns(this.panelCtrl.dataRaw);\n const segments = map(columns, (c: any) => this.uiSegmentSrv.newSegment({ value: c.text }));\n return Promise.resolve(segments);\n }\n\n addColumn() {\n const columns = transformers[this.panel.transform].getColumns(this.panelCtrl.dataRaw);\n const column: any = find(columns, { text: this.addColumnSegment.value });\n\n if (column) {\n this.panel.columns.push(column);\n this.render();\n }\n\n const plusButton = this.uiSegmentSrv.newPlusButton();\n this.addColumnSegment.html = plusButton.html;\n this.addColumnSegment.value = plusButton.value;\n }\n\n transformChanged() {\n this.panel.columns = [];\n if (this.panel.transform === 'annotations') {\n this.panelCtrl.refresh();\n } else {\n if (this.panel.transform === 'timeseries_aggregations') {\n this.panel.columns.push({ text: 'Avg', value: 'avg' });\n }\n\n this.updateTransformHints();\n this.render();\n }\n }\n\n render() {\n this.panelCtrl.render();\n }\n\n removeColumn(column: ColumnStyle) {\n this.panel.columns = without(this.panel.columns, column);\n this.panelCtrl.render();\n }\n}\n\nexport function tablePanelEditor(uiSegmentSrv: any) {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/table-old/editor.html',\n controller: TablePanelEditorCtrl,\n };\n}\n","import { find, first, isArray, isString, escape } from 'lodash';\n\nimport {\n escapeStringForRegex,\n formattedValueToString,\n getValueFormat,\n ScopedVars,\n stringStartsAsRegEx,\n stringToJsRegex,\n textUtil,\n unEscapeStringFromRegex,\n TimeZone,\n dateTimeFormatISO,\n dateTimeFormat,\n GrafanaTheme,\n} from '@grafana/data';\nimport { getTemplateSrv, TemplateSrv } from '@grafana/runtime';\n\nimport { ColumnOptionsCtrl } from './column_options';\nimport { ColumnRender, TableRenderModel, ColumnStyle } from './types';\n\nexport class TableRenderer {\n formatters: any[] = [];\n colorState: any;\n\n constructor(\n private panel: { styles: ColumnStyle[]; pageSize: number },\n private table: TableRenderModel,\n private timeZone: TimeZone,\n private sanitize: (v: any) => any,\n private templateSrv: TemplateSrv = getTemplateSrv(),\n private theme: GrafanaTheme\n ) {\n this.initColumns();\n }\n\n setTable(table: TableRenderModel) {\n this.table = table;\n\n this.initColumns();\n }\n\n initColumns() {\n this.formatters = [];\n this.colorState = {};\n\n for (let colIndex = 0; colIndex < this.table.columns.length; colIndex++) {\n const column = this.table.columns[colIndex];\n column.title = column.text;\n\n for (let i = 0; i < this.panel.styles.length; i++) {\n const style = this.panel.styles[i];\n\n const escapedPattern = stringStartsAsRegEx(style.pattern)\n ? style.pattern\n : escapeStringForRegex(unEscapeStringFromRegex(style.pattern));\n const regex = stringToJsRegex(escapedPattern);\n if (column.text.match(regex)) {\n column.style = style;\n\n if (style.alias) {\n column.title = textUtil.escapeHtml(column.text.replace(regex, style.alias));\n }\n\n break;\n }\n }\n\n this.formatters[colIndex] = this.createColumnFormatter(column);\n }\n }\n\n getColorForValue(value: number, style: ColumnStyle) {\n if (!style.thresholds || !style.colors) {\n return null;\n }\n for (let i = style.thresholds.length; i > 0; i--) {\n if (value >= style.thresholds[i - 1]) {\n return this.theme.visualization.getColorByName(style.colors[i]);\n }\n }\n return this.theme.visualization.getColorByName(first(style.colors));\n }\n\n defaultCellFormatter(v: any, style: ColumnStyle) {\n if (v === null || v === void 0 || v === undefined) {\n return '';\n }\n\n if (isArray(v)) {\n v = v.join(', ');\n }\n\n if (style && style.sanitize) {\n return this.sanitize(v);\n } else {\n return escape(v);\n }\n }\n\n createColumnFormatter(column: ColumnRender) {\n if (!column.style) {\n return this.defaultCellFormatter;\n }\n\n if (column.style.type === 'hidden') {\n return (v: any): undefined => undefined;\n }\n\n if (column.style.type === 'date') {\n return (v: any) => {\n if (v === undefined || v === null) {\n return '-';\n }\n\n if (isArray(v)) {\n v = v[0];\n }\n\n // if is an epoch (numeric string and len > 12)\n if (isString(v) && !isNaN(v as any) && v.length > 12) {\n v = parseInt(v, 10);\n }\n\n if (!column.style.dateFormat) {\n return dateTimeFormatISO(v, {\n timeZone: this.timeZone,\n });\n }\n\n return dateTimeFormat(v, {\n format: column.style.dateFormat,\n timeZone: this.timeZone,\n });\n };\n }\n\n if (column.style.type === 'string') {\n return (v: any): any => {\n if (isArray(v)) {\n v = v.join(', ');\n }\n\n const mappingType = column.style.mappingType || 0;\n\n if (mappingType === 1 && column.style.valueMaps) {\n for (let i = 0; i < column.style.valueMaps.length; i++) {\n const map = column.style.valueMaps[i];\n\n if (v === null) {\n if (map.value === 'null') {\n return map.text;\n }\n continue;\n }\n\n // Allow both numeric and string values to be mapped\n if ((!isString(v) && Number(map.value) === Number(v)) || map.value === v) {\n this.setColorState(v, column.style);\n return this.defaultCellFormatter(map.text, column.style);\n }\n }\n }\n\n if (mappingType === 2 && column.style.rangeMaps) {\n for (let i = 0; i < column.style.rangeMaps.length; i++) {\n const map = column.style.rangeMaps[i];\n\n if (v === null) {\n if (map.from === 'null' && map.to === 'null') {\n return map.text;\n }\n continue;\n }\n\n if (Number(map.from) <= Number(v) && Number(map.to) >= Number(v)) {\n this.setColorState(v, column.style);\n return this.defaultCellFormatter(map.text, column.style);\n }\n }\n }\n\n if (v === null || v === void 0) {\n return '-';\n }\n\n this.setColorState(v, column.style);\n return this.defaultCellFormatter(v, column.style);\n };\n }\n\n if (column.style.type === 'number') {\n const valueFormatter = getValueFormat(column.unit || column.style.unit);\n\n return (v: any): any => {\n if (v === null || v === void 0) {\n return '-';\n }\n\n if (isNaN(v) || isArray(v)) {\n return this.defaultCellFormatter(v, column.style);\n }\n\n this.setColorState(v, column.style);\n return formattedValueToString(valueFormatter(v, column.style.decimals, null));\n };\n }\n\n return (value: any) => {\n return this.defaultCellFormatter(value, column.style);\n };\n }\n\n setColorState(value: any, style: ColumnStyle) {\n if (!style.colorMode) {\n return;\n }\n\n if (value === null || value === void 0 || isArray(value)) {\n return;\n }\n\n const numericValue = Number(value);\n if (isNaN(numericValue)) {\n return;\n }\n\n this.colorState[style.colorMode] = this.getColorForValue(numericValue, style);\n }\n\n renderRowVariables(rowIndex: number) {\n const scopedVars: ScopedVars = {};\n let cellVariable;\n const row = this.table.rows[rowIndex];\n for (let i = 0; i < row.length; i++) {\n cellVariable = `__cell_${i}`;\n scopedVars[cellVariable] = { value: row[i], text: row[i] ? row[i].toString() : '' };\n }\n return scopedVars;\n }\n\n formatColumnValue(colIndex: number, value: any) {\n const fmt = this.formatters[colIndex];\n if (fmt) {\n return fmt(value);\n }\n return value;\n }\n\n renderCell(columnIndex: number, rowIndex: number, value: any, addWidthHack = false) {\n value = this.formatColumnValue(columnIndex, value);\n\n const column = this.table.columns[columnIndex];\n const cellStyles = [];\n let cellStyle = '';\n const cellClasses = [];\n let cellClass = '';\n\n if (this.colorState.cell) {\n cellStyles.push('background-color:' + this.colorState.cell);\n cellClasses.push('table-panel-color-cell');\n this.colorState.cell = null;\n } else if (this.colorState.value) {\n cellStyles.push('color:' + this.colorState.value);\n this.colorState.value = null;\n }\n // because of the fixed table headers css only solution\n // there is an issue if header cell is wider the cell\n // this hack adds header content to cell (not visible)\n let columnHtml = '';\n if (addWidthHack) {\n columnHtml = '<div class=\"table-panel-width-hack\">' + this.table.columns[columnIndex].title + '</div>';\n }\n\n if (value === undefined) {\n cellStyles.push('display:none');\n column.hidden = true;\n } else {\n column.hidden = false;\n }\n\n if (column.hidden === true) {\n return '';\n }\n\n if (column.style && column.style.preserveFormat) {\n cellClasses.push('table-panel-cell-pre');\n }\n\n if (column.style && column.style.align) {\n const textAlign = find(ColumnOptionsCtrl.alignTypesEnum, ['text', column.style.align]);\n if (textAlign && textAlign['value']) {\n cellStyles.push(`text-align:${textAlign['value']}`);\n }\n }\n\n if (cellStyles.length) {\n cellStyle = ' style=\"' + cellStyles.join(';') + '\"';\n }\n\n if (column.style && column.style.link) {\n // Render cell as link\n const scopedVars = this.renderRowVariables(rowIndex);\n scopedVars['__cell'] = { value: value, text: value ? value.toString() : '' };\n\n const cellLink = this.templateSrv.replace(column.style.linkUrl, scopedVars, encodeURIComponent);\n const sanitizedCellLink = textUtil.sanitizeUrl(cellLink);\n\n const cellLinkTooltip = textUtil.escapeHtml(this.templateSrv.replace(column.style.linkTooltip, scopedVars));\n const cellTarget = column.style.linkTargetBlank ? '_blank' : '';\n\n cellClasses.push('table-panel-cell-link');\n\n columnHtml += `<a href=\"${sanitizedCellLink}\" target=\"${cellTarget}\" data-link-tooltip data-original-title=\"${cellLinkTooltip}\" data-placement=\"right\"${cellStyle}>`;\n columnHtml += `${value}`;\n columnHtml += `</a>`;\n } else {\n columnHtml += value;\n }\n\n if (column.filterable) {\n cellClasses.push('table-panel-cell-filterable');\n columnHtml += `<a class=\"table-panel-filter-link\" data-link-tooltip data-original-title=\"Filter out value\" data-placement=\"bottom\"\n data-row=\"${rowIndex}\" data-column=\"${columnIndex}\" data-operator=\"!=\">`;\n columnHtml += `<i class=\"fa fa-search-minus\"></i>`;\n columnHtml += `</a>`;\n columnHtml += `<a class=\"table-panel-filter-link\" data-link-tooltip data-original-title=\"Filter for value\" data-placement=\"bottom\"\n data-row=\"${rowIndex}\" data-column=\"${columnIndex}\" data-operator=\"=\">`;\n columnHtml += `<i class=\"fa fa-search-plus\"></i>`;\n columnHtml += `</a>`;\n }\n\n if (cellClasses.length) {\n cellClass = ' class=\"' + cellClasses.join(' ') + '\"';\n }\n\n columnHtml = '<td' + cellClass + cellStyle + '>' + columnHtml + '</td>';\n return columnHtml;\n }\n\n render(page: number) {\n const pageSize = this.panel.pageSize || 100;\n const startPos = page * pageSize;\n const endPos = Math.min(startPos + pageSize, this.table.rows.length);\n let html = '';\n\n for (let y = startPos; y < endPos; y++) {\n const row = this.table.rows[y];\n let cellHtml = '';\n let rowStyle = '';\n const rowClasses = [];\n let rowClass = '';\n for (let i = 0; i < this.table.columns.length; i++) {\n cellHtml += this.renderCell(i, y, row[i], y === startPos);\n }\n\n if (this.colorState.row) {\n rowStyle = ' style=\"background-color:' + this.colorState.row + '\"';\n rowClasses.push('table-panel-color-row');\n this.colorState.row = null;\n }\n\n if (rowClasses.length) {\n rowClass = ' class=\"' + rowClasses.join(' ') + '\"';\n }\n\n html += '<tr ' + rowClass + rowStyle + '>' + cellHtml + '</tr>';\n }\n\n return html;\n }\n\n render_values() {\n const rows = [];\n const visibleColumns = this.table.columns.filter((column) => !column.hidden);\n\n for (let y = 0; y < this.table.rows.length; y++) {\n const row = this.table.rows[y];\n const newRow = [];\n for (let i = 0; i < this.table.columns.length; i++) {\n if (!this.table.columns[i].hidden) {\n newRow.push(this.formatColumnValue(i, row[i]));\n }\n }\n rows.push(newRow);\n }\n return {\n columns: visibleColumns,\n rows: rows,\n };\n }\n}\n","import $ from 'jquery';\nimport { defaults } from 'lodash';\nimport { ComponentType } from 'react';\n\nimport { isTableData, PanelEvents, PanelPlugin, PanelProps } from '@grafana/data';\nimport config from 'app/core/config';\nimport { applyFilterFromTable } from 'app/features/variables/adhoc/actions';\nimport { MetricsPanelCtrl } from 'app/plugins/sdk';\nimport { dispatch } from 'app/store/store';\n\nimport { columnOptionsTab } from './column_options';\nimport { tablePanelEditor } from './editor';\nimport { TableRenderer } from './renderer';\nimport { transformDataToTable } from './transformers';\n\nexport class TablePanelCtrl extends MetricsPanelCtrl {\n static templateUrl = 'module.html';\n\n pageIndex: number;\n dataRaw: any;\n table: any;\n renderer: any;\n panelHasRowColorMode: boolean;\n panelHasLinks: boolean;\n\n panelDefaults: any = {\n targets: [{}],\n transform: 'timeseries_to_columns',\n pageSize: null,\n showHeader: true,\n styles: [\n {\n type: 'date',\n pattern: 'Time',\n alias: 'Time',\n dateFormat: 'YYYY-MM-DD HH:mm:ss',\n align: 'auto',\n },\n {\n unit: 'short',\n type: 'number',\n alias: '',\n decimals: 2,\n colors: ['rgba(245, 54, 54, 0.9)', 'rgba(237, 129, 40, 0.89)', 'rgba(50, 172, 45, 0.97)'],\n colorMode: null,\n pattern: '/.*/',\n thresholds: [],\n align: 'right',\n },\n ],\n columns: [],\n\n fontSize: '100%',\n sort: { col: 0, desc: true },\n };\n\n /** @ngInject */\n constructor($scope: any, $injector: any, private annotationsSrv: any, private $sanitize: any) {\n super($scope, $injector);\n\n this.pageIndex = 0;\n\n if (this.panel.styles === void 0) {\n this.panel.styles = this.panel.columns;\n this.panel.columns = this.panel.fields;\n delete this.panel.columns;\n delete this.panel.fields;\n }\n\n defaults(this.panel, this.panelDefaults);\n\n this.panelHasRowColorMode = Boolean(this.panel.styles.find((style: any) => style.colorMode === 'row'));\n this.panelHasLinks = Boolean(this.panel.styles.find((style: any) => style.link));\n\n this.events.on(PanelEvents.dataReceived, this.onDataReceived.bind(this));\n this.events.on(PanelEvents.dataSnapshotLoad, this.onDataReceived.bind(this));\n this.events.on(PanelEvents.editModeInitialized, this.onInitEditMode.bind(this));\n }\n\n onInitEditMode() {\n this.addEditorTab('Options', tablePanelEditor, 2);\n this.addEditorTab('Column Styles', columnOptionsTab, 3);\n }\n\n migrateToPanel(type: string) {\n this.onPluginTypeChange(config.panels[type]);\n }\n\n issueQueries(datasource: any) {\n this.pageIndex = 0;\n\n if (this.panel.transform === 'annotations') {\n return this.annotationsSrv\n .getAnnotations({\n dashboard: this.dashboard,\n panel: this.panel,\n range: this.range,\n })\n .then((anno: any) => {\n this.loading = false;\n this.dataRaw = anno;\n this.pageIndex = 0;\n this.render();\n return { data: this.dataRaw }; // Not used\n });\n }\n\n return super.issueQueries(datasource);\n }\n\n onDataReceived(dataList: any) {\n this.dataRaw = dataList;\n this.pageIndex = 0;\n\n // automatically correct transform mode based on data\n if (this.dataRaw && this.dataRaw.length) {\n if (isTableData(this.dataRaw[0])) {\n this.panel.transform = 'table';\n } else {\n if (this.dataRaw[0].type === 'docs') {\n this.panel.transform = 'json';\n } else {\n if (this.panel.transform === 'table' || this.panel.transform === 'json') {\n this.panel.transform = 'timeseries_to_rows';\n }\n }\n }\n }\n\n this.render();\n }\n\n render() {\n this.table = transformDataToTable(this.dataRaw, this.panel);\n this.table.sort(this.panel.sort);\n\n this.renderer = new TableRenderer(\n this.panel,\n this.table,\n this.dashboard.getTimezone(),\n this.$sanitize,\n this.templateSrv,\n config.theme\n );\n\n return super.render(this.table);\n }\n\n toggleColumnSort(col: any, colIndex: any) {\n // remove sort flag from current column\n if (this.table.columns[this.panel.sort.col]) {\n this.table.columns[this.panel.sort.col].sort = false;\n }\n\n if (this.panel.sort.col === colIndex) {\n if (this.panel.sort.desc) {\n this.panel.sort.desc = false;\n } else {\n this.panel.sort.col = null;\n }\n } else {\n this.panel.sort.col = colIndex;\n this.panel.sort.desc = true;\n }\n this.render();\n }\n\n link(scope: any, elem: JQuery, attrs: any, ctrl: TablePanelCtrl) {\n let data: any;\n const panel = ctrl.panel;\n let pageCount = 0;\n\n function getTableHeight() {\n let panelHeight = ctrl.height;\n\n if (pageCount > 1) {\n panelHeight -= 26;\n }\n\n return panelHeight - 31 + 'px';\n }\n\n function appendTableRows(tbodyElem: JQuery) {\n ctrl.renderer.setTable(data);\n tbodyElem.empty();\n tbodyElem.html(ctrl.renderer.render(ctrl.pageIndex));\n }\n\n function switchPage(e: any) {\n const el = $(e.currentTarget);\n ctrl.pageIndex = parseInt(el.text(), 10) - 1;\n renderPanel();\n }\n\n function appendPaginationControls(footerElem: JQuery) {\n footerElem.empty();\n\n const pageSize = panel.pageSize || 100;\n pageCount = Math.ceil(data.rows.length / pageSize);\n if (pageCount === 1) {\n return;\n }\n\n const startPage = Math.max(ctrl.pageIndex - 3, 0);\n const endPage = Math.min(pageCount, startPage + 9);\n\n const paginationList = $('<ul></ul>');\n\n for (let i = startPage; i < endPage; i++) {\n const activeClass = i === ctrl.pageIndex ? 'active' : '';\n const pageLinkElem = $(\n '<li><a class=\"table-panel-page-link pointer ' + activeClass + '\">' + (i + 1) + '</a></li>'\n );\n paginationList.append(pageLinkElem);\n }\n\n footerElem.append(paginationList);\n }\n\n function renderPanel() {\n const panelElem = elem.parents('.panel-content');\n const rootElem = elem.find('.table-panel-scroll');\n const tbodyElem = elem.find('tbody');\n const footerElem = elem.find('.table-panel-footer');\n\n elem.css({ 'font-size': panel.fontSize });\n panelElem.addClass('table-panel-content');\n\n appendTableRows(tbodyElem);\n appendPaginationControls(footerElem);\n\n rootElem.css({ 'max-height': getTableHeight() });\n }\n\n // hook up link tooltips\n elem.tooltip({\n selector: '[data-link-tooltip]',\n });\n\n function addFilterClicked(e: any) {\n const filterData = $(e.currentTarget).data();\n const options = {\n datasource: panel.datasource,\n key: data.columns[filterData.column].text,\n value: data.rows[filterData.row][filterData.column],\n operator: filterData.operator,\n };\n\n dispatch(applyFilterFromTable(options));\n }\n\n elem.on('click', '.table-panel-page-link', switchPage);\n elem.on('click', '.table-panel-filter-link', addFilterClicked);\n\n const unbindDestroy = scope.$on('$destroy', () => {\n elem.off('click', '.table-panel-page-link');\n elem.off('click', '.table-panel-filter-link');\n unbindDestroy();\n });\n\n ctrl.events.on(PanelEvents.render, (renderData: any) => {\n data = renderData || data;\n if (data) {\n renderPanel();\n }\n ctrl.renderingCompleted();\n });\n }\n}\n\nexport const plugin = new PanelPlugin(null as unknown as ComponentType<PanelProps<any>>);\nplugin.angularPanelCtrl = TablePanelCtrl;\nplugin.setNoPadding();\n","import { makeClassES5Compatible } from '@grafana/data';\nimport { loadPluginCss } from '@grafana/runtime';\nimport { MetricsPanelCtrl as MetricsPanelCtrlES6 } from 'app/angular/panel/metrics_panel_ctrl';\nimport { PanelCtrl as PanelCtrlES6 } from 'app/angular/panel/panel_ctrl';\nimport { QueryCtrl as QueryCtrlES6 } from 'app/angular/panel/query_ctrl';\n\nconst PanelCtrl = makeClassES5Compatible(PanelCtrlES6);\nconst MetricsPanelCtrl = makeClassES5Compatible(MetricsPanelCtrlES6);\nconst QueryCtrl = makeClassES5Compatible(QueryCtrlES6);\n\nexport { PanelCtrl, MetricsPanelCtrl, QueryCtrl, loadPluginCss };\n"],"names":["DEFAULT_PORTS","http","https","ftp","AngularLocationWrapper","constructor","this","absUrl","wrapInDeprecationWarning","hash","host","path","port","protocol","replace","search","state","url","fn","replacement","self","deprecationWarning","name","apply","arguments","window","location","origin","newHash","navigationLogger","Error","locationService","slice","URL","href","hostname","pathname","parsedPath","String","startsWith","length","parseInt","paramValue","newQuery","locationSearchToObject","key","Object","keys","undefined","updatedUrl","urlUtil","newUrl","trim","MetricsPanelCtrl","PanelCtrl","$scope","$injector","super","next","data","panelData","LoadingState","loading","processDataError","error","angularDirtyCheck","request","timeInfo","timeRange","range","useDataFrames","handleDataFrames","series","legacy","map","v","toLegacyResponseData","handleQueryResult","contextSrv","get","datasourceSrv","timeSrv","templateSrv","panel","datasource","events","on","PanelEvents","onMetricsPanelRefresh","bind","onPanelTearDown","onMetricsPanelMounted","queryRunner","getQueryRunner","querySubscription","getData","withTransforms","withFieldConfig","subscribe","panelDataObserver","unsubscribe","otherPanelInFullscreenMode","snapshotData","updateTimeRange","isArray","$timeout","emit","scopedVars","then","issueQueries","catch","err","cancelled","console","log","message","$root","$$phase","$digest","newTimeData","applyPanelTimeOverrides","run","queries","targets","panelId","id","dashboardId","dashboard","timezone","getTimezone","maxDataPoints","width","minInterval","interval","cacheTimeout","transformations","snapshot","frame","toDataFrameDTO","result","plugin","$parent","editorTabs","$location","EventBusSrv","timing","config","type","pluginId","pluginName","$on","panelDidMount","panelInitialized","renderingCompleted","profiler","refresh","publishAppEvent","event","payload","appEvent","initEditMode","editModeInitiated","addEditorTab","title","directiveFn","index","icon","editorTab","isString","templateUrl","splice","push","getExtendedMenu","menu","otherPanelInFullscreen","render","QueryCtrl","panelCtrl","ctrl","target","isLastQuery","indexOf","ColumnOptionsCtrl","editor","activeStyleIndex","unitFormats","getValueFormats","colorModes","text","value","columnTypes","fontSizes","dateFormats","mappingTypes","alignTypes","alignTypesEnum","getColumnNames","table","columns","col","onColorChange","setUnitFormat","column","unit","addColumnStyle","styles","stylesCount","indexToInsert","pattern","alias","decimals","colors","colorMode","dateFormat","thresholds","mappingType","align","removeColumnStyle","style","without","invertColorOrder","ref","copy","colorIndex","newColor","addValueMap","valueMaps","removeValueMap","addRangeMap","rangeMaps","from","to","removeRangeMap","columnOptionsTab","restrict","scope","controller","transformers","timeSeriesFormatFilterer","Array","reduce","acc","datapoints","concat","tableDataFormatFilterer","description","getColumns","transform","model","filteredData","i","y","dp","rows","points","timeKey","toString","time","point","values","TimeSeries","getFlotPairs","cells","stats","annotations","evt","tags","columnNames","forEach","noTableIndex","findIndex","d","fromCharCode","mergeTablesIntoModel","names","maxDocs","Math","min","doc","flattened","flatten","propName","z","tableCol","filterable","isObject","JSON","stringify","TablePanelEditorCtrl","uiSegmentSrv","addColumnSegment","newPlusButton","updateTransformHints","canSetColumns","columnsHelpMessage","getColumnOptions","dataRaw","Promise","resolve","segments","c","newSegment","addColumn","find","plusButton","html","transformChanged","removeColumn","tablePanelEditor","TableRenderer","timeZone","sanitize","getTemplateSrv","theme","initColumns","setTable","formatters","colorState","colIndex","escapedPattern","stringStartsAsRegEx","escapeStringForRegex","unEscapeStringFromRegex","regex","stringToJsRegex","match","textUtil","createColumnFormatter","getColorForValue","visualization","getColorByName","first","defaultCellFormatter","join","escape","isNaN","dateTimeFormat","format","dateTimeFormatISO","Number","setColorState","valueFormatter","getValueFormat","formattedValueToString","numericValue","renderRowVariables","rowIndex","cellVariable","row","formatColumnValue","fmt","renderCell","columnIndex","addWidthHack","cellStyles","cellStyle","cellClasses","cellClass","cell","columnHtml","hidden","preserveFormat","textAlign","link","cellLink","linkUrl","encodeURIComponent","sanitizedCellLink","cellLinkTooltip","linkTooltip","cellTarget","linkTargetBlank","page","pageSize","startPos","endPos","cellHtml","rowStyle","rowClasses","rowClass","render_values","visibleColumns","filter","newRow","TablePanelCtrl","annotationsSrv","$sanitize","showHeader","fontSize","sort","desc","pageIndex","fields","defaults","panelDefaults","panelHasRowColorMode","Boolean","panelHasLinks","onDataReceived","onInitEditMode","migrateToPanel","onPluginTypeChange","getAnnotations","anno","dataList","isTableData","TableModel","transformer","transformDataToTable","renderer","toggleColumnSort","elem","attrs","pageCount","getTableHeight","panelHeight","height","renderPanel","panelElem","parents","rootElem","tbodyElem","footerElem","css","addClass","empty","appendTableRows","ceil","startPage","max","endPage","paginationList","$","activeClass","pageLinkElem","append","appendPaginationControls","tooltip","selector","e","el","currentTarget","filterData","options","operator","dispatch","applyFilterFromTable","unbindDestroy","off","renderData","PanelPlugin","angularPanelCtrl","setNoPadding","makeClassES5Compatible","PanelCtrlES6","MetricsPanelCtrlES6","QueryCtrlES6"],"sourceRoot":""}
|