Skip to content

Commit

Permalink
[CE-33] add document and Dockerfile for user dashboard
Browse files Browse the repository at this point in the history
Update to docker compose

Change-Id: If4a1b5d593ef90fe4f17d4e5d7157fa7437c5cb0
Signed-off-by: lixucheng <lixucheng@aliyun.com>
  • Loading branch information
xuchengli committed May 31, 2017
1 parent 7758c75 commit e11a7cc
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 2 deletions.
10 changes: 10 additions & 0 deletions user-dashboard/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node
MAINTAINER li xu cheng "lixucheng@aliyun.com"
RUN npm install -g requirejs
RUN mkdir -p /usr/app/src
COPY . /usr/app/src
RUN r.js -o /usr/app/src/build.js
WORKDIR /usr/app/built
RUN npm install && npm cache clean
EXPOSE 8080
CMD ["npm", "start"]
68 changes: 68 additions & 0 deletions user-dashboard/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**
* Created by lixuc on 2017/5/19.
*/
({
appDir: "./",
baseUrl: "./public/js",
mainConfigFile: "./public/js/common.js",
dir: "../built",
fileExclusionRegExp: /^node_modules|.idea|build\.js|\.DS_Store|Dockerfile|docker-compose\.yml/,
skipDirOptimize: true,
preserveLicenseComments: false,
modules:[
{
name: "common",
include: [
"jquery",
"uikit",
"lodash",
"plugin/notify",
"plugin/tooltip"
]
},
{
name: "app/index",
exclude: ["common"]
},
{
name: "app/dashboard/home",
exclude: ["common"]
},
{
name: "app/dashboard/chain/list",
exclude: ["common"]
},
{
name: "app/dashboard/chain/detail",
exclude: ["common"]
},
{
name: "app/dashboard/contract/list",
exclude: ["common"]
},
{
name: "app/dashboard/analytics/nochains",
exclude: ["common"]
},
{
name: "app/dashboard/analytics/overview",
exclude: ["common"]
},
{
name: "app/dashboard/analytics/chaincode/list",
exclude: ["common"]
},
{
name: "app/dashboard/analytics/fabric",
exclude: ["common"]
},
{
name: "app/dashboard/analytics/infrastructure",
exclude: ["common"]
},
{
name: "app/dashboard/store",
exclude: ["common"]
}
]
})
15 changes: 15 additions & 0 deletions user-dashboard/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "2"
services:
dashboard:
build: ./
image: cello-user-dashboard
container_name: user-dashboard
links:
- mongodb:dashboard_mongo
ports:
- "8080:8080"
mongodb:
image: mongo
container_name: mongo
ports:
- "27017:27017"
40 changes: 40 additions & 0 deletions user-dashboard/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# User Dashboard for Blockchain

This dashboard is a web based application for blockchain developers. It is especially useful for blockchain apps incubation. You can upload your smart contract, apply one or more chains that deploy your smart contract, and invoke / query your smart contract functions on the dashboard. It include blockchain topology overview, network latency monitor and log tracking, blocks' transactions reveal and etc. Also support chaincode, fabric and infrastructure analytics.

![Dashboard home page](images/dashboard-home.png)

## Installation

1. Goto directory of user dashboard

```
$ cd my-local-cello-dir/user-dashboard
```

2. Build dashboard image

```
$ docker-compose build
```

3. Start dashboard

```
$ docker-compose up -d
```

4. Access url: [http://localhost:8080](http://localhost:8080)

## Functions

| Name | URL | Description |
| --- | --- | --- |
| Home | `/dashboard` | The dashboard overview |
| Chain Management | `/dashboard/chain` | Include functions of apply / edit / release / start / stop / restart chains |
| Chain Detail | `/dashboard/chain/{id}` | Include functions of topology overview, log tracking, blocks view, APIs exposure and chaincode list / invoke / query |
| Smart Contract Management | `/dashboard/contract` | Include functions of smart contract upload, edit, delete and deploy |
| Analytics Overview | `/dashboard/analytics` | The high-level overview of chain status |
| Chaincode Analytics | `/dashboard/analytics/chaincode` | Chaincode invoke functions and response time statistic analysis |
| Fabric Analytics | `/dashboard/analytics/fabric` | Blocks amount and block time statistic analysis |
| Infrastructure Analytics | `/dashboard/analytics/infrastructure` | Cluster's CPU, memory, disk and network statistic analysis |
Binary file added user-dashboard/docs/images/dashboard-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions user-dashboard/modules/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ module.exports = {
Log_Server: process.env.Log_Server || "9.186.91.29:8080",
Log_BaseURL: "/v1/log",
mongodb: {
ip: "127.0.0.1",
ip: "dashboard_mongo",
port: 27017,
name: "bc_dashboard",
auth: true,
auth: false,
username: "admin",
password: "passw0rd"
},
Expand Down
1 change: 1 addition & 0 deletions user-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"devDependencies": {},
"scripts": {
"start": "node app.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "li xu cheng",
Expand Down

0 comments on commit e11a7cc

Please sign in to comment.