grafana/public/app/features/dataframe-import/constants.ts
Oscar Kilhed 8048a66e90
Dashboard: Add a feature that creates a table panel when a spreadsheet file is dropped on the dashboard. (#62688)
* drag files to dashboard

* use file name as panel title

* add file size limitation, file type limitation and error handling

* Refactor file parsing for code sharing

move accepted types and max size to file-import constants
show which file types are allowed in file type error

* update codeowners

* Adjust max size to 1mb
2023-02-09 15:16:17 +01:00

14 lines
466 B
TypeScript

import { Accept } from 'react-dropzone';
export const acceptedFiles: Accept = {
'text/plain': ['.csv', '.txt'],
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': ['.xlsx'],
'application/vnd.ms-excel': ['.xls'],
'application/vnd.apple.numbers': ['.numbers'],
'application/vnd.oasis.opendocument.spreadsheet': ['.ods'],
'application/json': ['.json'],
};
//This should probably set from grafana conf
export const maxFileSize = 1000000;