Giter Site home page Giter Site logo

thingproxy's Introduction

freeboard

free·board (noun) *\ˈfrē-ˌbȯrd*

  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.

Demo

http://freeboard.github.io/freeboard

https://freeboard.io

Screenshots

Weather

What is It?

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.

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.

How to Use

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. cd freeboard
  3. npm install
  4. 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:

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

Copyright

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


thingproxy's People

Contributors

jheising 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thingproxy's Issues

thingproxy does not send HOST header

Tried to use thingproxy, but I cannot since my host uses "host header names" to serve multiple web sited on the same server. Thingproxy does not seem to set the HOST header and all requests though thingproxy goes to the default web site and not the one it should according to the host header.

Preflight OPTIONS Requests

Almost every request to thingboard is accompanied by a preflight OPTIONS request. This is slow and taxes the server. To lower the amount of preflight requests, set the following headers in the preflight response:

Access-Control-Max-Age: 86400
This allow caching of preflight requests for up to 1 day (chrome will cap this to 10 minutes)

Access-Control-Allow-Methods: GET, HEAD, POST, PUT, DELETE, OPTIONS
This allow caching of preflight requests for different HTTP methods. If a non-standard HTTP method is in Access-Control-Request-Method, add it to the list. Ideally, this header would have a wildcard (*) value, but some slightly outdated browsers don't support the wildcard.

Reference:
Preflight request
Access-Control-Max-Age
Access-Control-Allow-Methods
Access-Control-Request-Method

Invalid URL

I keep getting this error when accessing locally and at thingproxy.freeboard.io

Example URL:
http://localhost:3000/fetch/https://us3.api.mailchimp.com/2.0/lists/growth-history.json?apikey=xxx-us3&id=xxxx

Invalid URL
The requested URL "2.0/lists/growth-history.json?apikey=xxx-us3&id=xxxx", is invalid.
Reference #9.5b35d417.1425848696.74f3f3f

I've tried debugging locally but don't know what is going wrong.

It also fails when trying to use the twitter api, which requires an authorization header.

Works from local onnly, or something with my hosting

Dear colleague, could you please explain/check if the solution works from any orygin? The matter is that I have an issue with connection from the hosted project - the proxy works perfect from my localhos but doesn't return the 'Access-Control-Allow-Origin: 'origin' header wen I request from hosting.
Will appreciate you help!
Thanks in advance!

Getting Cors error for beta testing site

Hey, I am trying to use https://thingproxy.freeboard.io/fetch/ and find that it works when the origin is localhost but not for my beta testing site.

Url i am trying to access: https://character-service.dndbeyond.com/character/v3/character/4338000
Url i am using: https://thingproxy.freeboard.io/fetch/https://character-service.dndbeyond.com/character/v3/character/4338000
Url of beta testing site: https://beta-dmscreen.samhenry.tech/

Works fine for: http://localhost:44390/

Error found:
image

How to install and configure in localhost

Is there any tips to install in localhost?

The redirected url of m3u8 cannot be played, please fix it.

By the way, could you add crossdomain.xml function in the codes?

thanks a lot

Unauthorized When Sending Production Origin Header

I'm able to use https://thingproxy.freeboard.io/fetch/http://79.111.119.111:9107/7.html successfully via Postman and my web app in the browser while sending http://localhost:4200 as the Origin header.

However, when I set Origin to my production URL (http://radio.browninglogic.com) (both from Postman and from the deployed web app), I get the following:

{
    "this": "failed",
    "with": 401,
    "because": {
        "message": "unauthorized"
    },
    "id": "lKKaSKW3f"
}

Strangely enough, when I clone and run the API locally, it appears to work properly even with the same Origin header that's causing it to fail when using the deployed site (http://thingproxy.freeboard.io/fetch/url).

Can you point me in the right direction? Is there something that I'm missing?

How to deploy it on vercel?

I tried to use some configurations that I found here, like rollup.config.js and vercel.json but didn't work.

I get this error:

2021-10-28T15:43:21.479Z	69849475-9b2d-4d02-bba2-38906031451b	ERROR	No exports found in module "../dist/server.js".
Legacy server listening...
2021-10-28T15:43:21.480Z	69849475-9b2d-4d02-bba2-38906031451b	ERROR	Did you forget to export a function or a server?
thingproxy.freeboard.io process started (PID 30)
RequestId: 10e24296-98d2-4b37-941e-7959647a6d6b Error: Runtime exited with error: exit status 1
Runtime.ExitError

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.