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
...
For running the jobs successfully your system must have PHP
installed.
$ ./goDashing
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
The value of the environment variables overwrites the values given by the flags. The variable names are:
PORT
- Port the server is listening on (default 8080)WEBROOT
- Root path for the webserverTOKEN
- Token for the API (default is empty)On Linux this can be done with the command export
. E.g. export PORT=8081
.
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.
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
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
----------------------------------
go mod vendor
go get github.com/gobuffalo/packr/packr
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
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.
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
create a name_here.gerb file in the dashboards
folder
dashboards/subfolder/dashboard1.gerb
will be available to http://127.0.0.1:8080/subfolder/dashboard1. dashboards/layout.gerb
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
You can use this if you want to send data to multiple widgets. (see example)
Edit your .gerb dashboard to add jira attributes to your widget :
jira-count-filter='17531'
- goDashing will search jiras with this filter and feed the widget with issues count.jira-count-jql='resolution is EMPTY'
- goDashing will search jiras with this JQL and feed the widget with issues count.jira-warning-over='10'
- widget status will pass to warning when there is more dans 10 issuesjira-danger-over='20'
- widget status will pass to danger when there is more dans 20 issuesYou don't need to restart goDashing when editing gerb files to take changes into account.
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