Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #194

Open
wants to merge 189 commits into
base: master
Choose a base branch
from
Open

Dev #194

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
38dbf46
initial commit
chavee May 30, 2016
ba9fd60
Update README.md
chavee May 30, 2016
fc99a15
rearrange config order, add some description
chavee May 30, 2016
e13e21b
handle netpie datasource configuration update
chavee May 30, 2016
291c770
Create README.th.md
chavee May 30, 2016
972d034
Update README.md
chavee May 30, 2016
1617c98
Update README.th.md
chavee May 30, 2016
a1ec8f3
save localstorage
anunpanya Jun 3, 2016
224ba32
add netpie logo
chavee Jun 3, 2016
23ae92c
Merge pull request #2 from netpieio/dev
chavee Jun 3, 2016
e88d498
Update README.md
chavee Jun 3, 2016
53e4c9b
Update README.th.md
chavee Jun 3, 2016
9b14439
add widgets toggle
Jun 5, 2016
48c5594
edit style button
Jun 5, 2016
915b82f
Merge pull request #3 from mrniranam/dev
chavee Jun 15, 2016
ad8c90e
redesign toggle function
chavee Jun 16, 2016
dab93c3
remove default state value
chavee Jun 16, 2016
f621502
add onCreated action option to toggle
chavee Jun 20, 2016
a0d6826
fix bug in button action
chavee Jun 20, 2016
3c49b9f
improve toggle configuration
chavee Jun 23, 2016
fe6d4bf
Merge pull request #5 from netpieio/dev
chavee Jun 23, 2016
a5bb038
rewrite option comment
chavee Jun 24, 2016
b3dbd9b
Merge pull request #6 from netpieio/dev
chavee Jun 24, 2016
8038e54
Update README.md
chavee Jun 24, 2016
d66e737
Update README.th.md
chavee Jun 24, 2016
89f20cd
Merge pull request #8 from netpieio/master
chavee Aug 8, 2016
7a17fac
add netpie.feedview
Aug 11, 2016
750e6ad
Merge pull request #9 from chaiwith/dev
chavee Aug 17, 2016
8c8b06e
edit color
Aug 28, 2016
b4d22ce
Merge pull request #10 from chaiwith/dev
chavee Aug 30, 2016
50ce1cc
store datasource name in plugin setting, add netpie-feed datasource
chavee Sep 1, 2016
5c7476f
reset netpie-feedview.js
chavee Sep 1, 2016
e84815f
small update
chavee Sep 1, 2016
d7c1c00
better handle configuration setting
chavee Sep 2, 2016
8bbd0ff
enable filter,marker options
chavee Sep 2, 2016
4ddc922
fix bug in line color option
chavee Sep 2, 2016
e9e6f8c
edit css
Sep 2, 2016
153b905
edit collor
Sep 2, 2016
e895a75
edit color error
Sep 2, 2016
03ca11f
edit index yaxis
Sep 2, 2016
956f8ea
fix bug don't work without filter
Sep 5, 2016
036c1f5
add function begin 0
Sep 5, 2016
f270ad9
fix bug disable multiple axis
Sep 6, 2016
b1a508b
edit css
Sep 6, 2016
8d39d49
edit color
Sep 6, 2016
005e526
edit time
Sep 7, 2016
d308c64
edit date
Sep 7, 2016
7645f2c
edit date
Sep 7, 2016
1b59829
add css theme netpie
Sep 8, 2016
b0a3471
edit css
Sep 10, 2016
7e654fc
use a datasource name as a microgear reference
chavee Sep 10, 2016
00751c5
merge freeboard on web
pookaium Sep 13, 2016
141a681
Merge pull request #1 from pookaium/pook-dev
pookaium Sep 13, 2016
c38a870
edit graph work with blank
Sep 13, 2016
c9d48b3
edit graph work with blank
Sep 13, 2016
4facad6
fix bug
Sep 13, 2016
ab5bc42
edit css
Sep 14, 2016
b48b03f
fixed bug
pookaium Sep 14, 2016
bcc8a5e
Update freeboard.css
pookaium Sep 14, 2016
cfdd20c
Add files via upload
pookaium Sep 14, 2016
6eedc56
edit freeboard for web
pookaium Sep 14, 2016
97756b8
edit freeboard for web
pookaium Sep 14, 2016
308b822
edit freeboard for web
pookaium Sep 14, 2016
7c7f306
fixed bug index.html
pookaium Sep 14, 2016
e78213e
Merge pull request #14 from pookaium/dev
chavee Sep 14, 2016
99afe89
edit color theme
Sep 14, 2016
3387d9f
edit css
Sep 14, 2016
d28705f
edit text color
Sep 15, 2016
19ccf9e
revert code in the stable commit
chavee Sep 16, 2016
0e492e8
edit feed with begin gap
Sep 19, 2016
2b57877
edit color link
Sep 20, 2016
29b0fcc
edit color gauge
Sep 21, 2016
073bc3c
edit color selector
Sep 28, 2016
1e205c5
delete minify js
Oct 12, 2016
53f466d
add slider widget
chavee Oct 13, 2016
cd57060
add slider value with option to display
chavee Oct 14, 2016
2c61e0d
add value option
chavee Oct 14, 2016
8c90403
add initial value option
chavee Oct 15, 2016
9e77e25
delay update after release
chavee Oct 15, 2016
ae6aee0
fix minor bug
chavee Oct 15, 2016
973df5a
auto adjust slider initial value to min/max range
chavee Oct 16, 2016
05d9403
fix delayed updated value of the slider onslide event
chavee Oct 17, 2016
e36cf5b
edit some text
chavee Oct 17, 2016
46a85e9
fix bug button caption setting fail to apply
chavee Oct 17, 2016
a27ac15
Update README.md
chavee Oct 17, 2016
2bce3d6
Update README.th.md
chavee Oct 17, 2016
0c81f4b
Add a slider widget from dev-slider branch
chavee Oct 17, 2016
463b599
add toggle theme
Nov 1, 2016
0403746
add icon toggle
Nov 1, 2016
4bab7dd
add unit
Nov 2, 2016
97452bd
remove aggregation option
chavee Nov 3, 2016
4d858ce
add unit
Nov 3, 2016
a7a8895
edit icon
Nov 14, 2016
151044b
change color icon
chaiwith Nov 21, 2016
fae8aae
edit theme
chaiwith Nov 22, 2016
c79b835
fix slider widget
chavee Nov 22, 2016
d5225a6
Merge branch 'master' into dev
chavee Nov 22, 2016
197e2e6
edit color justgage
chaiwith Nov 22, 2016
b1e7c1d
Merge pull request #18 from netpieio/dev
chavee Nov 22, 2016
6dba6b0
upgrade justgage version
chavee Nov 24, 2016
7ff740f
restructure slider plugin files
chavee Nov 24, 2016
4326c56
remove microgear alias option, add alert popup
chavee Nov 24, 2016
90c8f46
remove jquery-confirm
chavee Nov 25, 2016
f773dcb
Update README.md
chavee Nov 25, 2016
ae2c651
Update README.th.md
chavee Nov 25, 2016
a119838
Update README.th.md
chavee Nov 25, 2016
af996ee
Merge pull request #19 from netpieio/dev
chavee Nov 25, 2016
dea1f94
modified bg freeboard
chaiwith Nov 28, 2016
e4708f3
edit color bg graph
chaiwith Nov 28, 2016
2830ab3
edit toggle theme and save value theme to localstorage
chaiwith Nov 29, 2016
54bb2e2
edit theme maker update realtime
chaiwith Nov 29, 2016
62b79a0
save theme config to localstorage
chaiwith Nov 30, 2016
ba5b682
add file plugin theme
chaiwith Nov 30, 2016
f29630b
edit datasource
chaiwith Nov 30, 2016
e2e7895
update freeboard
chaiwith Nov 30, 2016
7163a4c
edit feed css
chaiwith Nov 30, 2016
980db56
add getdata function
chaiwith Dec 1, 2016
a6bcc0e
update toggle
chaiwith Dec 1, 2016
74bb8f9
edit color feed
chaiwith Dec 1, 2016
7126fdc
edit color indicator light
chaiwith Dec 3, 2016
4d6f5bd
edit config freeboard
chaiwith Dec 3, 2016
9d3adf7
fix error when import json
chaiwith Dec 3, 2016
6dc34db
Merge pull request #20 from netpieio/dev
chavee Dec 4, 2016
c7a8c23
create netpie.global.js to store global functions
chavee Dec 4, 2016
64111fc
roll back Justgage version
chavee Dec 4, 2016
a66b29b
improve netpie plugin and widget structure
chavee Dec 4, 2016
49df094
Merge branch 'dev' into dev-restructure
chavee Dec 4, 2016
5c264c2
Merge pull request #21 from netpieio/dev-restructure
chavee Dec 7, 2016
ef18801
implement load theme event
chaiwith Dec 7, 2016
0836c85
fix bug data config error
chaiwith Dec 13, 2016
5e8b8e8
Merge theme bug fix from branch dev
chavee Dec 13, 2016
440bd97
edit netpie theme
chaiwith Dec 19, 2016
fd0f1e4
Edit gauge theme
chavee Dec 19, 2016
b336885
implement option timegap feedview
chaiwith Jan 4, 2017
4c2d771
rename gap option with default value false
chavee Jan 4, 2017
71da368
add feedview auto gap option
chavee Jan 4, 2017
3834cdc
fix bug filter
chaiwith Jan 6, 2017
91cca6b
fix bug in filter
chavee Jan 6, 2017
c28b2ba
adjust initial settings on feed datasource
chavee Jan 13, 2017
0a20b1e
adjust initial settings on feed datasource
chavee Jan 13, 2017
fe0f807
fix button widget hint
chavee Jan 13, 2017
f51e59c
Merge pull request #27 from netpieio/dev
chavee Jan 13, 2017
50b308e
add datasources[DATASOURCE_NAME]['alias']
chavee Feb 10, 2017
a410672
add datasources[DATASOURCE_NAME]['alias']
chavee Feb 10, 2017
f1b6493
fix problem when multiple devices online with the same alias
chavee Feb 11, 2017
ad2346d
Merge pull request #29 from netpieio/dev
chavee Feb 11, 2017
83942fc
remove alias object when the last one goes offline
chavee Feb 14, 2017
50d993b
Merge pull request #30 from netpieio/dev
chavee Feb 14, 2017
c1f5a53
fix stuck token in alias list
chavee Feb 20, 2017
aab7a25
Merge pull request #31 from netpieio/dev
chavee Feb 20, 2017
857c650
reset alias list when freebaord is connect/disconnect
chavee Feb 21, 2017
4070b27
Merge pull request #32 from netpieio/dev
chavee Feb 21, 2017
0df1917
update feedview to support rate limit exceeded
chaiwith Mar 20, 2017
f58e06c
update feedview to support rate limit exceeded
chaiwith Mar 22, 2017
f86e30a
update feedview to support rate limit exceeded
chaiwith Mar 22, 2017
b391c1d
update feedview to support rate limit exceeded
chaiwith Mar 22, 2017
83243c0
fix bug feed support rate limit exceeded
chaiwith Mar 22, 2017
f815393
add 'ONCREATED ACTION' option to microgear datasource
chavee Apr 25, 2017
e1fd8a2
Merge pull request #33 from netpieio/dev
chavee Apr 25, 2017
1a9634b
turn off unused feedview options
chavee May 4, 2017
c0e6354
fix value undefined
chaiwith May 16, 2017
022e7a3
Merge pull request #34 from netpieio/dev
chaiwith May 20, 2017
9a5ed87
edit color theme netpie
chaiwith May 26, 2017
9d654ed
fix filter feedview
chaiwith Jun 1, 2017
2ddfa4d
fix filter feedview
chaiwith Jun 1, 2017
28a3d9d
fix feed lastest data
chaiwith Jun 30, 2017
7a13970
fix plugin feed
chaiwith Jul 5, 2017
05f4c14
fix plugin feed
chaiwith Jul 5, 2017
9215eda
fix freeboard
chaiwith Jul 5, 2017
f8d6ac5
update feed
chaiwith Jul 6, 2017
04507dc
fix bug microgear[datasourcename]
chaiwith Aug 13, 2017
8031066
Delete freeboard.css
chaiwith Nov 3, 2017
28ec708
Delete freeboard.min.css
chaiwith Nov 3, 2017
33f37e2
Delete freeboard_plugins.js
chaiwith Nov 3, 2017
276c8d5
Delete freeboard_plugins.min.js
chaiwith Nov 3, 2017
3bed953
Add netpie.widget.shoutbox.js
sekcompsci Mar 1, 2018
e7320dc
Merge pull request #41 from mrniranam/dev
chavee Mar 1, 2018
0e0c630
fix a bug casuing microgear[XXX] undefined
chavee Mar 1, 2018
5fb2656
Merge pull request #1 from netpieio/dev
Mar 2, 2018
a3c116f
Update type widget button and shoutbox
sekcompsci Mar 2, 2018
9b30d6d
Merge pull request #42 from mrniranam/dev
chavee Mar 2, 2018
63a03d6
Update netpie.feedview.js
chaiwith Mar 20, 2018
e696ad9
Update netpie.widget.feedview.js
chaiwith Mar 20, 2018
164b67a
Update netpie.feedview.js
chaiwith Mar 20, 2018
1462a0f
Update netpie.widget.feedview.js
chaiwith Mar 20, 2018
8aeff73
Update netpie.widget.feedview.js
chaiwith Mar 21, 2018
e7ddd1c
Update netpie.feedview.js
chaiwith Mar 21, 2018
a1123c5
Update netpie.feedview.js
chaiwith Mar 23, 2018
a797da6
Update netpie.widget.feedview.js
chaiwith Mar 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
node_modules
node_modules
\.DS_Store
185 changes: 15 additions & 170 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,181 +1,26 @@
freeboard
netpie-freeboard
==========

**free·board** (noun) *\ˈfrē-ˌbȯrd\*
A freeboard with NETPIE datasource and widget plugins.

1. the distance between the waterline and the main deck or weather deck of a ship or between the level of the water and the upper edge of the side of a small boat.
2. the act of freeing data from below the "waterline" and exposing it to the world.
3. a damn-sexy, open source real-time dashboard builder/viewer for IOT and other web mashups.
![netpie-freeboard-screenshot](https://cloud.githubusercontent.com/assets/7685964/19427706/de8aab54-946f-11e6-81ae-bbe8b78910e5.jpg)

### Demo
http://freeboard.github.io/freeboard

https://freeboard.io
Installation

### Screenshots
![Weather](https://raw.github.com/Freeboard/branding/master/screenshots/freeboard-screenshot-1.jpg)
git clone https://github.com/netpieio/netpie-freeboard

### What is It?
To use a freeboard, just open the file index.html in any web browser. Under the DATASOURCE section, click ADD to create a new datasource then select NETPIE Microgear and configure as follows:

Freeboard is a turn-key HTML-based "engine" for dashboards. Besides a nice looking layout engine, it provides a plugin architecture for creating datasources (which fetch data) and widgets (which display data)— freeboard then does all the work to connect the two together. Another feature of freeboard is its ability to run entirely in the browser as a single-page static web app without the need for a server. The feature makes it extremely attractive as a front-end for embedded devices which may have limited ability to serve complex and dynamic web pages.
- **NAME** - This is the name of the datasource. It also holds a microgear object that is referenced by microgear[*NAME*]. Moreover this name will be registered as a microgear device alias that you can chat to.
- **APP ID** - NETPIE App ID
- **KEY** - Microgear Key
- **SECRET** - Secret of the key
- **DEVICE ALIAS** - If needed you can name the datasource as a microgear so it can be reached by a function chat()
- **SUBSCRIBE TOPICS** - Topics that this datasource will subscribe. Wild cards # and + are allowed. The default value is /# meaning that it subscribes to all topics in this App ID.

The code here is the client-side portion of what you see when you visit a freeboard at http://freeboard.io. It does not include any of the server-side code for user management, saving to a database or public/private functionality— this is left up to you to implement should you want to use freeboard as an online service.
![netpie-freeboard2](https://cloud.githubusercontent.com/assets/7685964/15654634/fbe3c096-26bf-11e6-8ab5-4656839b53ad.jpg)

### How to Use
As for the button widget, you can configure it to execute Javascipt codes upon the onClick event. In the picture below the button is configured to send a chat message to the device named *pieslampher* everytime it is clicked. The index 'mg1' is simply the reference of a microgear of a datasource *netpie1* you entered in the datasource configurtion.

Freeboard can be run entirely from a local hard drive. Simply download/clone the repository and open index.html. When using Chrome, you may run into issues with CORS when accessing JSON based APIs if you load from your local hard-drive— in this case you can switch to using JSONP or load index.html and run from a local or remote web server.

1. git clone https://github.com/Freeboard/freeboard.git
2. npm install
3. grunt

Then run a index.html or index-dev.html through a webserver.

### API

While freeboard runs as a stand-alone app out of the box, you can augment and control it from javascript with a simple API. All API calls are made on the `freeboard` singleton object.

-------

**freeboard.initialize(allowEdit, [callback])**

Must be called first to initialize freeboard.

> **allowEdit** (boolean) - Sets the initial state of freeboard to allow or disallow editing.

> **callback** (function) - Function that will be called back when freeboard has finished initializing.

-------

**freeboard.newDashboard()**

Clear the contents of the freeboard and initialize a new dashboard.

-------

**freeboard.serialize()**

Serializes the current dashboard and returns a javascript object.

-------

**freeboard.loadDashboard(configuration, [callback])**

Load the dashboard from a serialized dashboard object.

> **configuration** (object) - A javascript object containing the configuration of a dashboard. Normally this will be an object that has been created and saved via the `freeboard.serialize()` function.

> **callback** (function) - Function that will be called back when the dashboard has finished loading.

-------

**freeboard.setEditing(editing, animate)**

Programatically control the editing state of the of dashboard.

> **editing** (bool) - Set to true or false to modify the view-only or editing state of the board.

> **animate** (function) - Set to true or false to animate the modification of the editing state. This animates the top-tab dropdown (the part where you can edit datasources and such).

-------

**freeboard.isEditing()**

Returns boolean depending on whether the dashboard is in in the view-only or edit state.

-------

**freeboard.loadDatasourcePlugin(plugin)**

Register a datasource plugin. See http://freeboard.github.io/freeboard/docs/plugin_example.html for information on creating plugins.

> **plugin** (object) - A plugin definition object as defined at http://freeboard.github.io/freeboard/docs/plugin_example.html

-------

**freeboard.loadWidgetPlugin(plugin)**

Register a widget plugin. See http://freeboard.github.io/freeboard/docs/plugin_example.html for information on creating plugins.

> **plugin** (object) - A plugin definition object as defined at http://freeboard.github.io/freeboard/docs/plugin_example.html

-------

**freeboard.showLoadingIndicator(show)**

Show/hide the loading indicator. The loading indicator will display an indicator over the entire board that can be useful when you have some code that takes a while and you want to give a visual indication and to prevent the user from modifying the board.

> **show** (boolean) - Set to true or false to show or hide the loading indicator.

-------

**freeboard.showDialog(contentElement, title, okButtonTitle, cancelButtonTitle, okCallback)**

Show a styled dialog box with custom content.

> **contentElement** (DOM or jquery element) - The DOM or jquery element to display within the content of the dialog box.

> **title** (string) - The title of the dialog box displayed on the top left.

> **okButtonTitle** (string) - The string to display in the button that will be used as the OK button. A null or undefined value will result in no button being displayed.

> **cancelButtonTitle** (string) - The string to display in the button that will be used as the Cancel button. A null or undefined value will result in no button being displayed.

> **okCallback** (function) - A function that will be called if the user presses the OK button.

-------

**freeboard.getDatasourceSettings(datasourceName)**

Returns an object with the current settings for a datasource or null if no datasource with the given name is found.

> **datasourceName** (string) - The name of a datasource in the dashboard.

-------

**freeboard.setDatasourceSettings(datasourceName, settings)**

Updates settings on a datasource.

> **datasourceName** (string) - The name of a datasource in the dashboard.

> **settings** (object) - An object of key-value pairs for the settings of the datasource. The values specified here will be combined with the current settings, so you do not need specify every setting if you only want to update one. To get a list of possible settings for a datasource, consult the datasource documentation or code, or call the freeboard.getDatasourceSettings function.

-------

**freeboard.on(eventName, callback)**

Attach to a global freeboard event.

> **eventName** (string) - The name of a global event. The following events are supported:

> **"dashboard_loaded"** - Occurs after a dashboard has been loaded.

> **"initialized"** - Occurs after freeboard has first been initialized.

> **callback** (function) - The callback function to be called when the event occurs.

-------

### Building Plugins

See http://freeboard.github.io/freeboard/docs/plugin_example.html for info on how to build plugins for freeboard.

### Testing Plugins

Just edit index.html and add a link to your javascript file near the end of the head.js script loader, like:

```javascript
...
"path/to/my/plugin/file.js",
$(function()
{ //DOM Ready
freeboard.initialize(true);
});
```

### Copyright

Copyright © 2013 Jim Heising (https://github.com/jheising)<br/>Copyright © 2013 Bug Labs, Inc. (http://buglabs.net)<br/>Licensed under the **MIT** license.

---
![netpie-freeboard3](https://cloud.githubusercontent.com/assets/7685964/15655823/ec23a1f2-26ca-11e6-9968-ee500136b7bc.jpg)
26 changes: 26 additions & 0 deletions README.th.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
netpie-freeboard
==========

Freeboard ที่มาพร้อม NETPIE datasource and widget plugins

![netpie-freeboard-screenshot](https://cloud.githubusercontent.com/assets/7685964/19427706/de8aab54-946f-11e6-81ae-bbe8b78910e5.jpg)


วิธีติดตั้ง

git clone https://github.com/netpieio/netpie-freeboard

การใช้งาน ใช้ browser เปิดไฟล์ index.html ในส่วนของ DATASOURCES คลิก ADD เลือก TYPE เป็น NETPIE Microgear ปรับแต่งค่าตามความเหมาะสม

- **NAME** - ชื่อของ datasource ซึ่งแต่ละ NETPIE microgear datasource จะมี microgear object ที่เข้าถึงจาก script ได้ทาง microgear[*NAME*] นอกจากนั้น ชื่อนี้ยังใช้เป็น microgear device alias ที่ device อื่นสามารถ chat มาหาได้
- **APP ID** - App ID ของ NETPIE
- **KEY** - Key ของ microgear
- **SECRET - Secret** ของ key ข้างต้น
- **SUBSCRIBE TOPICS** - เป็น topic ที่จะให้ datasource นี้ subscribe หากมีหลาย topic ให้ใช้ comma คั่น สามารถใช้ wildcard # และ + ได้ ค่าปกติจะเป็น /# คือ subscribe ทุก topic ของ App ID นี้

![netpie-freeboard2](https://cloud.githubusercontent.com/assets/7685964/15654634/fbe3c096-26bf-11e6-8ab5-4656839b53ad.jpg)

ในส่วนของ button widget เราสามารถปรับแต่งให้ปุ่ม มีการรันโค้ด Javascript เมื่อเกิดการกดได้ ตามตัวอย่างในรูป ปุ่มจะถูกกำหนดให้ส่ง chat message ไปยัง thing ที่ชื่อ pieslampher ทุกครั้งที่ถูกกด
โดยที่ index 'mg1' คือ microgear reference ของ datasource netpie1 ที่เราได้กำหนดไว้ตอนสร้าง datasource

![netpie-freeboard3](https://cloud.githubusercontent.com/assets/7685964/15655823/ec23a1f2-26ca-11e6-9968-ee500136b7bc.jpg)
Loading