Commit Graph

38 Commits

Author SHA1 Message Date
Agnès Toulet
8d68159b52
Public Dashboards: Disable email-sharing when there is no license (#80887)
* PublicDashboards: Disable email-shared dashboards when feature is disabled

* fix pubdash creation when it was email-shared

* add feature name const in OSS

* update doc

* Update service.go

* fix test & linter

* fix test

* Update query_test.go

* update tests

* fix imports

* fix doc linter issues

* Update docs/sources/administration/enterprise-licensing/_index.md

* fix after merge
2024-02-22 09:34:14 +01:00
Lucy Chen
a29e1ee6a6
Task: Improve public dashboard config url formatting (#79424)
* Update publicdashboard config url

* add slug to sessiondashboard

* swagger doc update
2023-12-14 14:35:17 -05:00
Lucy Chen
8833f360ec
PublicDashboards: Accept AccessToken for pubdash creation (#74134)
* Add Access token input

* add unit tests to access token

* if else logic to not call find on empty string

* update var naming
2023-09-01 10:21:54 -04:00
Lucy Chen
a39d1e278e
PublicDashboards: Accept uid to pubdash creation (#73956)
* accept uid to pubdash creation

* add accesstoken back

* add uid validation unit tests

* unit test for create pubdash with uid

* update err declaration

* remove white space

* add comment

* remove trailing spaces

* remove space

* suggested changes
2023-08-29 17:25:07 -04:00
Marcus Efraimsson
040b7d2571
Chore: Add errutils helpers (#73577)
Add helpers for the errutil package in favor of errutil.NewBase.
2023-08-22 12:52:24 +02:00
Ezequiel Victorero
b39c62efbf
PublicDashboards: Remove timeSettings from API (#70931) 2023-06-29 18:28:30 -03:00
Ezequiel Victorero
75a81e5b9f
PublicDashboards: Remove non updatable fields from DTO (#70871) 2023-06-29 14:35:23 -03:00
Juan Cabanas
ee73d41d24
PublicDashboards: Audit table pagination (#69823) 2023-06-21 10:48:09 -03:00
Ezequiel Victorero
fc374f93a3
PublicDashboards: Support timezone on query API (#68560) 2023-06-14 17:35:01 -03:00
Juan Cabanas
9890ff7c92
PublicDashboards: Audit table redesign (#68137) 2023-05-29 12:59:29 -03:00
Ezequiel Victorero
3224b4c8f0
PublicDashboards: validate only one public dashboard per dashboard (#66228) 2023-04-12 10:57:42 -03:00
juanicabanas
92e591d2e1
PublicDashboards: metrics collected in background service (#65836) 2023-04-11 14:36:50 -03:00
juanicabanas
c59682fad6
PublicDashboards: Paused or deleted public dashboard screen (#63970) 2023-03-03 10:12:29 -03:00
Ezequiel Victorero
4cc0399ee5
PublicDashboards: add recipient uid to recipient list (#63982) 2023-03-02 15:20:24 -03:00
Ezequiel Victorero
8520a8614c
PublicDashboards: add recipients to the public dashboards retrieval (#63149) 2023-02-10 15:01:26 -03:00
Ezequiel Victorero
c19f156a96
PublicDashboards: use share type (#63059) 2023-02-09 15:44:09 -03:00
Michael Mandrus
7391793504
Query Caching: Add per-panel query caching TTL (#61968)
* *Create Caching Config interface and OSS impl
*Create front-end facing DS Cache config
*Populate Caching Config on Datasource DTO
*Update OSS wire deps

* fix unit test

* handle query caching TTL override on the frontend

* Make sure the override works with pubdash

* move caching config to the right place in the ds info

* move caching config logic to enterprise index hook

* move queryCachingTTL to pubdash query payload

* Remove  from metadata (not needed)

* rename struct and add comment

* remove invalid wire dependency

* manual revert of 395c74b

* fix frontend test

* fix backend test

* fix tests for real this time

* truly fix frontend test

* fix back end unit test for real
2023-02-02 23:39:54 -05:00
owensmallwood
dd597c3a1e
PublicDashboards: Adds middleware for email sharing (#61950)
adds Share field to PublicDashboard model
2023-01-24 18:23:39 -06:00
idafurjes
7c2522c477
Chore: Move dashboard models to dashboard pkg (#61458)
* Copy dashboard models to dashboard pkg

* Use some models from current pkg instead of models

* Adjust api pkg

* Adjust pkg services

* Fix lint
2023-01-16 16:33:55 +01:00
Ezequiel Victorero
8d5b19bc61
PublicDashboards: support time range selection on the backend (#60203) 2022-12-15 10:44:33 -03:00
Ezequiel Victorero
c6cf774ac5
PublicDashboards: add time picker enabled column (#59324) 2022-12-01 11:37:08 -03:00
sam boyer
07e5f8117f
Reconcile coremodels, entities, objects under new kind framework (#56492)
* Update thema to latest

* Deal with s/Library/*Runtime/

* Commit new, working results of codegen

* We like pointers now

* Always take runtime arg for NewBase()

* Sketchy handwavy pass at entity meta framework

* Little nibbles

* Update pkg/framework/coremodel/entityframework.cue

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>

* Move file into new framework location

* Introduce loaders, Go code

* Complete rename to kind

* Flesh out framework, add svg/dashboard examples

* Cruft removal

* Remove generated kind go files from gitignore

* Refine maturity concept, add SlotKind

* Update embed and go deps

* Export PrefixWithGrafanaCUE

* Make the loader actually work, holy crap

* Many small tweaks to type.cue

* Add Apache 2 licensing exceptions for kinds

* Add new kinds dir, start of generator

* Roll back to earlier oapi-codegen

* Introduce new grafana-specific CUE loaders

* Introduce new tidy code generators framework

* Catch up kind framework with tinkering

* Add slices for the generators

* Add write/verify step to main generator

* Many renames

* Split up kind framework cue files

* Use kind.Decl within generated kinds

* Create kind.SomeDecl wrapper type to cache lineages

* Better names again

* Get one generated implemented, hopefully

* Copy dashboard schema into new kind.cue

* Small fixes to make the initial gen work

* Put svg kind in its new home

* Add generated Go dashboard type

* More renames and cleanups

* Add base kind registry and generator

* Stop blacklisting *_gen.go files

This is not the Go best practice, anyway. All we actually want to ignore
for enterprise is generated wire files.

* Change codegen output directories

pkg/kind -> pkg/kinds
pkg/registry/kindreg -> pkg/registry/corekind

* Rename pkg/framework/kind to pkg/kindsys

* Add core structured kind generator

* Add plural and machine names to kind spec

* Copy playlist over to kind system

* Consolidate kindsys files

* Add raw kind generator

* Update CODEOWNERS for kind framework

* Touch up comments a bit

* More docs tweaks

* Remove generated types to reduce noise for review

* Split each generator into its own file

* Rename Slot kind to Composable kind

* Add handwavy types for customkind loading

* Guard against init calls to framework loader

* First pass at doc on extending the kind system

* Improve attribute example in docs

* Fix wire imports

* Add basic TS types generator

* Fix composable kind category def

* No need for a separate file with generate directive

* Catch dashboard schema up

* Rename generator types to something saner and generic

* Make version configurable in ts/go generators

* Add CommonMeta to ease property access

* Add kindsys prop indicating whether lineage is group

* Put all kind categories back in a single file

* Finish with kindsys group props

* Refactor maturity progression per discussion

- Replace "committed" with "merged"
- All kindcats can use all maturity levels, at least for now

* Convert ts veneer index generator to modular system

* Move over to new jennywrites framework

* Strip down old coremodel generator

* Use public version of jennywrites

* Pull latest thema

* Commit generated Go types

* Add header injection postprocessor

* Move sdboyer/jennywrites to grafana/codejen

* Tweak header output

* Remove dashboard and playlist coremodels

* Fix up backend dashboards devenv test

* Fix TS import patterns to new gen filename

* Update internal imports, remove coremodel registry

* Fix compilation errors, wire generation

* Export and replace the prefix dropper

* More Go struct and field name changes

* Last name fixes, hopefully

* Fix lint errors

* Last lint error

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
2022-11-10 12:36:40 -08:00
Ezequiel Victorero
ae30a0688a
PublicDashboards: refactor using new grafana error types (#58078) 2022-11-04 14:14:32 -03:00
Jeff Levin
bf672f960a
public dashboards: rename api functions (#57789)
This PR imposes better naming conventions on public dashboards api

* rename api functions and remove use of _config_ noun

* fix tests

Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
2022-10-27 17:08:11 -08:00
Michael Mandrus
5879805e4b
PublicDashboards: Fix unsafe code snippets (#57641)
* return an error if we can't extract queries from a panel

* check for null or undefined
2022-10-25 20:16:10 -04:00
owensmallwood
0b8fb543fc
Public Dashboards: Can toggle annotations in modal (#57312)
adds toggle for pubdash annotations
2022-10-21 13:42:14 -06:00
owensmallwood
b2408dd7c5
Publicdasboards: Add annotations support (#56413)
adds annotations support for public dashboards
2022-10-18 19:48:20 -06:00
juanicabanas
75a5777e36
PublicDashboards: Validate access token not to be duplicated and add retries. (#56755)
PublicDashboards: Validate access token not to be duplicated and add retries.
2022-10-13 11:32:32 -03:00
Jeff Levin
cc27214dca
Public Dashboards: Add audit table (#54508)
This PR adds an audit table for public dashboards allowing a user to view all public dashboards on an instance of grafana. The public dashboards team is working on a proposal for adding RBAC support to the audit table for 9.3

Co-authored-by: juanicabanas <juan.cabanas@grafana.com>
2022-10-12 21:36:05 -08:00
owensmallwood
664aa795c1
PublicDashboards: Add metric for public dashboard datasource query success (#55701)
Adds metric for which datasource queries are successful or not with pubdash.
2022-09-27 12:25:56 -06:00
owensmallwood
e37420f0a8
PublicDashboards: Log api layer errors and which datasources fail/succeed (#55056)
Adds pubdash api error logging and logs array of datasource names with success status when running pubdash queries.
2022-09-14 13:19:21 -06:00
Guilherme Caulada
b06eaf66b6
Public Dashboards: Replace simplejson with TimeSettings on dashboard struct (#55047)
* Replace simplejson for TimeSettings on PublicDashboard struct

* Implement xorm conversion interface to TimeSettings

* Fix minor test assertion issue
2022-09-13 13:33:41 -03:00
Emil Tullstedt
b287047052
Chore: Upgrade Go to 1.19.1 (#54902)
* WIP

* Set public_suffix to a pre Ruby 2.6 version

* we don't need to install python

* Stretch->Buster

* Bump versions in lib.star

* Manually update linter

Sort of messy, but the .mod-file need to contain all dependencies that
use 1.16+ features, otherwise they're assumed to be compiled with
-lang=go1.16 and cannot access generics et al.

Bingo doesn't seem to understand that, but it's possible to manually
update things to get Bingo happy.

* undo reformatting

* Various lint improvements

* More from the linter

* goimports -w ./pkg/

* Disable gocritic

* Add/modify linter exceptions

* lint + flatten nested list

Go 1.19 doesn't support nested lists, and there wasn't an obvious workaround.
https://go.dev/doc/comment#lists
2022-09-12 12:03:49 +02:00
owensmallwood
108678a8cc
Public Dashboards: Only use queries from dashboard for caching (#54596)
Don't accept frontend queries for query caching when its from a public dashboard. Use queries on the dashboard instead.
2022-09-07 12:08:52 -06:00
Ezequiel Victorero
722aca5c53
Public Dashboards: use intervalMs and maxDataPoints from request (#53613) 2022-08-29 18:13:06 -03:00
Jeff Levin
6128cb60b4
cleanup unused fields (#54115)
This PR removes unused struct fields in SavePublicDashboardCommand
2022-08-24 21:29:01 -04:00
owensmallwood
cf86c696e0
Public Dashboards: Adds template variable validation for pubdash on the backend (#52566)
Validates template variables for pubdash on the backend when saving a public dashboard
2022-07-21 13:56:20 -06:00
Jeff Levin
eacee08135
public dashboards: move into into its own service (#51358)
This PR moves public dashboards into its own self contained service including API, Service, Database, and Models. Routes are mounted on the Grafana HTTPServer by the API service at injection time with wire.go. The main  route that loads the frontend for public dashboards is still handled by the API package.

Co-authored-by: Jesse Weaver <jesse.weaver@grafana.com>
Co-authored-by: Owen Smallwood <owen.smallwood@grafana.com>
2022-07-06 17:51:44 -06:00