* Loki, Prometheus: Fix syntax to not highlight # in quotes as a comment in queryField
* Loki, Prometheus: Fix syntax to not highlight # in quotes as a comment in queryField
* Fix regex
* PromQL, LogQL: Update syntax
* LogQL, PromQL highlighting: Add tests
* Annotations: Makes various annotation and alert calls cancelable
Fixes#21943
* Refactor: Uses backendSrv.get method with requestId instead
* Update public/app/features/annotations/annotations_srv.ts
Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* Make $__range more precise in Prometheus
It is now always equivalent to `${__range_s}s`, rather than rounding
down to an integer multiple of the biggest possible unit. For example,
a range of 47 hours is now represented as `169200s` rather than `1d`.
Closes#21689.
* Update a unit test to match new __range calc
* Move data links suggestions to grafana-data
* Data links - field config and overrides
* Lint
* Fix test
* Add variable suggestions to field override context
* Revert "Move data links suggestions to grafana-data"
This reverts commit 5d8d01a65e.
* Move FieldConfigEditor to core
* Assure base url when single stat, panel and data links are built
* Update public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderCorner.tsx
* Update public/app/features/panel/panellinks/link_srv.ts
* Update public/app/features/panel/panellinks/link_srv.ts
* Update public/app/features/panel/panellinks/link_srv.ts
* Update public/app/features/panel/panellinks/link_srv.ts
* Review updates
* Remove unnecessary code
* Add title editor
* Wip
* FIeld config overrides UI (v1)
* Basic property override editors
* name to prop
* use prop not path
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* WIP: Angular panel chrome, this is going to be tricky
* AngularPanelChrome: initial render works
* Options are showing up
* viz options working
* Fixed singlestat background
* AngularPanels: Fixed alert tab
* Removed anuglar loading spinner
* Dashboard: Refactor dashboard reducer & actions
* Dashboard: minor refactoring
* PanelChrome: loading state moved to header
* Subscribe to render events to solve title update issue
* Time info and query errors now works
* PanelHeader: unifying angular and react behavior
* added getPanelMenu test
* Scrollable now works again
* Various fixes
* Making stuff work
* seperate event emitter for angular
* Fixed issue sending updated dimensions to angular panel
* Minor tweaks
* Fixed tests
* Alerting: alert state now works
* Fixed unit tests
* Fixed a few null check errors
* Simplified events handling
* Fixed strict null checks
* initial POC
* fix import
* field config editor in the sidebar
* field config editor in the sidebar
* field config editor in the sidebar
* sidebar
* include threshold in sidebar
* include threshold in sidebar
* include threshold in sidebar
* init to empty threshold
* merge
* Make sure editor is fully rendered when page is refreshed
* use scrollbars
* add matcher UI folder
* remove
* Field options basic editors
* Removed deebugger
* Make number field editor controlled
* Update public/app/features/dashboard/state/PanelModel.ts
* Update public/app/plugins/panel/gauge/GaugePanel.tsx
* Ready for production
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* 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
* First attempt
* Save confirmation with discard option, reusing queriess a little bit differently
* simplify cloning panels and restoring last results in panel query runner
* Remove save button
* Update public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx
* Exit/discard buttons
* Update snaps
* Review comments
* Fix lint
* 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
* DatasourceEditor: Add UI to edit custom HTTP headers
Support for custom headers was added in #11643 but was missing in the UI.
Fixes#12779
* Review
* Layout updates
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Add new global built-in variables #20523
new branch from master
* #20523 Revert change on __from and __to like requested
* #20523 simplify contextSrv access
* #20523 simplify contextSrv access
* #20523 repair jest tests
* Applied prettier to relevant webpack configs
* Replaced ng-annotate with babel-plugin-angularjs-annotate
… and replaced ts-loader with @preset/typescript
* Removed redundant import
… that is problematic with Babel's module resolver
* Updated lockfile
* Traspile debug package to es5 for PhantomJS support
* Update babel to latest version
* Remove @babel/poolyfill and url search params polyfill
* Add ts-loader to grafana-ui dependencies
* Update prod webpack build to use cor-js 3
* Applied prettier to relevant webpack configs
* Replaced ng-annotate with babel-plugin-angularjs-annotate
… and replaced ts-loader with @preset/typescript
* Updated lockfile
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* add error tab
* conditional tabs
* feedback from review
* expose lastResult via function
* remove todo and weird char
* fixing overflow states and height of tabcontent
* style fixes
* more changes to scroll handling
* fixing null checks
* Change drawer content padding
* Add scroll in the story
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Fixed issue where gauge throw error on empty result.
* Some refactorings to improve the code.
* Added some tests to make sure this doesn't happen again.
* BackendSrv: Adds status, headers, statusText, redirect, type and url back to response
Fixes#21662
* BackendSrv: Adds request object back to datasourceRequest response
Fixes#21662
In 043bb59 a URLSearchParams usage was introduced which is not supported by PhantomJS. @babel/polyfill(deprecated) does not contain polyfill for URLSearchParams, hence the code (and Prometheus graphs rendering) was failing in PhantomJS environment.
The solution is to add https://www.npmjs.com/package/url-search-params-polyfill that takes care of the URLSearchParams
* Create basic react page for AdminUserCreate
* Forms.Field - render asterisk when field is marked as required
* Add validation to user create form wih react-hook-form
* Remove Angular code for UserCreatePage
* Remove commented route for admin settings
* Remove unused import
* Hide react-hooks-form behind Form component
* Fix webkit autofill
* Webkit autofill on inpiuts - bring back focus shadow
* Temporarily fix story (before 21635 is merged)
* Form: docs and minor updates to new form elements (#21635)
* Allow Switch, checkbox to be uncontrolled, forward refs, styles update
* Add Form docs
* User create page update
* Remove unused import
* Apply review notes
* Docs: Whats new updates
* Add cloudwatch and stackdriver paragraphs
* Minor changes
* Add link helper to render gif
* Docs: what's new updates
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
* Chore: Remove angular dependency from backendSrv
* Refactor: Naive soultion for logging out unauthorized users
* Refactor: Restructures to different streams
* Refactor: Restructures datasourceRequest
* Refactor: Flipped back if statement
* Refactor: Extracted getFromFetchStream
* Refactor: Extracts toFailureStream operation
* Refactor: Fixes issue when options.params contains arrays
* Refactor: Fixes broken test (but we need a lot more)
* Refactor: Adds explaining comments
* Refactor: Adds latest RxJs version so cancellations work
* Refactor: Cleans up the takeUntil code
* Refactor: Adds tests for request function
* Refactor: Separates into smaller functions
* Refactor: Adds last error tests
* Started to changed so we require getBackendSrv from the @grafana-runtime when applicable.
* Using the getBackendSrv from @grafana/runtime.
* Changed so we use the getBackendSrv from the @grafana-runtime when possible.
* Fixed so Server Admin -> Orgs works again.
* Removed unused dependency.
* Fixed digest issues on the Server Admin -> Users page.
* Fix: Fixes digest problems in Playlists
* Fix: Fixes digest issues in VersionHistory
* Tests: Fixes broken tests
* Fix: Fixes digest issues in Alerting => Notification channels
* Fixed digest issues on the Intive page.
* Fixed so we run digest after password reset email sent.
* Fixed digest issue when trying to sign up account.
* Fixed so the Server Admin -> Edit Org works with backendSrv
* Fixed so Server Admin -> Users works with backend srv.
* Fixed digest issues in Server Admin -> Orgs
* Fix: Fixes digest issues in DashList plugin
* Fixed digest issues on Server Admin -> users.
* Fix: Fixes digest issues with Snapshots
* Fixed digest issue when deleting a user.
* Fix: Fixes digest issues with dashLink
* Chore: Changes RxJs version to 6.5.4 which includes the same cancellation fix
* Fix: Fixes digest issue when toggling folder in manage dashboards
* Fix: Fixes bug in executeInOrder
* Fix: Fixes digest issue with CreateFolderCtrl and FolderDashboardsCtrl
* Fix: Fixes tslint error in test
* Refactor: Changes default behaviour for emitted messages as before migration
* Fix: Fixes various digest issues when saving, starring or deleting dashboards
* Fix: Fixes digest issues with FolderPickerCtrl
* Fixed digest issue.
* Fixed digest issues.
* Fixed issues with angular digest.
* Removed the this.digest pattern.
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
Co-authored-by: Marcus Andersson <systemvetaren@gmail.com>
* Calculate min period based on time range and no of queries
* Use hardcoded array of periods if period is not defined actively by the user
* Fix broken tests
* Use a smaller max period for auto interval
* Fix broken tests
* Test period calculation
* Test min retention period
* Fix broken test
* Rewrite angular segments for filter and group by in react
* wip: refactoring
* Update metric find queries
* Remove old maps used to create labels - use one map for all types instead
* Use value as label (again) for filters ang groupby
* Remove old filter
* Remove not used code
* Fixes after pr feedback
* Fix broken tests and add new metadata tests
* Add index file to make imports cleaner
* Cleanup. Remove old angular filter code
* Fix broken tests
* Use type switching instead of if statements
* Use globals for regex
* Updates after pr feedback
* Make sure it's possible to filter using the same key multiple times
* Replace metric select with segment component
* Pass template vars as props
* Refactor meta labels code
* Reorder template variables
* Fix broken tests
* Reset metric value when changing service
* Fix lint issue.
* Make tests independant of element order
* Include kubernetes.io in regex
* Add instruction in help section
* Rename old cascader
* Change name of old cascader
* Add basic cascader without search
* Add basic cascader without search
* Flatten options to make it searchable
* Add regex search and make backspace work
* Add barebone search without styles
* Add SearchResult list
* Add search navigation
* Rewrite of cascader and add some things to SelectBase
* Make SelectBase controlllable
* Cleanup
* Add initial value functionality
* Add onblur to hand caret direction
* New storyboom format for ButtonCascader
* Add knobs to story
* Add story and docs for UnitPicker
* Make UnitPicker use Cascader
* Fix backspace issue and empty value
* Fix backspace issue for real
* Remove unused code
* Fix focus issue
* Change children to items and remove ButtonCascaderProps
* Remove local CascaderOption
* Fix failed test
* Revert UnitPicker changes and change format for ButtonCascader
* Fix failing tests
* 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
* wip: react rewrite
* Cleanup
* Break out non annontations specific fields
* Cleanup. Make annontations editor a functional component
* Remove redundant classnames
* Add paneldata to props
* Cleanup
* Fix rebase merge problem
* Updates after pr feedback
* Fix conflict with master
* Fixed so when clicking a plot on a touch device we won't display the annotation context menue.
* Refactorings after feedback.
* changed to standard-ish comment.
* add common backend
* use const for range
* likely not differnt
* send the right orgId
* Add DataSourceWithBackend to @grafana/runtime mock in root reducer test
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* add min_interval_seconds setting to alerting config
It will let operator enforce a minimum time for the scheduler to enqueue evaluations
* Introduce UI modifications
* Update docs
Co-authored-by: Martin <uepoch@users.noreply.github.com>
* refactoring BigValue layout to use polymorphism
* Renamed file
* StatPanel: Fixed min & max handling, white theme background
* Typescript and test fixes
* Fixed justify center logic
* Updated test dashboard
* Updated test dashboard
* Adjust time xMax to align with last data point if it's close
* Fixed color issue
* removed text shadow
* Removed unused stuff
* Fixed auto min max
* Fixed strict typescript issues
* Updated
* remove anon funcs, removed options from state, removed update method, static selects as constants
* cancellable promise
* cancel promise on unmount
* use new datasource funcs for dryer component
* event handler funcs
* updated funcs and moved to utils, updating config editors
* S has no keys. never will never work
* remove report json
* update azure snapshot
* DataSourceSettings keyof
* rename reset funcs