├── .bowerrc ├── .cfignore ├── .editorconfig ├── .gitignore ├── .jshintrc ├── .travis.yml ├── HISTORY.md ├── LICENSE.md ├── OSS_Notice.pdf ├── README.md ├── bower.json ├── gulpfile.js ├── manifest.yml ├── moved.jpg ├── package.json ├── public ├── _index-inline-loading-script.js ├── _index.html ├── elements │ ├── bar-chart-card │ │ └── bar-chart-card.html │ ├── data-table-card │ │ └── data-table-card.html │ ├── ge-svg-logo │ │ └── ge-svg-logo.html │ ├── predix-logo │ │ └── predix-logo.html │ ├── px-deck │ │ ├── px-deck-index.html │ │ └── px-deck.html │ ├── seed-app │ │ ├── seed-app.html │ │ └── seed-app.scss │ ├── seed-footer │ │ ├── seed-footer.html │ │ └── seed-footer.scss │ ├── seed-intro-card │ │ ├── seed-intro-card.html │ │ └── seed-intro-card.scss │ ├── three-widgets-card │ │ ├── three-widgets-card.html │ │ └── three-widgets-card.scss │ ├── time-series-card │ │ └── time-series-card.html │ └── views │ │ ├── blankpage-view.html │ │ ├── dashboards-view.html │ │ ├── simple-asset-view.html │ │ └── winddata-view.html ├── favicon.png ├── index-inline.scss └── seed-theme.scss ├── server ├── app.js ├── localConfig.json ├── passport-config.js ├── predix-asset-routes.js ├── predix-config.js ├── proxy.js ├── sample-data │ ├── meters │ │ ├── crank-frame-compressionratio.json │ │ ├── crank-frame-dischargepressure.json │ │ ├── crank-frame-maxpressure.json │ │ ├── crank-frame-minpressure.json │ │ ├── crank-frame-suctionpressure.json │ │ ├── crank-frame-temperature.json │ │ └── crank-frame-velocity.json │ ├── predix-asset │ │ ├── compressor-2017.json │ │ ├── enterprises │ │ │ └── parent-asset │ │ │ │ └── parent-asset.json │ │ ├── root │ │ │ └── root.json │ │ └── sites │ │ │ └── child-asset │ │ │ └── child-asset.json │ ├── time-series │ │ ├── core-vibe │ │ │ ├── core-vibe-rear-cruise.json │ │ │ ├── core-vibe-rear-cruise0.json │ │ │ └── core-vibe-rear-cruise1.json │ │ ├── datagrid │ │ │ └── datagrid-data.json │ │ ├── delta-egt │ │ │ └── delta-egt-cruise.json │ │ ├── fan-vibration │ │ │ ├── fan-vibration-cruise.json │ │ │ └── fan-vibration-cruise2.json │ │ ├── scatter │ │ │ ├── scatter.json │ │ │ └── scatter1.json │ │ └── simple-data │ │ │ ├── simple-data-1.json │ │ │ ├── simple-data-2.json │ │ │ └── simple-data-3.json │ └── view-service │ │ ├── cards │ │ ├── 1.json │ │ ├── 2.json │ │ ├── 3.json │ │ ├── 4.json │ │ ├── 5.json │ │ └── 6.json │ │ ├── decks │ │ ├── 1.json │ │ ├── 2.json │ │ └── 3.json │ │ └── joins │ │ ├── 1.json │ │ ├── 2.json │ │ ├── 3.json │ │ └── 4.json ├── time-series-routes.js └── view-service-routes.js ├── tasks ├── compile.index.js ├── compile.sass.js ├── compile.vulcanize.js ├── dist.clean.js ├── dist.copy.js ├── serve.dev.start.js ├── serve.dist.start.js └── watch.public.js ├── test ├── index.html └── seed-test-01.html ├── tutorials └── USERAUTH.md ├── wct.conf.js └── yarn.lock /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "public/bower_components" 3 | } -------------------------------------------------------------------------------- /.cfignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | public/bower_components 3 | public/polymer-loader.vulcanized.html 4 | test-target 5 | public/index.html 6 | public/**/*-styles.html 7 | public/index-inline.css 8 | main.min.css 9 | .idea 10 | npm-debug.log 11 | *.log 12 | .DS_Store 13 | temp 14 | dist 15 | .github/ 16 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "browser": true, 4 | "jquery": true, 5 | "devel": true, 6 | "esnext": true, 7 | "bitwise": true, 8 | "camelcase": true, 9 | "curly": true, 10 | "eqeqeq": true, 11 | "immed": true, 12 | "indent": 4, 13 | "latedef": true, 14 | "newcap": true, 15 | "noarg": true, 16 | "quotmark": "single", 17 | "regexp": true, 18 | "undef": true, 19 | "unused": true, 20 | "strict": true, 21 | "trailing": true, 22 | "smarttabs": true, 23 | "white": false, 24 | "globals": { 25 | /* requirejs */ 26 | "window": false, 27 | "define": false, 28 | "vRuntime": false, 29 | "Promise": false, 30 | /* ANGULAR MOCKS */ 31 | "inject": false, 32 | "module": false, 33 | "expect": false, 34 | "element": false, 35 | /* PROTRACTOR */ 36 | "protractor": false, 37 | "browser": false, 38 | "by" : false, 39 | /* MOCHA */ 40 | "describe": false, 41 | "xdescribe": false, 42 | "it": false, 43 | "xit": false, 44 | "before": false, 45 | "beforeEach": false, 46 | "after": false, 47 | "afterEach": false, 48 | "jasmine": false 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | before_script: 2 | - npm update -g npm 3 | - npm install -g bower 4 | script: 5 | - npm install 6 | - bower --allow-root install 7 | -------------------------------------------------------------------------------- /HISTORY.md: -------------------------------------------------------------------------------- 1 | v3.0.1 2 | =================== 3 | * added the import once command to sass to avoid import loop. 4 | 5 | v3.0.0 6 | =================== 7 | * released Polymer Only seed 8 | v1.4.2 9 | =================== 10 | * Fix dist build issue stalling on promise polyfill. 11 | 12 | v1.4.1 13 | =================== 14 | * Upgrade to Polymer 1.5.0 and latest dev dependencies. 15 | 16 | v1.4.0 17 | =================== 18 | * Upgrade to Polymer 1.4.0 19 | 20 | v1.2.17 21 | =================== 22 | * updated bower repos in response to GH Issue 23 | 24 | v1.2.16 25 | =================== 26 | * forced install of vulcanize to 1.14.8, since 1.14.9 wouldn't work. 27 | 28 | v1.2.14 29 | =================== 30 | * Updated License 31 | 32 | v1.2.13 33 | =================== 34 | * resolved merge conflict 35 | 36 | v1.2.12 37 | =================== 38 | * started merge of develop and master 39 | 40 | v1.2.11 41 | =================== 42 | * uPatch version 43 | 44 | v1.2.10 45 | =================== 46 | * Updated manifest to not have logstash and newrelic in it. 47 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GE Software Development License Agreement – General Release 2 | 3 | THIS SOFTWARE LICENSE AGREEMENT (the “License”) describes the rights granted by the General Electric Company, operating through GE Digital (also referred to as “GE Software”), located at 2623 Camino Ramon, San Ramon, CA 94583 (herein referred to as “Licensor”) to any entity (the “Licensee”) receiving a copy of any of the following GE Digital development materials: Predix DevBox; Predix Reference Application (“RefApp”); Predix Dashboard Seed; Predix Px, Predix Security Service redistributable .jar files; Predix Machine redistributable .jar files; and Predix Machine SDK . These materials may include scripts, compiled code, supporting components, and documentation and are collectively referred to as the “Licensed Programs”. Both Licensor and Licensee are referred to hereinafter as a “Party” and collectively as the “Parties” to this License 4 | 5 | Section 1 – Conditional Grant. 6 | 7 | No Licensee is required to accept this License for use of the Licensed Programs. In the absence of a signed license agreement between Licensor and Licensee specifying alternate terms, any use of the Licensed Programs by the Licensee shall be considered acceptance of these terms. The Licensed Programs are copyrighted and are licensed, not sold, to you. If you are not willing to be bound by the terms of this License, do not install, copy or use the Licensed Programs. If you received this software from any source other than the Licensor, your access to the Licensed Programs is NOT permitted under this License, and you must delete the software and any copies from your systems. 8 | 9 | Section 2 – Warranty Disclaimer. 10 | 11 | NO WARRANTIES. LICENSOR AND OUR AFFILIATES, RESELLERS, DISTRIBUTORS, AND VENDORS, MAKE NO WARRANTIES, EXPRESS OR IMPLIED, GUARANTEES OR CONDITIONS WITH RESPECT TO USE OF THE LICENSED PROGRAMS. LICENSEE’S USE OF ALL SUCH PROGRAMS ARE AT LICENSEE’S AND CUSTOMERS’ OWN RISK. LICENSOR PROVIDES THE LICENSED PROGRAMS ON AN “AS IS” BASIS “WITH ALL FAULTS” AND “AS AVAILABLE.” LICENSOR DOES NOT GUARANTEE THE ACCURACY OR TIMELINESS OF INFORMATION AVAILABLE FROM, OR PROCESSED BY, THE LICENSED PROGRAMS. TO THE EXTENT PERMITTED UNDER LAW, LICENSOR EXCLUDES ANY IMPLIED WARRANTIES, INCLUDING FOR MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, AND NON-INFRINGEMENT. NO GUARANTEE OF UNINTERRUPTED, TIMELY, SECURE, OR ERROR-FREE OPERATION IS MADE. 12 | 13 | THESE LICENSED PROGRAMS MAY BE USED AS PART OF A DEVELOPMENT ENVIRONMENT, AND MAY BE COMBINED WITH OTHER CODE BY END-USERS. LICENSOR IS NOT ABLE TO GUARANTEE THAT THE LICENSED PROGRAMS WILL OPERATE WITHOUT DEFECTS WHEN USED IN COMBINATION WITH END-USER SOFTWARE. LICENSEE IS ADVISED TO SAFEGUARD IMPORTANT DATA, TO USE CAUTION, AND NOT TO RELY IN ANY WAY ON THE CORRECT FUNCTIONING OR PERFORMANCE OF ANY COMBINATION OF END-USER SOFTWARE AND THE LICENSED PROGRAMS AND/OR ACCOMPANYING MATERIALS. LICENSEE IS ADVISED NOT TO USE ANY COMBINATION OF LICENSED PROGRAMS AND END-USER PROVIDED SOFTWARE IN A PRODUCTION ENVIRONMENT WITHOUT PRIOR SUITABILITY AND DEFECT TESTING. 14 | 15 | Section 3 – Feedback. 16 | 17 | It is expressly understood, acknowledged and agreed that you may provide GE reasonable suggestions, comments and feedback regarding the Software, including but not limited to usability, bug reports and test results, with respect to Software testing (collectively, "Feedback"). If you provide such Feedback to GE, you shall grant GE the following worldwide, non-exclusive, perpetual, irrevocable, royalty free, fully paid up rights: 18 | 19 | a. to make, use, copy, modify, sell, distribute, sub-license, and create derivative works of, the Feedback as part of any product, technology, service, specification or other documentation developed or offered by GE or any of its affiliates (individually and collectively, "GE Products"); b. to publicly perform or display, import, broadcast, transmit, distribute, license, offer to sell, and sell, rent, lease or lend copies of the Feedback (and derivative works thereof) as part of any GE Product; c. solely with respect to Licensee's copyright and trade secret rights, to sublicense to third parties the foregoing rights, including the right to sublicense to further third parties; and d. to sublicense to third parties any claims of any patents owned or licensable by Licensee that are necessarily infringed by a third party product, technology or service that uses, interfaces, interoperates or communicates with the Feedback or portion thereof incorporated into a GE Product, technology or service. Further, you represent and warrant that your Feedback is not subject to any license terms that would purport to require GE to comply with any additional obligations with respect to any GE Products that incorporate any Feedback. 20 | 21 | Section 4 – Reserved 22 | 23 | Section 5 – Limitation of Liability. 24 | 25 | LIABILITY ARISING UNDER THIS LICENSE, WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), SHALL BE LIMITED TO DIRECT, OBJECTIVELY MEASURABLE DAMAGES. LICENSOR SHALL HAVE NO LIABILITY TO THE OTHER PARTY OR TO ANY THIRD PARTY, FOR ANY INCIDENTAL, PUNITIVE, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. LIABILITY FOR ANY SOFTWARE LICENSED FROM THIRD PARTIES FOR USE WITH THE SERVICES IS EXPLICILTLY DISCLAIMED AND LIMITED TO THE MAXIMUM EXTENT PERMITTED BY LAW. 26 | 27 | Notwithstanding anything to the contrary, the aggregate liability of Licensor and its suppliers under this License shall not exceed the total amounts paid by Licensee to Licensor hereunder during the one-year period immediately preceding the event which gave rise to the claims. 28 | 29 | Section 6 – License. 30 | 31 | A. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants Licensee a worldwide, perpetual, royalty-free, non-exclusive license to: 32 | 33 | install the Licensed Programs on Licensee’s premises, and permit Licensee’s users to use the Licensed Programs so installed, solely for Licensee’s own development, testing, demonstration, staging, and production of Licensee’s own software that makes use of the Licensed Programs in a way that adds substantial functionality not present in the Licensed Programs (the result, a “Licensee Application”); 34 | 35 | permit Licensee to permit third-party hosts (“Hosts”) to install the Licensee Application on such Hosts’ respective premises on Licensee’s behalf, and permit Licensee’s users to access and use the Licensed Programs so installed, solely for Licensee’s own development, testing, demonstration, staging and production purposes 36 | 37 | install the Licensee Application on Licensee’s own premises and permit its own users to use the Licensee Application so installed on the same terms as sub-sections (i) and (ii) above. 38 | 39 | B. For the purposes of this License, the right to “use” the Licensed Programs shall include the right to utilize, run, access, store, copy, test or display the Licensed Programs. No right or license is granted or agreed to be granted to disassemble or decompile any Licensed Programs furnished in object code form, and Licensee agrees not to engage in any such conduct unless permitted by law. Reverse engineering of Licensed Programs provided in object code form is prohibited, unless such a right is explicitly granted by any explicit license subject to sub-section (d) below or as a matter of law, and then only to the extent explicitly permitted. Licensor shall have no obligation to support any such reverse engineering, any product or derivative of such reverse engineering, or any use of the Licensed Programs with any modified versions of any of their components under this License. 40 | 41 | C. Licensee shall ensure that any Licensee Applications incorporate the Licensed Programs in such a way as to prevent third parties (other than Hosts) from viewing the code of the Licensed Programs or gaining access to any programmatic interface or other hidden aspect of the Licensed Programs. Licensee shall also restrict distribution of the Licensed Programs, including as part of Licensee Applications, to only those parties who are notified of, and subject to, an enforceable obligation to refrain from any of the prohibited activities listed herein, such as reverse engineering or disassembling the Licensed Programs. 42 | 43 | D. Use of some open source and third party software applications or components included in or accessed through the Licensed Programs may be subject to other terms and conditions found in a separate license agreement, terms of use or “Notice” file located at the download page. The Licensed Programs are accompanied by additional software components solely to enable the Licensed Programs to operate as designed. Licensee is not permitted to use such additional software independently of the Licensed Programs unless Licensee secures a separate license for use from the named vendor. Do not use any third party code unless you agree with the applicable license terms for that code. 44 | 45 | E. Title. Title to and ownership of the Licensed Programs shall at all times remain with Licensor. 46 | 47 | Section 7 – Termination. 48 | 49 | A) The Licensor reserves the right to cease distribution and grant of further licenses to any or all of the Licensed Programs at any time in its sole discretion. 50 | 51 | B) The Licensor reserves the right to at any time and at its sole discretion provide updated versions of any or all of the Licensed Programs that supercede and replace the prior version of that Licensed Program. 52 | 53 | C) Your license rights under Section 6 are effective until terminated as described below: 54 | 55 | i) This license and all rights under it will terminate or cease to be effective without notice if Licensee breaches the terms of the License and does not correct or remedy such breach promptly. 56 | 57 | ii) Notwithstanding the foregoing, Licensee may terminate this License at any time for any reason or no reason by providing the Licensor written notice thereof. 58 | 59 | D) Upon any expiration or termination of this License, the rights and licenses granted to you under this License shall immediately terminate, and you shall immediately cease using and delete the Licensed Programs. Licensee Applications based upon the Licensed Programs (see Section 6(a) above) are not subject to this limitation. 60 | 61 | In the event of any expiration or termination of this Licensee, any Confidentiality provision, disclaimers of GE’s representations and warranties, choice of applicable law and limitations of GE’s liability shall survive. 62 | 63 | Section 8 – Applicable Law. 64 | 65 | The License shall be governed by and interpreted in accordance with the substantive law of the State of California, U.S.A., excluding its conflicts of law provisions, and by the courts of that state. 66 | -------------------------------------------------------------------------------- /OSS_Notice.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PredixDev/predix-seed/64c4aa9d4d74f649e5562176dc02e7024ec36a88/OSS_Notice.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Project has moved 2 | This repo will no longer be updated. 3 | Please use the new version of the Seed app here: 4 | 5 | https://github.com/predixdev/predix-webapp-starter 6 | 7 | 8 | 9 | # Predix UI Seed 10 | 11 | ### NOTE - October 6, 2016 12 | 13 | This project was switched to a new, simplified implementation that includes using Polymer instead of AngularJS and removes dependencies on micro-services. For the previous implementation in AngularJS please refer to the 'develop-angular' and/or 'master-angular' branches. 14 | 15 | ## What is the Predix UI Seed? 16 | The Predix UI Seed ("Seed") is a web application starter kit aimed to accelerate Predix application development. It comes in the form of a simple web application, with code examples on features such as branding, theming, layout, navigation, responsiveness, organization of views, data presentation and micro-services integration, to name some. These working code samples can be straightforwardly customized and adapted to specific application needs. Predix application projects can directly use, remove from or add to these features to achieve prototype or production state much faster than through building everything from scratch. This speeds up application development, letting developers focus on functionality, instead of having to make boilerplate concerns work. 17 | 18 | As its name indicates the Seed is built on [Polymer](http://www.polymer-project.org). Based on the [Web Component API](https://developer.mozilla.org/en-US/docs/Web/Web_Components), Polymer is a component framework that prefers the browser's native capabilities over HTML and JavaScript enhancements, wherever possible. And where there are differences in currently available features, polyfills are provided towards consistent cross-browser behavior. By adopting the Polymer strategy the Seed ensures high consistency of application behavior across browsers, and the best chances of compatibility with future browser versions. 19 | 20 | Most of the frontend components provided in the Seed are from [Predix UI Components](http://predixdev.github.io/predix-ui/), which are also built on Polymer. These re-usable UI building blocks have been researched and designed to address the most common UI patterns. Both built upon Polymer, the Seed and Px Components work together out-of-the-box. Px Components can be used independently, or in combination with one another and with the Seed. This achieves consistent behavior, look-and-feel, and high code re-use. 21 | 22 | The backend of the Seed is now implemented as a NodeJS/Express web server. It presently includes a minimal set of public modules and a couple of Predix-specific modules (for session and proxy concerns, for example). Similar to the frontend, it is also straightforwardly customizable, even replaceable by another server application, if so desired. [NodeJS](http://nodejs.org) is a server-side application framework based on JavaScript. It enjoys strong growth and huge adoption in the server applications community. 23 | 24 | The features offered by the Seed are from open-source component projects, many of which are actively discussed and contributed to. This provides developers with available documentation and help in using such components for their projects. 25 | 26 | ## Getting Started 27 | 28 | ### Get the source code 29 | Make a directory for your project. Clone or download and extract the seed in that directory. 30 | ``` 31 | git clone https://github.com/PredixDev/predix-seed.git 32 | cd predix-seed 33 | ``` 34 | 35 | ### Install tools 36 | If you don't have them already, you'll need node, bower and gulp to be installed globally on your machine. 37 | 38 | 1. Install [node](https://nodejs.org/en/download/). This includes npm - the node package manager. 39 | 2. Install [bower](https://bower.io/) globally `npm install bower -g` 40 | 3. Install [gulp](http://gulpjs.com/) globally `npm install gulp-cli -g` 41 | 42 | ### Install the dependencies 43 | Change directory into the new project you just cloned, then install dependencies. 44 | ``` 45 | npm install 46 | bower install 47 | ``` 48 | ## Running the app locally 49 | The default gulp task will start a local web server. Just run this command: 50 | ``` 51 | gulp 52 | ``` 53 | Browse to http://localhost:5000. 54 | Initially, the app will use mock data for the views service, asset service, and time series service. 55 | Later you can connect your app to real instances of these services. 56 | 57 | ## Running in Predix Cloud 58 | With a few commands you can build a distribution version of the app, and deploy it to the cloud. 59 | 60 | ### Create a distribution version 61 | Use gulp to create a distribution version of your app, which contains vulcanized files for more efficient serving. 62 | You will need to run this command every time before you deploy to the Cloud. 63 | ``` 64 | gulp dist 65 | ``` 66 | 67 | 68 | ## Push to the Cloud 69 | 70 | ### Pre-Requisites 71 | Pushing (deploying) to a cloud environment requires knowledge of the commands involved and a valid user account with the environment. GE uses Cloud Foundry for its cloud platform. For information on Cloud Foundry, refer to this [link](http://docs.cloudfoundry.org/cf-cli/index.html). 72 | 73 | ### Steps 74 | The simplest way to push the Seed application to a cloud environment is by modifying the default manifest file (manifest.yml) and using the **cf push** command, as follows: 75 | 76 | 1. Update manifest.yml 77 | 78 | Change the name field in your manifest.yml. 79 | Uncomment the services section, and change the names to match your service instances. 80 | Uncomment the clientId and base64ClientCredential environment variables and enter the correct values for your UAA client. 81 | ``` 82 | --- 83 | applications: 84 | - name: predix-ui-seed 85 | memory: 64M 86 | buildpack: nodejs_buildpack 87 | command: node server/app.js 88 | #services: 89 | # - -secure-uaa-instance 90 | # - -timeseries-instance 91 | # - -asset-instance 92 | env: 93 | node_env: cloud 94 | uaa_service_label : predix-uaa 95 | # Add these values for authentication in the cloud 96 | #clientId: {Enter client ID, e.g. app-client-id, and place it here} 97 | #base64ClientCredential: dWFhLWNsaWVudC1pZDp1YWEtY2xpZW50LWlkLXNlY3JldA== 98 | ``` 99 | 100 | 2. Push to the cloud. 101 | 102 | ``` 103 | cf push 104 | ``` 105 | 106 | 3. Access the cloud deployment of your Seed application 107 | 108 | The output of the **cf push** command includes the URL to which your application was deployed. Below is an example: 109 | 110 | API endpoint: https://api.endpoint.svc.ice.ge.com (API version: 2.62.0) 111 | User: john.doe@ge.com 112 | Org: predix-org 113 | Space: predix-space 114 | 115 | Access your Seed application by loading the **API Endpoint** above in a web browser 116 | 117 | ## Support and Further Information 118 | 119 | Ask questions and file tickets on https://www.predix.io/community. 120 | 121 | # Copyright 122 | Copyright © 2015, 2016 GE Global Research. All rights reserved. 123 | 124 | The copyright to the computer software herein is the property of 125 | GE Global Research. The software may be used and/or copied only 126 | with the written permission of GE Global Research or in accordance 127 | with the terms and conditions stipulated in the agreement/contract 128 | under which the software has been supplied. 129 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "predix-seed", 3 | "version": "3.1.0", 4 | "private": true, 5 | "ignore": [ 6 | "**/.*", 7 | "node_modules", 8 | "bower_components", 9 | "public/bower_components", 10 | "test", 11 | "tests", 12 | "target", 13 | "test-target", 14 | "sass", 15 | "tutorials" 16 | ], 17 | "dependencies": { 18 | "es6-promise": "^3.3.1", 19 | "lodash": "~4.16.2", 20 | "q": "^1.0.0", 21 | "polymer": "^1.6.1", 22 | "iron-ajax": "~1.4.3", 23 | "iron-pages": "~1.0.8", 24 | "px-view": "^1.0.3", 25 | "app-route": "PolymerElements/app-route#^0.9.1", 26 | "px-overlay": "^0.4.0", 27 | "px-simple-line-chart": "^1.7.0", 28 | "px-simple-horizontal-bar-chart": "^0.8.0", 29 | "px-widget-cards": "^2.2.1", 30 | "px-simple-bar-chart": "^1.7.1", 31 | "px": "^1.4.3", 32 | "px-app-nav": "^1.9.1", 33 | "px-card": "^0.6.1", 34 | "px-context-browser": "^1.4.5", 35 | "px-deck-selector": "^1.5.5", 36 | "px-sample-cards": "^0.7.1", 37 | "px-theme": "^2.0.1", 38 | "px-vis-timeseries": "^0.6.2", 39 | "px-vis-xy-chart": "^0.3.0", 40 | "px-view-header": "^0.2.0" 41 | }, 42 | "devDependencies": { 43 | "px-forms-design": "^1.1.1", 44 | "px-toggle-design": "^1.1.1", 45 | "px-input-group-design": "^1.1.0", 46 | "px-flexbox-design": "^0.5.0", 47 | "px-viewport-design": "^0.4.6", 48 | "px-list-inline-design": "^0.3.1", 49 | "px-defaults-design": "^1.0.2", 50 | "px-functions-design": "^1.0.0", 51 | "px-normalize-design": "^0.4.1", 52 | "px-colors-design": "^0.3.0", 53 | "px-box-sizing-design": "^0.2.8", 54 | "px-helpers-design": "^0.3.5", 55 | "px-meta-lists-design": "^0.4.0", 56 | "px-starter-kit-design": "^0.7.0", 57 | "px-code-design": "^1.1.1", 58 | "px-headings-design": "^0.3.1", 59 | "px-buttons-design": "^1.1.2", 60 | "px-actionable-text-icons-design": "^1.1.1", 61 | "px-spacing-design": "^0.4.1" 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const gulp = require('gulp'); 3 | const plugins = require('gulp-load-plugins')(); 4 | const gulpSequence = require('gulp-sequence'); 5 | 6 | 7 | var dev = process.argv.indexOf('--dist') < 0; 8 | 9 | // ----------------------------------------------------------------------------- 10 | // getTask() loads external gulp task script functions by filename 11 | // ----------------------------------------------------------------------------- 12 | function getTask(task) { 13 | return require('./tasks/' + task)(gulp, plugins); 14 | } 15 | 16 | // ----------------------------------------------------------------------------- 17 | // Task: Compile : Scripts, Sass, EJS, All 18 | // ----------------------------------------------------------------------------- 19 | gulp.task('compile:sass', getTask('compile.sass')); 20 | gulp.task('compile:index', ['compile:sass'], getTask('compile.index')); 21 | 22 | // ----------------------------------------------------------------------------- 23 | // Task: Serve : Start 24 | // ----------------------------------------------------------------------------- 25 | gulp.task('serve:dev:start', getTask('serve.dev.start')); 26 | gulp.task('serve:dist:start', ['dist'], getTask('serve.dist.start')); 27 | 28 | // ----------------------------------------------------------------------------- 29 | // Task: Watch : Source, Public, All 30 | // ----------------------------------------------------------------------------- 31 | gulp.task('watch:public', getTask('watch.public')); 32 | 33 | // ----------------------------------------------------------------------------- 34 | // Task: Dist (Build app ready for deployment) 35 | // clean, compile:sass, compile:index, copy, vulcanize 36 | // ----------------------------------------------------------------------------- 37 | gulp.task('dist', ['dist:copy'], getTask('compile.vulcanize')); 38 | 39 | // ----------------------------------------------------------------------------- 40 | // Task: Dist : Copy source files for deploy to dist/ 41 | // ----------------------------------------------------------------------------- 42 | gulp.task('dist:copy', ['dist:clean', 'compile:index'], getTask('dist.copy')); 43 | 44 | // ----------------------------------------------------------------------------- 45 | // Task: Dist : Clean 'dist/'' folder 46 | // ----------------------------------------------------------------------------- 47 | gulp.task('dist:clean', getTask('dist.clean')); 48 | 49 | // ----------------------------------------------------------------------------- 50 | // Task: Default (compile source, start server, watch for changes) 51 | // ----------------------------------------------------------------------------- 52 | gulp.task('default', function (cb) { 53 | gulpSequence('compile:index', (dev ? 'serve:dev:start' : 'serve:dist:start'), 'watch:public')(cb); 54 | }); 55 | -------------------------------------------------------------------------------- /manifest.yml: -------------------------------------------------------------------------------- 1 | --- 2 | applications: 3 | - name: predix-ui-seed 4 | memory: 64M 5 | buildpack: nodejs_buildpack 6 | command: node server/app.js 7 | path: dist 8 | #services: 9 | # - -secure-uaa-instance 10 | # - -timeseries-instance 11 | # - -asset-instance 12 | env: 13 | node_env: cloud 14 | uaa_service_label : predix-uaa 15 | # Add these values for authentication in the cloud 16 | #clientId: {Enter client ID, e.g. app-client-id, and place it here} 17 | #base64ClientCredential: dWFhLWNsaWVudC1pZDp1YWEtY2xpZW50LWlkLXNlY3JldA== 18 | #windServiceURL: "{URL of the microservice -winddata-timeseries-service}, e.g. https://your-name-winddata-timeseries-service.run.asw-usw02-pr.predix.io" 19 | -------------------------------------------------------------------------------- /moved.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PredixDev/predix-seed/64c4aa9d4d74f649e5562176dc02e7024ec36a88/moved.jpg -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "predix-seed", 3 | "version": "3.1.0", 4 | "private": true, 5 | "engines": { 6 | "node": ">=0.10.0" 7 | }, 8 | "author": { 9 | "name": "Predix Experience", 10 | "email": "Predix.experience@ge.com" 11 | }, 12 | "scripts": { 13 | "start": "node server/app.js" 14 | }, 15 | "keywords": [ 16 | "predix-seed" 17 | ], 18 | "devDependencies": { 19 | "autoprefixer": "^6.3.6", 20 | "connect-modrewrite": "^0.7.9", 21 | "gulp": "^3.9.0", 22 | "gulp-autoprefixer": "^3.1.0", 23 | "gulp-clean": "^0.3.2", 24 | "gulp-cssmin": "^0.1.7", 25 | "gulp-ejs": "^1.2.2", 26 | "gulp-inline-source": "^2.1.0", 27 | "gulp-load-plugins": "^1.1.0", 28 | "gulp-nodemon": "^2.0.6", 29 | "gulp-rename": "^1.2.2", 30 | "gulp-replace": "^0.5.4", 31 | "gulp-sass": "^2.1.1", 32 | "gulp-sequence": "^0.4.6", 33 | "gulp-style-modules": "^0.1.0", 34 | "gulp-vulcanize": "^6.1.0", 35 | "http-rewrite-middleware": "^0.1.6", 36 | "merge-stream": "^1.0.0", 37 | "node-sass": "^3.8.0", 38 | "node-sass-import-once": "^1.2.0", 39 | "open": "0.0.4", 40 | "postcss": "^5.0.21", 41 | "postcss-cli": "^2.5.2", 42 | "request": "^2.58.0", 43 | "run-sequence": "^1.2.2", 44 | "sass-import-modules": "^2.1.0" 45 | }, 46 | "dependencies": { 47 | "body-parser": "^1.15.2", 48 | "cookie-parser": "^1.4.3", 49 | "express": "^4.14.0", 50 | "express-http-proxy": "^0.10.0", 51 | "express-session": "^1.14.1", 52 | "glob": "^7.0.3", 53 | "https-proxy-agent": "^1.0.0", 54 | "json-server": "^0.8.10", 55 | "lodash": "^4.11.2", 56 | "passport": "^0.3.2", 57 | "passport-oauth2-middleware": "^1.0.2", 58 | "passport-predix-oauth": "^0.1.2", 59 | "url": "^0.11.0" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /public/_index-inline-loading-script.js: -------------------------------------------------------------------------------- 1 | // Below is a fast app loading script 2 | // The script async & lazy-loads webcomponents-lite polyfill 3 | // then checks for Polymer element 4 | // then removes #splash div to reveal application UI in #app 5 | (function() { 6 | 7 | // Wait for async loading of elements.html bundle 8 | var onWebComponentsLoaded = function() { 9 | var mainElementLink = document.querySelector('#main-element-import'); 10 | if (mainElementLink.import && mainElementLink.import.readyState === 'complete') { 11 | onMainElementLoaded(); 12 | } else { 13 | mainElementLink.addEventListener('load', onMainElementLoaded); 14 | } 15 | }; 16 | 17 | // Remove #splash div and 'loading' class from body 18 | var onMainElementLoaded = function() { 19 | // Fade splash screen, then remove 20 | var splashEl = document.getElementById('splash'); 21 | splashEl.parentNode.removeChild(splashEl); 22 | }; 23 | 24 | // load webcomponents polyfills 25 | if ('registerElement' in document && 'import' in document.createElement('link') && 'content' in 26 | document.createElement('template')) { 27 | // browser has web components, no need to load webcomponents polyfill 28 | onWebComponentsLoaded(); 29 | } else { 30 | // polyfill web components 31 | var polyfill = document.createElement('script'); 32 | polyfill.async = true; 33 | polyfill.src = '../../bower_components/webcomponentsjs/webcomponents-lite.min.js'; 34 | polyfill.onload = onWebComponentsLoaded; 35 | document.head.appendChild(polyfill); 36 | } 37 | 38 | }()); 39 | -------------------------------------------------------------------------------- /public/_index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Predix UI Seed 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 27 | 28 | 29 | 30 | 33 | 38 | 39 | 40 | 44 | 45 | 46 | 48 |
49 | 50 | 51 | 52 | 53 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /public/elements/bar-chart-card/bar-chart-card.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 22 | 23 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /public/elements/data-table-card/data-table-card.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 21 | 22 | 75 | -------------------------------------------------------------------------------- /public/elements/ge-svg-logo/ge-svg-logo.html: -------------------------------------------------------------------------------- 1 | 2 | 22 | -------------------------------------------------------------------------------- /public/elements/predix-logo/predix-logo.html: -------------------------------------------------------------------------------- 1 | 2 | 45 | -------------------------------------------------------------------------------- /public/elements/px-deck/px-deck-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 21 | 22 | 23 | 24 | 25 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /public/elements/px-deck/px-deck.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 16 | 17 | 18 | 19 | 20 | 57 | 58 | -------------------------------------------------------------------------------- /public/elements/seed-app/seed-app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 107 | 211 | 212 | -------------------------------------------------------------------------------- /public/elements/seed-app/seed-app.scss: -------------------------------------------------------------------------------- 1 | // Settings 2 | @import "px-colors-design/_settings.colors.scss"; 3 | 4 | // Generic 5 | @import "px-normalize-design/_generic.normalize.scss"; 6 | @import "px-box-sizing-design/_generic.box-sizing.scss"; 7 | @import "px-helpers-design/_generic.helpers.scss"; 8 | 9 | // px-viewport configuration variables are documented in the px-viewport Readme.md: 10 | // https://github.com/predixdev/px-viewport-design 11 | $desk-wide-width: auto; // defaults to 100% 12 | $desk-wide-max-width: none; // defaults to 80rem 13 | $viewport-margin: 0; // defaults to auto 14 | 15 | // Base 16 | @import "px-viewport-design/_base.viewport.scss"; 17 | @import "px-flexbox-design/_base.flexbox.scss"; 18 | @import "px-code-design/_base.code.scss"; 19 | @import "px-headings-design/_base.headings.scss"; 20 | 21 | // Meta 22 | @import "px-meta-lists-design/_meta.lists.scss"; 23 | 24 | // Objects 25 | $inuit-enable-btn--bare : true; 26 | 27 | @import "px-buttons-design/_objects.buttons.scss"; 28 | 29 | $inuit-enable-layout--small : true; 30 | $inuit-enable-layout--flush : true; 31 | $inuit-enable-layout--full : true; 32 | 33 | @import "px-layout-design/_objects.layout.scss"; 34 | 35 | @import "../../seed-theme.scss"; 36 | 37 | [role=banner], [role=contentinfo] { 38 | height: calculateRem(60px); 39 | background: var(--px-seed-header-background-color); 40 | } 41 | 42 | [role=banner] { 43 | width: 100%; 44 | display: block; 45 | margin: auto; 46 | h3 { 47 | @include inuit-font-size(20px); 48 | margin: 0; 49 | line-height: calculateRem(60px); 50 | font-weight: normal; 51 | color: var(--px-seed-header-text-color, $px-page-banner-text-color); 52 | display:inline-block; 53 | svg { 54 | margin-bottom: -.1em; 55 | } 56 | 57 | } 58 | 59 | h3.app-title { 60 | color: var(--px-seed-header-text-color, $gray4); 61 | } 62 | 63 | h3.logo { 64 | color: var(--px-seed-header-text-color, $gray6); 65 | } 66 | 67 | } 68 | 69 | .content-wrapper { 70 | position: relative; 71 | display: flex; 72 | } 73 | 74 | header > div.viewport { 75 | margin: 0 15px; 76 | } 77 | 78 | main { 79 | min-height: calc(100vh - #{calculateRem(120px)}); 80 | margin-left: 0; 81 | background-color: var(--px-seed-app-main-content-area-background-color, $px-page-main-content-area-background-color); 82 | overflow-x: hidden; 83 | @include media-query(portable) { 84 | margin-left: calculateRem(55px); 85 | }; 86 | @include media-query(desk) { 87 | margin-left: 0; 88 | }; 89 | flex: 1; 90 | } 91 | 92 | [role=contentinfo] { 93 | @include inuit-font-size(12px); 94 | position: absolute; 95 | bottom: 0; 96 | width: 100%; 97 | color: $px-page-link-color; 98 | a { 99 | text-decoration: none; 100 | color: $px-page-link-color; 101 | &:hover { 102 | text-decoration: underline; 103 | } 104 | } 105 | } 106 | 107 | // Trumps 108 | $inuit-enable-margins--tiny : true; 109 | $inuit-enable-margins--small : true; 110 | $inuit-enable-margins--large : true; 111 | $inuit-enable-margins--huge : true; 112 | $inuit-enable-margins--none : true; 113 | $inuit-enable-margins--rtl : true; 114 | $inuit-enable-margins--negative-tiny : true; 115 | $inuit-enable-paddings : true; 116 | $inuit-enable-paddings--tiny : true; 117 | $inuit-enable-paddings--small : true; 118 | $inuit-enable-paddings--large : true; 119 | $inuit-enable-paddings--huge : true; 120 | $inuit-enable-paddings--none : true; 121 | 122 | @import "px-spacing-design/_trumps.spacing.scss"; 123 | @import "px-widths-design/_trumps.widths.scss"; 124 | -------------------------------------------------------------------------------- /public/elements/seed-footer/seed-footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 18 | 26 | 27 | -------------------------------------------------------------------------------- /public/elements/seed-footer/seed-footer.scss: -------------------------------------------------------------------------------- 1 | // Settings 2 | @import "px-colors-design/_settings.colors.scss"; 3 | @import "px-defaults-design/_settings.defaults.scss"; 4 | 5 | // Generic 6 | @import "px-helpers-design/_generic.helpers.scss"; 7 | 8 | $desk-wide-width: auto; // defaults to 100% 9 | $desk-wide-max-width: none; // defaults to 80rem 10 | $viewport-margin: 2rem; // defaults to auto 11 | 12 | // Base 13 | @import "px-viewport-design/_base.viewport.scss"; 14 | @import "px-flexbox-design/_base.flexbox.scss"; 15 | 16 | // Meta 17 | @import "px-meta-lists-design/_meta.lists.scss"; 18 | 19 | @import "px-mixins-design/_tools.mixins.scss"; 20 | 21 | $inuit-webfont-path: '/bower_components/px-typography-design/type'; 22 | $predix-font-family : "GE Inspira Sans", sans-serif !default; 23 | 24 | :host { 25 | font-family: $predix-font-family; 26 | } 27 | 28 | $px-page-link-color: $gray5; 29 | 30 | .footer__container { 31 | background: var(--px-seed-footer-background-color); 32 | height: 60px; 33 | padding-left: 15px; 34 | padding-right: 15px; 35 | -ms-flex-align: center; 36 | -webkit-align-items: center; 37 | -webkit-box-align: center; 38 | align-items: center; 39 | } 40 | 41 | .footer__container * { 42 | color: $gray5; 43 | } 44 | 45 | .footer__container li { 46 | margin-left: 7px; 47 | } 48 | 49 | .footer__copy { 50 | margin-left: 40px; 51 | font-size: 12px; 52 | } 53 | 54 | .footer__link { 55 | font-size: 12px; 56 | text-align: right; 57 | text-decoration: none; 58 | } 59 | 60 | // Trumps 61 | $inuit-enable-margins--small: true; 62 | $inuit-enable-margins--large: true; 63 | $inuit-enable-list-inline--delimited: true; 64 | 65 | @import "px-spacing-design/_trumps.spacing.scss"; 66 | @import "px-list-inline-design/_objects.list-inline.scss"; 67 | -------------------------------------------------------------------------------- /public/elements/seed-intro-card/seed-intro-card.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 25 | 26 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /public/elements/seed-intro-card/seed-intro-card.scss: -------------------------------------------------------------------------------- 1 | // Settings 2 | @import "px-colors-design/_settings.colors.scss"; 3 | 4 | // Generic 5 | @import "px-normalize-design/_generic.normalize.scss"; 6 | @import "px-box-sizing-design/_generic.box-sizing.scss"; 7 | @import "px-helpers-design/_generic.helpers.scss"; 8 | 9 | // Base 10 | @import "px-flexbox-design/_base.flexbox.scss"; 11 | @import "px-viewport-design/_base.viewport.scss"; 12 | @import "px-headings-design/_base.headings.scss"; 13 | 14 | // Objects 15 | @import 'px-actionable-text-icons-design/_objects.actionable.scss'; 16 | 17 | // Component 18 | // Trumps 19 | -------------------------------------------------------------------------------- /public/elements/three-widgets-card/three-widgets-card.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 87 | 88 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /public/elements/three-widgets-card/three-widgets-card.scss: -------------------------------------------------------------------------------- 1 | // Settings 2 | @import "px-colors-design/_settings.colors.scss"; 3 | 4 | // Generic 5 | @import "px-normalize-design/_generic.normalize.scss"; 6 | @import "px-box-sizing-design/_generic.box-sizing.scss"; 7 | @import "px-helpers-design/_generic.helpers.scss"; 8 | 9 | // Base 10 | 11 | @import "px-flexbox-design/_base.flexbox.scss"; 12 | @import "px-viewport-design/_base.viewport.scss"; 13 | @import "px-headings-design/_base.headings.scss"; 14 | 15 | // Objects 16 | // Component 17 | 18 | .large-value { 19 | @include inuit-font-size(30px); 20 | } 21 | .chart-header{ 22 | font-weight: bold; 23 | } 24 | 25 | // Trumps 26 | $inuit-enable-margins--none : true; 27 | $inuit-enable-paddings--huge : true; 28 | $inuit-enable-margins--small : true; 29 | $inuit-enable-margins--large : true; 30 | @import 'px-spacing-design/_trumps.spacing.scss'; -------------------------------------------------------------------------------- /public/elements/time-series-card/time-series-card.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 112 | 113 | 136 | -------------------------------------------------------------------------------- /public/elements/views/blankpage-view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 20 | 21 | -------------------------------------------------------------------------------- /public/elements/views/dashboards-view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 48 | 165 | 166 | -------------------------------------------------------------------------------- /public/elements/views/simple-asset-view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 30 | 83 | 84 | -------------------------------------------------------------------------------- /public/elements/views/winddata-view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 40 | 76 | 77 | -------------------------------------------------------------------------------- /public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PredixDev/predix-seed/64c4aa9d4d74f649e5562176dc02e7024ec36a88/public/favicon.png -------------------------------------------------------------------------------- /public/index-inline.scss: -------------------------------------------------------------------------------- 1 | // Seed Theme 2 | @import "seed-theme.scss"; 3 | 4 | // Settings 5 | // Tools 6 | 7 | // Generic 8 | @import "px-normalize-design/_generic.normalize.scss"; 9 | 10 | // Base 11 | $inuit-webfont-path: "/bower_components/px-typography-design/type"; 12 | @import "px-typography-design/_base.typography.scss"; 13 | @import "px-headings-design/_base.headings.scss"; 14 | 15 | // Meta 16 | // Objects 17 | // Components 18 | // Trumps 19 | 20 | // Page Styles to be inserted into index.html 21 | html { 22 | position: relative; 23 | min-height: 100%; 24 | } 25 | body { 26 | margin-bottom: calculateRem(60px); 27 | } 28 | html,body { 29 | margin: 0; 30 | background: var(--px-seed-header-backgrounde-color, $px-page-html-background-color); 31 | font-family: $predix-font-family; 32 | font-weight: normal; 33 | } 34 | body.loading #splash { 35 | opacity: 1; 36 | } 37 | #splash { 38 | position: absolute; 39 | top: 0; 40 | left: 0; 41 | right: 0; 42 | bottom: 0; 43 | transition: opacity 500ms cubic-bezier(0,0,0.2,1); 44 | opacity: 0; 45 | will-change: opacity; 46 | z-index: 1; 47 | background: #3b3b3f; 48 | } 49 | -------------------------------------------------------------------------------- /public/seed-theme.scss: -------------------------------------------------------------------------------- 1 | // Settings 2 | @import "px-defaults-design/_settings.defaults.scss"; 3 | @import "px-colors-design/_settings.colors.scss"; 4 | 5 | // Tools 6 | @import "px-mixins-design/_tools.mixins.scss"; 7 | 8 | // theme variables 9 | $predix-font-family : "GE Inspira Sans", sans-serif !default; 10 | $px-page-html-background-color: $gray9; 11 | $px-page-link-color: $gray5; 12 | $px-page-spine-border-color: $gray8; 13 | $px-page-spine-text-color: $white; 14 | $px-page-bold-text-color: $gray3; 15 | $px-page-card-border-color: $gray3; 16 | $px-page-card-background-color: $white; 17 | $px-page-card-text-color: $black; 18 | $px-page-card-paragraph-text-color: $gray5; 19 | $px-page-banner-text-color: $gray4; 20 | $px-page-banner-meatball-color : $gray4; 21 | $px-page-main-content-area-background-color: $graybg; 22 | -------------------------------------------------------------------------------- /server/app.js: -------------------------------------------------------------------------------- 1 | /******************************************************* 2 | The predix-seed Express web application includes these features: 3 | * routes to mock data files to demonstrate the UI 4 | * passport-predix-oauth for authentication, and a sample secure route 5 | * a proxy module for calling Predix services such as asset and time series 6 | *******************************************************/ 7 | 8 | var express = require('express'); 9 | var jsonServer = require('json-server'); // used for mock api responses 10 | var path = require('path'); 11 | var cookieParser = require('cookie-parser'); // used for session cookie 12 | var bodyParser = require('body-parser'); 13 | var passport; // only used if you have configured properties for UAA 14 | // simple in-memory session is used here. use connect-redis for production!! 15 | var session = require('express-session'); 16 | var proxy = require('./proxy'); // used when requesting data from real services. 17 | // get config settings from local file or VCAPS env var in the cloud 18 | var config = require('./predix-config'); 19 | // configure passport for authentication with UAA 20 | var passportConfig = require('./passport-config'); 21 | 22 | // if running locally, we need to set up the proxy from local config file: 23 | var node_env = process.env.node_env || 'development'; 24 | if (node_env === 'development') { 25 | var devConfig = require('./localConfig.json')[node_env]; 26 | proxy.setServiceConfig(config.buildVcapObjectFromLocalConfig(devConfig)); 27 | proxy.setUaaConfig(devConfig); 28 | } 29 | 30 | var windServiceURL = devConfig ? devConfig.windServiceURL : process.env.windServiceURL; 31 | 32 | console.log('************'+node_env+'******************'); 33 | 34 | var uaaIsConfigured = config.clientId && 35 | config.uaaURL && 36 | config.uaaURL.indexOf('https') === 0 && 37 | config.base64ClientCredential; 38 | if (uaaIsConfigured) { 39 | passport = passportConfig.configurePassportStrategy(config); 40 | } 41 | 42 | /********************************************************************** 43 | SETTING UP EXRESS SERVER 44 | ***********************************************************************/ 45 | var app = express(); 46 | 47 | app.set('trust proxy', 1); 48 | app.use(cookieParser('predixsample')); 49 | // Initializing default session store 50 | // *** Use this in-memory session store for development only. Use redis for prod. ** 51 | app.use(session({ 52 | secret: 'predixsample', 53 | name: 'cookie_name', 54 | proxy: true, 55 | resave: true, 56 | saveUninitialized: true})); 57 | 58 | if (uaaIsConfigured) { 59 | app.use(passport.initialize()); 60 | // Also use passport.session() middleware, to support persistent login sessions (recommended). 61 | app.use(passport.session()); 62 | } 63 | 64 | //Initializing application modules 65 | app.use(bodyParser.json()); 66 | app.use(bodyParser.urlencoded({ extended: false })); 67 | 68 | var server = app.listen(process.env.VCAP_APP_PORT || 5000, function () { 69 | console.log ('Server started on port: ' + server.address().port); 70 | }); 71 | 72 | /******************************************************* 73 | SET UP MOCK API ROUTES 74 | *******************************************************/ 75 | // Import route modules 76 | var viewServiceRoutes = require('./view-service-routes.js')(); 77 | var assetRoutes = require('./predix-asset-routes.js')(); 78 | var timeSeriesRoutes = require('./time-series-routes.js')(); 79 | 80 | // add mock API routes. (Remove these before deploying to production.) 81 | app.use('/api/view-service', jsonServer.router(viewServiceRoutes)); 82 | app.use('/api/predix-asset', jsonServer.router(assetRoutes)); 83 | app.use('/api/time-series', jsonServer.router(timeSeriesRoutes)); 84 | 85 | /**************************************************************************** 86 | SET UP EXPRESS ROUTES 87 | *****************************************************************************/ 88 | 89 | if (!uaaIsConfigured) { // no restrictions 90 | app.use(express.static(path.join(__dirname, process.env['base-dir'] ? process.env['base-dir'] : '../public'))); 91 | } else { 92 | //login route redirect to predix uaa login page 93 | app.get('/login',passport.authenticate('predix', {'scope': ''}), function(req, res) { 94 | // The request will be redirected to Predix for authentication, so this 95 | // function will not be called. 96 | }); 97 | 98 | // access real Predix services using this route. 99 | // the proxy will add UAA token and Predix Zone ID. 100 | app.use('/predix-api', 101 | passport.authenticate('main', { 102 | noredirect: true 103 | }), 104 | proxy.router); 105 | 106 | //callback route redirects to secure route after login 107 | app.get('/callback', passport.authenticate('predix', { 108 | failureRedirect: '/' 109 | }), function(req, res) { 110 | console.log('Redirecting to secure route...'); 111 | res.redirect('/'); 112 | }); 113 | 114 | // example of calling a custom microservice. 115 | if (windServiceURL && windServiceURL.indexOf('https') === 0) { 116 | app.get('/windy/*', passport.authenticate('main', { noredirect: true}), 117 | // if calling a secure microservice, you can use this middleware to add a client token. 118 | // proxy.addClientTokenMiddleware, 119 | proxy.customProxyMiddleware('/windy', windServiceURL) 120 | ); 121 | } 122 | 123 | //Use this route to make the entire app secure. This forces login for any path in the entire app. 124 | app.use('/', passport.authenticate('main', { 125 | noredirect: false //Don't redirect a user to the authentication page, just show an error 126 | }), 127 | express.static(path.join(__dirname, process.env['base-dir'] ? process.env['base-dir'] : '../public')) 128 | ); 129 | 130 | //Or you can follow this pattern to create secure routes, 131 | // if only some portions of the app are secure. 132 | app.get('/secure', passport.authenticate('main', { 133 | noredirect: true //Don't redirect a user to the authentication page, just show an error 134 | }), function(req, res) { 135 | console.log('Accessing the secure route'); 136 | // modify this to send a secure.html file if desired. 137 | res.send('

This is a sample secure route.

'); 138 | }); 139 | 140 | } 141 | 142 | //logout route 143 | app.get('/logout', function(req, res) { 144 | req.session.destroy(); 145 | req.logout(); 146 | passportConfig.reset(); //reset auth tokens 147 | res.redirect(config.uaaURL + '/logout?redirect=' + config.appURL); 148 | }); 149 | 150 | app.get('/favicon.ico', function (req, res) { 151 | res.send('favicon.ico'); 152 | }); 153 | 154 | // Sample route middleware to ensure user is authenticated. 155 | // Use this route middleware on any resource that needs to be protected. If 156 | // the request is authenticated (typically via a persistent login session), 157 | // the request will proceed. Otherwise, the user will be redirected to the 158 | // login page. 159 | //currently not being used as we are using passport-oauth2-middleware to check if 160 | //token has expired 161 | /* 162 | function ensureAuthenticated(req, res, next) { 163 | if(req.isAuthenticated()) { 164 | return next(); 165 | } 166 | res.redirect('/'); 167 | } 168 | */ 169 | 170 | ////// error handlers ////// 171 | // catch 404 and forward to error handler 172 | app.use(function(err, req, res, next) { 173 | console.error(err.stack); 174 | var err = new Error('Not Found'); 175 | err.status = 404; 176 | next(err); 177 | }); 178 | 179 | // development error handler - prints stacktrace 180 | if (node_env === 'development') { 181 | app.use(function(err, req, res, next) { 182 | if (!res.headersSent) { 183 | res.status(err.status || 500); 184 | res.send({ 185 | message: err.message, 186 | error: err 187 | }); 188 | } 189 | }); 190 | } 191 | 192 | // production error handler 193 | // no stacktraces leaked to user 194 | app.use(function(err, req, res, next) { 195 | if (!res.headersSent) { 196 | res.status(err.status || 500); 197 | res.send({ 198 | message: err.message, 199 | error: {} 200 | }); 201 | } 202 | }); 203 | 204 | module.exports = app; 205 | -------------------------------------------------------------------------------- /server/localConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "development": { 3 | "note": "Out of the box, the predix-seed app uses mock data, so these values are not required. Set these values for connecting to real Predix services.", 4 | "clientId": "{UAA Client ID created}", 5 | "uaaURL": "{The UAA URI end point to get auth token }", 6 | "base64ClientCredential": "{Get clientID:clientSecret then base64 encode and place it here}", 7 | "appURL": "http://localhost:5000", 8 | "timeseriesURL": "{Time Series URL from VCAPS}", 9 | "timeseriesZoneId": "{The Zone ID for the Timeseries Service Created}", 10 | "assetURL": "{Asset URL from VCAPS}", 11 | "assetZoneId": "{The Zone ID for the Asset Service Created}", 12 | "windServiceURL": "{URL of the microservice -winddata-timeseries-service}, e.g. https://your-name-winddata-timeseries-service.run.asw-usw02-pr.predix.io" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /server/passport-config.js: -------------------------------------------------------------------------------- 1 | var passport = require('passport'); 2 | var CloudFoundryStrategy = require('passport-predix-oauth').Strategy; 3 | var OAuth2RefreshTokenStrategy = require('passport-oauth2-middleware').Strategy; 4 | var cfStrategy; 5 | 6 | /********************************************************************* 7 | PASSPORT PREDIX STRATEGY SETUP 8 | **********************************************************************/ 9 | function configurePassportStrategy(predixConfig) { 10 | 'use strict'; 11 | var refreshStrategy = new OAuth2RefreshTokenStrategy({ 12 | refreshWindow: 10, // Time in seconds to perform a token refresh before it expires 13 | userProperty: 'ticket', // Active user property name to store OAuth tokens 14 | authenticationURL: '/login', // URL to redirect unathorized users to 15 | callbackParameter: 'callback' //URL query parameter name to pass a return URL 16 | }); 17 | 18 | passport.use('main', refreshStrategy); //Main authorization strategy that authenticates 19 | //user with stored OAuth access token 20 | //and performs a token refresh if needed 21 | 22 | // Passport session setup. 23 | // To support persistent login sessions, Passport needs to be able to 24 | // serialize users into and deserialize users out of the session. Typically, 25 | // this will be as simple as storing the user ID when serializing, and finding 26 | // the user by ID when deserializing. However, since this example does not 27 | // have a database of user records, the complete CloudFoundry profile is 28 | // serialized and deserialized. 29 | passport.serializeUser(function(user, done) { 30 | // console.log("From USER-->"+JSON.stringify(user)); 31 | done(null, user); 32 | }); 33 | passport.deserializeUser(function(obj, done) { 34 | done(null, obj); 35 | }); 36 | 37 | function getSecretFromEncodedString(encoded) { 38 | if (!encoded) { 39 | return ''; 40 | } 41 | var decoded = new Buffer(encoded, 'base64').toString(); 42 | // console.log('DECODED: ' + decoded); 43 | var values = decoded.split(':'); 44 | if (values.length !== 2) { 45 | throw "base64ClientCredential is not correct. \n It should be the base64 encoded value of: 'client:secret' \n Set in localConfig.json for local dev, or environment variable in the cloud."; 46 | } 47 | return values[1]; 48 | } 49 | 50 | cfStrategy = new CloudFoundryStrategy({ 51 | clientID: predixConfig.clientId, 52 | clientSecret: getSecretFromEncodedString(predixConfig.base64ClientCredential), 53 | callbackURL: predixConfig.callbackURL, 54 | authorizationURL: predixConfig.uaaURL, 55 | tokenURL: predixConfig.tokenURL 56 | },refreshStrategy.getOAuth2StrategyCallback() //Create a callback for OAuth2Strategy 57 | /* TODO: implement if needed. 58 | function(accessToken, refreshToken, profile, done) { 59 | token = accessToken; 60 | done(null, profile); 61 | }*/); 62 | 63 | passport.use(cfStrategy); 64 | //Register the OAuth strategy to perform OAuth2 refresh token workflow 65 | refreshStrategy.useOAuth2Strategy(cfStrategy); 66 | 67 | return passport; 68 | } 69 | 70 | function reset() { 71 | 'use strict'; 72 | cfStrategy.reset(); 73 | } 74 | 75 | module.exports = { 76 | configurePassportStrategy: configurePassportStrategy, 77 | reset: reset 78 | }; 79 | -------------------------------------------------------------------------------- /server/predix-asset-routes.js: -------------------------------------------------------------------------------- 1 | var glob = require("glob"); 2 | var path = require("path"); 3 | var _ = require("lodash"); 4 | 5 | // for each asset level, collect the json data to configure the json-server router 6 | // example structure: { 'assets': [ {...}, {...} ], 'enterprises': [...], ... } 7 | var getRoutes = function() { 8 | var levels = ['assets', 'enterprises', 'meters', 'plants', 'root', 'sites']; 9 | var routes = {}; 10 | _.each(levels, function(level) { 11 | routes[level] = getLevelData(level); 12 | }); 13 | 14 | var compressorJson = require(path.resolve(__dirname, './sample-data/predix-asset/compressor-2017.json')); 15 | routes["compressor-2017"] = compressorJson; 16 | 17 | return routes; 18 | }; 19 | 20 | // Pass in the name of the level 21 | // returns an array of objects based on data in .json files in level folder 22 | // example structure: [ { ... json file data ... }, { ... json file data ...} ] 23 | var getLevelData = function(level) { 24 | var fullPath = './sample-data/predix-asset/' + level + '/**/*.json'; 25 | var resolvedPath = path.resolve(__dirname, fullPath); 26 | var jsonObjects = []; 27 | var files = glob.sync(resolvedPath, {}); // all JSON files in path 28 | _.each(files, function(file) { 29 | var json = require(file); // import json data 30 | jsonObjects.push(json); 31 | }); 32 | return jsonObjects; 33 | }; 34 | 35 | // export the routes to be used in express/json-server in app.js 36 | module.exports = function() { 37 | return getRoutes(); 38 | }; 39 | -------------------------------------------------------------------------------- /server/predix-config.js: -------------------------------------------------------------------------------- 1 | /* 2 | This module reads config settings from localConfig.json when running locally, 3 | or from the VCAPS environment variables when running in Cloud Foundry. 4 | */ 5 | 6 | var settings = {}; 7 | 8 | // checking NODE_ENV to load cloud properties from VCAPS 9 | // or development properties from config.json. 10 | // These properties are not needed for fetching mock data. 11 | // Only needed if you want to connect to real Predix services. 12 | var node_env = process.env.node_env || 'development'; 13 | if(node_env === 'development') { 14 | // use localConfig file 15 | var devConfig = require('./localConfig.json')[node_env]; 16 | // console.log(devConfig); 17 | settings.base64ClientCredential = devConfig.base64ClientCredential; 18 | settings.clientId = devConfig.clientId; 19 | settings.uaaURL = devConfig.uaaURL; 20 | settings.tokenURL = devConfig.uaaURL; 21 | settings.appURL = devConfig.appURL; 22 | settings.callbackURL = devConfig.appURL + '/callback'; 23 | 24 | settings.assetURL = devConfig.assetURL; 25 | settings.assetZoneId = devConfig.assetZoneId; 26 | settings.timeseriesZoneId = devConfig.timeseriesZoneId; 27 | settings.timeseriesURL = devConfig.timeseriesURL; 28 | 29 | } else { 30 | // read VCAP_SERVICES 31 | var vcapsServices = JSON.parse(process.env.VCAP_SERVICES); 32 | var uaaService = vcapsServices[process.env.uaa_service_label]; 33 | var assetService = vcapsServices['predix-asset']; 34 | var timeseriesService = vcapsServices['predix-timeseries']; 35 | 36 | if(uaaService) { 37 | settings.uaaURL = uaaService[0].credentials.uri; 38 | settings.tokenURL = uaaService[0].credentials.uri; 39 | } 40 | if(assetService) { 41 | settings.assetURL = assetService[0].credentials.uri + '/' + process.env.assetMachine; 42 | settings.assetZoneId = assetService[0].credentials.zone['http-header-value']; 43 | } 44 | if(timeseriesService) { 45 | settings.timeseriesZoneId = timeseriesService[0].credentials.query['zone-http-header-value']; 46 | settings.timeseriesURL = timeseriesService[0].credentials.query.uri; 47 | } 48 | 49 | // read VCAP_APPLICATION 50 | var vcapsApplication = JSON.parse(process.env.VCAP_APPLICATION); 51 | settings.appURL = 'https://' + vcapsApplication.uris[0]; 52 | settings.callbackURL = settings.appURL + '/callback'; 53 | settings.base64ClientCredential = process.env.base64ClientCredential; 54 | settings.clientId = process.env.clientId; 55 | } 56 | // console.log('config settings: ' + JSON.stringify(settings)); 57 | 58 | // This vcap object is used by the proxy module. 59 | settings.buildVcapObjectFromLocalConfig = function(config) { 60 | 'use strict'; 61 | // console.log('local config: ' + JSON.stringify(config)); 62 | var vcapObj = {}; 63 | if (config.uaaURL) { 64 | vcapObj['predix-uaa'] = [{ 65 | credentials: { 66 | uri: config.uaaURL 67 | } 68 | }]; 69 | } 70 | if (config.timeseriesURL) { 71 | vcapObj['predix-timeseries'] = [{ 72 | credentials: { 73 | query: { 74 | uri: config.timeseriesURL, 75 | 'zone-http-header-value': config.timeseriesZoneId 76 | } 77 | } 78 | }]; 79 | } 80 | if (config.assetURL) { 81 | vcapObj['predix-asset'] = [{ 82 | credentials: { 83 | uri: config.assetURL, 84 | zone: { 85 | 'http-header-value': config.assetZoneId 86 | } 87 | } 88 | }]; 89 | } 90 | return vcapObj; 91 | }; 92 | 93 | module.exports = settings; 94 | -------------------------------------------------------------------------------- /server/proxy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This module can be used to set up reverse proxying from client to Predix services. 3 | * It assumes only one UAA instance, one UAA client, and one instance of each service. 4 | * Use setUaaConfig() and setServiceConfig() for local development. 5 | * In cloud foundry, set the following environment vars: clientId, base64ClientCredential 6 | * Info for bound services is read from VCAP environment variables. 7 | */ 8 | 9 | var url = require('url'); 10 | var express = require('express'); 11 | var expressProxy = require('express-http-proxy'); 12 | var HttpsProxyAgent = require('https-proxy-agent'); 13 | var router = express.Router(); 14 | var vcapServices = {}; 15 | 16 | var corporateProxyServer = process.env.http_proxy || process.env.HTTP_PROXY || process.env.https_proxy || process.env.HTTPS_PROXY; 17 | var corporateProxyAgent; 18 | if (corporateProxyServer) { 19 | corporateProxyAgent = new HttpsProxyAgent(corporateProxyServer); 20 | } 21 | 22 | var clientId = process.env.clientId; 23 | var base64ClientCredential = process.env.base64ClientCredential; 24 | var uaaURL = (function() { 25 | var vcapsServices = process.env.VCAP_SERVICES ? JSON.parse(process.env.VCAP_SERVICES) : {}; 26 | var uaaService = vcapsServices['predix-uaa']; 27 | var uaaURL; 28 | 29 | if(uaaService) { 30 | uaaURL = uaaService[0].credentials.uri; 31 | } 32 | return uaaURL; 33 | }) (); 34 | 35 | // Pass a VCAPS object here if desired, for local config. 36 | // Otherwise, this module reads from VCAP_SERVICES environment variable. 37 | var setServiceConfig = function(vcaps) { 38 | vcapServices = vcaps; 39 | setProxyRoutes(); 40 | }; 41 | 42 | var setUaaConfig = function(options) { 43 | clientId = options.clientId || clientId; 44 | uaaURL = options.uaaURL || uaaURL; 45 | base64ClientCredential = options.base64ClientCredential || base64ClientCredential; 46 | }; 47 | 48 | var getClientToken = function(successCallback, errorCallback) { 49 | var request = require('request'); 50 | var options = { 51 | method: 'POST', 52 | url: uaaURL + '/oauth/token', 53 | form: { 54 | 'grant_type': 'client_credentials', 55 | 'client_id': clientId 56 | }, 57 | headers: { 58 | 'Authorization': 'Basic ' + base64ClientCredential 59 | } 60 | }; 61 | 62 | request(options, function(err, response, body) { 63 | if (!err && response.statusCode == 200) { 64 | // console.log('response from getClientToken: ' + body); 65 | var clientTokenResponse = JSON.parse(body); 66 | successCallback(clientTokenResponse['token_type'] + ' ' + clientTokenResponse['access_token']); 67 | } else if (errorCallback) { 68 | errorCallback(body); 69 | } else { 70 | console.log('ERROR fetching client token: ' + body); 71 | } 72 | }); 73 | }; 74 | 75 | function cleanResponseHeaders (rsp, data, req, res, cb) { 76 | res.removeHeader('Access-Control-Allow-Origin'); 77 | cb(null, data); 78 | } 79 | 80 | function buildDecorator(zoneId) { 81 | var decorator = function(req) { 82 | if (corporateProxyAgent) { 83 | req.agent = corporateProxyAgent; 84 | } 85 | req.headers['Content-Type'] = 'application/json'; 86 | if (zoneId) { 87 | req.headers['Predix-Zone-Id'] = zoneId; 88 | } 89 | return req; 90 | }; 91 | return decorator; 92 | } 93 | 94 | function getEndpointAndZone(key, credentials) { 95 | var out = {}; 96 | // ugly code needed since vcap service variables are not consistent across services 97 | // TODO: all the other predix services 98 | if (key === 'predix-asset') { 99 | out.serviceEndpoint = credentials.uri; 100 | out.zoneId = credentials.zone['http-header-value']; 101 | } else if (key === 'predix-timeseries') { 102 | var urlObj = url.parse(credentials.query.uri); 103 | out.serviceEndpoint = urlObj.protocol + '//' + urlObj.host; 104 | out.zoneId = credentials.query['zone-http-header-value']; 105 | } 106 | if (!out.serviceEndpoint) { 107 | console.log('no proxy set for service: ' + key); 108 | } 109 | return out; 110 | } 111 | 112 | var setProxyRoute = function(key, credentials) { 113 | // console.log(JSON.stringify(credentials)); 114 | var routeOptions = getEndpointAndZone(key, credentials); 115 | if (!routeOptions.serviceEndpoint) { 116 | return; 117 | } 118 | console.log('setting proxy route for key: ' + key); 119 | console.log('serviceEndpoint: ' + routeOptions.serviceEndpoint); 120 | // console.log('zone id: ' + routeOptions.zoneId); 121 | var decorator = buildDecorator(routeOptions.zoneId); 122 | 123 | router.use('/' + key, expressProxy(routeOptions.serviceEndpoint, { 124 | https: true, 125 | forwardPath: function (req) { 126 | console.log('req.url: ' + req.url); 127 | return req.url; 128 | }, 129 | intercept: cleanResponseHeaders, 130 | decorateRequest: decorator 131 | })); 132 | }; 133 | 134 | // Fetches client token, adds to request headers, and stores in session. 135 | // Returns 403 if no session. 136 | // Use this middleware to proxy a request to a secure service, using a client token. 137 | var addClientTokenMiddleware = function(req, res, next) { 138 | function errorHandler(errorString) { 139 | // TODO: fix, so it doesn't return a status 200. 140 | // Tried sendStatus, but headers were already set. 141 | res.send(errorString); 142 | } 143 | // console.log('proxy root route'); 144 | if (req.session) { 145 | // console.log('session found.'); 146 | if (!req.session.clientToken) { 147 | // console.log('fetching client token'); 148 | getClientToken(function(token) { 149 | req.session.clientToken = token; 150 | req.headers['Authorization'] = req.session.clientToken; 151 | next(); 152 | }, errorHandler); 153 | } else { 154 | // console.log('client token found in session'); 155 | req.headers['Authorization'] = req.session.clientToken; 156 | next(); 157 | } 158 | } else { 159 | next(res.sendStatus(403).send('Forbidden')); 160 | } 161 | }; 162 | 163 | router.use('/', addClientTokenMiddleware); 164 | 165 | // TODO: Support for multiple instances of the same service. 166 | var setProxyRoutes = function() { 167 | var vcapString = process.env.VCAP_SERVICES; 168 | var serviceKeys = []; 169 | vcapServices = vcapString ? JSON.parse(vcapString) : vcapServices; 170 | console.log('vcaps: ' + JSON.stringify(vcapServices)); 171 | 172 | serviceKeys = Object.keys(vcapServices); 173 | serviceKeys.forEach(function(key) { 174 | setProxyRoute(key, vcapServices[key][0].credentials); 175 | }); 176 | }; 177 | // TODO: only call this, if we find a vcapstring in environment? 178 | setProxyRoutes(); 179 | 180 | // Use this to set up your own proxy route to your custom microservice. 181 | // Path and arguments after the pathPrefix will be passed on to the target endpoint. 182 | // pathPrefix: the path that clients will call in your express app. 183 | // endpoint: the URL of your custom microservice. 184 | // example usage: 185 | // customProxyMiddleware('/my-custom-api', 'https://my-custom-service.run.aws-usw02-pr.ice.predix.io') 186 | var customProxyMiddleware = function(pathPrefix, endpoint) { 187 | console.log('custom endpoint: ' + endpoint); 188 | return expressProxy(endpoint, { 189 | https: true, 190 | forwardPath: function (req) { 191 | var path = req.url.replace(pathPrefix, ''); 192 | console.log('proxying to:', path); 193 | return path; 194 | }, 195 | intercept: cleanResponseHeaders, 196 | decorateRequest: buildDecorator() 197 | }); 198 | }; 199 | 200 | module.exports = { 201 | router: router, 202 | setServiceConfig: setServiceConfig, 203 | setUaaConfig: setUaaConfig, 204 | customProxyMiddleware: customProxyMiddleware, 205 | addClientTokenMiddleware: addClientTokenMiddleware, 206 | expressProxy: expressProxy 207 | }; 208 | -------------------------------------------------------------------------------- /server/sample-data/predix-asset/compressor-2017.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "complexType": "Asset", 3 | "uri": "/asset/compressor-2017", 4 | "classificationUri": "/classification/GE_COMPRESSOR_CYLINDER", 5 | "assetId": "compressor-2017", 6 | "description": "GE Compressor", 7 | "group": "/group/plant-richmond-refinery", 8 | "assetTag": { 9 | "crank-frame-compressionratio": { 10 | "complexType": "AssetTag", 11 | "label": "Compression Ratio", 12 | "tagUri": "/tag/crank-frame-compressionratio", 13 | "hiAlarmThreshold": 3, 14 | "loAlarmThreshold": 2.5, 15 | "tagDatasource": { 16 | "sourceTagId": "Compressor-2017:CompressionRatio", 17 | "nodeName": "Compressor-2017:CompressionRatio", 18 | "isKpi": "true", 19 | "fieldUri": "asset/adh-field-123", 20 | "controllerUri": "/sample/machine/controller", 21 | "machineUri": "/Compressor-2017:CompressionRatio" 22 | } 23 | }, 24 | "crank-frame-dischargepressure": { 25 | "complexType": "AssetTag", 26 | "label": "Discharge Pressure", 27 | "tagUri": "/tag/crank-frame-dischargepressure", 28 | "hiAlarmThreshold": 23, 29 | "loAlarmThreshold": 0, 30 | "tagDatasource": { 31 | "sourceTagId": "Compressor-2017:DischargePressure", 32 | "nodeName": "Compressor-2017:DischargePressure", 33 | "isKpi": "true", 34 | "controllerUri": "/sample/machine/controller", 35 | "machineUri": "/Compressor-2017:DischargePressure", 36 | "tagExtensionsUri": "/asset/compressor-2017.tag-extensions.crank-frame-discharge-pressure" 37 | } 38 | }, 39 | "crank-frame-suctionpressure": { 40 | "complexType": "AssetTag", 41 | "label": "Suction Pressure", 42 | "tagUri": "/tag/crank-frame-suctionpressure", 43 | "hiAlarmThreshold": 0.21, 44 | "loAlarmThreshold": 0, 45 | "tagDatasource": { 46 | "sourceTagId": "Compressor-2017:SuctionPressure", 47 | "nodeName": "Compressor-2017:SuctionPressure", 48 | "fieldUri": "asset/adh-field-456", 49 | "controllerUri": "/sample/machine/controller", 50 | "machineUri": "/Compressor-2017:SuctionPressure" 51 | } 52 | }, 53 | "crank-frame-maxpressure": { 54 | "complexType": "AssetTag", 55 | "label": "Max Pressure", 56 | "tagUri": "/tag/crank-frame-maxpressure", 57 | "hiAlarmThreshold": 26, 58 | "loAlarmThreshold": 22, 59 | "tagDatasource": { 60 | "sourceTagId": "Compressor-2017:MaximumPressure", 61 | "nodeName": "Compressor-2017:MaximumPressure", 62 | "fieldUri": "asset/adh-field-456", 63 | "controllerUri": "/sample/machine/controller", 64 | "machineUri": "/Compressor-2017:MaximumPressure" 65 | } 66 | }, 67 | "crank-frame-minpressure": { 68 | "complexType": "AssetTag", 69 | "label": "Min Pressure", 70 | "tagUri": "/tag/crank-frame-minpressure", 71 | "hiAlarmThreshold": 0, 72 | "loAlarmThreshold": 0, 73 | "tagDatasource": { 74 | "sourceTagId": "Compressor-2017:MinimumPressure", 75 | "nodeName": "Compressor-2017:MinimumPressure", 76 | "fieldUri": "asset/adh-field-456", 77 | "controllerUri": "/sample/machine/controller", 78 | "machineUri": "/Compressor-2017:MinimumPressure" 79 | } 80 | }, 81 | "crank-frame-velocity": { 82 | "complexType": "AssetTag", 83 | "label": "Velocity", 84 | "tagUri": "/tag/crank-frame-velocity", 85 | "hiAlarmThreshold": 0.07, 86 | "loAlarmThreshold": 0, 87 | "tagDatasource": { 88 | "sourceTagId": "Compressor-2017:Velocity", 89 | "nodeName": "Compressor-2017:Velocity", 90 | "isKpi": "true", 91 | "fieldUri": "asset/adh-field-456", 92 | "controllerUri": "/sample/machine/controller", 93 | "machineUri": "/Compressor-2017:Velocity" 94 | } 95 | }, 96 | "crank-frame-temperature": { 97 | "complexType": "AssetTag", 98 | "label": "Temperature", 99 | "tagUri": "/tag/crank-frame-temperature", 100 | "hiAlarmThreshold": 80, 101 | "loAlarmThreshold": 65, 102 | "tagDatasource": { 103 | "sourceTagId": "Compressor-2017:Temperature", 104 | "nodeName": "Compressor-2017:Temperature", 105 | "fieldUri": "asset/adh-field-456", 106 | "controllerUri": "/sample/machine/controller", 107 | "machineUri": "/Compressor-2017:Temperature" 108 | } 109 | } 110 | }, 111 | "attributes": { 112 | "machineControllerId": { 113 | "complexType": "Attribute", 114 | "type": "string", 115 | "enumeration": [], 116 | "value": [ 117 | "/asset/Bently.Nevada.3500.Rack1" 118 | ] 119 | }, 120 | "summaryTag": { 121 | "complexType": "Attribute", 122 | "type": "string", 123 | "enumeration": [], 124 | "value": [ 125 | "crank-frame-velocity", 126 | "crank-frame-compressionratio" 127 | ] 128 | } 129 | } 130 | }] 131 | -------------------------------------------------------------------------------- /server/sample-data/predix-asset/enterprises/parent-asset/parent-asset.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "parent-asset", 3 | "data": [{ 4 | "id": "child-asset", 5 | "name": "Child Asset", 6 | "parent": "/enterprises/parent-asset", 7 | "parentId": "/enterprises/parent-asset", 8 | "description": "Child Asset", 9 | "uri": "/sites/child-asset", 10 | "level": "site", 11 | "isOpenable": true 12 | }], 13 | "meta": { 14 | "parentId": "parent-asset" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /server/sample-data/predix-asset/root/root.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "root", 3 | "data": [{ 4 | "id": "parent-asset", 5 | "name": "Parent Asset", 6 | "parent": "/parent-asset", 7 | "parentId": "/parent-asset", 8 | "description": "Parent Asset Description", 9 | "uri": "/enterprises/parent-asset", 10 | "level": "enterprise", 11 | "isOpenable": true 12 | }], 13 | "meta": { 14 | "parentId": null 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /server/sample-data/predix-asset/sites/child-asset/child-asset.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "child-asset", 3 | "name": "Child Asset", 4 | "parent": "/enterprises/parent-asset", 5 | "parentId": "/enterprises/parent-asset", 6 | "description": "Child Asset", 7 | "uri": "/sites/child-asset", 8 | "level": "site", 9 | "isOpenable": true, 10 | "meta": { 11 | "parentId": "child-asset" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /server/sample-data/time-series/core-vibe/core-vibe-rear-cruise.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "tags": [{ 4 | "name": "core-vib-rear-cruise", 5 | "results": [{ 6 | "datapoints": [ 7 | [1397102460000, 0.99], 8 | [1397139660000, 0.92], 9 | [1397177400000, 0.97], 10 | [1397228040000, 1.12], 11 | [1397248260000, 1.09], 12 | [1397291280000, 1], 13 | [1397318100000, 0.99], 14 | [1397342100000, 0.75], 15 | [1397390820000, 1.11], 16 | [1397408100000, 1.03], 17 | [1397458800000, 0.84], 18 | [1397522940000, 0.99], 19 | [1397542800000, 0.96], 20 | [1397640960000, 0.88], 21 | [1397663100000, 0.79], 22 | [1397700000000, 0.85], 23 | [1397753040000, 1.03], 24 | [1397772540000, 0.93], 25 | [1397794860000, 0.88], 26 | [1397813580000, 0.88], 27 | [1397890680000, 0.91], 28 | [1397932020000, 0.76], 29 | [1397973480000, 0.72], 30 | [1398009240000, 0.65], 31 | [1398195060000, 1.12], 32 | [1398219120000, 0.92], 33 | [1398239220000, 0.9], 34 | [1398260040000, 0.87], 35 | [1398301740000, 0.88], 36 | [1398331800000, 1.03], 37 | [1398369780000, 1], 38 | [1398395820000, 0.99], 39 | [1398430020000, 0.92], 40 | [1398486120000, 0.9], 41 | [1398487260000, 0.9], 42 | [1398507060000, 1.1], 43 | [1398529500000, 0.89], 44 | [1398600420000, 0.94], 45 | [1398617940000, 0.64], 46 | [1398638520000, 0.82], 47 | [1398691860000, 1.08], 48 | [1398714240000, 1.01], 49 | [1398807540000, 0.7], 50 | [1398858180000, 1.16], 51 | [1398879420000, 0.89], 52 | [1398920880000, 0.87], 53 | [1398956340000, 0.83], 54 | [1398995280000, 0.85], 55 | [1399033260000, 0.95], 56 | [1399048020000, 1.03], 57 | [1399072260000, 1.05], 58 | [1399093380000, 1.04], 59 | [1399136640000, 1.05], 60 | [1399382700000, 0.83], 61 | [1399399200000, 1.02], 62 | [1399427880000, 0.98], 63 | [1399557300000, 0.86], 64 | [1399574100000, 1.03], 65 | [1399659240000, 0.97], 66 | [1399714920000, 1.03], 67 | [1399741620000, 0.97], 68 | [1399761480000, 0.6], 69 | [1399811700000, 0.63], 70 | [1399851360000, 0.97], 71 | [1399919280000, 0.85], 72 | [1399975020000, 1.06], 73 | [1400007660000, 0.72], 74 | [1400055420000, 1.02], 75 | [1400071680000, 1.06], 76 | [1400090940000, 0.91], 77 | [1400155860000, 1.04], 78 | [1400168100000, 0.73], 79 | [1400220300000, 0.72], 80 | [1400245860000, 0.92], 81 | [1400260020000, 1.04], 82 | [1400308380000, 0.7], 83 | [1400347560000, 1.08], 84 | [1400367960000, 1], 85 | [1400399640000, 0.81], 86 | [1400469720000, 0.88], 87 | [1400495700000, 1.04], 88 | [1400538120000, 1.14], 89 | [1400560800000, 1.09], 90 | [1400584020000, 0.96], 91 | [1400611800000, 0.91], 92 | [1400640360000, 1.13], 93 | [1400655180000, 0.94], 94 | [1400682720000, 1.09], 95 | [1400693880000, 0.93], 96 | [1400753700000, 0.98], 97 | [1400775840000, 0.92], 98 | [1400848800000, 0.94], 99 | [1400877360000, 1.06], 100 | [1400913720000, 0.91], 101 | [1400946900000, 0.83], 102 | [1400981820000, 0.82], 103 | [1401019020000, 1], 104 | [1401031860000, 0.97], 105 | [1401049560000, 1.12], 106 | [1401075000000, 0.87], 107 | [1401101400000, 0.79], 108 | [1401139500000, 0.76], 109 | [1401200940000, 1], 110 | [1401222240000, 0.87], 111 | [1401265740000, 0.84], 112 | [1401292620000, 0.75], 113 | [1401331080000, 0.85], 114 | [1401377160000, 1.14], 115 | [1401391020000, 1.04], 116 | [1401413100000, 1.13], 117 | [1401425460000, 1.08], 118 | [1401445020000, 0.89], 119 | [1401528660000, 1.1], 120 | [1401549240000, 1.08], 121 | [1401581040000, 0.9], 122 | [1401612000000, 0.83], 123 | [1401639300000, 0.78], 124 | [1401657960000, 0.61], 125 | [1401706320000, 0.96], 126 | [1401715860000, 1.1], 127 | [1401777360000, 1.14], 128 | [1401817740000, 0.91], 129 | [1401851100000, 0.75], 130 | [1401877740000, 0.87], 131 | [1401925440000, 1.05], 132 | [1401948000000, 0.68], 133 | [1402005840000, 0.72], 134 | [1402050660000, 1.14], 135 | [1402079100000, 0.82], 136 | [1402119840000, 0.87], 137 | [1402145040000, 1.18], 138 | [1402168560000, 0.87], 139 | [1402216320000, 0.74], 140 | [1402285020000, 0.87], 141 | [1402315260000, 0.94], 142 | [1402327560000, 0.96], 143 | [1402465260000, 1.04], 144 | [1402474980000, 0.89], 145 | [1402527840000, 0.82], 146 | [1402539360000, 0.79], 147 | [1402556700000, 1.03], 148 | [1402588920000, 0.99], 149 | [1402606440000, 0.86], 150 | [1402640940000, 0.96], 151 | [1402684320000, 0.97], 152 | [1402732200000, 0.9], 153 | [1402759920000, 0.74], 154 | [1402796280000, 0.76], 155 | [1402822020000, 1], 156 | [1402834320000, 0.92], 157 | [1402860300000, 1.09], 158 | [1402881240000, 0.96], 159 | [1402941420000, 0.82], 160 | [1402965000000, 0.75], 161 | [1403016420000, 1.08], 162 | [1403040240000, 0.96], 163 | [1403092920000, 0.91], 164 | [1403112420000, 0.58], 165 | [1403143620000, 0.77], 166 | [1403177640000, 1.06], 167 | [1403191140000, 0.96], 168 | [1403225520000, 1.12], 169 | [1403236500000, 0.81], 170 | [1403283240000, 0.93], 171 | [1403370360000, 0.75], 172 | [1403397540000, 1.15], 173 | [1403422380000, 0.7], 174 | [1403498040000, 0.78], 175 | [1403593980000, 1.03], 176 | [1403624160000, 0.8], 177 | [1403667600000, 0.62], 178 | [1403683020000, 0.89], 179 | [1403703960000, 1.1], 180 | [1403766900000, 0.96], 181 | [1403924880000, 0.87], 182 | [1403985060000, 0.94], 183 | [1404023160000, 0.91], 184 | [1404058080000, 0.79], 185 | [1404084300000, 0.7], 186 | [1404132180000, 0.95], 187 | [1404142320000, 1], 188 | [1404190440000, 1.11], 189 | [1404331500000, 1.08], 190 | [1404373020000, 0.79], 191 | [1404404280000, 0.92], 192 | [1404443880000, 0.76], 193 | [1404462300000, 1.22], 194 | [1404493740000, 1], 195 | [1404575700000, 0.71], 196 | [1404635760000, 1.02], 197 | [1404664380000, 1], 198 | [1404684180000, 1.19], 199 | [1404699960000, 1.14], 200 | [1404750720000, 0.84], 201 | [1404843180000, 0.98], 202 | [1404921540000, 0.93], 203 | [1404946080000, 0.53], 204 | [1405004940000, 0.94], 205 | [1405019220000, 0.99], 206 | [1405035480000, 1.17], 207 | [1405052100000, 0.81], 208 | [1405110840000, 1], 209 | [1406131620000, 0.84], 210 | [1406163900000, 0.86], 211 | [1406198940000, 0.87], 212 | [1406264220000, 0.89], 213 | [1406509080000, 0.83], 214 | [1406532300000, 0.95], 215 | [1406546520000, 0.83], 216 | [1406599740000, 1.02], 217 | [1406609460000, 0.68], 218 | [1406701560000, 0.89], 219 | [1406735640000, 0.86], 220 | [1406757060000, 0.71], 221 | [1406801400000, 0.92], 222 | [1406815380000, 1.16], 223 | [1406845500000, 1.17], 224 | [1406861700000, 0.84], 225 | [1406893380000, 1.08], 226 | [1406952840000, 0.74], 227 | [1407006180000, 0.85], 228 | [1407060180000, 0.84], 229 | [1407083040000, 0.96], 230 | [1407130980000, 0.9], 231 | [1407144120000, 1.07], 232 | [1407161400000, 1.18], 233 | [1407235200000, 1.13], 234 | [1407270540000, 1.03], 235 | [1407357540000, 0.9], 236 | [1407368820000, 0.98], 237 | [1407439680000, 0.88], 238 | [1407597540000, 0.88], 239 | [1407672120000, 0.91], 240 | [1407732000000, 0.99], 241 | [1409522340000, 0.72], 242 | [1409567280000, 0.76], 243 | [1409673960000, 1], 244 | [1409765640000, 0.95], 245 | [1409781300000, 0.9], 246 | [1409792100000, 1.05], 247 | [1409849700000, 0.76], 248 | [1409916360000, 0.96], 249 | [1409932200000, 0.83], 250 | [1409969340000, 1.12], 251 | [1409985960000, 0.68], 252 | [1410040500000, 0.83], 253 | [1410091020000, 0.78], 254 | [1410106560000, 0.66], 255 | [1410153720000, 1.08], 256 | [1410170940000, 1.05], 257 | [1410184560000, 0.94], 258 | [1410809220000, 0.69], 259 | [1410876420000, 0.63], 260 | [1410901620000, 1.03], 261 | [1410921060000, 0.89], 262 | [1410940500000, 0.84], 263 | [1410973140000, 0.84], 264 | [1410998880000, 0.83], 265 | [1411046040000, 0.82], 266 | [1411062480000, 1.02], 267 | [1411143180000, 0.98], 268 | [1411199340000, 1], 269 | [1411222440000, 0.91], 270 | [1411332240000, 0.79], 271 | [1411350540000, 0.82], 272 | [1411401420000, 0.8], 273 | [1411446000000, 0.81], 274 | [1411468320000, 1.02], 275 | [1411496820000, 0.86], 276 | [1411561560000, 0.82], 277 | [1411579200000, 0.62], 278 | [1411609440000, 0.72], 279 | [1411644360000, 0.85], 280 | [1411654080000, 0.84], 281 | [1411679880000, 1], 282 | [1411704300000, 1.04], 283 | [1411725600000, 0.94], 284 | [1411749840000, 0.93], 285 | [1411793340000, 0.71], 286 | [1411820820000, 0.92], 287 | [1411848480000, 0.69], 288 | [1411872120000, 0.69], 289 | [1411902720000, 0.88], 290 | [1411937400000, 0.75], 291 | [1411950240000, 0.72], 292 | [1411968780000, 0.99], 293 | [1412140860000, 0.89], 294 | [1412163600000, 0.99], 295 | [1412174280000, 0.76], 296 | [1412209980000, 0.8], 297 | [1412244000000, 0.88], 298 | [1412268780000, 1], 299 | [1412289840000, 0.88], 300 | [1412326800000, 1.01], 301 | [1412362080000, 0.69], 302 | [1412386860000, 0.95], 303 | [1412403180000, 0.83], 304 | [1412465400000, 0.62], 305 | [1412482620000, 0.91], 306 | [1412506500000, 0.57], 307 | [1412562060000, 0.54], 308 | [1412582280000, 0.88], 309 | [1412707980000, 0.74], 310 | [1412728980000, 0.79], 311 | [1412758920000, 1.08], 312 | [1412794380000, 0.69], 313 | [1412823120000, 0.82], 314 | [1412875920000, 0.62], 315 | [1412919180000, 1], 316 | [1412937780000, 0.53], 317 | [1412997120000, 0.69], 318 | [1413041700000, 0.79], 319 | [1413082680000, 0.62], 320 | [1413112080000, 0.69], 321 | [1413132300000, 0.62], 322 | [1413146400000, 0.84], 323 | [1413176160000, 0.96], 324 | [1413193200000, 0.42], 325 | [1413259440000, 0.78], 326 | [1413289740000, 0.6], 327 | [1413305220000, 0.86], 328 | [1413326940000, 0.87], 329 | [1413359640000, 0.7], 330 | [1413436680000, 0.83], 331 | [1413454560000, 0.83], 332 | [1413471360000, 0.8], 333 | [1413492960000, 0.85], 334 | [1413508080000, 0.52], 335 | [1413561840000, 0.84], 336 | [1413573600000, 0.81], 337 | [1413585600000, 0.77], 338 | [1413625980000, 0.64], 339 | [1413666900000, 0.72], 340 | [1413703680000, 0.95], 341 | [1413721380000, 0.56], 342 | [1413768660000, 0.85], 343 | [1413812520000, 0.74], 344 | [1413847500000, 0.73], 345 | [1413877920000, 0.76], 346 | [1413918780000, 0.84], 347 | [1413930600000, 0.79], 348 | [1414080000000, 0.55], 349 | [1414118340000, 0.9], 350 | [1414142940000, 0.81], 351 | [1414179060000, 0.5], 352 | [1414228440000, 0.57], 353 | [1414267860000, 0.94], 354 | [1414283100000, 0.77], 355 | [1414317060000, 0.5], 356 | [1414341720000, 0.59], 357 | [1414382160000, 0.71], 358 | [1414406700000, 0.74], 359 | [1414428240000, 0.9], 360 | [1414444380000, 0.58], 361 | [1414539420000, 0.75], 362 | [1414566600000, 0.74], 363 | [1414602660000, 0.27], 364 | [1414620240000, 0.61], 365 | [1414663440000, 0.79], 366 | [1414687680000, 0.83], 367 | [1414710840000, 0.43], 368 | [1414751340000, 0.9], 369 | [1414783440000, 0.74], 370 | [1414878780000, 0.55], 371 | [1414925520000, 0.61], 372 | [1414942860000, 0.89], 373 | [1414971300000, 0.56], 374 | [1414989240000, 0.49], 375 | [1415027940000, 0.34], 376 | [1415064660000, 0.62], 377 | [1415097840000, 0.78], 378 | [1415130720000, 0.76], 379 | [1415192580000, 0.81], 380 | [1415207520000, 0.78], 381 | [1415230620000, 0.51], 382 | [1415271540000, 0.68], 383 | [1415286720000, 0.79], 384 | [1415319840000, 0.66], 385 | [1415337780000, 0.64], 386 | [1415379060000, 0.83], 387 | [1415406600000, 0.52], 388 | [1415429580000, 0.78], 389 | [1415457420000, 0.67], 390 | [1415479740000, 0.7], 391 | [1415504280000, 0.76], 392 | [1415535420000, 0.47], 393 | [1415553840000, 0.38], 394 | [1415652360000, 0.82], 395 | [1415671560000, 0.7], 396 | [1415714160000, 0.94], 397 | [1415734200000, 0.57], 398 | [1415751180000, 0.63], 399 | [1415779080000, 0.72], 400 | [1415807400000, 0.56], 401 | [1415849040000, 0.54], 402 | [1415869080000, 0.9], 403 | [1415886000000, 0.75], 404 | [1415906640000, 0.62], 405 | [1415990880000, 0.57], 406 | [1416014640000, 0.84], 407 | [1416032940000, 0.6], 408 | [1416052080000, 0.39], 409 | [1416112080000, 0.49], 410 | [1416170700000, 0.61], 411 | [1416181920000, 0.43], 412 | [1416203040000, 0.73], 413 | [1416221160000, 0.64], 414 | [1416259020000, 0.92], 415 | [1416280260000, 0.63], 416 | [1416325200000, 0.76], 417 | [1416368520000, 0.71], 418 | [1416382440000, 0.71], 419 | [1416393120000, 0.78], 420 | [1416421860000, 0.65], 421 | [1416453900000, 0.68], 422 | [1416516420000, 0.62], 423 | [1416532020000, 0.57], 424 | [1416556260000, 0.76], 425 | [1416601920000, 0.61], 426 | [1416633840000, 0.69], 427 | [1416672120000, 0.35], 428 | [1416711840000, 0.57], 429 | [1416742740000, 0.65], 430 | [1416768180000, 0.5], 431 | [1416833280000, 0.48], 432 | [1416845160000, 0.62], 433 | [1416885540000, 0.57], 434 | [1416906300000, 0.47], 435 | [1416920760000, 0.75], 436 | [1416953280000, 0.77], 437 | [1416969540000, 0.48], 438 | [1417008000000, 0.76], 439 | [1417038660000, 0.65], 440 | [1417076340000, 0.81], 441 | [1417096500000, 0.69], 442 | [1417126740000, 0.62], 443 | [1417204260000, 0.66], 444 | [1417239660000, 0.57], 445 | [1417270560000, 0.56], 446 | [1417283400000, 0.5], 447 | [1417305960000, 0.58], 448 | [1417377420000, 0.58], 449 | [1417394880000, 0.39], 450 | [1417416960000, 0.5], 451 | [1417446660000, 0.48], 452 | [1417536420000, 0.36], 453 | [1417558020000, 0.58], 454 | [1417574160000, 0.43], 455 | [1417596240000, 0.62], 456 | [1417622760000, 0.71], 457 | [1417650060000, 0.57], 458 | [1417788600000, 0.46], 459 | [1417813260000, 0.89], 460 | [1417839000000, 0.69], 461 | [1417874760000, 0.64], 462 | [1417910580000, 0.56], 463 | [1417934820000, 0.61], 464 | [1417960260000, 0.82], 465 | [1417978500000, 0.72], 466 | [1418017500000, 0.8], 467 | [1418043000000, 0.63], 468 | [1418073060000, 0.52], 469 | [1418095740000, 0.75], 470 | [1418129940000, 0.38], 471 | [1418154900000, 0.85], 472 | [1418191920000, 0.75], 473 | [1418219220000, 0.62], 474 | [1418239080000, 0.91], 475 | [1418278260000, 0.71], 476 | [1418302020000, 0.67], 477 | [1418321160000, 0.93], 478 | [1418362020000, 0.39], 479 | [1418379480000, 0.83], 480 | [1418418600000, 0.94], 481 | [1418451540000, 0.69], 482 | [1418478180000, 0.82], 483 | [1418557680000, 0.54], 484 | [1418577660000, 0.17], 485 | [1418594880000, 0.84], 486 | [1418638560000, 0.75], 487 | [1418682720000, 0.61], 488 | [1418701320000, 0.87], 489 | [1418728680000, 0.68], 490 | [1418749860000, 0.49], 491 | [1418764680000, 0.66], 492 | [1418796900000, 0.65], 493 | [1418824200000, 0.78], 494 | [1418866440000, 0.48], 495 | [1418880780000, 0.38], 496 | [1418915580000, 0.63], 497 | [1418931180000, 0.75], 498 | [1418942940000, 0.52], 499 | [1418960700000, 0.79], 500 | [1418998980000, 0.7], 501 | [1419025200000, 0.74], 502 | [1419078240000, 0.69], 503 | [1419101340000, 0.64], 504 | [1419249900000, 0.77], 505 | [1419264360000, 0.67], 506 | [1419280320000, 1], 507 | [1419323100000, 0.84], 508 | [1419341520000, 0.93], 509 | [1419398640000, 0.88], 510 | [1419554700000, 1.03], 511 | [1419593520000, 0.74], 512 | [1419623220000, 0.93], 513 | [1419682380000, 0.9], 514 | [1419702480000, 1.01], 515 | [1419765000000, 0.8], 516 | [1419782820000, 0.81], 517 | [1419819540000, 0.89], 518 | [1419834660000, 0.82], 519 | [1419854820000, 0.94], 520 | [1419880980000, 1.01], 521 | [1419939780000, 0.68], 522 | [1419959040000, 0.88], 523 | [1419974220000, 1], 524 | [1420006080000, 0.72], 525 | [1420041720000, 0.7], 526 | [1420057860000, 0.82], 527 | [1420105260000, 1.07], 528 | [1420122240000, 0.95], 529 | [1420172460000, 0.65], 530 | [1420188840000, 0.91], 531 | [1420255920000, 1.09], 532 | [1421569680000, 0.94], 533 | [1421589780000, 0.83], 534 | [1421605440000, 1.06], 535 | [1421634060000, 0.88], 536 | [1421669160000, 0.84], 537 | [1421692740000, 0.9], 538 | [1421741160000, 0.85], 539 | [1421757540000, 0.79], 540 | [1421769300000, 0.74], 541 | [1421792820000, 0.65], 542 | [1421817900000, 0.94], 543 | [1421838660000, 0.79], 544 | [1421860920000, 0.94], 545 | [1421906700000, 0.56], 546 | [1421948460000, 0.95], 547 | [1421973780000, 0.72], 548 | [1422006360000, 0.58], 549 | [1422019980000, 0.9], 550 | [1422051840000, 0.59], 551 | [1422071040000, 1.06], 552 | [1422119160000, 0.88], 553 | [1422141840000, 0.89], 554 | [1422193920000, 0.84], 555 | [1422258360000, 0.68], 556 | [1422281160000, 0.75], 557 | [1422296640000, 1.01], 558 | [1422340500000, 0.67], 559 | [1422357960000, 1.02], 560 | [1422410940000, 0.84], 561 | [1422439740000, 0.77], 562 | [1422456600000, 0.69], 563 | [1422474900000, 0.96], 564 | [1422513060000, 0.94], 565 | [1422561060000, 1], 566 | [1422596940000, 0.83], 567 | [1422624360000, 1.12], 568 | [1422659760000, 1.09], 569 | [1422689160000, 1.06], 570 | [1422713460000, 0.65], 571 | [1422735300000, 0.76], 572 | [1422786240000, 0.65], 573 | [1422807660000, 0.4], 574 | [1422843240000, 1.06], 575 | [1422872940000, 1.08], 576 | [1422892140000, 0.59], 577 | [1422925260000, 0.84], 578 | [1422953280000, 0.72], 579 | [1422972540000, 0.87], 580 | [1423017420000, 1.11], 581 | [1423038480000, 0.88], 582 | [1423067040000, 0.61], 583 | [1423081440000, 0.74], 584 | [1423111740000, 0.9], 585 | [1423153620000, 1.03], 586 | [1423191480000, 0.77], 587 | [1423206540000, 1.05], 588 | [1423233900000, 0.76], 589 | [1423251120000, 0.85], 590 | [1423308060000, 0.75], 591 | [1423325820000, 0.61], 592 | [1423357320000, 0.76], 593 | [1423391760000, 0.79], 594 | [1423409280000, 0.62], 595 | [1423437180000, 0.67], 596 | [1423477620000, 0.68], 597 | [1423495560000, 0.67], 598 | [1423521360000, 0.94], 599 | [1423558800000, 0.78], 600 | [1423571640000, 0.58], 601 | [1423590360000, 0.75], 602 | [1423615260000, 0.79], 603 | [1423645080000, 0.82], 604 | [1423671060000, 0.65], 605 | [1423717200000, 1.06], 606 | [1423746420000, 0.98], 607 | [1423761360000, 0.94], 608 | [1423829940000, 0.77], 609 | [1423848900000, 1.05], 610 | [1423890000000, 0.79], 611 | [1423927140000, 0.55], 612 | [1423967220000, 1.05], 613 | [1423992180000, 0.78], 614 | [1424011140000, 0.62], 615 | [1424038440000, 0.96], 616 | [1424051760000, 0.74], 617 | [1424189700000, 0.91], 618 | [1424220780000, 0.86], 619 | [1424247540000, 0.77], 620 | [1424271840000, 0.72], 621 | [1424301420000, 0.8], 622 | [1424336940000, 0.94], 623 | [1424362500000, 0.94], 624 | [1424381040000, 0.97], 625 | [1424453100000, 0.81], 626 | [1424480460000, 1.02], 627 | [1424522220000, 0.51], 628 | [1424531580000, 0.73], 629 | [1424547300000, 0.84], 630 | [1424571060000, 0.85], 631 | [1424623740000, 1.07], 632 | [1424652240000, 1.13], 633 | [1424692440000, 0.55], 634 | [1424716620000, 0.84], 635 | [1424787000000, 0.77], 636 | [1424803620000, 0.68], 637 | [1424845620000, 0.63], 638 | [1424900820000, 0.77], 639 | [1424942220000, 0.7], 640 | [1424957400000, 0.76], 641 | [1424977980000, 0.83], 642 | [1425000240000, 0.84], 643 | [1425042960000, 0.79], 644 | [1425069120000, 0.48], 645 | [1425082080000, 1.12], 646 | [1425115380000, 0.64], 647 | [1425141480000, 0.83], 648 | [1425171240000, 0.93], 649 | [1425216540000, 0.93], 650 | [1425259620000, 0.88], 651 | [1425275760000, 0.91], 652 | [1425399960000, 0.98], 653 | [1425443040000, 1.15], 654 | [1425466020000, 0.84], 655 | [1425503220000, 1], 656 | [1425533100000, 1.04], 657 | [1425605160000, 0.84], 658 | [1425630240000, 0.64], 659 | [1425669840000, 0.97], 660 | [1425725100000, 0.79], 661 | [1425738540000, 0.83], 662 | [1425758160000, 1.02], 663 | [1425780000000, 0.84], 664 | [1425840060000, 0.91], 665 | [1425941160000, 0.81], 666 | [1426007640000, 1.04], 667 | [1426058220000, 1.01], 668 | [1426094340000, 0.36], 669 | [1426117320000, 0.99], 670 | [1426758000000, 0.83], 671 | [1427270940000, 1.04], 672 | [1427300160000, 0.71], 673 | [1427322060000, 0.94], 674 | [1427370420000, 1.13], 675 | [1427379600000, 1.08], 676 | [1427421120000, 1.14], 677 | [1427448900000, 0.92], 678 | [1427483400000, 1.2], 679 | [1427497740000, 1.1], 680 | [1427525220000, 0.91], 681 | [1427540460000, 0.77], 682 | [1427564520000, 1.08], 683 | [1427617140000, 0.78], 684 | [1427646960000, 0.89], 685 | [1427680320000, 0.9], 686 | [1427715900000, 1.11], 687 | [1427745000000, 1.05], 688 | [1427813520000, 0.99], 689 | [1427839740000, 0.85], 690 | [1427920920000, 0.99] 691 | ] 692 | }] 693 | }], 694 | "max": 1.22, 695 | "min": 0.17, 696 | "mean": 0.826652046783625 697 | } 698 | -------------------------------------------------------------------------------- /server/sample-data/time-series/core-vibe/core-vibe-rear-cruise0.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 2, 3 | "tags": [{ 4 | "name": "core-vib-rear-cruise", 5 | "results": [{ 6 | "datapoints": [ 7 | [1397102460000, 1.99], 8 | [1397139660000, 0.92], 9 | [1397177400000, 2.97], 10 | [1397228040000, 1.12], 11 | [1397248260000, 1.09], 12 | [1397291280000, 1], 13 | [1397318100000, 0.99], 14 | [1397342100000, 1.45], 15 | [1397390820000, 0.11], 16 | [1397408100000, 0.03], 17 | [1397458800000, 1.84], 18 | [1397522940000, 0.99], 19 | [1397542800000, 0.96], 20 | [1397640960000, 0.88], 21 | [1397663100000, 1.49], 22 | [1397700000000, 0.85], 23 | [1397753040000, 1.03], 24 | [1397772540000, 1.93], 25 | [1397794860000, 2.88], 26 | [1397813580000, 2.88], 27 | [1397890680000, 0.91], 28 | [1397932020000, 3.76], 29 | [1397973480000, 1.42], 30 | [1398009240000, 1.65], 31 | [1398195060000, 0.12], 32 | [1398219120000, 0.92], 33 | [1398239220000, 0.9], 34 | [1398260040000, 0.87], 35 | [1398301740000, 0.88], 36 | [1398331800000, 1.03], 37 | [1398369780000, 2], 38 | [1398395820000, 0.99], 39 | [1398430020000, 0.92], 40 | [1398486120000, 2.9], 41 | [1398487260000, 3.9], 42 | [1398507060000, 1.1], 43 | [1398529500000, 1.89], 44 | [1398600420000, 0.94], 45 | [1398617940000, 1.64], 46 | [1398638520000, 0.82], 47 | [1398691860000, 1.08], 48 | [1398714240000, 2.01], 49 | [1398807540000, 1.4], 50 | [1398858180000, 1.16], 51 | [1398879420000, 0.89], 52 | [1398920880000, 1.87], 53 | [1398956340000, 0.83], 54 | [1398995280000, 2.85], 55 | [1399033260000, 0.95], 56 | [1399048020000, 3.03], 57 | [1399072260000, 1.05], 58 | [1399093380000, 1.04], 59 | [1399136640000, 2.05], 60 | [1399382700000, 0.83], 61 | [1399399200000, 1.02], 62 | [1399427880000, 0.98], 63 | [1399557300000, 1.86], 64 | [1399574100000, 1.03], 65 | [1399659240000, 0.97], 66 | [1399714920000, 1.03], 67 | [1399741620000, 2.97], 68 | [1399761480000, 0.6], 69 | [1399811700000, 3.63], 70 | [1399851360000, 1.97], 71 | [1399919280000, 1.85], 72 | [1399975020000, 1.06], 73 | [1400007660000, 1.42], 74 | [1400055420000, 0.02], 75 | [1400071680000, 1.06], 76 | [1400090940000, 0.91], 77 | [1400155860000, 2.04], 78 | [1400168100000, 1.43], 79 | [1400220300000, 1.72], 80 | [1400245860000, 0.92], 81 | [1400260020000, 1.04], 82 | [1400308380000, 1.4], 83 | [1400347560000, 1.08], 84 | [1400367960000, 2], 85 | [1400399640000, 0.81], 86 | [1400469720000, 0.88], 87 | [1400495700000, 1.04], 88 | [1400538120000, 2.14], 89 | [1400560800000, 1.09], 90 | [1400584020000, 1.96], 91 | [1400611800000, 0.91], 92 | [1400640360000, 2.13], 93 | [1400655180000, 0.94], 94 | [1400682720000, 1.09], 95 | [1400693880000, 1.93], 96 | [1400753700000, 0.98], 97 | [1400775840000, 2.92], 98 | [1400848800000, 0.94], 99 | [1400877360000, 3.06], 100 | [1400913720000, 0.91], 101 | [1400946900000, 0.83], 102 | [1400981820000, 0.82], 103 | [1401019020000, 2], 104 | [1401031860000, 0.97], 105 | [1401049560000, 1.12], 106 | [1401075000000, 0.87], 107 | [1401101400000, 3.79], 108 | [1401139500000, 1.46], 109 | [1401200940000, 3], 110 | [1401222240000, 0.87], 111 | [1401265740000, 0.84], 112 | [1401292620000, 1.45], 113 | [1401331080000, 3.85], 114 | [1401377160000, 1.14], 115 | [1401391020000, 1.04], 116 | [1401413100000, 1.13], 117 | [1401425460000, 1.08], 118 | [1401445020000, 0.89], 119 | [1401528660000, 1.1], 120 | [1401549240000, 1.08], 121 | [1401581040000, 0.9], 122 | [1401612000000, 0.83], 123 | [1401639300000, 1.48], 124 | [1401657960000, 0.61], 125 | [1401706320000, 0.96], 126 | [1401715860000, 1.1], 127 | [1401777360000, 1.14], 128 | [1401817740000, 0.91], 129 | [1401851100000, 1.45], 130 | [1401877740000, 0.87], 131 | [1401925440000, 1.05], 132 | [1401948000000, 0.68], 133 | [1402005840000, 1.42], 134 | [1402050660000, 1.14], 135 | [1402079100000, 0.82], 136 | [1402119840000, 0.87], 137 | [1402145040000, 1.18], 138 | [1402168560000, 0.87], 139 | [1402216320000, 1.44], 140 | [1402285020000, 0.87], 141 | [1402315260000, 0.94], 142 | [1402327560000, 0.96], 143 | [1402465260000, 1.04], 144 | [1402474980000, 0.89], 145 | [1402527840000, 0.82], 146 | [1402539360000, 1.49], 147 | [1402556700000, 1.03], 148 | [1402588920000, 0.99], 149 | [1402606440000, 0.86], 150 | [1402640940000, 0.96], 151 | [1402684320000, 0.97], 152 | [1402732200000, 0.9], 153 | [1402759920000, 1.44], 154 | [1402796280000, 1.46], 155 | [1402822020000, 1], 156 | [1402834320000, 0.92], 157 | [1402860300000, 1.09], 158 | [1402881240000, 0.96], 159 | [1402941420000, 0.82], 160 | [1402965000000, 1.45], 161 | [1403016420000, 1.08], 162 | [1403040240000, 0.96], 163 | [1403092920000, 0.91], 164 | [1403112420000, 0.58], 165 | [1403143620000, 1.47], 166 | [1403177640000, 1.06], 167 | [1403191140000, 0.96], 168 | [1403225520000, 1.12], 169 | [1403236500000, 0.81], 170 | [1403283240000, 0.93], 171 | [1403370360000, 1.45], 172 | [1403397540000, 1.15], 173 | [1403422380000, 1.4], 174 | [1403498040000, 1.48], 175 | [1403593980000, 1.03], 176 | [1403624160000, 0.8], 177 | [1403667600000, 0.62], 178 | [1403683020000, 0.89], 179 | [1403703960000, 1.1], 180 | [1403766900000, 0.96], 181 | [1403924880000, 0.87], 182 | [1403985060000, 0.94], 183 | [1404023160000, 0.91], 184 | [1404058080000, 1.49], 185 | [1404084300000, 1.4], 186 | [1404132180000, 0.95], 187 | [1404142320000, 1], 188 | [1404190440000, 1.11], 189 | [1404331500000, 1.08], 190 | [1404373020000, 1.49], 191 | [1404404280000, 0.92], 192 | [1404443880000, 1.46], 193 | [1404462300000, 1.22], 194 | [1404493740000, 1], 195 | [1404575700000, 1.41], 196 | [1404635760000, 1.02], 197 | [1404664380000, 1], 198 | [1404684180000, 1.19], 199 | [1404699960000, 1.14], 200 | [1404750720000, 0.84], 201 | [1404843180000, 0.98], 202 | [1404921540000, 0.93], 203 | [1404946080000, 0.53], 204 | [1405004940000, 0.94], 205 | [1405019220000, 0.99], 206 | [1405035480000, 1.17], 207 | [1405052100000, 0.81], 208 | [1405110840000, 1], 209 | [1406131620000, 0.84], 210 | [1406163900000, 0.86], 211 | [1406198940000, 0.87], 212 | [1406264220000, 0.89], 213 | [1406509080000, 0.83], 214 | [1406532300000, 0.95], 215 | [1406546520000, 0.83], 216 | [1406599740000, 1.02], 217 | [1406609460000, 0.68], 218 | [1406701560000, 0.89], 219 | [1406735640000, 0.86], 220 | [1406757060000, 1.41], 221 | [1406801400000, 0.92], 222 | [1406815380000, 1.16], 223 | [1406845500000, 1.17], 224 | [1406861700000, 0.84], 225 | [1406893380000, 1.08], 226 | [1406952840000, 1.44], 227 | [1407006180000, 0.85], 228 | [1407060180000, 0.84], 229 | [1407083040000, 0.96], 230 | [1407130980000, 0.9], 231 | [1407144120000, 1.07], 232 | [1407161400000, 1.18], 233 | [1407235200000, 1.13], 234 | [1407270540000, 1.03], 235 | [1407357540000, 0.9], 236 | [1407368820000, 0.98], 237 | [1407439680000, 0.88], 238 | [1407597540000, 0.88], 239 | [1407672120000, 0.91], 240 | [1407732000000, 0.99], 241 | [1409522340000, 1.42], 242 | [1409567280000, 1.46], 243 | [1409673960000, 1], 244 | [1409765640000, 0.95], 245 | [1409781300000, 0.9], 246 | [1409792100000, 1.05], 247 | [1409849700000, 1.46], 248 | [1409916360000, 0.96], 249 | [1409932200000, 0.83], 250 | [1409969340000, 1.12], 251 | [1409985960000, 0.68], 252 | [1410040500000, 0.83], 253 | [1410091020000, 1.48], 254 | [1410106560000, 0.66], 255 | [1410153720000, 1.08], 256 | [1410170940000, 1.05], 257 | [1410184560000, 0.94], 258 | [1410809220000, 0.69], 259 | [1410876420000, 0.63], 260 | [1410901620000, 1.03], 261 | [1410921060000, 0.89], 262 | [1410940500000, 0.84], 263 | [1410973140000, 0.84], 264 | [1410998880000, 0.83], 265 | [1411046040000, 0.82], 266 | [1411062480000, 1.02], 267 | [1411143180000, 0.98], 268 | [1411199340000, 1], 269 | [1411222440000, 0.91], 270 | [1411332240000, 1.49], 271 | [1411350540000, 0.82], 272 | [1411401420000, 0.8], 273 | [1411446000000, 0.81], 274 | [1411468320000, 1.02], 275 | [1411496820000, 0.86], 276 | [1411561560000, 0.82], 277 | [1411579200000, 0.62], 278 | [1411609440000, 1.42], 279 | [1411644360000, 0.85], 280 | [1411654080000, 0.84], 281 | [1411679880000, 1], 282 | [1411704300000, 1.04], 283 | [1411725600000, 0.94], 284 | [1411749840000, 0.93], 285 | [1411793340000, 1.41], 286 | [1411820820000, 0.92], 287 | [1411848480000, 0.69], 288 | [1411872120000, 0.69], 289 | [1411902720000, 0.88], 290 | [1411937400000, 1.45], 291 | [1411950240000, 1.42], 292 | [1411968780000, 0.99], 293 | [1412140860000, 0.89], 294 | [1412163600000, 0.99], 295 | [1412174280000, 1.46], 296 | [1412209980000, 0.8], 297 | [1412244000000, 0.88], 298 | [1412268780000, 1], 299 | [1412289840000, 0.88], 300 | [1412326800000, 1.01], 301 | [1412362080000, 0.69], 302 | [1412386860000, 0.95], 303 | [1412403180000, 0.83], 304 | [1412465400000, 0.62], 305 | [1412482620000, 0.91], 306 | [1412506500000, 0.57], 307 | [1412562060000, 0.54], 308 | [1412582280000, 0.88], 309 | [1412707980000, 1.44], 310 | [1412728980000, 1.49], 311 | [1412758920000, 1.08], 312 | [1412794380000, 0.69], 313 | [1412823120000, 0.82], 314 | [1412875920000, 0.62], 315 | [1412919180000, 1], 316 | [1412937780000, 0.53], 317 | [1412997120000, 0.69], 318 | [1413041700000, 1.49], 319 | [1413082680000, 0.62], 320 | [1413112080000, 0.69], 321 | [1413132300000, 0.62], 322 | [1413146400000, 0.84], 323 | [1413176160000, 0.96], 324 | [1413193200000, 0.42], 325 | [1413259440000, 1.48], 326 | [1413289740000, 0.6], 327 | [1413305220000, 0.86], 328 | [1413326940000, 0.87], 329 | [1413359640000, 1.4], 330 | [1413436680000, 0.83], 331 | [1413454560000, 0.83], 332 | [1413471360000, 0.8], 333 | [1413492960000, 0.85], 334 | [1413508080000, 0.52], 335 | [1413561840000, 0.84], 336 | [1413573600000, 0.81], 337 | [1413585600000, 1.47], 338 | [1413625980000, 0.64], 339 | [1413666900000, 1.42], 340 | [1413703680000, 0.95], 341 | [1413721380000, 0.56], 342 | [1413768660000, 0.85], 343 | [1413812520000, 1.44], 344 | [1413847500000, 1.43], 345 | [1413877920000, 1.46], 346 | [1413918780000, 0.84], 347 | [1413930600000, 1.49], 348 | [1414080000000, 0.55], 349 | [1414118340000, 0.9], 350 | [1414142940000, 0.81], 351 | [1414179060000, 0.5], 352 | [1414228440000, 0.57], 353 | [1414267860000, 0.94], 354 | [1414283100000, 1.47], 355 | [1414317060000, 0.5], 356 | [1414341720000, 0.59], 357 | [1414382160000, 1.41], 358 | [1414406700000, 1.44], 359 | [1414428240000, 0.9], 360 | [1414444380000, 0.58], 361 | [1414539420000, 1.45], 362 | [1414566600000, 1.44], 363 | [1414602660000, 0.27], 364 | [1414620240000, 0.61], 365 | [1414663440000, 1.49], 366 | [1414687680000, 0.83], 367 | [1414710840000, 0.43], 368 | [1414751340000, 0.9], 369 | [1414783440000, 1.44], 370 | [1414878780000, 0.55], 371 | [1414925520000, 0.61], 372 | [1414942860000, 0.89], 373 | [1414971300000, 0.56], 374 | [1414989240000, 0.49], 375 | [1415027940000, 0.34], 376 | [1415064660000, 0.62], 377 | [1415097840000, 1.48], 378 | [1415130720000, 1.46], 379 | [1415192580000, 0.81], 380 | [1415207520000, 1.48], 381 | [1415230620000, 0.51], 382 | [1415271540000, 0.68], 383 | [1415286720000, 1.49], 384 | [1415319840000, 0.66], 385 | [1415337780000, 0.64], 386 | [1415379060000, 0.83], 387 | [1415406600000, 0.52], 388 | [1415429580000, 1.48], 389 | [1415457420000, 0.67], 390 | [1415479740000, 1.4], 391 | [1415504280000, 1.46], 392 | [1415535420000, 0.47], 393 | [1415553840000, 0.38], 394 | [1415652360000, 0.82], 395 | [1415671560000, 1.4], 396 | [1415714160000, 0.94], 397 | [1415734200000, 0.57], 398 | [1415751180000, 0.63], 399 | [1415779080000, 1.42], 400 | [1415807400000, 0.56], 401 | [1415849040000, 0.54], 402 | [1415869080000, 0.9], 403 | [1415886000000, 1.45], 404 | [1415906640000, 0.62], 405 | [1415990880000, 0.57], 406 | [1416014640000, 0.84], 407 | [1416032940000, 0.6], 408 | [1416052080000, 0.39], 409 | [1416112080000, 0.49], 410 | [1416170700000, 0.61], 411 | [1416181920000, 0.43], 412 | [1416203040000, 1.43], 413 | [1416221160000, 0.64], 414 | [1416259020000, 0.92], 415 | [1416280260000, 0.63], 416 | [1416325200000, 1.46], 417 | [1416368520000, 1.41], 418 | [1416382440000, 1.41], 419 | [1416393120000, 1.48], 420 | [1416421860000, 0.65], 421 | [1416453900000, 0.68], 422 | [1416516420000, 0.62], 423 | [1416532020000, 0.57], 424 | [1416556260000, 1.46], 425 | [1416601920000, 0.61], 426 | [1416633840000, 0.69], 427 | [1416672120000, 0.35], 428 | [1416711840000, 0.57], 429 | [1416742740000, 0.65], 430 | [1416768180000, 0.5], 431 | [1416833280000, 0.48], 432 | [1416845160000, 0.62], 433 | [1416885540000, 0.57], 434 | [1416906300000, 0.47], 435 | [1416920760000, 1.45], 436 | [1416953280000, 1.47], 437 | [1416969540000, 0.48], 438 | [1417008000000, 1.46], 439 | [1417038660000, 0.65], 440 | [1417076340000, 0.81], 441 | [1417096500000, 0.69], 442 | [1417126740000, 0.62], 443 | [1417204260000, 0.66], 444 | [1417239660000, 0.57], 445 | [1417270560000, 0.56], 446 | [1417283400000, 0.5], 447 | [1417305960000, 0.58], 448 | [1417377420000, 0.58], 449 | [1417394880000, 0.39], 450 | [1417416960000, 0.5], 451 | [1417446660000, 0.48], 452 | [1417536420000, 0.36], 453 | [1417558020000, 0.58], 454 | [1417574160000, 0.43], 455 | [1417596240000, 0.62], 456 | [1417622760000, 1.41], 457 | [1417650060000, 0.57], 458 | [1417788600000, 0.46], 459 | [1417813260000, 0.89], 460 | [1417839000000, 0.69], 461 | [1417874760000, 0.64], 462 | [1417910580000, 0.56], 463 | [1417934820000, 0.61], 464 | [1417960260000, 0.82], 465 | [1417978500000, 1.42], 466 | [1418017500000, 0.8], 467 | [1418043000000, 0.63], 468 | [1418073060000, 0.52], 469 | [1418095740000, 1.45], 470 | [1418129940000, 0.38], 471 | [1418154900000, 0.85], 472 | [1418191920000, 1.45], 473 | [1418219220000, 0.62], 474 | [1418239080000, 0.91], 475 | [1418278260000, 1.41], 476 | [1418302020000, 0.67], 477 | [1418321160000, 0.93], 478 | [1418362020000, 0.39], 479 | [1418379480000, 0.83], 480 | [1418418600000, 0.94], 481 | [1418451540000, 0.69], 482 | [1418478180000, 0.82], 483 | [1418557680000, 0.54], 484 | [1418577660000, 0.17], 485 | [1418594880000, 0.84], 486 | [1418638560000, 1.45], 487 | [1418682720000, 0.61], 488 | [1418701320000, 0.87], 489 | [1418728680000, 0.68], 490 | [1418749860000, 0.49], 491 | [1418764680000, 0.66], 492 | [1418796900000, 0.65], 493 | [1418824200000, 1.48], 494 | [1418866440000, 0.48], 495 | [1418880780000, 0.38], 496 | [1418915580000, 0.63], 497 | [1418931180000, 1.45], 498 | [1418942940000, 0.52], 499 | [1418960700000, 1.49], 500 | [1418998980000, 1.4], 501 | [1419025200000, 1.44], 502 | [1419078240000, 0.69], 503 | [1419101340000, 0.64], 504 | [1419249900000, 1.47], 505 | [1419264360000, 0.67], 506 | [1419280320000, 1], 507 | [1419323100000, 0.84], 508 | [1419341520000, 0.93], 509 | [1419398640000, 0.88], 510 | [1419554700000, 1.03], 511 | [1419593520000, 1.44], 512 | [1419623220000, 0.93], 513 | [1419682380000, 0.9], 514 | [1419702480000, 1.01], 515 | [1419765000000, 0.8], 516 | [1419782820000, 0.81], 517 | [1419819540000, 0.89], 518 | [1419834660000, 0.82], 519 | [1419854820000, 0.94], 520 | [1419880980000, 1.01], 521 | [1419939780000, 0.68], 522 | [1419959040000, 0.88], 523 | [1419974220000, 1], 524 | [1420006080000, 1.42], 525 | [1420041720000, 1.4], 526 | [1420057860000, 0.82], 527 | [1420105260000, 1.07], 528 | [1420122240000, 0.95], 529 | [1420172460000, 0.65], 530 | [1420188840000, 0.91], 531 | [1420255920000, 1.09], 532 | [1421569680000, 0.94], 533 | [1421589780000, 0.83], 534 | [1421605440000, 1.06], 535 | [1421634060000, 0.88], 536 | [1421669160000, 0.84], 537 | [1421692740000, 0.9], 538 | [1421741160000, 0.85], 539 | [1421757540000, 1.49], 540 | [1421769300000, 1.44], 541 | [1421792820000, 0.65], 542 | [1421817900000, 0.94], 543 | [1421838660000, 1.49], 544 | [1421860920000, 0.94], 545 | [1421906700000, 0.56], 546 | [1421948460000, 0.95], 547 | [1421973780000, 1.42], 548 | [1422006360000, 0.58], 549 | [1422019980000, 0.9], 550 | [1422051840000, 0.59], 551 | [1422071040000, 1.06], 552 | [1422119160000, 0.88], 553 | [1422141840000, 0.89], 554 | [1422193920000, 0.84], 555 | [1422258360000, 0.68], 556 | [1422281160000, 1.45], 557 | [1422296640000, 1.01], 558 | [1422340500000, 0.67], 559 | [1422357960000, 1.02], 560 | [1422410940000, 0.84], 561 | [1422439740000, 1.47], 562 | [1422456600000, 0.69], 563 | [1422474900000, 0.96], 564 | [1422513060000, 0.94], 565 | [1422561060000, 1], 566 | [1422596940000, 0.83], 567 | [1422624360000, 1.12], 568 | [1422659760000, 1.09], 569 | [1422689160000, 1.06], 570 | [1422713460000, 0.65], 571 | [1422735300000, 1.46], 572 | [1422786240000, 0.65], 573 | [1422807660000, 0.4], 574 | [1422843240000, 1.06], 575 | [1422872940000, 1.08], 576 | [1422892140000, 0.59], 577 | [1422925260000, 0.84], 578 | [1422953280000, 1.42], 579 | [1422972540000, 0.87], 580 | [1423017420000, 1.11], 581 | [1423038480000, 0.88], 582 | [1423067040000, 0.61], 583 | [1423081440000, 1.44], 584 | [1423111740000, 0.9], 585 | [1423153620000, 1.03], 586 | [1423191480000, 1.47], 587 | [1423206540000, 1.05], 588 | [1423233900000, 1.46], 589 | [1423251120000, 0.85], 590 | [1423308060000, 1.45], 591 | [1423325820000, 0.61], 592 | [1423357320000, 1.46], 593 | [1423391760000, 1.49], 594 | [1423409280000, 0.62], 595 | [1423437180000, 0.67], 596 | [1423477620000, 0.68], 597 | [1423495560000, 0.67], 598 | [1423521360000, 0.94], 599 | [1423558800000, 1.48], 600 | [1423571640000, 0.58], 601 | [1423590360000, 1.45], 602 | [1423615260000, 1.49], 603 | [1423645080000, 0.82], 604 | [1423671060000, 0.65], 605 | [1423717200000, 1.06], 606 | [1423746420000, 0.98], 607 | [1423761360000, 0.94], 608 | [1423829940000, 1.47], 609 | [1423848900000, 1.05], 610 | [1423890000000, 1.49], 611 | [1423927140000, 0.55], 612 | [1423967220000, 1.05], 613 | [1423992180000, 1.48], 614 | [1424011140000, 0.62], 615 | [1424038440000, 0.96], 616 | [1424051760000, 1.44], 617 | [1424189700000, 0.91], 618 | [1424220780000, 0.86], 619 | [1424247540000, 1.47], 620 | [1424271840000, 1.42], 621 | [1424301420000, 0.8], 622 | [1424336940000, 0.94], 623 | [1424362500000, 0.94], 624 | [1424381040000, 0.97], 625 | [1424453100000, 0.81], 626 | [1424480460000, 1.02], 627 | [1424522220000, 0.51], 628 | [1424531580000, 1.43], 629 | [1424547300000, 0.84], 630 | [1424571060000, 0.85], 631 | [1424623740000, 1.07], 632 | [1424652240000, 1.13], 633 | [1424692440000, 0.55], 634 | [1424716620000, 0.84], 635 | [1424787000000, 1.47], 636 | [1424803620000, 0.68], 637 | [1424845620000, 0.63], 638 | [1424900820000, 1.47], 639 | [1424942220000, 1.4], 640 | [1424957400000, 1.46], 641 | [1424977980000, 0.83], 642 | [1425000240000, 0.84], 643 | [1425042960000, 1.49], 644 | [1425069120000, 0.48], 645 | [1425082080000, 1.12], 646 | [1425115380000, 0.64], 647 | [1425141480000, 0.83], 648 | [1425171240000, 0.93], 649 | [1425216540000, 0.93], 650 | [1425259620000, 0.88], 651 | [1425275760000, 0.91], 652 | [1425399960000, 0.98], 653 | [1425443040000, 1.15], 654 | [1425466020000, 0.84], 655 | [1425503220000, 1], 656 | [1425533100000, 1.04], 657 | [1425605160000, 0.84], 658 | [1425630240000, 0.64], 659 | [1425669840000, 0.97], 660 | [1425725100000, 1.49], 661 | [1425738540000, 0.83], 662 | [1425758160000, 1.02], 663 | [1425780000000, 0.84], 664 | [1425840060000, 0.91], 665 | [1425941160000, 0.81], 666 | [1426007640000, 1.04], 667 | [1426058220000, 1.01], 668 | [1426094340000, 0.36], 669 | [1426117320000, 0.99], 670 | [1426758000000, 0.83], 671 | [1427270940000, 1.04], 672 | [1427300160000, 1.41], 673 | [1427322060000, 0.94], 674 | [1427370420000, 1.13], 675 | [1427379600000, 1.08], 676 | [1427421120000, 1.14], 677 | [1427448900000, 0.92], 678 | [1427483400000, 1.2], 679 | [1427497740000, 1.1], 680 | [1427525220000, 0.91], 681 | [1427540460000, 1.47], 682 | [1427564520000, 1.08], 683 | [1427617140000, 1.48], 684 | [1427646960000, 0.89], 685 | [1427680320000, 0.9], 686 | [1427715900000, 1.11], 687 | [1427745000000, 1.05], 688 | [1427813520000, 0.99], 689 | [1427839740000, 0.85], 690 | [1427920920000, 0.99] 691 | ] 692 | }] 693 | }], 694 | "max": 1.22, 695 | "min": 0.17, 696 | "mean": 0.826652046783625 697 | } 698 | -------------------------------------------------------------------------------- /server/sample-data/time-series/datagrid/datagrid-data.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "data": [{ 4 | "Last Occurence": "2014-02-17, 19:33:51", 5 | "Asset Path": "/Unit1/HRSG", 6 | "point": "39VS11", 7 | "meter": "crank-frame-compressionratio", 8 | "units": "psi", 9 | "Current Reading": "0.88" 10 | }, { 11 | "Last Occurence": "2014-02-17, 19:33:51", 12 | "Asset Path": "/Unit1/HRSG", 13 | "point": "39VS11", 14 | "meter": "crank-frame-dischargepressure", 15 | "units": "psi", 16 | "Current Reading": "2.605" 17 | }, { 18 | "Last Occurence": "2014-02-17, 19:33:51", 19 | "Asset Path": "/Unit1/HRSG", 20 | "point": "39VS11", 21 | "meter": "crank-frame-suctionpressure", 22 | "units": "m/s", 23 | "Current Reading": "18.331" 24 | }, { 25 | "Last Occurence": "2014-02-17, 19:33:51", 26 | "Asset Path": "/Unit1/HRSG", 27 | "point": "39VS11", 28 | "meter": "crank-frame-compressionratio", 29 | "units": "psi", 30 | "Current Reading": "0.88" 31 | }, { 32 | "Last Occurence": "2014-02-17, 19:33:51", 33 | "Asset Path": "/Unit1/HRSG", 34 | "point": "39VS11", 35 | "meter": "crank-frame-dischargepressure", 36 | "units": "psi", 37 | "Current Reading": "2.605" 38 | }, { 39 | "Last Occurence": "2014-02-17, 19:33:51", 40 | "Asset Path": "/Unit1/HRSG", 41 | "point": "39VS11", 42 | "meter": "crank-frame-suctionpressure", 43 | "units": "m/s", 44 | "Current Reading": "18.331" 45 | }, { 46 | "Last Occurence": "2014-02-17, 19:33:51", 47 | "Asset Path": "/Unit1/HRSG", 48 | "point": "39VS11", 49 | "meter": "crank-frame-compressionratio", 50 | "units": "psi", 51 | "Current Reading": "0.88" 52 | }, { 53 | "Last Occurence": "2014-02-17, 19:33:51", 54 | "Asset Path": "/Unit1/HRSG", 55 | "point": "39VS11", 56 | "meter": "crank-frame-dischargepressure", 57 | "units": "psi", 58 | "Current Reading": "2.605" 59 | }, { 60 | "Last Occurence": "2014-02-17, 19:33:51", 61 | "Asset Path": "/Unit1/HRSG", 62 | "point": "39VS11", 63 | "meter": "crank-frame-suctionpressure", 64 | "units": "m/s", 65 | "Current Reading": "18.331" 66 | }, { 67 | "Last Occurence": "2014-02-17, 19:33:51", 68 | "Asset Path": "/Unit1/HRSG", 69 | "point": "39VS11", 70 | "meter": "crank-frame-compressionratio", 71 | "units": "psi", 72 | "Current Reading": "0.88" 73 | }, { 74 | "Last Occurence": "2014-02-17, 19:33:51", 75 | "Asset Path": "/Unit1/HRSG", 76 | "point": "39VS11", 77 | "meter": "crank-frame-dischargepressure", 78 | "units": "psi", 79 | "Current Reading": "2.605" 80 | }, { 81 | "Last Occurence": "2014-02-17, 19:33:51", 82 | "Asset Path": "/Unit1/HRSG", 83 | "point": "39VS11", 84 | "meter": "crank-frame-suctionpressure", 85 | "units": "m/s", 86 | "Current Reading": "18.331" 87 | }, { 88 | "Last Occurence": "2014-02-17, 19:33:51", 89 | "Asset Path": "/Unit1/HRSG", 90 | "point": "39VS11", 91 | "meter": "crank-frame-compressionratio", 92 | "units": "psi", 93 | "Current Reading": "0.88" 94 | }, { 95 | "Last Occurence": "2014-02-17, 19:33:51", 96 | "Asset Path": "/Unit1/HRSG", 97 | "point": "39VS11", 98 | "meter": "crank-frame-dischargepressure", 99 | "units": "psi", 100 | "Current Reading": "2.605" 101 | }, { 102 | "Last Occurence": "2014-02-17, 19:33:51", 103 | "Asset Path": "/Unit1/HRSG", 104 | "point": "39VS11", 105 | "meter": "crank-frame-suctionpressure", 106 | "units": "m/s", 107 | "Current Reading": "18.331" 108 | }, { 109 | "Last Occurence": "2014-02-17, 19:33:51", 110 | "Asset Path": "/Unit1/HRSG", 111 | "point": "39VS11", 112 | "meter": "crank-frame-compressionratio", 113 | "units": "psi", 114 | "Current Reading": "0.88" 115 | }, { 116 | "Last Occurence": "2014-02-17, 19:33:51", 117 | "Asset Path": "/Unit1/HRSG", 118 | "point": "39VS11", 119 | "meter": "crank-frame-dischargepressure", 120 | "units": "psi", 121 | "Current Reading": "2.605" 122 | }, { 123 | "Last Occurence": "2014-02-17, 19:33:51", 124 | "Asset Path": "/Unit1/HRSG", 125 | "point": "39VS11", 126 | "meter": "crank-frame-suctionpressure", 127 | "units": "m/s", 128 | "Current Reading": "18.331" 129 | }, { 130 | "Last Occurence": "2014-02-17, 19:33:51", 131 | "Asset Path": "/Unit1/HRSG", 132 | "point": "39VS11", 133 | "meter": "crank-frame-compressionratio", 134 | "units": "psi", 135 | "Current Reading": "0.88" 136 | }, { 137 | "Last Occurence": "2014-02-17, 19:33:51", 138 | "Asset Path": "/Unit1/HRSG", 139 | "point": "39VS11", 140 | "meter": "crank-frame-dischargepressure", 141 | "units": "psi", 142 | "Current Reading": "2.605" 143 | }, { 144 | "Last Occurence": "2014-02-17, 19:33:51", 145 | "Asset Path": "/Unit1/HRSG", 146 | "point": "39VS11", 147 | "meter": "crank-frame-suctionpressure", 148 | "units": "m/s", 149 | "Current Reading": "18.331" 150 | }] 151 | } 152 | -------------------------------------------------------------------------------- /server/sample-data/time-series/fan-vibration/fan-vibration-cruise.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "tags": [{ 4 | "name": "fan-vibration-cruise", 5 | "results": [{ 6 | "datapoints": [ 7 | [1397102460000, 0.56], 8 | [1397139660000, 0.4], 9 | [1397177400000, 0.43], 10 | [1397228040000, 0.33], 11 | [1397248260000, 0.47], 12 | [1397291280000, 0.41], 13 | [1397318100000, 0.26], 14 | [1397342100000, 0.42], 15 | [1397390820000, 0.27], 16 | [1397408100000, 0.38], 17 | [1397458800000, 0.36], 18 | [1397522940000, 0.32], 19 | [1397542800000, 0.35], 20 | [1397640960000, 0.34], 21 | [1397663100000, 0.28], 22 | [1397700000000, 0.49], 23 | [1397753040000, 0.35], 24 | [1397772540000, 0.21], 25 | [1397794860000, 0.42], 26 | [1397813580000, 0.58], 27 | [1397890680000, 0.37], 28 | [1397932020000, 0.27], 29 | [1397973480000, 0.35], 30 | [1398009240000, 0.24], 31 | [1398195060000, 0.31], 32 | [1398219120000, 0.34], 33 | [1398239220000, 0.32], 34 | [1398260040000, 0.44], 35 | [1398301740000, 0.32], 36 | [1398331800000, 0.22], 37 | [1398369780000, 0.29], 38 | [1398395820000, 0.33], 39 | [1398430020000, 0.48], 40 | [1398486120000, 0.42], 41 | [1398487260000, 0.42], 42 | [1398507060000, 0.35], 43 | [1398529500000, 0.23], 44 | [1398600420000, 0.27], 45 | [1398617940000, 0.16], 46 | [1398638520000, 0.41], 47 | [1398691860000, 0.31], 48 | [1398714240000, 0.36], 49 | [1398807540000, 0.44], 50 | [1398858180000, 0.25], 51 | [1398879420000, 0.42], 52 | [1398920880000, 0.22], 53 | [1398956340000, 0.42], 54 | [1398995280000, 0.16], 55 | [1399033260000, 0.21], 56 | [1399048020000, 0.34], 57 | [1399072260000, 0.28], 58 | [1399093380000, 0.39], 59 | [1399136640000, 0.43], 60 | [1399382700000, 0.22], 61 | [1399399200000, 0.39], 62 | [1399427880000, 0.4], 63 | [1399557300000, 0.35], 64 | [1399574100000, 0.33], 65 | [1399659240000, 0.29], 66 | [1399714920000, 0.25], 67 | [1399741620000, 0.2], 68 | [1399761480000, 0.38], 69 | [1399811700000, 0.47], 70 | [1399851360000, 0.23], 71 | [1399919280000, 0.45], 72 | [1399975020000, 0.22], 73 | [1400007660000, 0.35], 74 | [1400055420000, 0.37], 75 | [1400071680000, 0.11], 76 | [1400090940000, 0.33], 77 | [1400155860000, 0.25], 78 | [1400168100000, 0.42], 79 | [1400220300000, 0.36], 80 | [1400245860000, 0.32], 81 | [1400260020000, 0.34], 82 | [1400308380000, 0.47], 83 | [1400347560000, 0.35], 84 | [1400367960000, 0.4], 85 | [1400399640000, 0.38], 86 | [1400469720000, 0.45], 87 | [1400495700000, 0.34], 88 | [1400538120000, 0.34], 89 | [1400560800000, 0.37], 90 | [1400584020000, 0.36], 91 | [1400611800000, 0.39], 92 | [1400640360000, 0.31], 93 | [1400655180000, 0.37], 94 | [1400682720000, 0.34], 95 | [1400693880000, 0.56], 96 | [1400753700000, 0.32], 97 | [1400775840000, 0.29], 98 | [1400848800000, 0.31], 99 | [1400877360000, 0.43], 100 | [1400913720000, 0.41], 101 | [1400946900000, 0.24], 102 | [1400981820000, 0.53], 103 | [1401019020000, 0.36], 104 | [1401031860000, 0.21], 105 | [1401049560000, 0.36], 106 | [1401075000000, 0.47], 107 | [1401101400000, 0.44], 108 | [1401139500000, 0.56], 109 | [1401200940000, 0.34], 110 | [1401222240000, 0.39], 111 | [1401265740000, 0.43], 112 | [1401292620000, 0.34], 113 | [1401331080000, 0.44], 114 | [1401377160000, 0.38], 115 | [1401391020000, 0.31], 116 | [1401413100000, 0.36], 117 | [1401425460000, 0.26], 118 | [1401445020000, 0.38], 119 | [1401528660000, 0.32], 120 | [1401549240000, 0.36], 121 | [1401581040000, 0.49], 122 | [1401612000000, 0.46], 123 | [1401639300000, 0.29], 124 | [1401657960000, 0.58], 125 | [1401706320000, 0.45], 126 | [1401715860000, 0.17], 127 | [1401777360000, 0.46], 128 | [1401817740000, 0.29], 129 | [1401851100000, 0.46], 130 | [1401877740000, 0.42], 131 | [1401925440000, 0.41], 132 | [1401948000000, 0.54], 133 | [1402005840000, 0.49], 134 | [1402050660000, 0.33], 135 | [1402079100000, 0.43], 136 | [1402119840000, 0.46], 137 | [1402145040000, 0.27], 138 | [1402168560000, 0.37], 139 | [1402216320000, 0.48], 140 | [1402285020000, 0.37], 141 | [1402315260000, 0.39], 142 | [1402327560000, 0.44], 143 | [1402465260000, 0.43], 144 | [1402474980000, 0.75], 145 | [1402527840000, 0.43], 146 | [1402539360000, 0.48], 147 | [1402556700000, 0.37], 148 | [1402588920000, 0.39], 149 | [1402606440000, 0.38], 150 | [1402640940000, 0.42], 151 | [1402684320000, 0.35], 152 | [1402732200000, 0.3], 153 | [1402759920000, 0.23], 154 | [1402796280000, 0.43], 155 | [1402822020000, 0.38], 156 | [1402834320000, 0.47], 157 | [1402860300000, 0.39], 158 | [1402881240000, 0.5], 159 | [1402941420000, 0.42], 160 | [1402965000000, 0.43], 161 | [1403016420000, 0.41], 162 | [1403040240000, 0.38], 163 | [1403092920000, 0.56], 164 | [1403112420000, 0.21], 165 | [1403143620000, 0.53], 166 | [1403177640000, 0.34], 167 | [1403191140000, 0.38], 168 | [1403225520000, 0.4], 169 | [1403236500000, 0.38], 170 | [1403283240000, 0.36], 171 | [1403370360000, 0.53], 172 | [1403397540000, 0.33], 173 | [1403422380000, 0.75], 174 | [1403498040000, 0.57], 175 | [1403593980000, 0.36], 176 | [1403624160000, 0.59], 177 | [1403667600000, 0.58], 178 | [1403683020000, 0.32], 179 | [1403703960000, 0.39], 180 | [1403766900000, 0.5], 181 | [1403924880000, 0.5], 182 | [1403985060000, 0.36], 183 | [1404023160000, 0.48], 184 | [1404058080000, 0.25], 185 | [1404084300000, 0.59], 186 | [1404132180000, 0.53], 187 | [1404142320000, 0.27], 188 | [1404190440000, 0.31], 189 | [1404331500000, 0.4], 190 | [1404373020000, 0.43], 191 | [1404404280000, 0.44], 192 | [1404443880000, 0.34], 193 | [1404462300000, 0.39], 194 | [1404493740000, 0.45], 195 | [1404575700000, 0.6], 196 | [1404635760000, 0.38], 197 | [1404664380000, 0.42], 198 | [1404684180000, 0.27], 199 | [1404699960000, 0.44], 200 | [1404750720000, 0.37], 201 | [1404843180000, 0.35], 202 | [1404921540000, 0.24], 203 | [1404946080000, 0.53], 204 | [1405004940000, 0.36], 205 | [1405019220000, 0.34], 206 | [1405035480000, 0.3], 207 | [1405052100000, 0.36], 208 | [1405110840000, 0.38], 209 | [1406131620000, 0.24], 210 | [1406163900000, 0.42], 211 | [1406198940000, 0.3], 212 | [1406264220000, 0.42], 213 | [1406509080000, 0.37], 214 | [1406532300000, 0.29], 215 | [1406546520000, 0.41], 216 | [1406599740000, 0.37], 217 | [1406609460000, 0.47], 218 | [1406701560000, 0.46], 219 | [1406735640000, 0.23], 220 | [1406757060000, 0.5], 221 | [1406801400000, 0.38], 222 | [1406815380000, 0.29], 223 | [1406845500000, 0.28], 224 | [1406861700000, 0.59], 225 | [1406893380000, 0.29], 226 | [1406952840000, 0.42], 227 | [1407006180000, 0.48], 228 | [1407060180000, 0.33], 229 | [1407083040000, 0.29], 230 | [1407130980000, 0.41], 231 | [1407144120000, 0.35], 232 | [1407161400000, 0.2], 233 | [1407235200000, 0.34], 234 | [1407270540000, 0.51], 235 | [1407357540000, 0.43], 236 | [1407368820000, 0.35], 237 | [1407439680000, 0.54], 238 | [1407597540000, 0.25], 239 | [1407672120000, 0.42], 240 | [1407732000000, 0.36], 241 | [1409522340000, 0.38], 242 | [1409567280000, 0.31], 243 | [1409673960000, 0.42], 244 | [1409765640000, 0.38], 245 | [1409781300000, 0.19], 246 | [1409792100000, 0.29], 247 | [1409849700000, 0.48], 248 | [1409916360000, 0.3], 249 | [1409932200000, 0.32], 250 | [1409969340000, 0.32], 251 | [1409985960000, 0.41], 252 | [1410040500000, 0.37], 253 | [1410091020000, 0.33], 254 | [1410106560000, 0.14], 255 | [1410153720000, 0.4], 256 | [1410170940000, 0.36], 257 | [1410184560000, 0.42], 258 | [1410809220000, 0.45], 259 | [1410876420000, 0.54], 260 | [1410901620000, 0.32], 261 | [1410921060000, 0.34], 262 | [1410940500000, 0.55], 263 | [1410973140000, 0.46], 264 | [1410998880000, 0.46], 265 | [1411046040000, 0.41], 266 | [1411062480000, 0.26], 267 | [1411143180000, 0.5], 268 | [1411199340000, 0.51], 269 | [1411222440000, 0.38], 270 | [1411332240000, 0.25], 271 | [1411350540000, 0.42], 272 | [1411401420000, 0.32], 273 | [1411446000000, 0.32], 274 | [1411468320000, 0.37], 275 | [1411496820000, 0.35], 276 | [1411561560000, 0.36], 277 | [1411579200000, 0.17], 278 | [1411609440000, 0.45], 279 | [1411644360000, 0.36], 280 | [1411654080000, 0.33], 281 | [1411679880000, 0.41], 282 | [1411704300000, 0.58], 283 | [1411725600000, 0.23], 284 | [1411749840000, 0.42], 285 | [1411793340000, 0.36], 286 | [1411820820000, 0.3], 287 | [1411848480000, 0.36], 288 | [1411872120000, 0.48], 289 | [1411902720000, 0.41], 290 | [1411937400000, 0.34], 291 | [1411950240000, 0.43], 292 | [1411968780000, 0.33], 293 | [1412140860000, 0.58], 294 | [1412163600000, 0.2], 295 | [1412174280000, 0.48], 296 | [1412209980000, 0.52], 297 | [1412244000000, 0.33], 298 | [1412268780000, 0.39], 299 | [1412289840000, 0.52], 300 | [1412326800000, 0.39], 301 | [1412362080000, 0.52], 302 | [1412386860000, 0.3], 303 | [1412403180000, 0.36], 304 | [1412465400000, 0.42], 305 | [1412482620000, 0.36], 306 | [1412506500000, 0.5], 307 | [1412562060000, 0.53], 308 | [1412582280000, 0.43], 309 | [1412707980000, 0.35], 310 | [1412728980000, 0.39], 311 | [1412758920000, 0.49], 312 | [1412794380000, 0.36], 313 | [1412823120000, 0.38], 314 | [1412875920000, 0.56], 315 | [1412919180000, 0.29], 316 | [1412937780000, 0.58], 317 | [1412997120000, 0.29], 318 | [1413041700000, 0.3], 319 | [1413082680000, 0.39], 320 | [1413112080000, 0.38], 321 | [1413132300000, 0.27], 322 | [1413146400000, 0.3], 323 | [1413176160000, 0.37], 324 | [1413193200000, 0.42], 325 | [1413259440000, 0.45], 326 | [1413289740000, 0.36], 327 | [1413305220000, 0.24], 328 | [1413326940000, 0.45], 329 | [1413359640000, 0.53], 330 | [1413436680000, 0.44], 331 | [1413454560000, 0.35], 332 | [1413471360000, 0.31], 333 | [1413492960000, 0.38], 334 | [1413508080000, 0.42], 335 | [1413561840000, 0.43], 336 | [1413573600000, 0.39], 337 | [1413585600000, 0.43], 338 | [1413625980000, 0.56], 339 | [1413666900000, 0.52], 340 | [1413703680000, 0.39], 341 | [1413721380000, 0.53], 342 | [1413768660000, 0.36], 343 | [1413812520000, 0.48], 344 | [1413847500000, 0.43], 345 | [1413877920000, 0.48], 346 | [1413918780000, 0.24], 347 | [1413930600000, 0.29], 348 | [1414080000000, 0.63], 349 | [1414118340000, 0.4], 350 | [1414142940000, 0.22], 351 | [1414179060000, 0.46], 352 | [1414228440000, 0.4], 353 | [1414267860000, 0.25], 354 | [1414283100000, 0.48], 355 | [1414317060000, 0.31], 356 | [1414341720000, 0.29], 357 | [1414382160000, 0.59], 358 | [1414406700000, 0.38], 359 | [1414428240000, 0.31], 360 | [1414444380000, 0.33], 361 | [1414539420000, 0.35], 362 | [1414566600000, 0.25], 363 | [1414602660000, 0.26], 364 | [1414620240000, 0.45], 365 | [1414663440000, 0.37], 366 | [1414687680000, 0.34], 367 | [1414710840000, 0.57], 368 | [1414751340000, 0.18], 369 | [1414783440000, 0.34], 370 | [1414878780000, 0.38], 371 | [1414925520000, 0.33], 372 | [1414942860000, 0.41], 373 | [1414971300000, 0.43], 374 | [1414989240000, 0.22], 375 | [1415027940000, 0.22], 376 | [1415064660000, 0.5], 377 | [1415097840000, 0.37], 378 | [1415130720000, 0.24], 379 | [1415192580000, 0.28], 380 | [1415207520000, 0.39], 381 | [1415230620000, 0.39], 382 | [1415271540000, 0.38], 383 | [1415286720000, 0.31], 384 | [1415319840000, 0.45], 385 | [1415337780000, 0.47], 386 | [1415379060000, 0.29], 387 | [1415406600000, 0.39], 388 | [1415429580000, 0.31], 389 | [1415457420000, 0.28], 390 | [1415479740000, 0.47], 391 | [1415504280000, 0.38], 392 | [1415535420000, 0.36], 393 | [1415553840000, 0.21], 394 | [1415652360000, 0.29], 395 | [1415671560000, 0.38], 396 | [1415714160000, 0.34], 397 | [1415734200000, 0.19], 398 | [1415751180000, 0.38], 399 | [1415779080000, 0.38], 400 | [1415807400000, 0.18], 401 | [1415849040000, 0.4], 402 | [1415869080000, 0.55], 403 | [1415886000000, 0.41], 404 | [1415906640000, 0.43], 405 | [1415990880000, 0.42], 406 | [1416014640000, 0.28], 407 | [1416032940000, 0.44], 408 | [1416052080000, 0.54], 409 | [1416112080000, 0.38], 410 | [1416170700000, 0.41], 411 | [1416181920000, 0.24], 412 | [1416203040000, 0.28], 413 | [1416221160000, 0.58], 414 | [1416259020000, 0.35], 415 | [1416280260000, 0.21], 416 | [1416325200000, 0.25], 417 | [1416368520000, 0.29], 418 | [1416382440000, 0.37], 419 | [1416393120000, 0.33], 420 | [1416421860000, 0.47], 421 | [1416453900000, 0.44], 422 | [1416516420000, 0.39], 423 | [1416532020000, 0.33], 424 | [1416556260000, 0.22], 425 | [1416601920000, 0.41], 426 | [1416633840000, 0.25], 427 | [1416672120000, 0.3], 428 | [1416711840000, 0.41], 429 | [1416742740000, 0.3], 430 | [1416768180000, 0.48], 431 | [1416833280000, 0.29], 432 | [1416845160000, 0.17], 433 | [1416885540000, 0.52], 434 | [1416906300000, 0.38], 435 | [1416920760000, 0.33], 436 | [1416953280000, 0.27], 437 | [1416969540000, 0.42], 438 | [1417008000000, 0.36], 439 | [1417038660000, 0.35], 440 | [1417076340000, 0.23], 441 | [1417096500000, 0.36], 442 | [1417126740000, 0.4], 443 | [1417204260000, 0.34], 444 | [1417239660000, 0.25], 445 | [1417270560000, 0.17], 446 | [1417283400000, 0.27], 447 | [1417305960000, 0.28], 448 | [1417377420000, 0.48], 449 | [1417394880000, 0.18], 450 | [1417416960000, 0.27], 451 | [1417446660000, 0.4], 452 | [1417536420000, 0.48], 453 | [1417558020000, 0.34], 454 | [1417574160000, 0.4], 455 | [1417596240000, 0.39], 456 | [1417622760000, 0.29], 457 | [1417650060000, 0.35], 458 | [1417788600000, 0.34], 459 | [1417813260000, 0.35], 460 | [1417839000000, 0.44], 461 | [1417874760000, 0.57], 462 | [1417910580000, 0.28], 463 | [1417934820000, 0.34], 464 | [1417960260000, 0.33], 465 | [1417978500000, 0.22], 466 | [1418017500000, 0.38], 467 | [1418043000000, 0.31], 468 | [1418073060000, 0.35], 469 | [1418095740000, 0.51], 470 | [1418129940000, 0.27], 471 | [1418154900000, 0.4], 472 | [1418191920000, 0.38], 473 | [1418219220000, 0.35], 474 | [1418239080000, 0.49], 475 | [1418278260000, 0.42], 476 | [1418302020000, 0.26], 477 | [1418321160000, 0.16], 478 | [1418362020000, 0.27], 479 | [1418379480000, 0.44], 480 | [1418418600000, 0.36], 481 | [1418451540000, 0.33], 482 | [1418478180000, 0.45], 483 | [1418557680000, 0.35], 484 | [1418577660000, 0.23], 485 | [1418594880000, 0.42], 486 | [1418638560000, 0.36], 487 | [1418682720000, 0.28], 488 | [1418701320000, 0.39], 489 | [1418728680000, 0.38], 490 | [1418749860000, 0.23], 491 | [1418764680000, 0.39], 492 | [1418796900000, 0.41], 493 | [1418824200000, 0.17], 494 | [1418866440000, 0.42], 495 | [1418880780000, 0.33], 496 | [1418915580000, 0.53], 497 | [1418931180000, 0.46], 498 | [1418942940000, 0.28], 499 | [1418960700000, 0.42], 500 | [1418998980000, 0.44], 501 | [1419025200000, 0.35], 502 | [1419078240000, 0.34], 503 | [1419101340000, 0.25], 504 | [1419249900000, 0.39], 505 | [1419264360000, 0.48], 506 | [1419280320000, 0.56], 507 | [1419323100000, 0.28], 508 | [1419341520000, 0.36], 509 | [1419398640000, 0.43], 510 | [1419554700000, 0.44], 511 | [1419593520000, 0.44], 512 | [1419623220000, 0.42], 513 | [1419682380000, 0.38], 514 | [1419702480000, 0.43], 515 | [1419765000000, 0.5], 516 | [1419782820000, 0.41], 517 | [1419819540000, 0.49], 518 | [1419834660000, 0.27], 519 | [1419854820000, 0.56], 520 | [1419880980000, 0.47], 521 | [1419939780000, 0.18], 522 | [1419959040000, 0.32], 523 | [1419974220000, 0.34], 524 | [1420006080000, 0.33], 525 | [1420041720000, 0.37], 526 | [1420057860000, 0.42], 527 | [1420105260000, 0.53], 528 | [1420122240000, 0.3], 529 | [1420172460000, 0.24], 530 | [1420188840000, 0.26], 531 | [1420255920000, 0.39], 532 | [1421569680000, 0.97], 533 | [1421589780000, 0.68], 534 | [1421605440000, 0.89], 535 | [1421634060000, 0.89], 536 | [1421669160000, 0.79], 537 | [1421692740000, 0.69], 538 | [1421741160000, 0.73], 539 | [1421757540000, 0.58], 540 | [1421769300000, 0.53], 541 | [1421792820000, 0.65], 542 | [1421817900000, 0.96], 543 | [1421838660000, 0.56], 544 | [1421860920000, 0.93], 545 | [1421906700000, 0.85], 546 | [1421948460000, 1.1], 547 | [1421973780000, 0.63], 548 | [1422006360000, 0.68], 549 | [1422019980000, 0.85], 550 | [1422051840000, 0.67], 551 | [1422071040000, 0.91], 552 | [1422119160000, 0.85], 553 | [1422141840000, 0.86], 554 | [1422193920000, 0.92], 555 | [1422258360000, 0.85], 556 | [1422281160000, 0.66], 557 | [1422296640000, 0.79], 558 | [1422340500000, 0.53], 559 | [1422357960000, 1.02], 560 | [1422410940000, 0.89], 561 | [1422439740000, 0.67], 562 | [1422456600000, 0.6], 563 | [1422474900000, 0.84], 564 | [1422513060000, 0.75], 565 | [1422561060000, 0.85], 566 | [1422596940000, 0.51], 567 | [1422624360000, 0.65], 568 | [1422659760000, 0.84], 569 | [1422689160000, 0.71], 570 | [1422713460000, 0.74], 571 | [1422735300000, 0.65], 572 | [1422786240000, 0.91], 573 | [1422807660000, 0.44], 574 | [1422843240000, 0.98], 575 | [1422872940000, 0.73], 576 | [1422892140000, 0.64], 577 | [1422925260000, 0.83], 578 | [1422953280000, 0.58], 579 | [1422972540000, 0.72], 580 | [1423017420000, 0.85], 581 | [1423038480000, 0.58], 582 | [1423067040000, 0.61], 583 | [1423081440000, 0.69], 584 | [1423111740000, 0.87], 585 | [1423153620000, 0.76], 586 | [1423191480000, 0.71], 587 | [1423206540000, 0.8], 588 | [1423233900000, 0.58], 589 | [1423251120000, 0.83], 590 | [1423308060000, 0.65], 591 | [1423325820000, 0.46], 592 | [1423357320000, 0.81], 593 | [1423391760000, 0.65], 594 | [1423409280000, 0.64], 595 | [1423437180000, 0.84], 596 | [1423477620000, 0.75], 597 | [1423495560000, 0.78], 598 | [1423521360000, 0.88], 599 | [1423558800000, 0.73], 600 | [1423571640000, 0.49], 601 | [1423590360000, 0.6], 602 | [1423615260000, 0.79], 603 | [1423645080000, 0.73] 604 | ] 605 | }] 606 | }], 607 | "max": 1.1, 608 | "min": 0.11, 609 | "mean": 0.45714912280701736 610 | } 611 | -------------------------------------------------------------------------------- /server/sample-data/time-series/scatter/scatter1.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 2, 3 | "data": [ 4 | { 5 | "id": "123", 6 | "x": 1334, 7 | "label": "Fa Icon" 8 | }, 9 | { 10 | "id": "456", 11 | "x": 1342, 12 | "label": "Unicode" 13 | }, 14 | { 15 | "id": "789", 16 | "x": 1352, 17 | "label": "Event Png" 18 | }, 19 | { 20 | "id": "333", 21 | "x": 1360, 22 | "label": "Default" 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /server/sample-data/time-series/simple-data/simple-data-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "data": { 4 | "name": "Open Cases by Weekday", 5 | "labels": [ 6 | "Monday", 7 | "Tuesday", 8 | "Wednesday", 9 | "Thursday", 10 | "Friday", 11 | "Saturday", 12 | "Sunday" 13 | ], 14 | "values": [2, 5.2, 6, 6.7, 3, 3.7, 4.5], 15 | "max": 10, 16 | "min": 0, 17 | "threshold": 5.9 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /server/sample-data/time-series/simple-data/simple-data-2.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 2, 3 | "data": { 4 | "name": "Output vs. Capacity", 5 | "values": [ 6 | [1, 2], 7 | [2, 1], 8 | [3, 4], 9 | [4, 3.9], 10 | [5, 4.5], 11 | [6, 4.2], 12 | [7, 5.5], 13 | [8, 6.9], 14 | [9, 3.3], 15 | [10, 2], 16 | [11, 1], 17 | [12, 4], 18 | [13, 7.5], 19 | [14, 6.5], 20 | [15, 8.5], 21 | [16, 7.7], 22 | [17, 5.2], 23 | [18, 7.3], 24 | [19, 3.5], 25 | [20, 4.5], 26 | [21, 5.5], 27 | [22, 3.7], 28 | [23, 4.2], 29 | [24, 5.5], 30 | [25, 5.8], 31 | [26, 6.5], 32 | [27, 5.2], 33 | [28, 6.7], 34 | [29, 4.2], 35 | [30, 4.5], 36 | [31, 5.5], 37 | [32, 6.5] 38 | ], 39 | "max": 10, 40 | "min": 0, 41 | "threshold": 5.9 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /server/sample-data/time-series/simple-data/simple-data-3.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 3, 3 | "data": { 4 | "name": "Open Cases by Status", 5 | "values": [ 6 | [1.3, 2, 2, 2.5, 4.5, 6.2, 4, 3, 2.6, 4.4, 6, 6, 7.8], 7 | [1.4, 1.1, 2.9, 2.4, 6.3, 6, 3, 4, 3, 2.5, 5, 5, 8.1], 8 | [1.2, 2, 2.5, 3, 3.5, 4.9, 5, 4, 3, 2.7, 3.3, 5.2, 5.2], 9 | [1.1, 1.55, 2, 3.4, 4, 5.5, 3, 4, 5, 5.2, 4.5, 6.5, 7.2], 10 | [1.6, 2, 2.5, 4, 3.5, 4.3, 6, 4, 4, 4.5, 4.5, 6.2, 7.2], 11 | [1.8, 2.3, 2.7, 4, 4, 4.6, 6, 4, 5, 4.5, 4.3, 4.5, 5.1] 12 | ], 13 | "labels": [ 14 | "Icebox", "Backlog", "In-Progress", "Tested", "QA", "Done" 15 | ], 16 | "max": 10, 17 | "min": 0, 18 | "threshold": 5.9 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /server/sample-data/view-service/cards/1.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "title": "seed-intro-card", 4 | "slug": "seed-intro-card", 5 | "attributes": { 6 | "elementHref": "/elements/seed-intro-card/seed-intro-card.html" 7 | }, 8 | "createTimeStamp": "2015-11-24T23:02:53.816Z", 9 | "tags": [] 10 | } 11 | -------------------------------------------------------------------------------- /server/sample-data/view-service/cards/2.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 2, 3 | "title": "Three widgets card", 4 | "slug": "three-widgets-card", 5 | "attributes": { 6 | "elementHref": "/elements/three-widgets-card/three-widgets-card.html" 7 | }, 8 | "createTimeStamp": "2015-11-24T23:02:53.816Z", 9 | "tags": [] 10 | } 11 | -------------------------------------------------------------------------------- /server/sample-data/view-service/cards/3.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 3, 3 | "title": "Data Table Card", 4 | "slug": "data-table-card", 5 | "attributes": { 6 | "elementHref": "/elements/data-table-card/data-table-card.html", 7 | "dataUrl": "/api/time-series/datagrid/1", 8 | "headerText": "HRSG Unit Data" 9 | }, 10 | "createTimeStamp": "2015-11-24T23:02:53.816Z", 11 | "tags": [] 12 | } 13 | -------------------------------------------------------------------------------- /server/sample-data/view-service/cards/4.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 4, 3 | "title": "Time Series", 4 | "slug": "time-series-card", 5 | "attributes": { 6 | "elementHref": "/elements/time-series-card/time-series-card.html", 7 | "dataUrl": "/api/time-series/core-vibe/1" 8 | }, 9 | "createTimeStamp": "2015-11-24T23:02:53.816Z", 10 | "tags": [] 11 | } 12 | -------------------------------------------------------------------------------- /server/sample-data/view-service/cards/5.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 5, 3 | "title": "Scatter Plot", 4 | "slug": "scatter-plot-card", 5 | "attributes": { 6 | "elementHref": "/elements/scatter-plot-card/scatter-plot-card.html" 7 | }, 8 | "createTimeStamp": "2015-11-24T23:02:53.816Z", 9 | "tags": [] 10 | } 11 | -------------------------------------------------------------------------------- /server/sample-data/view-service/cards/6.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 6, 3 | "title": "Bar Chart", 4 | "slug": "bar-chart-card", 5 | "attributes": { 6 | "elementHref": "/elements/bar-chart-card/bar-chart-card.html" 7 | }, 8 | "createTimeStamp": "2016-08-31T23:02:53.816Z", 9 | "tags": [] 10 | } 11 | -------------------------------------------------------------------------------- /server/sample-data/view-service/decks/1.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "title": "Overview", 4 | "slug": "overview", 5 | "cardOrder": null, 6 | "createTimeStamp": "2015-11-24T23:02:53.838Z", 7 | "tags": [{ 8 | "id": 1, 9 | "value": "parent-asset" 10 | }] 11 | } 12 | -------------------------------------------------------------------------------- /server/sample-data/view-service/decks/2.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 2, 3 | "title": "Data Table View", 4 | "slug": "data-table-view", 5 | "cardOrder": null, 6 | "createTimeStamp": "2015-11-24T23:02:53.838Z", 7 | "tags": [{ 8 | "id": 2, 9 | "value": "parent-asset" 10 | }] 11 | } 12 | -------------------------------------------------------------------------------- /server/sample-data/view-service/decks/3.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 3, 3 | "title": "Detail View", 4 | "slug": "detail-view", 5 | "cardOrder": null, 6 | "createTimeStamp": "2016-08-31T23:02:53.838Z", 7 | "tags": [{ 8 | "id": 3, 9 | "value": "child-asset" 10 | }] 11 | } 12 | -------------------------------------------------------------------------------- /server/sample-data/view-service/joins/1.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "deckId": 1, 4 | "cardId": 1, 5 | "createTimeStamp": "1234567890" 6 | } 7 | -------------------------------------------------------------------------------- /server/sample-data/view-service/joins/2.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 2, 3 | "deckId": 1, 4 | "cardId": 2, 5 | "createTimeStamp": "1234567890" 6 | } 7 | -------------------------------------------------------------------------------- /server/sample-data/view-service/joins/3.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 3, 3 | "deckId": 2, 4 | "cardId": 3, 5 | "createTimeStamp": "1234567890" 6 | } 7 | -------------------------------------------------------------------------------- /server/sample-data/view-service/joins/4.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 4, 3 | "deckId": 3, 4 | "cardId": 4, 5 | "createTimeStamp": "1234567890" 6 | } 7 | -------------------------------------------------------------------------------- /server/time-series-routes.js: -------------------------------------------------------------------------------- 1 | var glob = require("glob"); 2 | var path = require("path"); 3 | var _ = require("lodash"); 4 | 5 | // for each asset level, collect the json data to configure the json-server router 6 | // example structure: { 'assets': [ {...}, {...} ], 'enterprises': [...], ... } 7 | var getRoutes = function() { 8 | var levels = ['core-vibe', 'datagrid', 'delta-egt', 'fan-vibration', 'simple-data', 'scatter']; 9 | var routes = {}; 10 | _.each(levels, function(level) { 11 | routes[level] = getLevelData(level); 12 | }); 13 | return routes; 14 | }; 15 | 16 | // Pass in the name of the level 17 | // returns an array of objects based on data in .json files in level folder 18 | // example structure: [ { ... json file data ... }, { ... json file data ...} ] 19 | var getLevelData = function(level) { 20 | var fullPath = './sample-data/time-series/' + level + '/**/*.json'; 21 | var resolvedPath = path.resolve(__dirname, fullPath); 22 | var jsonObjects = []; 23 | var files = glob.sync(resolvedPath, {}); // all JSON files in path 24 | _.each(files, function(file) { 25 | var json = require(file); // import json data 26 | jsonObjects.push(json); 27 | }); 28 | return jsonObjects; 29 | }; 30 | 31 | // export the routes to be used in express/json-server in app.js 32 | module.exports = function() { 33 | return getRoutes(); 34 | }; 35 | -------------------------------------------------------------------------------- /server/view-service-routes.js: -------------------------------------------------------------------------------- 1 | var glob = require("glob"); 2 | var path = require("path"); 3 | var _ = require("lodash"); 4 | 5 | // options is optional 6 | var options = {}; 7 | 8 | var decksPath = path.resolve(__dirname, "./sample-data/view-service/decks/*.json"); 9 | var cardsPath = path.resolve(__dirname, "./sample-data/view-service/cards/*.json"); 10 | var joinsPath = path.resolve(__dirname, "./sample-data/view-service/joins/*.json"); 11 | 12 | var decks = []; 13 | var cards = []; 14 | var joins = []; 15 | 16 | var joinFiles = glob.sync(joinsPath, options); 17 | _.each(joinFiles, function(joinFile) { 18 | var joinJSON = require(joinFile); 19 | joins.push(joinJSON); 20 | }); 21 | 22 | var cardFiles = glob.sync(cardsPath, options); 23 | _.each(cardFiles, function(cardFile) { 24 | var cardJSON = require(cardFile); 25 | cards.push(cardJSON); 26 | }); 27 | 28 | var deckFiles = glob.sync(decksPath, options); 29 | _.each(deckFiles, function(deckFile) { 30 | var deckJSON = require(deckFile); 31 | var matchingJoins = _.filter(joins, { 32 | "deckId": deckJSON["id"] 33 | }); 34 | deckJSON.cards = []; 35 | _.each(matchingJoins, function(join) { 36 | var joinedCard = _.find(cards, { 37 | "id": join["cardId"] 38 | }); 39 | deckJSON.cards.push(joinedCard); 40 | }); 41 | var newTags = []; 42 | // flatten tags to be searchable with query string filter e.g.: "?tags=tagName" 43 | _.each(deckJSON.tags, function(tagObject) { 44 | return newTags.push(tagObject.value); 45 | }, ''); 46 | deckJSON.tag = newTags.join(', '); 47 | decks.push(deckJSON); 48 | }); 49 | 50 | module.exports = function() { 51 | return { 52 | decks: decks, 53 | cards: cards 54 | }; 55 | }; 56 | -------------------------------------------------------------------------------- /tasks/compile.index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ------------------------------------- 4 | // Task: Compile: Inline Index Source 5 | // ------------------------------------- 6 | const inlinesource = require('gulp-inline-source'); 7 | const rename = require('gulp-rename'); 8 | 9 | module.exports = function(gulp) { 10 | return function() { 11 | return gulp.src('./public/_index.html') 12 | .pipe(inlinesource()) 13 | .pipe(rename('index.html')) 14 | .pipe(gulp.dest('./public')); 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /tasks/compile.sass.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ------------------------------------- 4 | // Task: Compile: Sass 5 | // ------------------------------------- 6 | const stylemod = require('gulp-style-modules'); 7 | const autoprefixer = require('gulp-autoprefixer'); 8 | const path = require('path'); 9 | const importOnce = require('node-sass-import-once'); 10 | const cssmin = require('gulp-cssmin'); 11 | 12 | var getName = function(file) { 13 | return path.basename(file.path, path.extname(file.path)); 14 | }; 15 | 16 | var styleModuleDest = function(file) { 17 | return file.base; 18 | // console.log(path.basename(file.path)); 19 | // var name = getName(file); 20 | // return './temp/styles.html'; 21 | }; 22 | 23 | module.exports = function(gulp, plugins) { 24 | return function() { 25 | 26 | return gulp.src([ 27 | './public/*.scss', 28 | './public/elements/*.scss', 29 | './public/elements/**/*.scss' 30 | ]) 31 | .pipe(plugins.sass({ 32 | includePaths: './public/bower_components/', 33 | importer: importOnce, 34 | importOnce: { 35 | index: true, 36 | bower: true 37 | } 38 | }) 39 | .on('error', plugins.sass.logError)) 40 | .pipe(autoprefixer()) 41 | .pipe(cssmin()) 42 | .pipe(stylemod({ 43 | // All files will be named 'styles.html' 44 | filename: function(file) { 45 | var name = getName(file) + '-styles'; 46 | return name; 47 | }, 48 | // Use '-css' suffix instead of '-styles' for module ids 49 | moduleId: function(file) { 50 | return getName(file) + '-styles'; 51 | } 52 | })) 53 | .pipe(gulp.dest(styleModuleDest)); 54 | 55 | }; 56 | }; 57 | -------------------------------------------------------------------------------- /tasks/compile.vulcanize.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ------------------------------------------- 4 | // Task: Compile: Vulcanize seed-app element 5 | // ------------------------------------------- 6 | 7 | const vulcanize = require('gulp-vulcanize'); 8 | 9 | module.exports = function(gulp) { 10 | return function () { 11 | return gulp.src([ 12 | 'public/elements/seed-app/seed-app.html', 13 | 'public/elements/views/dashboards-view.html', 14 | 'public/elements/views/blankpage-view.html' 15 | ], { base: 'public/elements/' }) 16 | .pipe(vulcanize({ 17 | abspath: '', 18 | excludes: [ 19 | 'public/bower_components/polymer/polymer.html', 20 | 'public/bower_components/px-tooltip/px-tooltip.html', 21 | 'public/bower_components/px-view/px-view.html', 22 | 'public/bower_components/iron-meta/iron-meta.html', 23 | 'public/bower_components/iron-iconset-svg/iron-iconset-svg.html', 24 | 'public/bower_components/iron-icon/iron-icon.html', 25 | 'public/bower_components/iron-ajax/iron-ajax.html', 26 | 'public/bower_components/iron-ajax/iron-request.html', 27 | 'public/bower_components/px-card/px-card-header.html', 28 | 'public/bower_components/px-card/px-card.html' 29 | ], 30 | stripComments: true, 31 | inlineCss: true, 32 | inlineScripts: true 33 | })) 34 | .pipe(gulp.dest('dist/public/elements/')); 35 | }; 36 | }; 37 | -------------------------------------------------------------------------------- /tasks/dist.clean.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const clean = require('gulp-clean'); 3 | 4 | // --------------------------- 5 | // Task: Clean 'dist' folder 6 | // --------------------------- 7 | 8 | module.exports = function(gulp) { 9 | return function() { 10 | return gulp.src('dist', {read: false}) 11 | .pipe(clean()); 12 | }; 13 | }; 14 | -------------------------------------------------------------------------------- /tasks/dist.copy.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const merge = require('merge-stream'); 3 | 4 | // ------------------------------------------------ 5 | // Task: Copy all deployment files to Dist folder 6 | // ------------------------------------------------ 7 | 8 | module.exports = function(gulp) { 9 | return function() { 10 | var publicFiles = gulp.src(['public/**/*.*']).pipe(gulp.dest('./dist/public')); 11 | var server = gulp.src(['server/**/*.*']).pipe(gulp.dest('./dist/server')) 12 | var packageFile = gulp.src(['package.json']).pipe(gulp.dest('dist')); 13 | 14 | return merge(publicFiles, server, packageFile); 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /tasks/serve.dev.start.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ------------------------------------- 4 | // Task: Serve 5 | // ------------------------------------- 6 | const nodemon = require('gulp-nodemon'); 7 | 8 | module.exports = function() { 9 | return function() { 10 | nodemon({ 11 | script: 'server/app.js', 12 | env: { 'base-dir' : '/../public'} 13 | }) 14 | .on('restart', function() { 15 | console.log('app.js restarted'); 16 | }); 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /tasks/serve.dist.start.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ------------------------------------- 4 | // Task: Serve 5 | // ------------------------------------- 6 | const nodemon = require('gulp-nodemon'); 7 | 8 | module.exports = function() { 9 | return function() { 10 | nodemon({ 11 | script: 'server/app.js' 12 | , env: { 'base-dir' : '/../dist/public'} 13 | }) 14 | .on('restart', function() { 15 | console.log('app.js restarted'); 16 | }); 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /tasks/watch.public.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // ------------------------------------- 4 | // Task: Watch: Public 5 | // ------------------------------------- 6 | 7 | module.exports = function(gulp) { 8 | return function() { 9 | gulp.watch('./public/**/*.scss', ['compile:sass']); 10 | gulp.watch(['./public/_index.html','./public/_index-inline-loading-script.js','./public/index-inline.scss'], 11 | ['compile:index']); 12 | }; 13 | }; 14 | -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | Tests 9 | 10 | 11 | 12 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/seed-test-01.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | seed-test-01 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /tutorials/USERAUTH.md: -------------------------------------------------------------------------------- 1 | # Tutorial : User Authentication with UAA 2 | 3 | ## Introduction 4 | Web applications almost always involve controlling access to information and features. For this reason one commonly needed feature is that of authentication. Requiring login prior to accessing restricted features is just a necessary part of securing a web application. 5 | 6 | This tutorial shows how to add authentication to an instance of the Predix UI Seed. Specifically, we use the UAA authentication service that has its own user interface. With an unauthenticated browser session, accessing any restricted page of the application should cause the user to be redirected to the UAA login page. Upon successful login the user is redirected back to the application. From there the user is able to access the application's restricted pages and information. This authenticated session lasts until the user logs out. 7 | 8 | We first show how to restrict access to specific routes or pages of the application. Then we show how to make such routes or pages require authentication. Finally, we show how to require authentication for all routes and pages of the application. 9 | 10 | If you prefer a video version (on which this written version is based) one is available [**here**](https://youtu.be/AiJ2IFJoTHg?list=PLibNgo_CBeuujvRV26_uLTksm1ezh7oGd). 11 | 12 | ### Pre-Requisites 13 | This tutorial requires a running UAA service instance. Please refer to this [**tutorial**](https://www.predix.io/resources/tutorials/tutorial-details.html?tutorial_id=1544&tag=1605&journey=Build%20a%20basic%20application&resources=1580,1569,1523,1544,1547,1549,1556,1553,1570) for information on creating an instance and a set of valid credentials. UAA instance creation will involve the following values: 14 | 15 | - URL 16 | 17 | - clientId 18 | 19 | - secret 20 | 21 | - username / password (credentials) 22 | 23 | Save these values for use in the configuration steps below. 24 | 25 | This tutorial also requires knowledge of and practical experience with the Predix UI Seed (this project). You should have been able to install, minimally configure, and deploy the Seed prior to performing this tutorial. Please refer to the README document of this project for this requirement. 26 | 27 | ## Steps 28 | ### Configure for Authentication 29 | 0. Install the Seed and have it running locally by following the steps in the **README** document of this project. 30 | 1. With the Seed running locally, access the */secure* route ( For example: *https://localhost:5000/secure* ). You should see a page that says the site is unavailable ( browser shows page that says *cannot GET /secure* ). This is because the route has not been defined yet. 31 | 32 | 2. Find the *localConfig.json* file under the *server* folder. From this file locate the 3 configuration variables: 33 | - **clientId** 34 | - **uaaURL** 35 | - **base64ClientCredential** 36 | 3. Replace the values of these variables with the following: 37 | 38 | #### clientId 39 | For UAA-based authentication (which is what we use here), use the same value that was used for **clientId** in your UAA instance creation, as mentioned in the **Pre-Requisites** section above. 40 | 41 | #### uaaURL 42 | This is the URL of the UAA instance that was created in the **Pre-Requisites** section. With the service running and a set of credentials in hand (user and password), use the service URL as the value for this variable. 43 | 44 | #### base64ClientCredential 45 | This is a [**Base64**](https://en.wikipedia.org/wiki/Base64) encoding of the string '*\*:*\*', where '*\*' is the value of the **clientId** configuration variable, and '*\*' is the 'secret' value used in the UAA instance creation. 46 | 47 | In a Mac OS or Unix environment, you can get this value by running the following command sequence (for example, using the string literals '*app_client_id*' and '*secret*' for **clientId** and **secret** values, respectively): 48 | ``` 49 | echo -n app_client_id:secret | base64 50 | ``` 51 | In a Windows environment, [**certutil**](https://technet.microsoft.com/en-us/library/cc732443\(v=ws.11\).aspx) utility can be used to generate the same value. 52 | 53 | After running the above command sequence in your chosen environment, copy the output string into the variable. 54 | 55 | Here is an example of all three configuration variables in *server/localConfig.json* populated with their respective values : 56 | 57 | ``` 58 | ... 59 | "clientId": "app_client_id", 60 | "uaaURL": "https://162665f2-e477-488a-93d1-bb33ccb3d568.predix-uaa.run.aws-usw02-pr.ice.predix.io", 61 | "base64ClientCredential": "YXBwX2NsaWVudF9pZDpzZWNyZXQ=", 62 | ... 63 | ``` 64 | 65 | ### Verify Authentication 66 | 4. With the configurations in place, restart the local application. 67 | 68 | 69 | 5. Access the */secure* route again, as in step 1 of the previous section. Notice that the browser now returns a page that says *Unauthorized*, instead of not being able to find the page (as in the previous section). This is because that route has now been defined, as an authenticated route (other routes that have also been defined are */login*, */callback*, */predix-api* and */logout*). At this point authentication is in place, and your browser session is in an unauthenticated state. Consequently, accessing such routes results in "Unauthorized" (with the exception of */login*, which redirects to the authentication service's page). 70 | 71 | 6. Access the */login* route. Notice that the browser is redirected to the UAA login page. 72 | 73 | 7. Enter valid credentials in the login page and click on Submit. Upon successful login, the browser is redirected to the */secure* route, which now shows the text **This is a sample secure route**. At this point, the browser session is now in the authenticated state, and access to such route is now authorized. We have just shown how to integrate UAA with authentication-requiring routes/pages in an instance of the Seed. 74 | 75 | 8. Access the */logout* route. This will put the browser session back to the unauthenticated state. 76 | 77 | 9. Access the */secure* route once more. Notice that we get the *Unauthorized* result again, because the browser session is now back to being unauthenticated. Accessing the other routes mentioned in step 2 of this section (except */login*) should now return *Unauthorized* as well. We have just shown how authentication enables access to specific routes or pages, and how the user is given the chance to authenticate when accessing a route while in an unauthenticated state. 78 | 79 | ### Authenticating All Routes 80 | The previous sections show how authentication can be added to specific routes in the application. Oftentimes, all routes (except the login route) need to be accessible only after authentication. Since this is such a common pattern it is enabled by default, when you configured UAA above. This is the snippet of code that addes authentication to all routes in the application: 81 | 82 | ``` 83 | //Use this route to make the entire app secure. This forces login for any path in the entire app. 84 | app.use('/', passport.authenticate('main', { 85 | noredirect: false //Don't redirect a user to the authentication page, just show an error 86 | }), 87 | express.static(path.join(__dirname, process.env['base-dir'] ? process.env['base-dir'] : '../public')) 88 | ); 89 | ``` 90 | 91 | Now you can access any route, including the default route '*/*'. Notice that the browser is redirected to the authentication page. If the route is defined, the browser is redirected to it after successful login by the user. 92 | 93 | ### Deploying to the Cloud 94 | The previous steps showed how authentication is enabled in a local instance of the Predix UI Seed application. Ultimately, we want the authentication feature to be part of deployments to the Cloud. To achieve this, perform these steps: 95 | 96 | In the *manifest.yml* file (or your designated manifest file), enable services by uncommenting the *services* section, and enter the name of the UAA instance that will be used. For example: 97 | 98 | ``` 99 | services 100 | - my-uaa-service 101 | ``` 102 | 103 | In the same file, enter the values for **clientId** and **base64ClientCredential** that were used in the previous sections. For Example: 104 | 105 | ``` 106 | env: 107 | clientId: app_client_id 108 | base64ClientCredential: YXBwX2NsaWVudF9pZDpzZWNyZXQ= 109 | ``` 110 | 111 | From the command terminal, and in the main folder of the application, run 112 | 113 | ``` 114 | gulp dist 115 | ``` 116 | 117 | to include the configuration in the distribution package for the application. 118 | 119 | Deploy to the Cloud as usual. 120 | 121 | Perform the same steps above to verify that authentication is working. 122 | 123 | ## Conclusion 124 | 125 | This document has shown how to add Authentication to an instance of the Seed, and apply the feature to specific, and later, all routes. It has also shown how to apply the feature in both local and cloud deployments. 126 | 127 | ## Support and Further Information 128 | 129 | For more information on this tutorial, you can ask questions and file tickets on https://www.predix.io/community. 130 | -------------------------------------------------------------------------------- /wct.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | verbose: false, 3 | persistent: true, 4 | plugins: { 5 | local: { 6 | browsers: ['chrome'] 7 | }, 8 | sauce: { 9 | disabled: true, 10 | "browsers": [{ 11 | "browserName": "microsoftedge", 12 | "platform": "Windows 10", 13 | "version": "" 14 | }, { 15 | "browserName": "internet explorer", 16 | "platform": "Windows 8.1", 17 | "version": "11" 18 | }, { 19 | "browserName": "safari", 20 | "platform": "OS X 10.11", 21 | "version": "9" 22 | }, { 23 | "browserName": "safari", 24 | "platform": "OS X 10.10", 25 | "version": "8" 26 | }] 27 | } 28 | }, 29 | suites: [ 30 | 'test/index.html' 31 | ] 32 | }; 33 | --------------------------------------------------------------------------------