GithubHelp home page GithubHelp logo

decodedco / predix-seed-xlp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from predixdev/predix-seed

0.0 4.0 1.0 48.52 MB

Dashboard Seed is an application that uses Px Web Components and Px UI Elements inside an Angular application.

License: Other

JavaScript 12.83% HTML 81.65% CSS 5.52%

predix-seed-xlp's Introduction

Predix Experience 2.0 Seed

Dashboard Seed is an application that uses Px Web Components inside a Polymer web application. It runs on the Express web server.

Getting Started

Get the source code

Make a directory for your project. Clone or download and extract the seed in that directory.

git clone https://github.com/PredixDev/predix-seed.git

Install tools

If you don't have them already, you'll need node, bower and gulp to be installed globally on your machine.

  1. Install node. This includes npm - the node package manager.
  2. Install bower globally npm install bower -g
  3. Install gulp globally npm install gulp -g

Install the dependencies

Change directory into the new project you just cloned, then install dependencies.

npm install
bower install

Running the app locally

The default gulp task will start a local web server. Just run this command:

gulp

Browse to http://localhost:5000. Initially, the app will use mock data for the views service, asset service, and time series service. Later you can connect your app to real instances of these services.

Running in Predix Cloud

With a few commands you can build a distribution version of the app, and deploy it to the cloud.

Create a dist version

Use gulp to create a distribution version of your app. You will need to run this command during development every time before you cf push to make the latest dist.

gulp compile:all

Deploy to the cloud

First make sure you're logged in to the Predix Cloud using the cf login command. Then deploy your app using this command:

cf push my-seed-app

You can give the app any unique name you like. "my-seed-app" is just an example.

UAA

1. Setup UAA service

  1. cf create-service predix-uaa Tiered xlpuser04-uaa -c '{"adminClientSecret":"clientsecret"}'
  2. Add xlpuser-04-uaa to manifest.yml
  3. cf push
  4. cf env xlp-polymer to extract

2. Add client for UAA

  1. uaac target <uaa-URI>
  2. uaac token client get admin
  3. uaac client add xlpuser04-uaa-client -i:
  4. scope: openid uaa.none
  5. authorized grant types: password client_credentials authorization_code
  6. authorities: uaa.resource openid uaa.none
  7. echo -n xlpuser04-uaa-client:clientsecret | base64 - save in manifest.yml under base64ClientCredential
  8. Update clientId in manifest.yml

3. Add users to app

  1. uaac user add <my-user> --emails <my_user>@domain.com --password <my_password>
  2. uaac group add uaa.user
  3. uaac member add uaa.user user

Predix Time series

1. Create Service

  1. cf env xlp-polymer - grab issuer id from uaa
  2. cf create-service predix-timeseries Tiered xlpuser04-timeseries -c '{"trustedIssuerIds":["https://xxx.run.aws-usw02-pr.ice.predix.io/oauth/token"]}'
  3. Update manifest.yml with timeseries instance, cf push

2. Config Service

  1. cf env xlp-polymer - grab zone id
  2. uaac client update xlpuser04-uaa-client -i add
  3. authorities: timeseries.zones.<zone-id>.user timeseries.zones.<zone-id>.query timeseries.zones.<zone-id>.ingest
  4. scope: timeseries.zones.<zone-id>.user timeseries.zones.<zone-id>.query timeseries.zones.<zone-id>.ingest

3. Use Timeseries

  1. Simply access /predix-api/predix-timeseries/v1/tags..
  2. To test with curl, copy the cookie_name from your browser and curl --cookie "cookie_name=xxxx" http://localhost:5000/predix-api/predix-timeseries/v1/tags

Predix Machine

On the Pis, update the following:

  1. ~/PredixMachine/configuration/machine/com.ge.dspmicro.predixcloud.identity.config with UAA details
  2. com.ge.dspmicro.websocketriver.send-0.config with Zone ID for TS
  3. com.ge.dspmicro.hoover.spillway-0.config updated com.ge.dspmicro.hoover.spillway.destination="WS Sender Service"

Questions?

Copyright

Copyright © 2015 GE Global Research. All rights reserved.

The copyright to the computer software herein is the property of GE Global Research. The software may be used and/or copied only with the written permission of GE Global Research or in accordance with the terms and conditions stipulated in the agreement/contract under which the software has been supplied.

predix-seed-xlp's People

Contributors

ek avatar jaadams05 avatar clementchi avatar gedesigntech avatar yashdoshi89 avatar mdwragg avatar amadeuspzs avatar randyaskin avatar lrbridge avatar

Watchers

James Cloos avatar Allen Koh avatar  avatar Jaclyn avatar

Forkers

vijayravik

predix-seed-xlp's Issues

Split out values into individual cards

Right now values appear all together:

image

  1. Can we split out each value as a separate card
  2. Can we allow user to change h1 of card to e.g. "Wind Power (MW)"
  3. Can we add latest timestamp from data, formatted for information (check we have latest data)
  4. Is there option to combine multiple cards in a row?

Allow timeseries viz of Demand tag

There is now a global Demand tag in timeseries for energy demand, which each team will share.

Currently the timeseries dropdown filters on the device name:

if(tag.indexOf(this.deviceName)!== -1){

image

Can we add in the Demand tag as always there?

Plot Demand timeseries data

    <time-series-card id="tsSingleTag"
        card-title="Demand - Line" tags="[[_setTag('CoalPower-xlp-')]]" hide-bar card-color="[[cardColor]]">
    </time-series-card>

This notation prevents Demand being shown, as it doesn't have the device name after it

Clean up unneeded code

To reduce complexity, remove cards and decks from the views API and provide example blocks in the dashboard-views.html

Allow one tag display of Timeseries

Currently, timeseries plots have a dropdown of all available tags (see #18).

Some customers will want to show multiple timeseries on one page, of specific tags.

Can

    <time-series-card id="tsLineChart" card-title="Time Series Card - Line" tags="[[tagVals]]" hide-bar></time-series-card>

be extended to behave like

      <latest-data-card id="humidityTag" class="layout__item"
        card-title="Humidity" tag="Humidity-xlp-[[deviceName]]"></latest-data-card>

Identify easy CSS changes

Customers will want different color schemes.

We should identify easy things to change:

  1. bg color
  2. card color
  3. add logo

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.