Commit Graph

846 Commits

Author SHA1 Message Date
Torkel Ödegaard
6cb7d95916
Components: IconButton (#23510)
* IconButton: New component to share pointer, size & hover style for icon buttons

* Progress

* IconButton: new component

* Think I am done

* Updated snapshots

* Do not like the black button reverting that, and not the plus-circle changed to plus

* fixed test

* fixed e2e test

* Fixed ts issue
2020-04-11 16:07:18 +02:00
Torkel Ödegaard
5a4f690807
NewPanelEditor: Enable new edit mode (#23405)
* WIP: initial commit to transition to new edit mode

* More old edit cleanup

* Minor update

* Refactoring url edit/fullscreen state to simplify logic, now seperate states

* Fixed tests and part of the explore integration

* Updated snapshot

* Fix alert rule links

* Fixed issue going back from explore

* Updated snapshots

* Fixes and changes

* Fixed bridge srv issue

* Fixed add panel issue

* Removed console log

* Removed render

* Tests: fixes e2e smoketest

* Make description optional

* Fixed typings

* e2e fixes

* removed import

* updated snapshot

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2020-04-10 16:37:26 +02:00
Tobias Skarhed
c11ea0b973
Form migrations: TextArea from Forms namespace (#23436)
* Move from Forms namespace and move folder

* Figrate pages from Forms

* Make Enterprise mergable
2020-04-09 09:16:10 +02:00
Stephanie Closson
3acc318d72
Chore: reduce null check errors to 788 (currently over 798) (#23449)
* Fixed ts errors so build will succeed

* Update packages/grafana-data/src/types/graph.ts

Co-Authored-By: Ryan McKinley <ryantxu@gmail.com>

* Feedback from code review

* Leaving out trivial typing's

* Fix error with color being undefined now.

* fix test with timezone issue

* Fixed test

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-04-09 08:29:36 +02:00
Andrej Ocenas
263dcb1452
Chore: Fix bunch of strict null error to fix master CI (#23443)
* Fix bunch of null error

* Fix failing test

* Another test fix
2020-04-08 23:44:10 +02:00
Andrej Ocenas
008bee8f27
Tracing: Adds header and minimap (#23315)
* Add integration with Jeager
Add Jaeger datasource and modify derived fields in loki to allow for opening a trace in Jager in separate split.
Modifies build so that this branch docker images are pushed to docker hub
Add a traceui dir with docker-compose and provision files for demoing.:wq

* Enable docker logger plugin to send logs to loki

* Add placeholder zipkin datasource

* Fixed rebase issues, added enhanceDataFrame to non-legacy code path

* Trace selector for jaeger query field

* Fix logs default mode for Loki

* Fix loading jaeger query field services on split

* Updated grafana image in traceui/compose file

* Fix prettier error

* Hide behind feature flag, clean up unused code.

* Fix tests

* Fix tests

* Cleanup code and review feedback

* Remove traceui directory

* Remove circle build changes

* Fix feature toggles object

* Fix merge issues

* Add trace ui in Explore

* WIP

* WIP

* WIP

* Make jaeger datasource return trace data instead of link

* Allow js in jest tests

* Return data from Jaeger datasource

* Take yarn.lock from master

* Fix missing component

* Update yarn lock

* Fix some ts and lint errors

* Fix merge

* Fix type errors

* Make tests pass again

* Add tests

* Fix es5 compatibility

* Add header with minimap

* Fix sizing issue due to column resizer handle

* Fix issues with sizing, search functionality, duplicate react, tests

* Refactor TraceView component, fix tests

* Fix type errors

* Add tests for hooks

Co-authored-by: David Kaltschmidt <david.kaltschmidt@gmail.com>
2020-04-08 17:16:22 +02:00
Ivana Huckova
431f454d57
@grafana/ui: Create Icon component and replace part of the icons (#23402)
* Part1: Unicons implementation (#23197)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179)

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Remove color prop from icon, remove color implemetation in mono icons

* Update navbar styling

* Move toPascalCase to utils/string

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Resolve type errors resulted from merge

* Part2: Unicons implementation (#23266)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Implment icons in Tabs

* Implement icons in search items and  empty  list

* Update buttons

* Update button-related snapshot tests

* Update icons in modals and page headers

* Create anfular wrapper and update all icons on search screen

* Update sizing, remove colors, update snapshot tests

* Remove color prop from icon, remove color implemetation in mono icons

* Remove color props from monochrome icons

* Complete update of icons for search screen

* Update icons for infor tooltips, playlist, permissions

* Support temporarly font awesome icons used in enterprise grafana

* Part1: Unicons implementation (#23197)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179)

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Remove color prop from icon, remove color implemetation in mono icons

* Update navbar styling

* Move toPascalCase to utils/string

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Icons update

* Add optional chaining to for isFontAwesome variable

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Part3:  Unicons implementation (#23356)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Implment icons in Tabs

* Implement icons in search items and  empty  list

* Update buttons

* Update button-related snapshot tests

* Update icons in modals and page headers

* Create anfular wrapper and update all icons on search screen

* Update sizing, remove colors, update snapshot tests

* Remove color prop from icon, remove color implemetation in mono icons

* Remove color props from monochrome icons

* Complete update of icons for search screen

* Update icons for infor tooltips, playlist, permissions

* Support temporarly font awesome icons used in enterprise grafana

* Part1: Unicons implementation (#23197)

* Create a new Icon component

* Update icons in main sidebar

* Update icons in Useful links and in react components on  main site

* Update icons in Useful links and in main top navigation

* Adjust sizing

* Update panel navigation and timepicker

* Update icons in Panel menu

* NewPanelEditor: Fixed so that test alert rule works in new edit mode (#23179)

* Update icons in add panel widget

* Resolve merge conflict

* Fix part of the test errors and type errors

* Fix storybook errors

* Update getAvailableIcons import in storybook knobs

* Fix import path

* Fix SyntaxError: Cannot use import statement outside a module in test environment error

* Remove dynamic imports

* Remove types as using @ts-ignore

* Update snapshot test

* Add @iconscout/react-unicons to the shouldExclude list as it is blundled with es2015 syntax

* Remove color prop from icon, remove color implemetation in mono icons

* Update navbar styling

* Move toPascalCase to utils/string

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Update icons in Explore

* Update icons in alerting

* Update + and x buttons

* Update icons in configurations and settings

* Update close icons

* Update icons in rich history

* Update alert messages

* Add optional chaining to for isFontAwesome variable

* Remove icon mock, set up jest.config

* Fix navbar plus icon

* Fir enable-bacground to enableBackgournd

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Merge remote branch origin master to icons-unicons

* Revert "Merge remote branch origin master to icons-unicons"

This reverts commit 3f25d50a39.

* Size-up dashnav icons

* Fix alerting icons, panel headers, update tests

* Fix typecheck error

* Adjustments - add panel icon, spacing

* Set TerserPlugin sourceMap to false to prevent running out of memory when publishing storybook

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-04-08 14:33:31 +02:00
Tobias Skarhed
61a2a713ea
Forms migrations: Move Switch from Forms namespace (#23386) 2020-04-08 10:17:19 +02:00
Tobias Skarhed
553f50e4f5
Form migrations: Switch to LegacyForms namespace (#23357)
* Move Switch to Legacy namespace

* Make story internal

* Fix import
2020-04-07 08:50:54 +02:00
Ryan McKinley
6366e43a44
Chore: swap [value,time] order when converting to DataFrame (#23206) 2020-04-03 11:11:28 -07:00
Andrej Ocenas
a4d4dd325f
Explore: Add trace UI to show traces from tracing datasources (#23047)
* Add integration with Jeager
Add Jaeger datasource and modify derived fields in loki to allow for opening a trace in Jager in separate split.
Modifies build so that this branch docker images are pushed to docker hub
Add a traceui dir with docker-compose and provision files for demoing.:wq

* Enable docker logger plugin to send logs to loki

* Add placeholder zipkin datasource

* Fixed rebase issues, added enhanceDataFrame to non-legacy code path

* Trace selector for jaeger query field

* Fix logs default mode for Loki

* Fix loading jaeger query field services on split

* Updated grafana image in traceui/compose file

* Fix prettier error

* Hide behind feature flag, clean up unused code.

* Fix tests

* Fix tests

* Cleanup code and review feedback

* Remove traceui directory

* Remove circle build changes

* Fix feature toggles object

* Fix merge issues

* Add trace ui in Explore

* WIP

* WIP

* WIP

* Make jaeger datasource return trace data instead of link

* Allow js in jest tests

* Return data from Jaeger datasource

* Take yarn.lock from master

* Fix missing component

* Update yarn lock

* Fix some ts and lint errors

* Fix merge

* Fix type errors

* Make tests pass again

* Add tests

* Fix es5 compatibility

Co-authored-by: David Kaltschmidt <david.kaltschmidt@gmail.com>
2020-04-02 13:34:16 +02:00
Tobias Skarhed
b34281e250
Forms migration: Old Select to Legacy namespace (#23200)
* Export other components as Legacy

* More Select Legacy

* Add namespacing to more files

* Export new elements

* Move Legacy Select folder

* Let's not forget the scss file

* Move new Select folder

* Move new Select from Forms namespace

* Little oopsie

* Fix errors

* Fix merge issues
2020-04-02 10:57:35 +02:00
Andrej Ocenas
4c5005e575
Explore: Fix 100% height of graph and table panel (#23101)
* Fix 100% height styles

* Move utility class to component styles
2020-03-26 13:24:58 +01:00
Tobias Skarhed
5cdb8f8e44
Form Migrations: Button (#23019)
* Update legacy exports and fix Type errors

* Remove Button and LinkButton from Forms namespace

* Fix errors

* Update snapshots

* Move Legacy button

* Migrate more Buttons

* Remove legacy button dependency

* Move button up

* Remove legacy button

* Update Snapshots

* Fix ComponentSize issues

* Switch primary button

* Switch primary

* Add classNames and fix some angular directive issues

* Fix failing build and remove log

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-03-26 11:50:27 +01:00
Andrej Ocenas
ae09ccbf79
Trace UI demo (#20297)
* Add integration with Jeager
Add Jaeger datasource and modify derived fields in loki to allow for opening a trace in Jager in separate split.
Modifies build so that this branch docker images are pushed to docker hub
Add a traceui dir with docker-compose and provision files for demoing.:wq

* Enable docker logger plugin to send logs to loki

* Add placeholder zipkin datasource

* Fixed rebase issues, added enhanceDataFrame to non-legacy code path

* Trace selector for jaeger query field

* Fix logs default mode for Loki

* Fix loading jaeger query field services on split

* Updated grafana image in traceui/compose file

* Fix prettier error

* Hide behind feature flag, clean up unused code.

* Fix tests

* Fix tests

* Cleanup code and review feedback

* Remove traceui directory

* Remove circle build changes

* Fix feature toggles object

* Fix merge issues

* Fix some null errors

* Fix test after strict null changes

* Review feedback fixes

* Fix toggle name

Co-authored-by: David Kaltschmidt <david.kaltschmidt@gmail.com>
2020-03-25 12:25:39 +01:00
kay delaney
40e875369b
Explore: Allows a user to cancel a running query (#22545) 2020-03-25 10:38:14 +00:00
Ivana Huckova
dd732eac50
Rich history: Improve animation (#22983) 2020-03-24 11:13:38 +01:00
Torkel Ödegaard
08c95c3419
UI: Theme changes (#22880)
* Theme: Updates the theme to align panel & page background colors

* Updated dashboard settings view to be similar to new panel edit

* Updated themes

* Added shadow

* Updates generated files

* Minor fix to inspect drawer

* Clean up old dashboard setttings stuff

* Polish to search

* Updated truth image

* Minor tweaks to dropdown menu

* Updates and alignments between inspect drawer and explore rich history

* removed unused variables

* Minor tweak to light page header bg
2020-03-24 10:30:53 +01:00
Ivana Huckova
8ba75e77b1
Design tweaks (#22886) 2020-03-19 10:17:56 +01:00
Jess
db85c3e7b9
Rich history UX fixes (#22783)
* Initial commit

* Visualised renamed or deleted  datasources as well, if they have queries

* Pass ds image to card and information if the datasource was removed/renamed

* Set up card with datasource info and change run query

* Style comment, run button

* Fix button naming

* Remember last filters

* Update public/app/core/store.ts

* Update public/app/features/explore/RichHistory/RichHistory.tsx

* Update comments

* Rename datasource to data source

* Add test coverage, fix naming

* Remove unused styles, add feedback info

Co-authored-by: Ivana <ivana.huckova@gmail.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2020-03-19 08:47:27 +01:00
Cyril Tovena
ec9167e972
Check if the datasource is of type loki using meta.id instead of name. (#22877)
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
2020-03-18 21:18:48 +01:00
Ivana Huckova
8edf8e3982
Rich history: Test coverage (#22852)
* Add unit test coverage

* Add tests to util/richHistory

* Remove unused import

* Remove redundant tests

* Fix tests for components

* Test saving to local storage

* Add boxshadow to container

* Revert "Add boxshadow to container"

This reverts commit 5ca2e850e4.

* Fix failing tests after merging master

* Fix imports, aria-labels

* Remove console.log
2020-03-17 23:24:27 +01:00
Ivana Huckova
d7312750a3
Revert "Explore: Add test coverage for Rich history (#22722)" (#22850)
This reverts commit 40a8aea313.
2020-03-17 17:20:32 +01:00
Ivana Huckova
40a8aea313
Explore: Add test coverage for Rich history (#22722)
* Add unit test coverage

* Add tests to util/richHistory

* Remove unused import

* Remove redundant tests

* Fix tests for components

* Test saving to local storage

* Add boxshadow to container

* Revert "Add boxshadow to container"

This reverts commit 5ca2e850e4.
2020-03-17 16:10:56 +01:00
Ivana Huckova
544690060a
Rich History: UX adjustments and fixes (#22729)
* Initial commit

* Fix spelling of data sources

* Display sorting value for starred and query tab

* Fix handle color for light theme

* Add close button and fix animation

* Remove toggling of tabs

* Stop event propagation when clicking on comment buttons

* Add title for card functionality

* Remove interpolation for easier searchability of variables

* Improve syncing of comments and starred

* Add modal to check if user wants to permanently delete history

* Fix the height of the query card buttons

* Adjust slider's width based on drawer width

* Add spacing between slider and legend

* Semantic variable naming

* Fix disabled button when live tailing

* Add error handling

* Remove unused imports

* Fix starring, remove useEffect

* Remove emiting of appEvents.alertError in store

* Remove unused imports
2020-03-17 16:06:02 +01:00
Hugo Häggmark
b51e28bc15
Chore: reduces strict null errors to 824 (#22744)
* Chore: reduces strict null errors with 100+

* Chore: lowers the build error number
2020-03-12 10:22:33 +01:00
Lukas Siatka
688283a5cc
Explore: adds QueryRowErrors component, moves error display to QueryRow (#22438)
* Explore: adds QueryRowErrors component

* Explore: updates QueryRow to use QueryRowErrors component

* Explore: updates PromQueryField to remove error render

* Explore: updates Elastic query field  to remove error render

* Explore: updates LokiQueryFieldForm to remove error render

* Explore: updates QueryRow component - brings back passing errors down

* Explore: removes QueryRowErrors component

* Explore: updates ErrorContainer component - moves out data filtering

* Explore: updates QueryRow component - changes QueryRowErrors to ErrorContainer

* Explore: updates Explore component - adds error filtering for ErrorContainer

* Explore: updates ErrorContainer and adds a basic test for it

* Explore: updates Explore component props name and adds a basic render test

* Explore: adds snapshots for Explore and ErrorContainer

* Explore: adds a test for error render

* Explore: adds a comment to Explore component explaining the way we filter non-query-row-specific errors

* Explore: adds getFirstNonQueryRowSpecificError method to explore utilities

* Explore: extracts getFirstNonQueryRowSpecificError method and slightly refactors Explore component

* Explore: updates Explore component tests to cover non-query-row-specific errors
2020-03-11 10:01:58 +01:00
Torkel Ödegaard
bbed213115
RichHistory: Design Tweaks (#22703)
* design tweaks

* RichHistory: Design tweaks
2020-03-11 09:37:35 +01:00
Ivana Huckova
62c824e3a4
Explore: Rich History (#22570)
* Explore: Refactor active buttons css

* Explore: Add query history button

* WIP: Creating drawer

* WIP: Create custom drawer (for now)

* Revert changes to Drawer.tsx

* WIP: Layout finished

* Rich History: Set up boilerplate for Settings

* WIP: Query history cards

* Refactor, split components

* Add resizability, interactivity

* Save history to local storage

* Visualise queries from queryhistory local storage

* Set up query history settings

* Refactor

* Create link, un-refactored verison

* Copyable url

* WIP: Add slider

* Commenting feature

* Slider filtration

* Add headings

* Hide Rich history behind feature toggle

* Cleaning up, refactors

* Update tests

* Implement getQueryDisplayText

* Update lockfile for new dependencies

* Update heading based on sorting

* Fix typescript strinctNullCheck errors

* Fix Forms, new forms

* Fixes based on provided feedback

* Fixes, splitting component into two

* Add tooltips, add delete history button

* Clicking on card adds queries to query rows

* Delete history, width of drawers

* UI/UX changes, updates

* Add number of queries to headings, box shadows

* Fix slider, remove feature toggle

* Fix typo in the beta announcement

* Fix how the rich history state is rendered when initialization

* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code

* Fix typescript strictnull errors, not used variables errors
2020-03-10 15:08:15 +01:00
Lukas Siatka
fd44abd177
DevEnv: update frontend dependencies - tests (#22140)
* DevEnv: updates @types/testing-library__react-hooks 3.1.0 -> 3.2.0

* DevEnv: updates @types/enzyme-adapter-react-16 1.0.5 -> 1.0.6

* DevEnv: updates @types/react-test-renderer 16.9.0 -> 16.9.2

* DevEnv: updates react-test-renderer 16.9.0 -> 16.12.0

* DevEnv: updates @types/enzyme 3.9.0 -> 3.10.5

* DevEnv: updates enzyme-adapter-react-16 1.0.6 -> 1.15.2

* DevEnv: updates enzyme 3.9.0 -> 3.11.0

* Fix: updates snapshots

* Fix: updates tests

* DevEnv: updates enzyme-to-json 3.3.5 -> 3.4.4

* DevEnv: updates expect.js 0.2.0 -> 0.3.1

* DevEnv: updates @types/puppeteer-core 1.9.0 -> 2.0.0

* DevEnv: updates puppeteer-core 1.15.0 -> 2.1.1

* DevEnv: updates @types/expect-puppeteer 3.3.1 -> 4.4.0

* DevEnv: updates expect-puppeteer 4.1.1 -> 4.4.0

* DevEnv: updates mocha 4.1.0 -> 7.0.1
2020-02-14 15:16:07 +01:00
Ivana Huckova
2be4d8dfd0
Explore: Refactor active buttons css (#22124) 2020-02-12 20:11:40 +01:00
Torkel Ödegaard
a58d2b87f8 Dashboard: Refactor dashboard reducer & actions (#22021)
* Dashboard: Refactor dashboard reducer & actions

* Dashboard: minor refactoring

* Minor cleanup
2020-02-09 09:45:50 +01:00
Steven Vachon
f48169633c
TSLint → ESLint (#21006)
* Alphabetized tslint and tsconfig files

* Optimized tsconfig files

* Optimized editorconfig & prettier config files

… to reduce redundancy

* Switched to @grafana/tsconfig

… and:
* de-duped options
* removed options with default values

* Fixed nasty issue with types for nested slate-react

* Replaced TSLint with ESLint

* TSLint disables → ESLint disables

… also JSHint removals, which haven’t had an affect since it was replaced with TSLint.

* Compliances for ESLint, Prettier and TypeScript

* Updated lockfile
2020-02-08 02:40:04 +01:00
Lukas Siatka
df48d1c19f
Explore: Adds Loki explore query editor (#21497)
* Explore: updates grafana-data explore query field props with explore mode

* Explore: updates query row to pass down explore mode to query fields

* Explore: adds LokiExploreQueryEditor

* Explore: updates loki query field form to render children

* Explore: adds loki explore extra field component

* Explore: adds extra field element to loki query field form

* Explore: updates loki explore query editor to use extra field element

* Explore: moves ExploreMode to grafana-data

* Explore: updates query row limit string

* Explore: adds maxLines to DataQuery

* Explore: adds maxLines to loki datasource runRangeQueryWithFallback

* Explore: adds onChangeQueryLimit to LokiExploreQueryEditor

* Explore: updates loki explore query editor to render extra field only in logs mode

* Explore: fixes query limits for live and legacy queries

* Explore: fixes result processor max lines limit in get logs result

* Explore: fixes Loki datasource limit test

* Explore: removes unnecessary ExploreMode from Loki language provider

* Explore: fixes formatting

* Explore: updates grafana-data datasource types - replaces strings with explore mode enum

* Explore: updates loki explore query field props to take ReactNode

* Explore: updates the way we calculate loki query lines limit to fall back to 0 lines on negative or invalid input instead of datasource maxLines

* Explore: updates result processor get logs result method to avoid counting invalid/negative line limits

* Explore: updates loki result transformer to process only an appropriate slice of a result instead of an entire one

* Explore: adds a method for query limit preprocessing/mapping

* Explore: updates loki datasource run range query with fallback method to use options.maxDataPoints in dashboards

* Explore: removes unnecessary maxlineslimt from getLogsResult in resultProcessor

* Explore: moves line limit to metadata

* Explore: adds an ability to specify input type of extra field

* Explore: updates LokiExploreQueryEditor - adds an input type

* Explore: updates LokiExploreQueryEditor to run queries when maxLines is positive

* Explore: fixes failing import of ExploreMode

* Explore: fixes reducers test imports formatting

* Explore: updates Loki extra field with min value set to 0

* Explore: exports LokiExploreExtraFieldProps

* Explore: adds render test of LokiExploreQueryEditor

* Explore: adds LokiExploreQueryEditor snapshot

* Explore: updates LokiExploreQueryEditor onChangeQueryLimit method to prevent it from running when query input is empty - fixes cheatsheet display issue

* Explore: updates Loki editor snapshots

* Explore: fixes typo in test set name in LokiExploreQueryEditor

* Explore: adds a render test of LokiExploreExtraField

* Explore: fixes typo in LokiExploreQueryEditor

* Explore: updates LokiExploreQueryEditor snapshot due to timezone issues

* Explore: updates LokiExploreExtraField to export both functional component and a version using memo

* Explore: updates LokiExploreQueryEditor to export both functional component and memoized function

* Explore: updates LokiExploreQueryEditor - removes unnecessary react fragment

* Explore: updates LokiExploreQueryEditor snapshot

* Explore: adds LokiExploreQueryEditor tests for different explore mode cases

* Explore: fixes Loki datasource and result transformer

* Explore: updates LokiExploreQueryEditor snapshot

* Explore: updates LokiExploreQueryEditor tests and test setup

* Explore: updates LokiExploreQueryEditor - refactors component

* Explore: updates LokiExploreQueryEditor to use default import from LokiExploreExtraField

* Explore: updates LokiExploreQueryEditor snapshot

* Explore: fixes formatting

* Explore: updates LokiExploreQueryEditor max lines change

* Explore: updates LokiExploreQueryEditor tests checking ExtraFieldElement

* Explore: adds mock loki datasource to LokiExploreQueryEditor

* Explore: updates LokiExploreQueryEditor test mock - adds language provider

* Explore: updates LokiExploreQueryEditor snapshot

* Explore: updates Loki ResultTransformer to filter out rows on limit - logic to be moved into a component with new form styles

* Explore: updates LokiExploreQueryEditor tests
2020-02-06 12:34:52 +00:00
Ivana Huckova
89d1ab37de
Elastic: Limit the number of datapoints for the counts query (#21937) 2020-02-06 11:06:26 +01:00
Lukas Siatka
c425a837a9 Explore: adds basic tests to TableContainer checking the render and output on 0 series returned 2020-01-30 12:02:50 +00:00
Lukas Siatka
f7fe4d4865 Explore: adds MetaInfoText tests 2020-01-30 12:02:50 +00:00
Lukas Siatka
61b5471ed8 Explore: adds export of MetaItem and its props 2020-01-30 12:02:50 +00:00
Lukas Siatka
865a8dd355 Explore: updates TableContainer to use MetaInfoText component 2020-01-30 12:02:50 +00:00
Lukas Siatka
d99121d6fa Explore: updates Logs component to use MetaInfoText component 2020-01-30 12:02:50 +00:00
Lukas Siatka
a5ca5dffa4 Explore: adds MetaInfoText component 2020-01-30 12:02:50 +00:00
Lukas Siatka
e230e1df96 Explore: updates Table container render to avoid rendering table on empty result 2020-01-30 12:02:50 +00:00
Lukas Siatka
2bdbdd6930 Explore: updates explore table container to show a span on 0 series returned 2020-01-30 12:02:50 +00:00
Hugo Häggmark
044bea0935
Chore: Fixes various strict null errors (#21763)
* Chore: Removes strict null checks in ReducerTester

* Chore: Fixes strict null errors in ConfigureStore

* Chore: Fixes strict null errors in reducer tests

* Chore: Fixes strict null errors in reducers tests

* Chore: Fixes strict null errors in reducers tests

* Chore: Fixes strict null errors in toggleLogActionsMiddleware

* Chore: Fixes strict null errors in navModelReducer

* Core: Fixes strict null errors in public/app/features/admin/state

* Chore: Fixes strict null errors in public/app/features/dashboard/state/reducers.test.ts

* Chore: Fixes strict null errors in public/app/features/explore/state/reducers.test.ts

* Chore: Fixes strict null errors in public/app/features/datasources/state/reducers.test.ts

* Chore: Fixes strict null errors in public/e2e-test/scenarios/templating/templatevariables-crud.test.ts

* Chore: Fixes strict null errors in public/app/features/dashboard/containers/DashboardPage.test.tsx
2020-01-28 09:13:56 +01:00
Andrej Ocenas
0fda3c4f44
Explore: Fix context view in logs, where some rows may have been filtered out. (#21729)
* Fix timestamp formats and use uid to filter context rows

* Remove timestamps from tests
2020-01-26 23:13:56 +01:00
Tobias Skarhed
6ff315a299
Emotion: Add main package with version 10 (#21560)
* Update version and snapshots

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-01-21 07:40:05 +01:00
Ivana Huckova
dfeee3dd4a
grafana/ui: Add synced timepickers styling to TimePicker (#21598) 2020-01-20 09:59:35 +01:00
Ivana Huckova
9ebd99d595
Explore: Create unique ids and deduplicate Loki logs (#21493) 2020-01-17 14:28:00 +01:00
kay delaney
cc1d468041
Explore: Ensures queries aren't updated when returning to dashboard if browser back is used (#20897)
* Explore: Ensures queries aren't updated when returning to dashboard if browser back is used
Closes #20873
2020-01-16 11:44:05 +00:00
Peter Holmberg
43dbbe51f0
Inspect: Use AutoSizer for managing width for content in tabs. (#21511)
* wrap content in autosizer

* replace lib

* removing react-virtualized, correct type in editor.ts

* remove caret

* remove dep from grafana/ui and remove story util
2020-01-16 11:11:33 +01:00
Ivana Huckova
ba7d8c1a3d
Explore: Fix timepicker when browsing back after switching datasource (#21454) 2020-01-14 19:20:17 +01:00
Hugo Häggmark
4f0fa776be
Chore: Migrates reducers and actions to Redux Toolkit (#21287)
* Refactor: Adds Redux Toolkit package

* Refactor: Uses configureStore from Redux Toolkit

* Refactor: Migrates applicationReducer

* Refactor: Migrates appNotificationsReducer

* Refactor: Migrates locationReducer

* Refactor: Migrates navModelReducer

* Refactor: Migrates teamsReducer and teamReducer

* Refactor: Migrates cleanUpAction

* Refactor: Migrates alertRulesReducer

* Refactor: Cleans up recursiveCleanState

* Refactor: Switched to Angular compatible reducers

* Refactor: Migrates folderReducer

* Refactor: Migrates dashboardReducer

* Migrates panelEditorReducer

* Refactor: Migrates dataSourcesReducer

* Refactor: Migrates usersReducer

* Refactor: Migrates organizationReducer

* Refactor: Migrates pluginsReducer

* Refactor: Migrates ldapReducer and ldapUserReducer

* Refactor: Migrates apiKeysReducer

* Refactor: Migrates exploreReducer and itemReducer

* Refactor: Removes actionCreatorFactory and reducerFactory

* Refactor: Moves mocks to test section

* Docs: Removes sections about home grown framework

* Update contribute/style-guides/redux.md

Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Refactor: Cleans up some code

* Refactor: Adds state typings

* Refactor: Cleans up typings

* Refactor: Adds comment about ImmerJs autoFreeze

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-01-13 08:03:22 +01:00
David
3667781e6f
Loki: fix filter expression suggestions (#21290)
* Loki: fix filter expression suggestions

- dont suggest term completion items in filter expression
- allow at least one character before suggesting term items
- keep logql expression when switching between Metrics/Logs mode
- show only history by default in completion items

* Clear results when changing mode
2019-12-31 09:53:30 +01:00
Ryan McKinley
d9e9843a10
FieldConfig: add thresholds and color modes (#21273) 2019-12-28 17:32:58 -08:00
Torkel Ödegaard
45b7de1910
Explore: Moves PromContext from query level to DataQueryRequest level (#21260)
Closes #19598

Fixes bug introduced recently where the new PromQueryEditor did not preserve
the PromContext.Explore set on the query model by PromQueryField which caused
the table to be empty for Prometheus in explore.
2019-12-27 09:11:16 +01:00
Lukas Siatka
74924c8284 Explore: moves add query row button below query rows (#20522)
* Explore: updates Query Row component, moves latency to query row actions

* Explore: updates query row actions - adds latency and removes add row button

* Explore: updates explore toolbar props, adds index of the last query row

* Explore: updates toolbar, adds add new row button

* Explore: updates add new query row toolbar button title to add query

* Explore: updates query row actions - adds disabled property on latency button

* Explore: updates query row actions snapshot

* Explore: updates styles

* Explore: updates query row, removes latency

* Explore: updates query row actions, removed latency

* Explore: updates query row actions test and snapshot

* Explore: updates toolbar, moves add new query row button below query rows

* Explore: updates add query row button color and adds transparent background to latency div

* Explore: updates styles for add query row button responsiveness

* Explore: updates query row with latency button, fixes alignment of overall latency

* Explore: updates query row actions snapshot

* Explore: removes overall latency

* Explore: updates query row latency - removes mouseover-triggered style changes

* Explore: updates query row actions snapshot

* Explore: moves styles from scss to emotion

* Add row button: Removed responsiveness, reused query row styles

Co-authored-by: David <david.kaltschmidt@gmail.com>
2019-12-23 12:29:00 +01:00
Torkel Ödegaard
3347b45a95
Table: Component progress & custom FieldConfig options (#21231)
* Table: Set & use field display processor

* Use applyFieldOverrides outside in story instead

* Change types a bit

* Table: Move to flexible layout

* Simplest possible custom field option

* Skip default column

* Added textAlign

* Explore: Set display processor for table data frame

* Fixed storybook

* Refactoring

* Progress on cell display mode

* Major progress

* Progress & refactoring

* Fixes

* Updated tests

* Added more tests

* Table: Progress on cell style customization

* Restored testdata random walk table scenario

* put back unrelated change

* remove unused things

* Updated table story

* Renamed property

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2019-12-23 06:22:54 +01:00
Marcus Andersson
587e4009f3
Dashboard: new updated time picker (#20931)
* Dashboard: started to implement new time picker.

* TimePicker: working in full screen (except calendar).

* TimePicker: first draft on narrow screen variant.

* TimePicker: small adjustments to the narrow design.

* TimePicker: enabled range selection and started to style calendar.

* TimePicker: applied some more styling.

* Calendar: added so the calendar range selection is styled properly.

* Calendar: added styling for timepicker calendar in narrow screen.

* TimePicker: made it possible to select range from calendar.

* TimePicker: made the calendar have previous selected value.

* TimePicker: moved calendar to be able to update form state.

* TimePicker: calendar is now displayed onFocus or onClick.

* TimePicker: calendar will be closed if click outside input.

* Calendar: fixed the styling of the calendar in narrow screen.

* Calendar: made it work properly with narrow screen.

* TimePicker: connected recent to absolute time range.

* TimePicker: changed the label on recent ranges.

* TimePicker: cleaned up the range list and options.

* TimePicker: some more cleaning up.

* TimePicker: cleaned up the calendar a bit.

* TimePicker: some more refactorings.

* TimePicker: refactorings.

* TimePicker: styled modal properly.

* TimePicker: empty recent list.

* TimePicker: width when calendar in full screen.

* TimePicker: will validate input value.

* TimePicker: removed unused code.

* TimePicker: positioning with emotion instead of sass.

* Calendar: Made sure we send the dates in the correct order to the calendar.

* TimePicker: fixed theme.

* TimePicker: fixed positioning of the content.

* TimePicker: positioning of narrow.

* TimePicker: added some simple tets.

* TimePicker: fixed issue with invalid and added error message.

* TimePicker: added history.

* TimePicker: cleaned up snapshot data.

* TimePicker: fixed so we keep the quick values in the input.

* TimePicker: fixed the missing styling on UTC.

* TimePicker: added missing caret icon.

* TimePicker: fixed formatting on recent time ranges.

* TimePicker: added missing -.

* TimePicker: refactorings after feedback.

* TimePicker: renamed reserved prop name.

* TimePicker: added missing onChange call.

* TimePicker: removed alternative return type.

* TimePicker: fixed the sorting order on the recent list.

* TimePicker: added useCallback for the onEvent functions.

* TimePicker: moving away from default export.

* TimePicker: used the isMathString instead of private function.

* TimePicker: minor refactoring simplify the code.

* TimePicker: Added empty container that will expand when less then 4 recent searches.

* TimePicker: changed the top to be absolute relative to the container.

* TimePicker: updated snapshots for failing tests.

* Fixed shadow

* Move it down a bit

* added some more tests.

* Fixed so we change the anchor point of the time picker in really small screens.

* removed memo.

* fixed snapshot.

* Make sure that we always use the correct timeZone when formatting output.

* Fixed form background.

* Some minor fixes after demo.

* Making sure that empty info box is centered.

* updated snapshots for timepicker after css changes.

* fixed so we don't overflow when input validation error.

* adjusted final things on the time picker.

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2019-12-20 15:31:58 +01:00
Ivana Huckova
14b2dad9da
Livetailing: set table withd to 100% (#21213) 2019-12-20 11:21:04 +01:00
Peter Holmberg
e9079c3faa
grafana/ui: New table component (#20991)
* first working example

* Support sorting, adding types while waiting for official ones

* using react-window for windowing

* styles via emotion

* sizing

* set an offset for the table

* change table export

* fixing table cell widths

* Explore: Use new table component in explore (#21031)

* Explore: Use new table component in explore

* enable oncellclick

* only let filterable columns be clickable, refactor renderrow

* remove explore table

* Keep using old merge tables logic

* prettier

* remove unused typings file

* fixing tests

* Fixed explore table issue

* NewTable: Updated styles

* Fixed unit test

* Updated TableModel

* Minor update to explore table height

* typing
2019-12-18 08:38:50 +01:00
Ivana Huckova
842dde3dc9
Explore: Refactor log rows (#21066) 2019-12-16 16:07:36 +01:00
David
e7ae220cde
Logs: Optional logs label column (#21025)
* Logs: Optional logs label column

- reintroduces label column that was removed when log details were
introduced
- added to explore and also as a new option to logs panel
- explore column settings now stored in localstorage
- labels are rendered with font size xs
- labels that start with `_` or are called `level` or `filename` are not
displayed
- removed click handlers and moved remaining `LogLabel` logic into `LogLabels`

* Added prop to satisfy interface

* Review feedback

* removed comment

* Changed label of label column switch
2019-12-11 16:11:32 +01:00
Ivana Huckova
32c9d558f9
Explore: Sync timepicker and logs after live-tailing stops (#20979) 2019-12-11 14:14:39 +01:00
kay delaney
b4736558ac Datasource/Loki: Loki now goes to Logs mode when importing prom queries (#20890)
* Datasource/Loki: Loki now goes to Logs mode when importing prom queries
Closes #20831

* Fixes behavior and adds tests

* Update public/app/features/explore/state/actions.test.ts
2019-12-06 17:00:05 +01:00
Andrej Ocenas
c4c031ef43
Explore: Cleanup redundant state variables and unused actions (#20837) 2019-12-05 11:22:46 +01:00
Andrej Ocenas
6682a36b8a
Explore: Fix reset reducer duplication (#20838) 2019-12-04 12:51:15 +01:00
Ivana Huckova
5a4465a382
Explore: Log message line wrapping options for logs (#20360) 2019-12-03 13:02:44 +01:00
Ivana Huckova
5710e52c11
Explore: Export timezone from redux state (#20812) 2019-12-03 09:38:47 +01:00
kay delaney
514f2beafc
Chore: Remove several instances of non-strict null usage (#20563) 2019-11-26 09:01:32 +00:00
Ivana Huckova
29b46f7a28
Explore: UI changes for split view and live tailing (#20516) 2019-11-22 12:26:14 +01:00
Lukas Siatka
4ddb113b79 Explore: updates responsive button to pass all the div element props 2019-11-21 15:06:16 +01:00
Łukasz Siatka
013179eebc Explore: fixes explore responsive button ref 2019-11-21 15:06:16 +01:00
Łukasz Siatka
1cc1e545a0 Explore: adds a ref to responsive button 2019-11-21 15:06:16 +01:00
Łukasz Siatka
231e620f95 Explore: updates responsive button to forward ref 2019-11-21 15:06:16 +01:00
kay delaney
ca3dff99e8
Chore: Bumps prettier version for new typescript syntax support (#20463)
* Chore: Bumps prettier version for new typescript syntax support

* Ran new version of prettier against the codebase
2019-11-19 13:59:39 +00:00
kay delaney
e0a2d4beac Grafana/Loki: Adds support for new Loki endpoints and metrics (#20158)
* Grafana/Loki: Adds support for new Loki endpoints and metrics

* Adds `/loki/` prefix to new loki endpoints and updates response interfaces

* Improved legacy support

* Removed changes related to plugin.json and added Loki-specific hacks

* Fixes live streaming for legacy loki datasources
2019-11-15 16:38:25 +01:00
kay delaney
f1c8330877
Chore: Upgrade typescript to 3.7 (#20375)
* Chore: Upgrade typescript to 3.7
2019-11-15 09:18:09 +00:00
Lukas Siatka
adc84c6ac5 Explore: updates breakpoint used to collapse datasource picker 2019-11-13 12:01:19 +01:00
Torkel Ödegaard
b756aa0bb1
Prometheus: Adds hint support to dashboard and fixes prometheus link in query editor (#20275)
* Prometheus: moved hints into query editor, and fixed missing refIds in responses

* Minor fix

* Removed unused type import
2019-11-11 16:47:17 +01:00
Hugo Häggmark
e66fc3d47a
ReactPanels: Adds Explore menu item (#20236)
* Fix: Adds Explore menuitem to React Panels
Fixes #19865

* Refactor: Adds CMD|CTRL+click to Explore menu item
2019-11-07 13:49:45 +01:00
Dominik Prokop
96dbed5efc
Graph: introduce Tooltip to React graph (#20046) 2019-11-07 12:37:46 +01:00
Lukas Siatka
a79f5980d3 Explore: fixes toolbars datasource selector and date picker responsiveness (#19718)
* Explore: fixes toolbars datasource selector and date picker responsiveness

* Explore: updates grafana UI time picker component - adds a class on long date

* Explore: updates styles for responsive long date without split

* Explore: adds styles for responsive time picker with long date during split

* Explore: updates long datetime detector to isDateTime, renames isAbsolute to hasAbsolute

* Explore: updates datasource responsiveness

* Explore: moves time picker styles

* Explore: updates datasource picker and select component responsiveness

* Explore: updates data source picker

* Explore: updates explore toolbar to use container width

* Explore: updates styles for datasource picker

* Explore: updates Grafana UI elements - select and single value with an ability to hide text

* Explore: updates time picker styles

* Explore: updates datasource select and date picker

* Explore: updates toolbar elements margin

* Explore: updates toolbar elements split breakpoints

* Explore: updates datasource picker label length with substrings

* Explore: updates the datasource picker label length

* Explore: removes refresh picker hide media query

* Explore: updates refresh picker style query to use xs breakpoint
2019-11-06 19:19:50 +00:00
Andrej Ocenas
0a78652404
Explore: Add custom DataLinks on datasource level for Loki (#20060)
Adds a config section with derived fields which is a config that allows you to create a new field based on a regex matcher run on a log message create DataLink to it which is the clickable in the log detail.
2019-11-06 16:15:08 +01:00
David
9507eda9d1
QueryField: Prevent query runs on blur in Explore (#20180)
As discussed in a UX feedback session, it's annoying that queries are
automatically executed in Explore. This change adds props to override
the blur behavior.

- add `onBlur` to Explore query field props
- Explore's query row will pass down an empty function for onBlur to the
query fields
- pass onBlur through to the QueryField component for Loki and
Prometheus
- add test to QueryField to make sure if onBlur is specified, the
onRunQuery is not executed
2019-11-06 15:08:30 +00:00
Andrej Ocenas
dca872f75f
Explore: Memory leak fix due to dedup selector (#20107)
Change custom hashing and lodash.memoize based selector for standard reselect.
2019-11-01 16:38:34 +01:00
Ivana Huckova
0ecc9a57f1
Explore: Add titles to query row action buttons (#20128) 2019-11-01 14:48:35 +01:00
Ivana Huckova
a5e8e0e291 Explore: UI change for log row details (#20034)
Add LogDetail section that is shown when log line is clicked and expanded. Contains labels/fields and actions to show stats and add/remove label filter.
2019-11-01 10:01:00 +01:00
Dominik Prokop
9b7748ec13
Chore: Reorg packages (#20111)
Primarily- moving majority of the types and utils from @grafana/ui to @grafana/data

* Move types from grafana-ui to grafana-data

* Move valueFormats to grafana-data

* Move utils from grafana-ui to grafana-data

* Update imports in grafana-ui

* revert data's tsconfig change

* Update imports in grafana-runtime

* Fix import paths in grafana-ui

* Move rxjs to devDeps

* Core import updates batch 1

* Import updates batch 2

* Imports fix batch 3

* Imports fixes batch i don't know

* Fix imorts in grafana-toolkit

* Fix imports after master merge
2019-10-31 10:48:05 +01:00
kay delaney
3e8c00dad1 Chore: Moves QueryField to @grafana/ui (#19678)
Closes #19626
2019-10-31 08:27:01 +00:00
David
781cff07af
Explore: Remove datasource testing on selector (#19910)
* Explore: Remove datasource testing on selector

- datasource testing gets in the way of fast query iteration: switching
between datasources can take seconds
- it should not be explore's duty to test datasources in the first place
- removed the concept of datasourceError in Explore, should not be its
concern
- datasource erorrs will express themselves in query errors just fine
- connection errors are still bubbled up
- removed reconnection logic from explore, should not be its concern
- missing labels in loki are still "visible" via an empty label selector
- Loki and Prometheus treated connection errors differently than other
datasources, making sure to pass through the original error message

* Show datasource error in query field for prom/loki/influx

* Removed connection test case, fixed disabled state
2019-10-29 10:37:36 +00:00
Andrej Ocenas
551e24f9f8
ReactMigration: Migrate Loki and Elastic config pages to React (#19979) 2019-10-25 16:43:20 +02:00
Ivana Huckova
6390e51b8c
Explore: Change loading state to done after live-tailing stops (#19955) 2019-10-23 13:54:20 +02:00
Ivana Huckova
7a1eff197d
Explore: Add functionality to show/hide query row results (#19794) 2019-10-22 14:57:46 +02:00
Andrej Ocenas
80a6853fd4
Refactor: Suggestion plugin for slate (#19825) 2019-10-21 18:53:35 +02:00
Ivana Huckova
f8c474fa1b
Explore: Add unit test to TimeSyncButton (#19836) 2019-10-16 11:48:10 +02:00
Andrej Ocenas
5cf5d89dff
Fix: clicking outside of some query editors required 2 clicks (#19822) 2019-10-15 17:04:11 +02:00
kay delaney
99411bf37a
Types: Adds type safety to appEvents (#19418)
* Types: Add type safety to appEvents
2019-10-14 09:27:47 +01:00
Łukasz Siatka
f0264ebe43 Explore: updates live button to responsive button 2019-10-11 19:49:56 +02:00
Łukasz Siatka
e2ea2d3050 updated live tailing text 2019-10-11 19:49:56 +02:00
Łukasz Siatka
f8cef9b900 updated live tail button - responsive fold 2019-10-11 19:49:56 +02:00
Łukasz Siatka
33f8b36b44 updated toolbar - added media query for tail buttons 2019-10-11 19:49:56 +02:00
Lukas Siatka
4bd00491bd
Explore: updates clear all button to responsive button (#19719)
* Explore: updates clear all button to responsive button

* Explore: update toolbar icons alignment

* Explore: adds responsive styles for explore icon alignment
2019-10-10 21:53:02 +02:00
Ivana Huckova
dabc848e11
Explore: Synchronise time ranges in split mode (#19274)
* Explore: create connected sync button when screen is splitted

* Explore: create attachable button to TimePicker

* WIP/Explore: set up redux boilerplate for synced state

* WIP/Explore: add toggling functionality to sync buttons

* WIP/Explore: Fix styling issue

* First pass solution working

* Explore: Clean up, update comments

* Explore: refactore Timepicker, remove newly introduced class names

* Explore: refactore ExploreTimeControls

* Explore: more semantic variables naming

* Explore: run query on syncable item when synced times activated

* Explore: Add tooltip to sync times button

* Explore: Remove typo

* Explore: check exploreId

* Explore: refactor ExploreTimeControls

* Explore: refactor to include suggested changes

* Explore: Create TimeSyncButton component, update colors

* Explore: Toggle tooltip, use stylesFactory
2019-10-08 18:55:53 +02:00
Andrej Ocenas
5238faf6da
Loki: Fix lookup for label key token (#19579) 2019-10-07 19:36:52 +02:00
David
cf7ace6aad
Rename live option in queries (#19658) 2019-10-07 14:09:46 +02:00
Andrej Ocenas
16b041608d
Explore: Move data source loader into the select (#19465) 2019-10-02 10:15:06 +02:00
Andrej Ocenas
0490dbb88d
Explore: Generate log row uid (#18994) 2019-09-30 14:44:15 +02:00
kay delaney
ccba986bc2
Editor: Brings up suggestions menu after clicking suggestion (#19359) 2019-09-30 12:41:47 +01:00
Andrej Ocenas
234a2c599d
Refactor: RefreshPicker export things as statics on class (#19443) 2019-09-27 10:15:05 +02:00
Ivana Huckova
ff834afdc3
UI: Add orangeDark color to theme (#19407) 2019-09-25 18:09:08 +02:00
Hugo Häggmark
889f8e3131 PanelData: Adds timeRange prop to PanelData (#19361)
* Refactor: Adds newTimeRange property to PanelData

* Refactor: Handles timeRange prop after requests

* Refactor: Makes timeRange mandatory

* Refactor: Adds DefaultTimeRange
2019-09-25 11:19:17 +02:00
Andrej Ocenas
f203e82b40
Explore: Do not send explicit maxDataPoints for logs. (#19235) 2019-09-24 16:20:45 +02:00
Andrej Ocenas
6a699af27b
Explore: Refactor mode selection (#19356) 2019-09-24 12:19:48 +02:00
kay delaney
c93325cdd8
Chore: Bump typescript to version 3.6.3 (#19308) 2019-09-24 10:40:16 +01:00
Andrej Ocenas
b0d6ac5f42
Explore: Refactor live tail controls (#19328) 2019-09-24 10:18:34 +02:00
Torkel Ödegaard
08cc4f0c8a
Keybindings: Improve esc / exit / blur logic (#19320)
* Keybindings: Improve esc / exit / blur logic

* Slight modifications

* removed use of jquery
2019-09-24 09:03:14 +02:00
kay delaney
68d6da77da
Chore: Update Slate to 0.47.8 (#19197)
* Chore: Update Slate to 0.47.8
Closes #17430
2019-09-23 12:26:05 +01:00
Torkel Ödegaard
bbf2bd18fd
QueryEditor: Clean-up interface to only have one PanelData (#19249)
* QueryEditor: Clean-up interface to only have one PanelData

* Renamed to prop name to data
2019-09-23 11:13:33 +02:00
srid12
2a1e130000 AlertBox: Merged Alertbox into Alert (#19212)
* refatoring alert box and using alert

* refactoring alertbox to alert

* Changed default to Error

* added buttonText, onButtonClick, omRemove

* Minor fix to buttons

* fixed onRemove
2019-09-20 13:41:00 +02:00
Andrej Ocenas
bf24cbba76
Explore: live tail UI fixes and improvements (#19187) 2019-09-20 13:00:11 +02:00
Dominik Prokop
503dccb771 Revert "Chore: Update Slate to 0.47.8 (#18412)" (#19167)
This reverts commit 601853fc84.
2019-09-17 13:21:50 +02:00
kay delaney
601853fc84 Chore: Update Slate to 0.47.8 (#18412)
* Chore: Update Slate to 0.47.8
Closes #17430

* Add slate and immutable to grafana-ui deps

* Fixes some small regressions introduced

* Fix suggestions for multiple query fields

* Pin upgraded dependencies

* Prettier fix

* Remove original slate-react dependency

* Fix tiny-invariant dep

* (Temporarily) comments out source maps for grafana-ui
2019-09-17 13:16:24 +02:00
Andrej Ocenas
359404eb77
Explore: Update live tail buttons (#19143) 2019-09-17 11:25:12 +02:00
Dominik Prokop
5c0f424d1b
grafana/data: Reorganise code (#19136)
* Organise data frame and vectors code

* Organise transformations

* Move dataframe utils to dataframe dir

* Organise datetime utils

* Organise text utils

* Organise logs utils

* Revert "Organise logs utils"

This reverts commit c24115c755.

* registry -> Registry

* Transformations reorg
2019-09-17 08:23:47 +02:00
Hugo Häggmark
e9f1e86c8e
Fix: Fixes crash using back button with zoomed graph (#19122)
Fixes: #19114
2019-09-16 14:17:33 +02:00
Torkel Ödegaard
e968a2aa86
DataFrame: Fixes to dealing with empty results (#19119)
* DataFrame: Fixes to dealing with empty results

* review feedback fixes
2019-09-16 13:02:26 +02:00
Torkel Ödegaard
9d0a076eb1
Explore: calculate intervals when building data source request (#19107)
* Explore: calculate intervals when building data source request

* Added unit test

* updated unit test
2019-09-16 12:35:39 +02:00
Hugo Häggmark
7ace80c71c Graph: Adds onHorizontalRegionSelected (#19083)
* Refactor: Renamed and changed Signature for OnHorizontalRegionSelected

* Refactor: Adds onHorizontalRegionSelected to GraphPanelController

* Refactor: Moves TimeSrv call to PanelChrome instead
2019-09-16 09:31:22 +02:00
David
b392bba745
Loki: Updated cheat sheet with new filter syntax (#18947)
* Loki: Updated cheat sheet with new filter syntax

- updated cheat sheet with new filter syntax
- added user-specific examples from the user's label set
- added link to LogQL docs
- separated styles for examples (clickable) and expressions

* Review feedback
2019-09-16 07:17:34 +02:00
Andrej Ocenas
d55261aac7 Explore: Move throttling before processing (#19095) 2019-09-13 15:32:53 +02:00
Andrej Ocenas
81ec76bdef
Explore: Add throttling when doing live queries (#19085) 2019-09-13 10:58:29 +02:00
Hugo Häggmark
076a8fc85c
Explore: Fixes issue with lastResult being null (#19081) 2019-09-13 08:13:01 +02:00
Torkel Ödegaard
55717769a3
QueryProcessing: Fixes showing last result in initial loading state (#19057)
* PanelQueryRunner: Need to cache preProcessPanelData function between runs so last result can be remembered

* Better fix for remembering lastResult

* Code simplification

* Simplify code a bit
2019-09-12 21:42:50 +02:00
Torkel Ödegaard
140ecbcf79
QueryProcessing: Observable query interface and RxJS for query & stream processing (#18899)
* I needed to learn some rxjs and understand this more, so just playing around

* Updated

* Removed all the complete calls

* Refactoring

* StreamHandler -> observable start

* progress

* simple singal works

* Handle update time range

* added error handling

* wrap old function

* minor changes

* handle data format in the subscribe function

* Use replay subject to return last value to subscribers

* Set loading state after no response in 50ms

* added missing file

* updated comment

* Added cancelation of network requests

* runRequest: Added unit test scenario framework

* Progress on tests

* minor refactor of unit tests

* updated test

* removed some old code

* Shared queries work again, and also became so much simplier

* unified query and observe methods

* implict any fix

* Fixed closed subject issue

* removed comment

* Use last returned data for loading state

* WIP: Explore to runRequest makover step1

* Minor progress

* Minor progress on explore and runRequest

* minor progress

* Things are starting to work in explore

* Updated prometheus to use new observable query response, greatly simplified code

* Revert refId change

* Found better solution for key/refId/requestId problem

* use observable with loki

* tests compile

* fix loki query prep

* Explore: correct first response handling

* Refactorings

* Refactoring

* Explore: Fixes LoadingState and GraphResults between runs (#18986)

* Refactor: Adds state to DataQueryResponse

* Fix: Fixes so we do not empty results before new data arrives
Fixes: #17409

* Transformations work

* observable test data

* remove single() from loki promise

* Fixed comment

* Explore: Fixes failing Loki and Prometheus unit tests (#18995)

* Tests: Makes datasource tests work again

* Fix: Fixes loki datasource so highligthing works

* Chore: Runs Prettier

* Fixed query runner tests

* Delay loading state indication to 200ms

* Fixed test

* fixed unit tests

* Clear cached calcs

* Fixed bug getProcesedDataFrames

* Fix the correct test is a better idea

* Fix: Fixes so queries in Explore are only run if Graph/Table is shown (#19000)

* Fix: Fixes so queries in Explore are only run if Graph/Table is shown
Fixes: #18618

* Refactor: Removes unnecessary condition

* PanelData: provide legacy data only when needed  (#19018)

* no legacy

* invert logic... now compiles

* merge getQueryResponseData and getDataRaw

* update comment about query editor

* use single getData() function

* only send legacy when it is used in explore

* pre process rather than post process

* pre process rather than post process

* Minor refactoring

* Add missing tags to test datasource response

* MixedDatasource: Adds query observable pattern to MixedDatasource (#19037)

* start mixed datasource

* Refactor: Refactors into observable parttern

* Tests: Fixes tests

* Tests: Removes console.log

* Refactor: Adds unique requestId
2019-09-12 17:28:46 +02:00
Jess
3742db720f Fix exit live mode icon: change back to Stop. (#19043) 2019-09-12 16:01:21 +02:00
Ivana Huckova
2c5d1745ca
Explore: Unify background color for fresh logs (#18973) 2019-09-10 11:30:25 +02:00
Ivana Huckova
14a740572d
Explore: UX/UI improvements for pausing and resuming of live tailing (#18931) 2019-09-09 19:09:06 +02:00
kay delaney
a838d2b30a
Explore: Adds ability to save a panel's query from Explore (#17982)
* Explore: Adds ability to return to origin dashboard
2019-09-05 13:44:37 +01:00
Ryan McKinley
991f77cee1 Loki: support loki with streaming in dashboards (#18709)
Move some of the buffering with live streaming inside of the datasource, sending full frames instead of deltas and allow Loki in dashboards.
2019-09-05 14:04:01 +02:00
Torkel Ödegaard
490a1d6fc9
ErrorHandling: Error boundary for every container (#18845)
* ErrorHandling: Error boundary for every container

* Remvoe custom query editor errors
2019-09-04 13:59:30 +02:00
Andrej Ocenas
aab224ef29
Explore: elastic small fixes (#18879)
- Fix cancellation error showing in UI
- Fix display of object values in log rows
2019-09-04 10:49:09 +02:00
Andrej Ocenas
e0e3a4db54
Explore: Add typings for queryTransaction.request (#18847) 2019-09-03 22:04:33 +02:00
Torkel Ödegaard
b39268f195 Explore: ResultProcessor refactor isTimeSeries check 2019-09-03 17:31:23 +02:00
Torkel Ödegaard
aafae4c523
Explore: Use DataFrame to derive graph/table/logs (#18859)
* WIP: Use data frames in explore

* Explore: everything seems to be working again

* Reworked ResultProcessor tests

* Fixed unit test

* Add some typings and comments
2019-09-03 17:24:22 +02:00
Torkel Ödegaard
289a33bf5b Updated is time series test 2019-09-03 15:57:00 +02:00
Torkel Ödegaard
7cec383470 Fixed unit test 2019-09-03 15:24:55 +02:00
Torkel Ödegaard
443e8d8daa Reworked ResultProcessor tests 2019-09-03 14:31:34 +02:00
Torkel Ödegaard
8003041321 Explore: everything seems to be working again 2019-09-03 12:36:21 +02:00
Torkel Ödegaard
8272dc87ab WIP: Use data frames in explore 2019-09-03 12:09:52 +02:00
Andrej Ocenas
e3181e66b4
Explore: Allow pausing and resuming of live tailing (#18836)
Adding pause/resume buttons and pause on scroll to prevent new rows messing with the scroll position.
2019-09-03 11:23:39 +02:00
kay delaney
7985aa1e57
Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements (#18544)
* Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements
- Introduces dynamic imports for built-in plugins
- Uses dynamic imports for various packages (rst2html, brace)
- Introduces route-based dynamic imports
- Splits angular and moment into separate bundles
2019-09-03 09:29:02 +01:00
Hugo Häggmark
409874b35d Explore: Introduces PanelData to ExploreItemState (#18804)
* WIP: inital POC

* Wip: Moving forward

* Wip

* Refactor: Makes loading indicator work for Prometheus

* Refactor: Reverts prom observable queries because they did not work for multiple targets

* Refactor: Transforms all epics into thunks

* Fix: Fixes scanning

* Fix: Fixes so that Instant and TimeSeries Prom query loads in parallel

* Fix: Fixes negation logic error

* Wip: Introduces PanelData as a carries for query responses

* Refactor: Makes errors work again

* Refactor: Simplifies code somewhat and removes comments

* Tests: Fixes broken tests

* Fix query latency

* Remove unused code
2019-09-03 09:55:20 +02:00
Torkel Ödegaard
fe658d7ac2
Prometheus: Fixed Prometheus query editor error (plus new ErrorBoundaryAlert component) (#18838)
* ErrorHandling: Fixed Prometheus query editor error and added error boundary

* Update public/app/core/components/ErrorBoundary/ErrorBoundary.tsx

Co-Authored-By: kay delaney <45561153+kaydelaney@users.noreply.github.com>

* Fixed ts error
2019-09-02 20:45:18 +02:00
Ryan McKinley
c777301535 DataFrame: split DataFrameHelper into MutableDataFrame and FieldCache (#18795)
* add appending utility

* add appending utility

* update comment

* rename to mutable

* move mutable functions out of DataFrameHelper

* move mutable functions out of DataFrameHelper

* move mutable functions out of DataFrameHelper

* turn DataFrameHelper into FieldCache

* guess time from name

* graph the numbers

* return the timeField, not just the index

* just warn on duplicate field names

* only use a parser if the input is a string

* append init all fields to the same length

* typo

* only parse string if value is a string

* DataFrame: test fixes

* Switch to null for missing values

* Fixed tests
2019-09-01 14:44:22 +02:00
kay delaney
d6fb48c0ff Editor: Fixes issue where only entire lines were being copied (#18806)
* Editor: Fixes issue where only entire lines were being copied
Closes #18768

* Simplifies onCopy handler and factors out logic for easier testing
Also adds tests to verify behaviour
2019-08-30 17:09:00 +02:00
Torkel Ödegaard
a147aedb10
Explore: Fixed query status issue (#18791)
* Explore: Fixed query status issue, fixes #18778

* Added test for QueryStatus
2019-08-30 15:30:24 +02:00
Torkel Ödegaard
8e9cb5c81a
Explore: Fixes query hint issues (#18803)
* Explore: clear results when you change datasource

* Explore: Clear results on data source change, and fix query hints issue

* Clear results on clear all

* Prometheus: Update logic of when to re-check query hints
2019-08-30 15:22:36 +02:00
Torkel Ödegaard
e6e8611d52
Explore: Fixed issue in PanelQuery state arround cancellation (#18771)
* Explore: Fixed issue in PanelQuery state arround cancellation

* Added unit test

* Fixed typescript issues in test
2019-08-29 16:25:10 +02:00
Andrej Ocenas
6402391638
Explore: Add memoization and remove unused props (#18775) 2019-08-29 13:41:45 +02:00
kay delaney
3aa3a45372 Prometheus: Changes brace-insertion behavior to be less annoying (#18698)
* Changes brace-insertion behavior to be less annoying

* Removes use of braces plugin

* Revert "Removes use of braces plugin"

This reverts commit 4cf4a6073b.
2019-08-29 12:02:48 +02:00
Hugo Häggmark
5ca643f2ba Explore: Use PanelQueryState to handle querying (#18694)
* WIP: inital POC

* Wip: Moving forward

* Wip

* Refactor: Makes loading indicator work for Prometheus

* Refactor: Reverts prom observable queries because they did not work for multiple targets

* Refactor: Transforms all epics into thunks

* Fix: Fixes scanning

* Fix: Fixes so that Instant and TimeSeries Prom query loads in parallel

* Fix: Fixes negation logic error

* Propagate errors in stream events, and close streams
2019-08-28 18:24:52 +02:00
Ivana Huckova
c347b64b5a
center NoDataSourceCallToActionCard in Explore (#18752) 2019-08-28 10:26:48 +02:00
Shavonn Brown
a540f05330 QueryEditor: check if optional func toggleEditorMode is provided (#18705) 2019-08-26 18:28:43 +02:00
Hugo Häggmark
e5e7bd3153
Dashboard: Adds Logs Panel (alpha) as visualization option for Dashboards (#18641)
* WIP: intial commit

* Switch: Adds tooltip

* Refactor: Adds props to LogsPanelEditor

* Refactor: Moves LogRowContextProvider to grafana/ui

* Refactor: Moves LogRowContext and Alert to grafana/ui

* Refactor: Moves LogLabelStats to grafana/ui

* Refactor: Moves LogLabels and LogLabel to grafana/ui

* Refactor: Moves LogMessageAnsi and ansicolor to grafana/ui

* Refactor: Moves calculateFieldStats, LogsParsers and getParser to grafana/data

* Refactor: Moves findHighlightChunksInText to grafana/data

* Refactor: Moves LogRow to grafana/ui

* Refactor: Moving ExploreGraphPanel to grafana/ui

* Refactor: Copies Logs to grafana/ui

* Refactor: Moves ToggleButtonGroup to grafana/ui

* Refactor: Adds Logs to LogsPanel

* Refactor: Moves styles to emotion

* Feature: Adds LogsRows

* Refactor: Introduces render limit

* Styles: Moves styles to emotion

* Styles: Moves styles to emotion

* Styles: Moves styles to emotion

* Styles: Moves styles to emotion

* Refactor: Adds sorting to LogsPanelEditor

* Tests: Adds tests for sorting

* Refactor: Changes according to PR comments

* Refactor: Changes according to PR comments

* Refactor: Moves Logs and ExploreGraphPanel out of grafana/ui

* Fix: Shows the Show context label again
2019-08-26 08:11:07 +02:00
kay delaney
1723ad9bdb
Fixes several usability issues with QueryField component (#18681)
* Fixes several usability issues with QueryField component
- Can now indent with tab and `mod+[`, `mod+]`
- Copy/Cut preserves new lines, and paste correctly splits blocks now
- Adds support for selection hotkeys
2019-08-23 14:17:13 +01:00
Hugo Häggmark
774b7267df
Explore: Fixes so Show context shows results again (#18675)
* Fix: Fixes so Show context shows results again
Fixes: #18656

* Refactor: Removes unused import that made it thrugh the pre-commit somehow
2019-08-22 11:10:20 +02:00
Hugo Häggmark
6eb13ae555
Explore: Fixes query field layout in splitted view for Safari browsers (#18654)
Fixes: #18436
2019-08-21 10:31:37 +02:00
kay delaney
bf82e6cded
Explore: Fixes error when switching from prometheus to loki data sources (#18599)
Closes #18594
Closes #18596
2019-08-16 15:10:22 +01:00
Ryan McKinley
e59bae55d9
DataFrame: convert from row based to a columnar value format (#18391) 2019-08-15 09:18:51 -07:00
kay delaney
d66601a5f5
Explore/Prometheus: More consistently allows for multi-line queries (#18362)
* Explore/Prometheus: More consistently allows for multi-line queries
Allows a user to hit shift+enter to create a new line in the query field, even
when the autocomplete suggestions are displayed.
Also fixes an issue where a new line was inserted when selecting a suggestion
Closes #18341

* Fixes behavior where query wasn't running on pressing Enter
Also adds test to verify this behavior
2019-08-14 13:37:04 +01:00
Ryan McKinley
3ccc10f82c React: Rename deprecated UNSAFE_componentWillReceiveProps (#18526) 2019-08-13 10:08:33 +02:00
Hugo Häggmark
4b3440325e
Explore: Replaces TimeSeries with GraphSeriesXY (#18475)
* Wip: Compiles and runs

* WIP: Logs Graph partially working

* Refactor: Adds GraphSeriesToggler

* Refactor: Adds tickDecimals to YAxis

* Refactor: Adds TimeZone and PlotSelection to Graph

* Refactor: Makes the graphResult work in Explore

* Refactor: Adds ExploreGraphPanel that is used by Logs and Explore

* Fix: Fixes strange behaviour with ExploreMode not beeing changed

* Fix: Adds onSelectionChanged to GraphWithLegend

* Refactor: Cleans up unused comments

* ExploreGraph: Disable colorpicker
2019-08-13 07:32:43 +02:00
David
b3d2cc3e2f
Explore: Fix loading error for empty queries (#18488)
* Explore: Fix loading error for empty queries

* Explore: Render tests for QueryField
2019-08-09 17:08:59 +02:00
Hugo Häggmark
445f1dabcc
Fix: Fixes stripping of $d in Explore urls (#18480)
Fixes: #18455
2019-08-09 14:55:23 +02:00
Hugo Häggmark
ead2d6e88f
Explore: Fixes incorrect handling of utc in timeEpic (#18386)
* Fix: Fixes incorrect handling of utc in timeEpic

* Chore: Renames dateTimeFromTimeZone to dateTimeForTimeZone
2019-08-06 10:43:53 +02:00
Ryan McKinley
5f4b5dfecd
Refactor: use data rather than series in stream callback(#18126) 2019-08-01 23:16:29 -07:00
Tobias Skarhed
7891233812
Chore: noImplicitAny Sub 500 errors (#18287) 2019-07-30 15:49:32 +02:00
Tobias Skarhed
c8498461a5 noImplicitAny: Down approx 200 errors (#18143)
* noImplicitAny playlist approx 200

* Add AngularPanelMenuItem interface

* Roughly 100 noImplicitAny
2019-07-18 08:03:04 +02:00
Ryan McKinley
c194ae1ba5
Registry: add a reusable function registry (#17047) 2019-07-16 11:40:23 -07:00
kay delaney
bf7fb67f73
Explore/Loki: Display live tailed logs in correct order (#18031)
Closes #18027
2019-07-10 13:57:23 +01:00
Ryan McKinley
ccc3d88cee
Refactor: move dom utils to @grafana/ui (#17976) 2019-07-08 10:02:16 -07:00
kay delaney
246358344c
Explore: Adds support for new loki 'start' and 'end' params for labels endpoint (#17512)
* Explore: Adds support for new loki 'start' and 'end' params for labels endpoint
Also initializes absoluteRange when explore is initialized
Closes #16788

* Explore: Dispatches updateTimeRangeAction instead of passing absoluteRange when initializing
Also removes dependency on sinon from loki language provider test

* Loki: Refactors transformation of absolute time range to URL params into small utility function

* Makes use of rangeToParams() util function in loki language provider test
Also updates LanguageProvider.request() interface so that url should be type string, and adds optional params argument
2019-07-08 16:14:48 +01:00
Ryan McKinley
8f5df80161 Chore: Removes custom debounce utility in favor of lodash/debounce (#17977) 2019-07-08 15:20:29 +01:00
Ryan McKinley
fcdc29746f
@grafana/data: export dateMath and rangeUtil (#17971) 2019-07-05 23:43:12 -07:00
Ryan McKinley
3f15170914 Refactor: move some files to @grafana/data (#17952)
* moving to data WIP

* more refactoring

* add missing test

* mock full path

* remove sinon from grafana-ui
2019-07-06 08:05:53 +02:00
kay delaney
d4e9a8c009
Explore: Introduces storage keys for last used data source on per-orgId basis (#17934)
* Explore: Introduces storage keys for last used data source on per-orgId basis
Closes #17903
2019-07-04 15:31:15 +01:00
kay delaney
3a18098760 Explore: Restricts query text edit toggle to metrics mode (#17921)
* Explore: Adds datasource plugin config option 'modesSupportingTextEdit'
This allows one to specify which modes support toggling query text edit on and off
Closes #17904

* Explore: Restricts query text edit toggle to metrics mode
2019-07-04 14:10:44 +02:00
kay delaney
164fb13d99
Explore: Adds orgId to URL for sharing purposes (#17895)
Also replaces one-off segment detection functions in explore.ts with general purpose function
Closes #15462
2019-07-03 16:36:12 +01:00
kay delaney
98147fd52b
Explore: Adds support for toggling text edit mode in explore (#17870)
* Explore: Adds support for toggling text edit mode in explore
Also modifies query-row-status css to use relative position instead of absolute
Closes #16770

* Explore: Defines State interface for <QueryRow /> and removes unnecessary constructor
2019-07-03 15:42:03 +01:00
kay delaney
b06ad02a74
Explore: Query rows are now reset when changing data sources (#17865)
Except when those data sources are compatible, via query import.
Closes #17861
2019-07-03 13:49:47 +01:00
kay delaney
364f1f2e55
Explore: Log highlights only update when user stops typing (#17845)
Reverts performance enhancements made to LogsContainer as they are no
longer needed, and complicated things.
Closes #17818
2019-07-02 09:06:21 +01:00
Ryan McKinley
e7c3d0ed97
Refactor: rename SeriesData to DataFrame (#17854) 2019-07-01 12:00:29 -07:00
Torkel Ödegaard
bd4a7ddf3a
TimePicker: Style and responsive fixes, restored dashboard settings (#17822)
* TimePicker: Restore time picker settings

* CleanUp: removed unuused angular-ui (calendar) components

* Fix angular boot dependency list

* TimePicker: set time to 23:59:00 when setting To time using calendar
2019-07-01 10:16:33 +02:00
Marcus Efraimsson
53db823511
Explore: Fix filter by series level in logs graph (#17798)
Adds back support for filtering log messages by series level 
in logs graph which seem to have been broken since merging
of #17027.

Fixes #17769
2019-06-28 17:05:59 +02:00
Hugo Häggmark
ead4b1f5c7
Explore: Uses new TimePicker from Grafana/UI (#17793)
* Wip: Intiail commit

* Refactor: Replaces TimePicker in Explore

* Refactor: Removes Angular TimePicker folder

* Refactor: Adds tests for getShiftedTimeRange

* Fix: Fixes invalid import to removed TimePicker

* Fix: Fixes dateTime tests

* Refactor: Reuses getShiftedTimeRange for both Explore and Dashboards

* Refactor: Shares getZoomedTimeRange between Explore and Dashboard
2019-06-28 12:07:55 +02:00
Hugo Häggmark
2379de53c4
Explore: Uses RFC3339Nano string to retrieve LogRow contexts from Loki API (#17813)
* Refactor: Uses nanosecond string to retreive LogRow contexts

* Reafactor: Small changes to comments after PR comments
2019-06-28 10:47:19 +02:00
Tobias Skarhed
3045daedbd noImplicitAny: Reduce errors to 3800-ish (#17781)
* Reduce noImplicitAny errors to 3900-ish

* Fix lots of errors

* Add interface
2019-06-27 13:21:04 +02:00
kay delaney
5f3a71bc7a Explore: Adds URL support for select mode (#17755)
Adds URL support for mode state (Metrics/Logs). It's important 
to be able to share a link to logs when a data source supports 
both metrics and logs.

Closes #17101
2019-06-27 11:11:49 +02:00
Hugo Häggmark
7cac7435ce
Explore: Displays only one Time column as configured in TimeZone settings (#17775)
* Refactor: Removes switches for TimeStamp and LocalTime and displays time as configured for user

* Styles: Updates classname used to display timeUtc

* Refactor: Adds switch for Time column
2019-06-26 13:35:23 +02:00
Hugo Häggmark
2c5400c61e Explore: Parses and updates TimeSrv in one place in Explore (#17677)
* Wip: Adds timeEpic

* Refactor: Introduces absoluteRange in Explore state

* Refactor: Removes changeTime action

* Tests: Adds tests for timeEpic

* Refactor: Spells AbsoluteRange correctly
2019-06-25 13:44:19 +01:00
Torkel Ödegaard
335cec07a5
Graph: Add data links feature (click on graph) (#17267)
* WIP: initial panel links editor

* WIP: Added dashboard migration to new panel drilldown link schema

* Make link_srv interpolate new variables

* Fix failing tests

* Drilldown: Add context menu to graph viz (#17284)

* Add simple context menu for adding graph annotations and showing drilldown links

* Close graph context menu when user start scrolling

* Move context menu component to grafana/ui

* Make graph context menu appear on click, use cmd/ctrl click for quick annotations

* Move graph context menu controller to separate file

* Drilldown: datapoint variables interpolation (#17328)

* Add simple context menu for adding graph annotations and showing drilldown links

* Close graph context menu when user start scrolling

* Move context menu component to grafana/ui

* Make graph context menu appear on click, use cmd/ctrl click for quick annotations

* Add util for absolute time range transformation

* Add series name and datapoint timestamp interpolation

* Rename drilldown link variables tot snake case, use const values instead of strings in tests

* Bring LinkSrv.getPanelLinkAnchorInfo for compatibility reasons and add deprecation warning

* Rename seriesLabel to seriesName

* Drilldown: use separate editors for panel and series links (#17355)

* Use correct target ini context menu links

* Rename PanelLinksEditor to DrilldownLinksEditor and mote it to grafana/ui

* Expose DrilldownLinksEditor as an angular directive

* Enable visualization specifix drilldown links

* Props interfaces rename

* Drilldown: Add variables suggestion and syntax highlighting for drilldown link editor (#17391)

* Add variables suggestion in drilldown link editor

* Enable prism

* Fix backspace not working

* Move slate value helpers to grafana/ui

* Add syntax higlighting for links input

* Rename drilldown link components to data links

* Add template variabe suggestions

* Bugfix

* Fix regexp not working in Firefox

* Display correct links in panel header corner

* bugfix

* bugfix

* Bugfix

* Context menu UI tweaks

* Use data link terminology instead of drilldown

* DataLinks: changed autocomplete syntax

* Use singular form for data link

* Use the same syntax higlighting for built-in and template variables in data links editor

* UI improvements to context menu

* UI review tweaks

* Tweak layout of data link editor

* Fix vertical spacing

* Remove data link header in context menu

* Remove pointer cursor from series label in context menu

* Fix variable selection on click

* DataLinks: migrations for old links

* Update docs about data links

* Use value time instead of time range when interpolating datapoint timestamp

* Remove not used util

* Update docs

* Moved icon a bit more down

* Interpolate value ts only when using __value_time variable

* Bring href property back to LinkModel

* Add any type annotations

* Fix TS error on slate's Value type

* minor changes
2019-06-25 11:38:51 +02:00
kay delaney
cbe057fce8
Explore: Changes LogsContainer from a PureComponent to a Component (#17741) 2019-06-25 09:10:20 +01:00
Marcus Efraimsson
eecd8d1064 Elasticsearch: Visualize logs in Explore (#17605)
* explore: try to use existing mode when switching datasource

* elasticsearch: initial explore logs support

* Elasticsearch: Adds ElasticsearchOptions type
Updates tests accordingly

* Elasticsearch: Adds typing to query method

* Elasticsearch: Makes maxConcurrentShardRequests optional

* Explore: Allows empty query for elasticsearch datasource

* Elasticsearch: Unifies ElasticsearchQuery interface definition
Removes check for context === 'explore'

* Elasticsearch: Removes context property from ElasticsearchQuery interface
Adds field property
Removes metricAggs property
Adds typing to metrics property

* Elasticsearch: Runs default 'empty' query when 'clear all' button is pressed

* Elasticsearch: Removes index property from ElasticsearchOptions interface

* Elasticsearch: Removes commented code from ElasticsearchQueryField.tsx

* Elasticsearch: Adds comment warning usage of for...in to elastic_response.ts

* Elasticsearch: adds tests related to log queries
2019-06-24 21:15:03 +01:00
Johannes Schill
0412a28d2e TimePicker: New time picker dropdown & custom range UI (#16811)
* feat: Add new picker to DashNavTimeControls

* chore: noImplicitAny limit reached

* chore: noImplicityAny fix

* chore: Add momentUtc helper to avoid the isUtc conditionals

* chore: Move getRaw from Explore's time picker to grafana/ui utils and rename to getRawRange

* feat: Use helper functions to convert utc to browser time

* fix: Dont Select current value when pressing tab when using Time Picker

* fix: Add tabIndex to time range inputs so tab works smoothly and prevent mouseDown event to propagate to react-select

* fix: Add spacing to custom range labels

* fix: Updated snapshot

* fix: Re-adding getRaw() temporary to fix the build

* fix: Disable scroll event in Popper when we're using the TimePicker so the popup wont "follow" the menu

* fix: Move all "Last xxxx" quick ranges to the menu and show a "UTC" text when applicable

* fix: Add zoom functionality

* feat: Add logic to mark selected option as active

* fix: Add tooltip to zoom button

* fix: lint fix after rebase

* chore: Remove old time picker from DashNav

* TimePicker: minor design update

* chore: Move all time picker quick ranges to the menu

* fix: Remove the popover border-right, since the quick ranges are gone

* chore: Remove function not in use

* Fix: Close time picker on resize event

* Fix: Remove border bottom

* Fix: Use fa icons on prev/next arrows

* Fix: Pass ref from TimePicker to TimePickerOptionGroup so the popover will align as it should

* Fix: time picker ui adjustments to get better touch area on buttons

* Fix: Dont increase line height on large screens

* TimePicker: style updates

* Fix: Add more prominent colors for selected dates and fade out dates in previous/next month

* TimePicker: style updates2

* TimePicker: Big refactorings and style changes

* Removed use of Popper not sure we need that here?
* Made active selected item in the list have the "selected" checkmark
* Changed design of popover
* Changed design of and implementation of the Custom selection in the dropdown it did not feel like a item you
could select like the rest now the list is just a normal list

* TimePicker: Refactoring & style changes

* TimePicker: use same date format everywhere

* TimePicker: Calendar style updates

* TimePicker: fixed unit test

* fixed unit test

* TimeZone: refactoring time zone type

* TimePicker: refactoring

* TimePicker: finally to UTC to work

* TimePicker: better way to handle calendar utc dates

* TimePicker: Fixed tooltip issues

* Updated snapshot

* TimePicker: moved tooltip from DashNavControls into TimePicker
2019-06-24 14:39:59 +02:00
Tobias Skarhed
219d711597 noImplicitAny: slate (#17681)
* Update slate types

* Fix noImplicitAny
2019-06-20 20:41:01 +02:00
kay delaney
57dadebbd8
Explore: Improves performance of Logs element by limiting re-rendering (#17685)
* Explore: Improves performance of Logs element by limiting re-rendering
Re-renders only when query has finished executing or when deduplication
strategy changes.
Closes #17663

* Explore: Adds logsHighlighterExpressions as prop to consider when re-rendering Logs
2019-06-20 12:56:47 +01:00
Hugo Häggmark
3424b64299
Typescript: Removes implicit anys (#17625)
* Chore: Remove implicit anys from ResultProcessor and tests

* Chore: Removes implicit anys for /loki/**/*.ts

* Chore: Removes implicit anys for prometheus/**/*
2019-06-18 11:01:12 +02:00
kay delaney
d6ee96ee64
Explore: Removes minus button in adhoc query field (#17573)
Closes #17571
2019-06-18 09:48:32 +01:00
Tobias Skarhed
6de75de755
Refactor buttons (#17611) 2019-06-17 16:15:49 +02:00
Hugo Häggmark
51c6b50582
Explore: Tag and Values for Influx are filtered by the selected measurement (#17539)
* Fix: Filters Tags and Values depending on options passed
Fixes: #17507

* Fix: Makes sure options is not undefined

* Fix: Fixes tests and small button refactor

* Chore: PR comments
2019-06-14 10:13:06 +02:00
Hugo Häggmark
fabc6f4241
Fix: Fixes merge conflict (#17568) 2019-06-13 12:46:10 +02:00
Hugo Häggmark
9e9fdb9cf1
Build: Fix failing e2e tests and implicit any check (#17567)
* Tests: Updates truth screen shot

* Fix: Fixes an implicit any error
2019-06-13 12:37:18 +02:00
kay delaney
d612beec25
Explore: Fixes implicit any error in AdHocFilterField.test.tsx (#17565) 2019-06-13 11:28:03 +01:00
kay delaney
6170a039e5
Explore: Adds ability to remove filter from <AdHocFilterField /> key dropdown (#17553)
Also adds tests to validate behaviour
Query now reruns when filter is removed
Changes <AdHocFilterField /> such that after a measurement and field have been chosen,
just a '+' button is displayed, rather than an empty <AdHocFilter />

Closes #17544
Closes #17497
2019-06-13 10:00:53 +01:00
Marcus Efraimsson
fcd2fb8b04
Explore: Clear queries when switching between metrics and logs (#17505)
This will clear the existing queries when switching between metrics and logs. 

Closes #17496
2019-06-11 16:18:33 +02:00
Hugo Häggmark
591ea0bfe3
Explore: Adds LogQueryField for InfluxDb (#17450)
* Wip: Intial commit

* Wip: Adds intial InfluxLogsQueryField

* Refactor: Adds measurements to InfluxLogQueryField

* Style: Tweaks styles and adds chosen measurement to measurements

* Refactor: Adds remove filter row

* refactor: make influx datasource typed

Uses the new api for exporting the plugin.

* adds metricFindQuery to DataSourceApi

metricFindQuery, getTagKeys and getTagValues now returns a promise

* influx: minor improvements

Limits logs result to 1000.
Don't show adhoc filter until measurement have been selected.

* Refactor: Adds fields to Cascader and uses chosen field as log column

Co-authored-by: Marcus <marcus.efraimsson@gmail.com>
2019-06-10 14:39:53 +02:00
rrFeng
c31b939e10 Explore: Handle newlines in LogRow Highlighter (#17425) 2019-06-06 13:55:04 +02:00
Ryan McKinley
574a37e46f
@grafana/runtime: expose location update (#17428) 2019-06-04 16:20:55 +02:00
Marcus Efraimsson
d1ab29c36d Explore: Makes it possible to use a different query field per mode (#17395) 2019-06-04 12:35:16 +02:00
Ryan McKinley
1e76f1a728
DataSourceApi: remove ExploreDataSourceApi (#17424) 2019-06-04 10:30:07 +02:00
Ryan McKinley
96ba32d0c8
Add a @grafana/runtime package with backendSrv interface (#16533)
grafana-runtime/tsconfig.json imports query to avoid a build error  ¯\_(ツ)_/¯
2019-06-03 17:55:59 +02:00
Hugo Häggmark
fb39831df2
Explore: Queries the datasource once per run query and uses DataStreamObserver (#17263)
* Refactor: Removes replaceUrl from actions

* Refactor: Moves saveState thunk to epic

* Refactor: Moves thunks to epics

* Wip: removes resulttype and queries once

* Refactor: LiveTailing uses observer in query

* Refactor: Creates epics folder for epics and move back actioncreators

* Tests: Adds tests for epics and reducer

* Fix: Checks for undefined as well

* Refactor: Cleans up previous live tailing implementation

* Chore: merge with master

* Fix: Fixes url issuses and prom graph in Panels

* Refactor: Removes supportsStreaming and adds sockets to DataSourcePluginMeta instead

* Refactor: Changes the way we create TimeSeries

* Refactor: Renames sockets to streaming

* Refactor: Changes the way Explore does incremental updates

* Refactor: Removes unused method

* Refactor: Adds back Loading indication
2019-06-03 14:54:32 +02:00
Marcus Efraimsson
1497f3d79a
Chore: Remove unused properties in explore (#17359)
This removes unused properties in explore and datasource 
meta data (tables and explore properties in plugin.json).
2019-05-31 09:45:53 +02:00
Marcus Efraimsson
e951e71843
Explore: Update time range before running queries (#17349)
This makes sure that refresh/update/run query are parsing a
relative time range to get proper epoch time range before
running queries.

Fixes #17322
2019-05-29 13:47:05 +02:00
Dominik Prokop
a9c94ec93b
Explore: Update the way Loki retrieve log context (#17204)
* Move log's typings into grafana/ui
* Update the way context is retrieved for Loki

Major changes:

1. getLogRowContext expects row to be of LogRowModel type
2. getLogRowContext accepts generic options object, specific to a datasource of interest. limit option has been removed, and now it's a part of Loki's context query options (see below)
3. LogRowContextProvider performs two queries now. Before, it was Loki ds that performed queries in both directions when getLogRowContext.
4. Loki's getLogRowContext accepts options object of a type:

interface LokiContextQueryOptions {
    direction?: 'BACKWARD' | 'FORWARD';
    limit?: number;
}

This will enable querying in either direction independently and also slightly simplifies the way query errors are handled.

LogRowContextProvider maps the results to a Loki specific context types, basically string[][], as raw log lines are displayed in first version.
2019-05-22 23:10:05 +02:00
Marcus Efraimsson
5414a31101 explore: fix null checks (#17191) 2019-05-21 09:37:31 +02:00
Hugo Häggmark
3b35e9d5e8 Fix: Fixes so new data is pushed during live tailing (#17189)
Fixes: #17188
2019-05-21 09:34:41 +02:00
Hugo Häggmark
458bb3b0e3 Fix: Changes WebSocket protocol to wss:// for https (#17173) 2019-05-20 15:24:48 +02:00
Hugo Häggmark
db48ec1f08
Explore: Adds Live option for supported datasources (#17062)
* Wip: Initial commit

* Refactor: Adds support in Loki datasource for streaming

* Refactor: Adds Live option to RefreshInterval

* Refactor: Adds styles to logrows

* Style: Reverses the order of Explore layout on Live

* Refactor: Adds LiveLogs component

* Tests: Adds tests for epics

* Style: Adds animation to Live in RefreshPicker

* Refactor: Adds ElapsedTime and progress line to LiveLogs

* Style: Adds specific colors to each theme

* Refactor: Adds support for Lokis new API

* Fix: Adds null to resulting empty array

* Refactor: Limits the rate of incoming messages from websockets

* Refactor: Throttles messages instead for simplicity

* Refactor: Optimizes row processing performance

* Refactor: Adds stop live button

* Fix: Fixes so that RefreshPicker shows the correct value when called programmatically

* Refactor: Merges with master and removes a console.log

* Refactor: Sorts rows in correct order and fixes minor UI issues

* Refactor: Adds minor improvments to sorting and container size
2019-05-20 13:28:23 +02:00
Marcus Efraimsson
0e210dc271
Explore: Fix selection/copy of log lines (#17121)
This adds some logic to identify if the user is selecting 
text and if so disables parsing of log messages on hover. 
This should resolve the issue of selecting log lines to be 
copied and the selection is truncated.

Fixes #17072
2019-05-20 09:51:57 +02:00
Dominik Prokop
12e0616413
Explore: display log line context (#17097)
* Extend DataSourceAPI to enable log row context retrieval

* Add react-use package

* Display log row context in UI

* Make Loki datasource return "after" log context in correct order

* Don't show Load more context links  when there are no more new results

* Update getLogRowContext to return DataQueryResponse

* Use DataQueryResponse in log row context provider, filter out original row  being duplicated in context
2019-05-20 08:44:37 +02:00
Marcus Efraimsson
1a80885180
explore: fix issues when loading and both graph/table are collapsed (#17113)
Removes the functionality of being able to collapse/expand the logs 
container.
When both graph and table are collapsed and you reload the page 
then the start page should not be displayed.
When both graph and table are collapsed and you reload the page 
then the graph and table panels should be displayed.
Fix so that reducer tests are run. On of the test used fit() instead of 
it() which had the consequence of only 1 reducer test was executed 
and the rest skipped. There was some failing tests that now is 
updated and now passes.

Fixes #17098
2019-05-17 12:45:11 +02:00
Marcus Efraimsson
32cdab4cbf
explore: make sure datasource is added to target (#17116)
Fixes a regression introduced in #16959 which removed datasource 
property from changed query for angular query editors having the 
result of loading explore URL's without datasource loaded the 
default query in query editor and Explore.

Ref #16808
2019-05-17 10:11:55 +02:00
Johannes Schill
b11eeadbd9 fix: Initial url update in Explore should replace existing url history #17030 (#17061) 2019-05-16 11:02:21 +02:00
Marcus Efraimsson
e6001f57a2
Explore: Allow switching between metrics and logs (#16959)
Adds basic support for switching between Metrics and Logs in Explore. 
Currently only test datasource that supports both Metrics and Logs.
Summary of changes:
* Moves mode (Metric, Logs) selection to the left of datasource 
picker and add some quick styling.
* Only trigger change in ToggleButton if not selected
* Set correct mode if datasource only supports logs

Closes #16808
2019-05-16 09:52:22 +02:00
Hugo Häggmark
fdd421e24c Explore: Fixes filtering in Prometheus queries when clicking in Table (#17083)
Fixes: #17071
2019-05-15 11:43:27 +02:00
Dominik Prokop
34f9b3ff2b
Explore: use @grafana/ui legend (#17027) 2019-05-14 08:46:35 +02:00
Marcus Efraimsson
01a7c1f098
chore: remove x character in explore 2019-05-13 16:33:27 +02:00
David
927e1cbd27
(feat/explore): Support for new LogQL filtering syntax (#16674)
* (feat/explore): Support for new LogQL filtering syntax

Loki is adding syntax to support chained filtering.
This PR adapts Grafana to support this.

- Send only `query` parameter in loki request
- Automatically wrap search text in simple syntax, e.g., `{} foo` is
sent as `{} |~ "foo"`.


* Adapted to regexp parameter staying on in Loki

* Dont wrap single regexp in new filter syntax

* Fix datasource test

* Fallback regexp parameter for legacy queries

* Fix search highlighting

* Make highlighting work for filter chains

* Fix datasource test
2019-05-13 09:58:26 +02:00
David
bf5b60f74a
fix(explore): Prevent double querying for Prometheus and Loki (#17004)
* fix(explore): Prevent double querying for Prometheus and Loki

- queries were triggered twice because two Enter handlers existed
- removed runner plugin from Loki and Prom query fields (runner plugin
is still being used in azure)

Part of #16995

* Set loki's mtrics capability to false

Loki is not a metrics store. Explore was using the `metrics` field in
the plugin definition to issue a second query run. But Loki shows only
one result viewer.

Fixes #16995
2019-05-13 09:55:20 +02:00
Torkel Ödegaard
e0b760e08e
Chore: No implict any fixes (#17020) 2019-05-13 09:38:19 +02:00
Marcus Efraimsson
e7930a27b5
explore: add some extra time for angular query editors to update query (#16955)
Now when loading a query editor which changes the default query in the
constructor this will result in the actual updated query is used in
explore when running the query. Without this, the query used is sort
of out of sync between query editor and executed query.
2019-05-10 14:09:07 +02:00
Hugo Häggmark
6dbaa704bc
Explore: Align Explore with Dashboards and Panels (#16823)
* Wip: Removes queryTransactions from state

* Refactor: Adds back query failures

* Refactor: Moves error parsing to datasources

* Refactor: Adds back hinting for Prometheus

* Refactor: removed commented out code

* Refactor: Adds back QueryStatus

* Refactor: Adds scanning back to Explore

* Fix: Fixes prettier error

* Fix: Makes sure there is an error

* Merge: Merges with master

* Fix: Adds safeStringifyValue to error parsing

* Fix: Fixes table result calculations

* Refactor: Adds ErrorContainer and generic error handling in Explore

* Fix: Fixes so refIds remain consistent

* Refactor: Makes it possible to return result even when there are errors

* Fix: Fixes digest issue with Angular editors

* Refactor: Adds tests for explore utils

* Refactor: Breakes current behaviour of always returning a result even if Query fails

* Fix: Fixes Prettier error

* Fix: Adds back console.log for erroneous querys

* Refactor: Changes console.log to console.error
2019-05-10 14:00:39 +02:00
Hugo Häggmark
d5a35f3631
Explore: Fixes zoom exception in Loki/Graph (#16991)
Fixes: #16986
2019-05-10 12:10:32 +02:00
Hugo Häggmark
a04b3a13e0
Explore: Removes Promise.All from runQueries thunk (#16957) 2019-05-09 12:24:48 +02:00
Hugo Häggmark
ceb9f0855b
Chore: Replaces moment with Grafanas DateTime (#16919)
* Wip: Initial commit

* Refactor: Replaces moment.utc(

* Refactor: replaces the last isMoment statements

* Refactor: Removes almost all moment imports

* Refactor: Moves moment_wrapper to grafana/ui

* Refactor: Renames momentWrapper

* Refactor: Removes one more moment import

* Refactor: Removes unitOfTime import

* Fix: Fixes Prettier error

* Refactor: Renames DateTimeType to DateTime

* Refactor: Renames isDateTimeType to isDateTime

* Refactor: Renames dateTime to dateTime

* Feature: Bans moment imports and types
2019-05-08 13:51:44 +02:00
Ryan McKinley
d881976c9d Refactor: move datemath to grafana/ui (#16890)
* move datemath to grafana/ui

* don't reference @grafana/ui from its own component
2019-05-06 12:36:42 +02:00
Marcus Efraimsson
fe20dde5db
Explore: Use SeriesData format for loki/logs (#16793)
This is the first step moving towards Explore supporting logs for 
more datasources than Loki. In the first step we move all the log 
processing from Loki into Explore.
- Make explore convert logs result returned from datasources to SeriesData, 
if needed, and for now convert SeriesData to LogsModel.
- Loki datasource query now returns SeriesData and all
processing have been moved into explore instead.
- Removed key from LogRowModel and use log row indexes as 
the unique key instead.
- Removed id from LogsModel since it looks like it's not in use.
- Introduced a new class FieldCache which is convenient to use when
looking up multiple fields and/or field types and series values.

Closes #16287
2019-04-30 18:21:22 +02:00
Marcus Efraimsson
02cb7ff436
Explore: Support user timezone (#16469)
Explore now uses the timezone of the user to decide if local browser 
time or UTC should be used. 
- Now uses TimeRange instead of RawTimeRange in explore item
state tree and only parsing actual time in a few action
handlers.
- Time picker should now properly handle moving back/forward and
apply time range when both utc and non utc time zone.
- URL range representation is changed from YYYY-MM-DD HH:mm:ss
to epoch ms.
- Now uses AbsoluteTimeRange in graph component instead of moment.
- Makes a copy of the time range passed to timeSrv to make sure immutability
of explore time range when for example elasticsearch test datasources uses
timeSrv and sets a time range of last 1 min.
- Various refactorings and cleanup.

Closes #12812
2019-04-29 18:28:41 +02:00
Torkel Ödegaard
e38762665b
UX: Improve Grafana usage for smaller screens (#16783)
* Mobile: Switch to mobile view already at md or lower breakpoint

* UX: Tweaked breakpoint so that media-breakpoint-up(md) will only apply to screens larger than normal ipad

* Updated snapshots
2019-04-26 19:16:03 +02:00
Hugo Häggmark
7b63913dc1 Explore: Adds logs highlighting in Explore on keypress (#16596)
Fixes: #16277
2019-04-16 16:27:57 +02:00
Johannes Schill
406ef962fc Explore & Dashboard: New Refresh picker (#16505)
* Added RefreshButton

* Added RefreshSelect

* Added RefreshSelectButton

* Added RefreshPicker

* Removed the magic string Paused

* Minor style changes and using Off instead of Pause

* Added HeadlessSelect

* Added HeadlessSelect story

* Added SelectButton

* Removed RefreshSelectButton

* Added TimePicker and moved ClickOutsideWrapper to ui/components

* Added TimePickerPopOver

* Added react-calendar

* Missed yarn lock file

* Added inputs to popover

* Added TimePicker and RefreshPicker to DashNav

* Moved TimePicker and RefreshPicker to app/core

* Added react-calendar to app and removed from ui/components

* Fixed PopOver onClick

* Moved everything back to ui components because of typings problems

* Exporing RefreshPicker and TimePicker

* Added Apply and inputs

* Added typings

* Added TimePickerInput and logic

* Fixed parsing of string to Moments

* Fixed range string

* Styling and connecting the calendars and inputs

* Changed Calendar styling

* Added backward forward and zoom

* Fixed responsive styles

* Moved TimePicker and RefreshPicker into app core

* Renamed menuIsOpen to isOpen

* Changed from className={} to className=""

* Moved Popover to TimePickerOptionGroup

* Renamed all PopOver to Popover

* Renamed popOver to popover and some minor refactorings

* Renamed files with git mv

* Added ButtonSelect and refactored RefreshPicker

* Refactored TimePicker to use new ButtonSelect

* Removed HeadlessSelect as suggested

* fix: Fix typings and misc errors after rebase

* wip: Enable time picker on dashboard and add tooltip

* Merge branch 'master' into hugoh/new-timepicker-and-unified-component

# Conflicts:
#	packages/grafana-ui/package.json
#	packages/grafana-ui/src/components/Input/Input.test.tsx
#	packages/grafana-ui/src/components/Input/Input.tsx
#	packages/grafana-ui/src/utils/validate.ts
#	public/app/features/dashboard/panel_editor/QueryOptions.tsx
#	yarn.lock

* fix: Snapshot update

* Move TimePicker default options into the TimePicker as statics, pass the tooltipContent down the line when wanted and wrap the button in a tooltip element

* fix: Override internal state prop if we provide one in a prop

* Updated snapshots

* Let dashnav control refreshPicker state

* feat: Add a stringToMs function

* wip: RefreshPicker

* wip: Move RefreshPicker to @grafana/ui

* wip: Move TimePicker to @grafana/ui

* wip: Remove comments

* wip: Add refreshPicker to explore

* wip: Use default intervals if the prop is missing

* wip: Nicer way of setting defaults

* fix: Control the select component

* wip: Add onMoveForward/onMoveBack

* Remove code related to the new time picker and refresh picker from dashnav

* Fix: Typings after merge

* chore: Minor fix after merge

* chore: Remove _.map usage

* chore: Moved refresh-picker logic out of the refresh picker since it will work a little differently in explore and dashboards until we have replaced the TimeSrv

* feat: Add an Interval component to @grafana/ui

* chore: Remove intervalId from redux state and move setInterval logic from ExploreToolbar to its own Interval component

* feat: Add refreshInterval to Explore's URL state

* feat: Pick up refreshInterval from url on page load

* fix: Set default refreshInterval when no value can be retained from URL

* fix: Update test initial state with refreshInterval

* fix: Handle URLs before RefreshPicker

* fix: Move RefreshInterval to url position 3 since the segments can take multiple positions

* fix: A better way of detecting urls without RefreshInterval in Explore

* chore: Some Explore typings

* fix: Attach refresh picker to interval picker

* chore: Sass fix for refresh button border radius

* fix: Remove refreshInterval from URL

* fix: Intervals now start when previous interval is finished

* fix: Use clearTimeout instead of clearInterval

* fix: Make sure there's a delay set before adding a timeout when we have slow explore queries

* wip: Add refresh picker to dashboard

* feat: Add util for removing keys with empty values

* feat: RefreshPicker in dashboards and tmp rem out old RefreshPicker

* fix: Remove the jumpy:ness in the refreshpicker

* Changed placement and made it hide when your in dashboard settings

* chore: Move logic related to refresh picker out of DashNav to its own component

* feat: Add tooltip to refreshpicker

* fix: Fix bug with refreshpicker not updating when setting to 'off'

* fix: Make it possible to override refresh intervals using the dashboard intervals

* chore: Change name of Interval to SetInterval to align with ecmascripts naming since its basically the same but declarative and async

* fix: Use default intervals when auto refresh is empty in dashboard settings

* fix: Hide time/interval picker when hidden is true on the model, such as on the home dashboard

* fix: Interval picker will have to handle location changes since timeSrv wont

* RefreshPicker: Refactoring refresh picker

* RefreshPicker: minor refactoring
2019-04-16 09:15:23 +02:00
Hugo Häggmark
7eabc282e9
Chore: Adds typings to lodash (#16590) 2019-04-15 12:11:52 +02:00
Hugo Häggmark
e5c1cbabb1
Fix: Pass missing maxDataPoints to query in Explore (#16513)
Fixes: #16490
2019-04-11 13:57:04 +02:00
Hugo Häggmark
1341f4517a
Fix: Recalculate intervals in Explore on run queries (#16510)
Fixes: #16485
2019-04-11 13:56:09 +02:00
Hugo Häggmark
a887c344eb
Fix: Disables auto open datasource picker on focus (#16398) 2019-04-09 14:59:30 +02:00
Hugo Häggmark
ed7ad8f6ac
Feat: Suggestion list in Explore is virtualized (#16342)
* Wip: virtualize suggestions list

* Refactor: Separate components to different files

* Refactor: Made TypeaheadItem a FunctionComponent using emotion

* Refactor: Use theme to calculate width instead of hardcoded values

* Refactor: Calculate list height and item size

* Style: Adds labels to emotion classes

* Refactor: Flattens CompletionItems to one list

* Chore: merge yarn.lock

* Refactor: Adds documentation popup on the side

* Refactor: Makes position of TypeaheadInfo dynamic

* Refactor: Calculations moved to separate file
2019-04-09 14:25:13 +02:00
Patrick O'Carroll
128fb8fa7e Theme: Reworking button styling (#16362)
* added new variables for height in theme, added height to gui button large, replaced add gicon with regular gicon, replaced + with gicon, changed button display to flex

* set fixed height to large button, removed xlarge button and replaced with large button

* removed button-mini and replaced with button-small, set fixed height to default button and button-small

* fixed padding for default and large button, fixed height for navbar button, fixed snapshots

* fixed padding and margin on navbar buttons

* gave special height to login btn-primary

* readded btn-mini class with same styling as btn-small and a deprecated notice

* fixed add panel widget buttons
2019-04-08 09:48:15 +02:00
Torkel Ödegaard
47e51cb6b3
Refactor: Plugin exports & data source / panel types (#16364)
* wip: began work off removing meta and pluginExports from DataSourceApi interface

* WIP: changing how plugins are exports and loaded

* Down the refactoring rabit hole that keeps expanding

* TestData now returns DataSourcePlugin

* Refactoring: fixed app config page loading, type renamings and more typings

* Refactor: Correct casing on DatasourceStatus => DataSourceStatus
2019-04-04 18:30:15 +02:00
Hugo Häggmark
988b7c4dc3
Feat: Adds reconnect for failing datasource in Explore (#16226)
* Style: made outlined buttons and used it in Alert component

* Refactor: clean up state on load data source failure

* Refactor: test data source thunk created

* Refactor: move logic to changeDatasource and call that from intialize

* Refactor: move load explore datasources to own thunk

* Refactor: move logic to updateDatasourceInstanceAction

* Tests: reducer tests

* Test(Explore): Added tests and made thunkTester async

* Fix(Explore): Fixed so that we do not render StartPage if there is no StartPage

* Fix(Explore): Missed type in merge

* Refactor: Thunktester did not fail tests on async failures and prevented queires from running on datasource failures

* Feat: Fadein error alert to prevent flickering

* Feat: Refresh labels after reconnect

* Refactor: Move useLokiForceLabels into useLokiLabels from PR comments

* Feat: adds refresh metrics to Prometheus languageprovider

* Style: removes padding for connected datasources

* Chore: remove implicit anys
2019-04-01 07:38:00 +02:00
Ryan McKinley
bfba47c6c4 Refactor: Move LogLevel and Labels utils to @grafana/ui (#16285)
* rename Tags to Labels in SeriesData

* move some logs stuff to grafana/ui

* add roundtrip tests
2019-03-29 09:41:37 +01:00
Dominik Prokop
9fd824960f
Feature: added actionable message in Explore when no datasource configured (#16252) 2019-03-28 17:17:01 +01:00
Dominik Prokop
9655eeda18
fix(explore): only show split close button when split is active (#16203) 2019-03-25 16:44:09 +01:00
Peter Holmberg
4898502e4e
refactor(grafana/ui): Replace <input />with Input component from grafana/ui (#16085)
* replace with Input component from grafana/ui

* removing placeholder classname

* change import

* fix import
2019-03-25 15:53:05 +01:00
Steven Sheehy
dd388ed578 fix(loki): Hide empty labels column
Signed-off-by: Steven Sheehy <ssheehy@firescope.com>
2019-03-25 15:23:54 +01:00
Andrej Ocenas
a978e28e7c
chore(core/utils): Add typings to datemath.ts (#16195)
* Add typings

* Remove explicit cast
2019-03-25 14:32:55 +01:00
Dominik Prokop
a8c50ed6ba
feat(explore): make it possible to close left pane of split view (#16155)
* feat(explore): make it possible to close left pane of split view

* Use action's type prop instead of enum
2019-03-25 12:49:15 +01:00
Hugo Häggmark
d563505dd3 fix: added missing event to function signature
Fixes: #16055
2019-03-25 11:23:59 +01:00
Hugo Häggmark
eedbc485dd
Makes it possible to navigate back/forward with browser buttons in Explore (#16150)
Make it possible to navigate back/forward with browser buttons in Explore
2019-03-22 15:24:30 +01:00
Torkel Ödegaard
25cd196c09
Merge pull request #16006 from grafana/fix-explore-refId
Explore: Query row using character refId instead of number
2019-03-18 22:59:47 +01:00
Steven Sheehy
ec34099ea7
Explore: Fix log stats for long labels
Signed-off-by: Steven Sheehy <ssheehy@firescope.com>
2019-03-16 00:55:10 -05:00
Steven Sheehy
fff6e0a522 feature(explore/table): Add tooltips to explore table (#16007)
Longer labels are now viewable as a tooltip in the Explore table

Signed-off-by: Steven Sheehy <ssheehy@firescope.com>
2019-03-15 14:11:40 +01:00
Peter Holmberg
cf55d68894 using refId from panel model 2019-03-14 17:20:33 +01:00
Torkel Ödegaard
9c4abc9d0c
Merge pull request #15982 from steven-sheehy/hide-duplicate-column
explore/logs: Hide empty duplicates column
2019-03-13 20:38:18 +01:00
Steven Sheehy
17184257af
explore/logs: Hide empty duplicates column
Signed-off-by: Steven Sheehy <ssheehy@firescope.com>
2019-03-13 11:12:29 -05:00
Torkel Ödegaard
d6bab53d3b
Merge pull request #15626 from grafana/davkal/15607-explore-line-colors
Explore: Make sure line graphs get different colors
2019-03-13 12:21:44 +01:00
Steven Sheehy
aa7e348694 fix(explore/logs) not collapsing whitespace (#15737)
- Set container width to 100% so column widths can be calculated properly
- Sets duplicates, level, timestamp, local time to a fixed width based upon em units since the size of these are static
- Sets labels to be 20%
- Remove min-width:80% on message column so that it now consumes remaining space
- Additionally fixes long labels from overflowing into the messages column by properly setting a max-width per label and hiding overflow

closes #15673

Signed-off-by: Steven Sheehy <ssheehy@firescope.com>
2019-03-11 15:55:11 +01:00
Dominik Prokop
a853e2c36e
Fix deduplication results displaying wrong data (#15755)
The log rows were mutated in the store, what resulted in wrong deduplication results as well as made the selector memoization quirky - for "the same results" the selector was running twice.
2019-03-11 11:48:14 +01:00
Torkel Ödegaard
73980adb17
Merge pull request #15826 from grafana/davkal/15635-vendor-ansicolor-ts
fix(renderer): Vendor ansicolor as typescript
2019-03-06 15:06:46 +01:00
David Kaltschmidt
26236b4bc3 fix(renderer): Vendor ansicolor as typescript
Fixes #15635

Importing ansicolor from node_modules or vendored as is failed because
there is no ES5 transpiler configured for ES6 libs.

- remove ansicolor from package.json
- add ansicolor to public/vendor/ansicolor and port to typescript
- adapt all ansicolor imports
- add `public/vendor` as a path to be considered by ts compiler
2019-03-06 14:22:59 +01:00
Jon Ferreira
a3da8dc673 Expose onQueryChange to angular plugins 2019-03-05 15:04:10 -05:00
David Kaltschmidt
e6a74eb1a2 Explore: Make sure line graphs get different colors
- lines for graphs from different query rows end up in different
transactions
- within each transaction the color distribution resets leading to color
overlap
- this change takes existing transaction colors into account
2019-02-24 10:01:50 -08:00
Valentin Agachi
425636ff70 Improve Loki logs render with ANSI colors (#15558)
* Improve Loki logs render with ANSI colors

* fixup! Improve Loki logs render with ANSI colors

* fixup! Improve Loki logs render with ANSI colors

* fixup! Improve Loki logs render with ANSI colors
2019-02-22 13:13:10 +01:00
Torkel Ödegaard
7d105439f9 Fixed scrollbar issue introduced in theme changes 2019-02-21 09:41:53 +01:00
Dominik Prokop
88a46e6dd4 Bump Prettier version (#15532)
* Fix prettier version to 1.16.4
2019-02-19 15:41:35 +01:00
Torkel Ödegaard
df170aee16 Updated explore icon and style tweaks
Lowered icon size and improved paddings, tried to align placement between dashboard and explore
2019-02-18 18:26:24 +01:00
Torkel Ödegaard
2d5fd7fdfd
Fixed prettier issue (#15471)
Fixed prettier CI issue that caused build failures
2019-02-16 15:45:19 +01:00
David
2c92365969
Merge pull request #15305 from avaly/feature/ansi-colors
Support ANSI colors codes in Loki logs
2019-02-14 18:01:23 +01:00
Hugo Häggmark
90d162e608 Merge with master 2019-02-12 16:47:57 +01:00
Torkel Ödegaard
8bd7e5a5f4
Merge pull request #15374 from grafana/explore/dedup-selector
Move deduplication calculation from Logs component to reselect selector
2019-02-12 14:57:06 +01:00
Dominik Prokop
dd19ec3b22 Move explore selectors to a separate file 2019-02-12 12:36:46 +01:00
Torkel Ödegaard
a79bd42414
Merge pull request #15306 from grafana/explore/dedup-strategu-url
Persist deduplication strategy in url
2019-02-11 17:12:41 +01:00
Dominik Prokop
1693f083cc Move deduplication calculation from Logs component to redux selector 2019-02-11 16:57:49 +01:00
Daniel Lee
52fe6b0316
Merge pull request #15198 from CorpGlory/azure-monitor-refactor-#15087
Azure Monitor: refactor #15087
2019-02-11 14:19:42 +01:00
Dominik Prokop
85780eb30c Remove not related code 2019-02-11 13:18:16 +01:00
Dominik Prokop
cee2e4788b Do not read store state from toggle panelaction creator 2019-02-11 12:56:37 +01:00
Dominik Prokop
14bf960b64 Merge branch 'master' into explore/dedup-strategu-url 2019-02-11 12:03:45 +01:00
Dominik Prokop
c9fbd43231 Review changes 2019-02-11 11:59:48 +01:00
Torkel Ödegaard
b780b6377a Fixed missing time axis on graph due to width not being passed 2019-02-11 11:17:23 +01:00
Torkel Ödegaard
df17f7dc45 fixed explore width-0 issue, fixes #15304 2019-02-07 18:20:16 +01:00