Giter VIP home page Giter VIP logo

grafana-timepicker-buttons's Introduction

Timepicker Buttons Panel for Grafana

license

A Grafana panel which allows you to create a list of buttons which set specific times (retrieved from a datasource) on the dashboard's timepicker when clicked.

Panel Screenshot Vertical Buttons Panel Screenshot Dropdown List Panel Screenshot Horizontal Buttons


Compatibility

This plugin works with Grafana 7.0.0 and up.

For older versions, check out the releases page.


Installation

sudo service grafana-server stop
cd /var/lib/grafana/plugins
sudo git clone https://github.com/WilliamVenner/grafana-timepicker-buttons
sudo mv grafana-timepicker-buttons williamvenner-timepickerbuttons-panel
sudo chown grafana:grafana williamvenner-timepickerbuttons-panel -R
sudo chmod 774 williamvenner-timepickerbuttons-panel -R
sudo service grafana-server start

Usage

Display Style Configuration

The timepicker can be configured to display buttons (vertically or horizontally), or as a dropdown list.


Panel Options Buttons Panel Options Dropdown List


Field Mapping

All dates and times should use UTC.

The data returned from the datasource must be formatted as a Table, not a Time Series.

The panel can be configured to map fields to the button properties:


Panel Options


The data fields returned from the datasource should be mapped with the following panel configuration settings:

Column Default Value Description
Time From Field time_from Required
A UNIX Timestamp (Number) or ISO 8601 formatted date
This will set the "From" part of the time range.
The value can include or exclude ms. Example: 1612413008000 or 1612413008
Time To Field time_to Optional
A UNIX Timestamp (Number) or ISO 8601 formatted date
This will set the "To" part of the time range.
The value can include or exclude ms. Example: 1612413008000 or 1612413008
If this is not supplied, it will default to now.
Button Text Field button_text Optional
What the text inside the button will say.
If this is not supplied, it will default to a locale-formatted timestamp.
Primary Field primary Optional
Field used to determine if the button will be marked with a star icon
Primary Value 1 Optional
A Regex pattern to perform on the Primary Field. If matched the button will be marked with a star icon.

Example Screenshot



Credit
Logo made by DinosoftLabs on www.flaticon.com

grafana-timepicker-buttons's People

Contributors

ducaale avatar jburgess avatar williamvenner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

grafana-timepicker-buttons's Issues

Use of Field Labels after Transform

Thanks for the great plugin! I was performing a query (InfluxDB) and need to apply a transform on my query before supplying it to the timepicker-buttons panel. It appears the plugin does not use the transformed fields. Is this possible with the plugin framework?

image
->
image

Not works after upgrade to 8.5.0-beta1 (2022-04-06)

The plugin does not work after upgrade to 8.5.0-beta1 (2022-04-06)
Please help, this is the only plugin in the enterprise

Environment:

  • Grafana version: 8.5.0-beta1
  • Data source type & version: MSSQL
  • OS Grafana is installed on: Windows Server 2016
  • User OS & Browser: Chrome

Compilation failed - unexpected token: keyword "const"

I'm getting the following error while trying to compile the master branch:

berger on nikos-desktop in ~/src/timepicker-buttons on  master is 📦 v1.0.0 via ⬢ v12.11.0 took 8s

✦ at [23:24:58] ➜ yarn build
yarn run v1.19.1
$ node --max-old-space-size=8192 ./node_modules/.bin/webpack --config webpack.config.prod.js
clean-webpack-plugin: /home/berger/src/timepicker-buttons2/dist has been removed.
Hash: b74a2e2513922ffd20b2
Version: webpack 4.43.0
Time: 6926ms
Built at: 06/12/2020 23:25:06
 2 assets
Entrypoint module = module.js module.js.map
 [48] external "lodash" 42 bytes {0} [built]
 [99] ./module.ts 4.53 KiB {0} [built]
[100] external "app/plugins/sdk" 42 bytes {0} [built]
[106] util (ignored) 15 bytes {0} [built]
[108] util (ignored) 15 bytes {0} [built]
[140] ./css/timepicker-btns.css 545 bytes {0} [built]
[142] ../node_modules/css-loader/dist/cjs.js??ref--5-1!./css/timepicker-btns.css 741 bytes {0} [built]
    + 137 hidden modules
ERROR in module.js from UglifyJs
Unexpected token: keyword «const» [../node_modules/apache-arrow/type.js:19,0][module.js:110,0]
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I did a bit of googling and this must be due to UglifyJS not supporting ES6.
I've tried replacing it with terser-webpack in my fork but that doesn't seem to work and the timepicker widget isn't even visible in the grafana dashboard.

Notice that I don't really know my way around JS or webpack so my workaround may as well be completely wrong.

Any pointers?

P.S. Thanks for this great project! :)

Missing panel selection?

Hi,

I'm using Grafana 6.7.3 running on Windows server 2016. I've installed the plugin as you can see from the screenshot below but when I choose the type of panel I cannot find the timepicker-button option:
photo_2020-05-05_00-28-23
photo_2020-05-05_00-28-29

Am I trying to use it in the wrong way? How do I insert a timepicker-button? (that's exactly what I need)

Plugin crashes on Grafana 7.1

Dear developers,

I'm having problems trying to make your plugin works on Grafana 7.1, is this version supported?

If it helps you here you have a screenshot from my browser debug console:
Screenshot 2020-08-13 at 15 50 54

Does not work properly with InfluxDB queries!

Hello,
I just want to query the last time values (time_from & time_to) from InfluxDB, although it returns the queried value correctly under query inspector, it is not showing on the panel display, what could be wrong here!? Moreover, if I remove the 'Order By' Clause/Command the panel displays all the times(1....1000 items)!

Error on Panel Display:
grafik

Query Inspector:
grafik

Panel Displays without Order By Query:
grafik

Please help!

Regards,
Mukara

to = from when time_to is set

Hey,

when I set a time_to the to is set to the same value as from. The values offered by the query are different (seen in Query Inspector).

I can't really determine why. Can you help?

Tested with Grafana 7.0.3 and 7.2.1 with Timepicker-Buttons 2.0.0.

Thank you in advance!

Request for a longer tutorial

I am fairly new to Grafana. I know how to make dashboards and add panels, but the README leaves out a lot of setup details for this plugin. Here is a list of questions I have.

  • I only have InfluxDB installed. Do I need to install MySQL like you showed in your pictures
  • What information does the MySQL database need to contain for this plugin to work?
  • You showed yourself setting the "button_text" and "time_from" in your database queries. Do I need to have that information also in the database? Or do you just make a query to an empty database and provide all the information in the grafana query?

Dropdown list feature available?

Dear,

I recently implement this plugin and I love it !
My (future) users are non-technical and grafana standard time range chooser is too complex.
I am now able to let them choose (in native language !) their time range in my predifined choices.
Thansk a lot.

I would like to suggest an enhancement. Let me know if it is possible:
I have a dashboard and analysis is weekly based. Today I am using buttons so the user can select the week they want to analyse.
However, There can be 52 choices in the future so would be great to be able to propose a scrolldown list instead of individual buttons.

Best Regards,
Antoine

Custom sorting of the buttons

I am using the date time picker plugin with Influx 2.0 as the data source which works fine but i have not found a way to control the order of the buttons or the content of the dropdown. I already tried to add sorting to the flux query without success so an option to have the button sorted on eithr

  • button texy asc/desc
  • time from asc/desc
  • time to asc/desc

would be very usefull.

Examples of my button text
PI 20-1
PI 20-1
...
PI 21-4

This is the order in which the buttons / dropdown are shown but the majority of the users needs the last value (this is also the primary values) and need to scroll down every time they open the dashboard

Nop option on 7.03 and 7.4

Hi I currently testing the panel for my use case but it seems that for some reason the panel is not displaying the options to configure it.
The panel version I got is version 2.0.1.
I created a panel with the last 10 date ranges I need to use to update my dashboard but it seems it only creates one button at the time I would like to confirm if that is the expected behavior or is it a bug related to what I'm reporting.

Dynamic date

Hello

I would like to configure myself three buttons with a time range for three working shifts, e.g.

1 Shift from 06:00 to 14:00
2 Shift from 14:00 to 22:00
3 Shift from 22:00 to 06:00

But the date had to be dynamic, always the current day, is it possible to add such functionality or maybe it can be done now in the current plugin version, if so, if not, is it possible at all?

Highlight Button(s) Based on Selected Time

Once a button is clicked it is hard to recall which button was selected after the button loses focus.

@WilliamVenner what are your thoughts on adding a feature to highlight or change a button or list item's appearance based on the selected time?

I can see this being implemented a few different ways:

  1. Highlight a button/item if the item's range overlaps the currently selected time (this overlap could be to and from or to or from). This best matches my use case and allows the user to see all items which are contained in the selected range. However, this may be confusing if there are buttons with overlapping times.
  2. Highlight the item if the item's to/from equals the selected time range to/from.
  3. Highlight the button/item after it is selected until the time range changes. This seems fragile.

timepicker time is not same as actual time in database

hello, i have an issue about timepicker. this is the data that i uploaded in grafana in table form
Screenshot 2024-04-04 113916
And this is the timepicker panel that shows the time.
Screenshot 2024-04-04 113926
as you see, the timepicker panel shows date and time that is not same as data in table form. can you give me a guide to solve that problem?

Custom time range

I found your approach very intereseting and would be even better :) if possible to add below time frames. It is more less feature request, is it possible to set buttons the way I describe below ?

This would be very helpful and many users would benefit from that, that was the initial request from Custom Time ranges to the time picker drop down

Yesterday: all shifts
yesterday from 06:00 to today 06:00

Yesterday: 1st shift =
yesterday from 06:00 to 14:00

Today: 1st shift
today from 06:00 to 14:00

etc.

Default value before selection ?

Hi,

I am very happy about this plugin but have a question:

  • Is-it possible to define the value by default before the user choose something in the dropdown ?

My use case is:
I use a grafana dashboard to display information and analysis based on regular week (from monday to sunday).
I use the plugin so the user can easily select the week of analysis
I would like that the last week will be automatically displayed

Today I have to to select the last week value and I save this value in the dashboard but i have to do this step manually every week. Not feasible anymore.

Would be great if we could define (or have another way) to select automatically the "default selected / current" value in the table.
I would for example add a column default value. It would be easy to update the value of this column that would have an impact on all the grafana dashboard every week automatically.

Let me know if you have any advice or remark,
Antoine

Put list on the "front" when viewing on smartphone

Dear,

I integrate the timepicker in list mode and I love this feature !
On my computer, no problem to select the right option.
But when viewing on a smartphone, the list is like on background and I can not scroll on the list itself.
When I try to scoll, it scroll on the page itself, not on the list.

Is-it possible to modify something to be correctly displayed on mobile?

Best Regards,
Antoine

backgroung_list
list_foregroung_computer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.