MasterZydra / goDashing

Build beautiful dashboards (dashing.io port) and is easy to setup.
MIT License
2 stars 0 forks source link
dashboard dashing go

Go

GoDashing

Contentlist

Links

GoDashing is a fork of vjeantet/goDashing. It is a Golang based port of the original project shopify/dashing and gigablah/dashing-go that lets you build beautiful dashboards. This dashing project was created at Shopify for displaying custom dashboards on TVs around the office.

> ./goDashing_darwin_amd64

 ..|'''|.          '||''|.                ||      ||
.|'     '    ...    ||   ||   ....   ...  || ..   ..  . ...   ...
||    .... .|  '|.  ||    || '' .|| ||. ' ||' ||  ||  ||  || || ||
'|.    ||  ||   ||  ||    || .|' ||   '|. ||  ||  ||  ||  ||  |''
 ''|...|'   '|..|' .||...|'  '|..|' '..|' ||  ||  ||  ||  || '||||.
                                                             .|....'

------------------------------------------------------------
                       Startup
------------------------------------------------------------
2021/07/28 00:03:59 Check for asset folder 'dashboards'
2021/07/28 00:03:59 Extract asset folder 'dashboards'
...

Listen on http://localhost:8080

------------------------------------------------------------
                      Running
------------------------------------------------------------
2021/07/28 00:03:59 ExecJob - 1_water_main_city.php - scheduled every 1s
2021/07/28 00:03:59 ExecJob - 2_valuation.php - scheduled every 2s
...

example dashbaord

Key features

Dependencies

For running the jobs successfully your system must have PHP installed.

Getting started

  1. Get the app here https://github.com/Hein-Software-Solutions/goDashing/releases
  2. Start goDashing $ ./goDashing
  3. Go to http://127.0.0.1:8080

Note on macOS
macOS requires to add the application to the Gatekeeper Approval. This can be done with the terminal:
spctl --add /Path/To/Application.app
For more Details please visit OSXDaily.com

Settings

Environment variables

The value of the environment variables overwrites the values given by the flags. The variable names are:

On Linux this can be done with the command export. E.g. export PORT=8081.

Flags

The executable can be called with a few flags. To see all flags call the application with the flag -help.

> ./goDashing -help
Usage of ./goDashing:
  -debugmode
        Debug mode for extended informations
  -log2file
        Save log output into a file
  -port int
        Port the server is listening on (default 8080)
  -webroot string
        root path for webserver

The debugmode can be enabled with -debugmode=true or using the developer console.

Dashing API

The dashing API can be used to send data to the widgets:

curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "text": "Hey, Look what I can do!" } http://YOUR_IP:YOUR_PORT/widgets/YOUR_WIDGET_ID

For example:

curl -d '{ "auth_token": "", "text": "Hey, Look what I can do!" }' http://localhost:8080/widgets/welcome

Developer informations

Developer console

The developer console can be used by typing in the terminal window. This can be used to change settings for example the debug mode at run time.

By typing some invalid input or 'help' the manual will be displayed:

----------------------------------
Developer console
-----------------
Commands:
- debugmode:
  debugmode          // Show the current state
  debugmode=true     // Enable debug mode
  debugmode=false    // Disable debug mode
----------------------------------

Setting up the project

  1. Download the source code
  2. Download all dependencies:
    go mod vendor
  3. Install packr for building the project:
    go get github.com/gobuffalo/packr/packr

Build the project

To build the project in the terminal run the command
> packr build -o ./goDashing ./cmd/godashing/....
Packr is a package used for including the necessary files into the binary itself.

To build a version for every operating system the script release can be executed. The binaries will be saved in the folder release.
> ./release.sh

Add your own widgets

To add a custom widget add the folder with the widget name in the widgets folder. All the files in the folder must have the same name as the folder with the supported file extensions.
The following file extensions will be delivered by goDashing: .css, .html, .js goDashing will use them as soon as you add a widget in the gerb file of a dashboard with a data-view="<YourWidgetName>"

Important hint: Widget names are case sensitive!

A list of third party widgets for the original Shopify dashing is linked here.
Some porting is required. Helpful converters are listed in the section Helpful converters.

If you have successfully ported a widget or created a new widget, please consider to create a pull request to add it to the default widgets.

Helpful converters

Used dependencies

JavaScript
https://github.com/chartjs/Chart.js
https://github.com/es-shims
https://jquery.com/download/
https://github.com/aterrien/jQuery-Knob
https://github.com/dsmorse/gridster.js
https://d3js.org
https://github.com/shutterstock/rickshaw
https://batmanjs.org


TODO

Create a new dashboard

create a name_here.gerb file in the dashboards folder

Customize layout

Feed data to your dashboard

jobs folder usage

When you place a file in jobs folder Then goDashing will immediatly execute and schedule it according to this convention : NUMBEROFSECONDS_WIDGETID.ext

The output of the executed file should be a json representing the data to send to your widget, see examples in jobs folder.

2 cli arguments are provided to each executed file

  1. The url of the current running goDashing
  2. the token of the current running goDashing API
  3. You can use this if you want to send data to multiple widgets. (see example)

    JIRA Jql and filters

    Edit your .gerb dashboard to add jira attributes to your widget :

You don't need to restart goDashing when editing gerb files to take changes into account.

jira configuration

create a conf/jiraissuecount.ini file in goDashing working directory.

url = "https://jira.atlassian.com/"
username = "" #if empty jira will be used anonymously
password =  ""
interval = 30