Skip to content

Commit fe03cb0

Browse files
committed
First commit of code ported from dceu-visualizer
1 parent 428f824 commit fe03cb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1765
-3
lines changed

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM node:4.1.2-slim
2+
3+
WORKDIR /app
4+
5+
# Only run npm install if these files change
6+
ADD ./package.json /app/package.json
7+
8+
# Install dependencies
9+
RUN npm install --unsafe-perm=true
10+
11+
# Add the rest of the sources
12+
ADD . /app
13+
14+
# Build the app
15+
RUN npm run dist
16+
ENV HOST "localhost"
17+
ENV MS 200
18+
ENV PORT 8080
19+
EXPOSE 8080
20+
21+
CMD ["npm","start"]

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,4 @@
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201201
limitations under the License.
202+

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
# Docker Swarm Visualizer
2-
A visualizer for Docker Swarm using the Docker Remote API, Node.JS, and D3
3-
Originally written for DockerCon EU 2015 to visualize Tutum clusters by the Tutum team. Re-written for DockerCon 2016 to visualize Docker Swarm. Still hacky, but will work on fleshing it out.
1+
# Tutum Visualizer
2+
3+
[![Deploy to Tutum](https://s.tutum.co/deploy-to-tutum.svg)](https://dashboard.tutum.co/stack/deploy/)
4+
5+
Demo container that displays services on a diagram
6+
7+

cfg/base.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
var path = require('path');
2+
3+
var port = 8080;
4+
var srcPath = path.join(__dirname, '/../src');
5+
var publicPath = '/';
6+
7+
module.exports = {
8+
port: port,
9+
debug: true,
10+
output: {
11+
path: path.join(__dirname, '/../dist'),
12+
filename: 'app.js',
13+
publicPath: publicPath
14+
},
15+
devServer: {
16+
contentBase: './src/',
17+
historyApiFallback: true,
18+
hot: true,
19+
inline: true,
20+
port: port,
21+
publicPath: publicPath,
22+
noInfo: false,
23+
proxy: {
24+
'/api/*': {
25+
target: 'https://dashboard.tutum.co',
26+
secure: false,
27+
},
28+
},
29+
},
30+
module: {
31+
preLoaders: [
32+
{
33+
test: /\.(js|jsx)$/,
34+
include: path.join(__dirname, 'src'),
35+
loader: 'eslint-loader'
36+
}
37+
],
38+
loaders: [
39+
{
40+
test: /\.css$/,
41+
loader: 'style!css'
42+
},
43+
{
44+
test: /\.sass/,
45+
loader: 'style-loader!css-loader!sass-loader?outputStyle=expanded&indentedSyntax'
46+
},
47+
{
48+
test: /\.scss/,
49+
loader: 'style-loader!css-loader!sass-loader?outputStyle=expanded'
50+
},
51+
{
52+
test: /\.less/,
53+
loader: 'style-loader!css-loader!less-loader'
54+
},
55+
{
56+
test: /\.styl/,
57+
loader: 'style-loader!css-loader!stylus-loader'
58+
},
59+
{
60+
test: /\.(png|jpg|gif|woff|woff2)$/,
61+
loader: 'url-loader?limit=8192'
62+
},
63+
{
64+
test: /\.svg$/,
65+
loader: 'svg-inline'
66+
}
67+
]
68+
}
69+
};

cfg/dev.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
var path = require('path');
2+
var webpack = require('webpack');
3+
var _ = require('lodash');
4+
5+
var baseConfig = require('./base');
6+
7+
var config = _.merge({
8+
entry: [
9+
'webpack-dev-server/client?http://127.0.0.1:8080',
10+
'webpack/hot/only-dev-server',
11+
'./src/main'
12+
],
13+
cache: true,
14+
devtool: 'eval',
15+
plugins: [
16+
new webpack.HotModuleReplacementPlugin(),
17+
new webpack.NoErrorsPlugin()
18+
]
19+
}, baseConfig);
20+
21+
// Add needed loaders
22+
config.module.loaders.push({
23+
test: /\.(js|jsx)$/,
24+
loader: 'babel-loader',
25+
include: path.join(__dirname, '/../src')
26+
});
27+
28+
module.exports = config;

cfg/dist.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
var path = require('path');
2+
var webpack = require('webpack');
3+
var _ = require('lodash');
4+
5+
var baseConfig = require('./base');
6+
7+
var config = _.merge({
8+
entry: path.join(__dirname, '../src/main'),
9+
cache: false,
10+
devtool: 'sourcemap',
11+
plugins: [
12+
new webpack.optimize.DedupePlugin(),
13+
new webpack.optimize.UglifyJsPlugin(),
14+
new webpack.optimize.OccurenceOrderPlugin(),
15+
new webpack.optimize.AggressiveMergingPlugin(),
16+
new webpack.NoErrorsPlugin()
17+
]
18+
}, baseConfig);
19+
20+
config.module.loaders.push({
21+
test: /\.(js|jsx)$/,
22+
loader: 'babel',
23+
include: path.join(__dirname, '/../src')
24+
});
25+
26+
module.exports = config;

cfg/test.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
var path = require('path');
2+
var srcPath = path.join(__dirname, '/../src/');
3+
4+
module.exports = {
5+
devtool: 'eval',
6+
module: {
7+
loaders: [
8+
{
9+
test: /\.(png|jpg|gif|woff|woff2|css|sass|scss|less|styl)$/,
10+
loader: 'null-loader'
11+
},
12+
{
13+
test: /\.(js|jsx)$/,
14+
loader: 'babel-loader',
15+
include: [
16+
path.join(__dirname, '/../src'),
17+
path.join(__dirname, '/../test')
18+
]
19+
}
20+
]
21+
},
22+
resolve: {
23+
extensions: ['', '.js', '.jsx'],
24+
alias: {
25+
actions: srcPath + 'actions/',
26+
helpers: path.join(__dirname, '/../test/helpers'),
27+
components: srcPath + 'components/',
28+
sources: srcPath + 'sources/',
29+
stores: srcPath + 'stores/',
30+
styles: srcPath + 'styles/'
31+
}
32+
}
33+
};

create-index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var fs = require('fs');
2+
var indexFile = require('lodash')
3+
.template(fs.readFileSync('index.tpl'))(require('./credentials'))
4+
5+
fs.writeFileSync('./src/index.html',indexFile);
6+
process.exit(0);

dist/app.js

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/app.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)