Skip to content

Commit 50ddf79

Browse files
committed
docs(): work on example app
1 parent 39bb9ce commit 50ddf79

23 files changed

+198
-45
lines changed

examples/nginx-app/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
3+
node_modules
4+
tmp/*
5+
npm-debug.log
6+
dist/*
7+

examples/nginx-app/.jscs.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"disallowImplicitTypeConversion": ["string"],
3+
"disallowKeywords": ["with"],
4+
"disallowMultipleLineBreaks": true,
5+
"disallowMixedSpacesAndTabs": true,
6+
"disallowTrailingWhitespace": true,
7+
"requireSpacesInFunctionExpression": {
8+
"beforeOpeningCurlyBrace": true
9+
},
10+
"disallowSpacesInsideArrayBrackets": true,
11+
"disallowSpacesInsideParentheses": true,
12+
"validateIndentation": 2
13+
}

examples/nginx-app/.jshintrc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"browser": true,
3+
"esnext": true,
4+
5+
"bitwise":false,
6+
"curly": true,
7+
"eqnull": true,
8+
"devel": true,
9+
"eqeqeq": true,
10+
"forin": false,
11+
"immed": true,
12+
"supernew": true,
13+
"expr": true,
14+
"indent": 2,
15+
"latedef": true,
16+
"newcap": true,
17+
"noarg": true,
18+
"noempty": true,
19+
"undef": true,
20+
"boss": true,
21+
"trailing": true,
22+
"laxbreak": true,
23+
"laxcomma": true,
24+
"sub": true,
25+
"unused": true,
26+
"maxdepth": 6,
27+
"maxlen": 140,
28+
29+
"globals": {
30+
"System": true,
31+
"define": true,
32+
"require": true,
33+
"Chromath": false,
34+
"setImmediate": true
35+
}
36+
}

examples/nginx-app/Gruntfile.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
module.exports = function(grunt) {
2+
3+
require('load-grunt-tasks')(grunt);
4+
5+
grunt.loadNpmTasks('grunt-execute');
6+
grunt.loadNpmTasks('grunt-contrib-clean');
7+
8+
grunt.initConfig({
9+
10+
clean: ["dist"],
11+
12+
copy: {
13+
src_to_dist: {
14+
cwd: 'src',
15+
expand: true,
16+
src: ['**/*', '!**/*.js', '!**/*.scss'],
17+
dest: 'dist'
18+
},
19+
pluginDef: {
20+
expand: true,
21+
src: 'plugin.json',
22+
dest: 'dist',
23+
}
24+
},
25+
26+
watch: {
27+
rebuild_all: {
28+
files: ['src/**/*', 'plugin.json'],
29+
tasks: ['default'],
30+
options: {spawn: false}
31+
},
32+
},
33+
34+
babel: {
35+
options: {
36+
sourceMap: true,
37+
presets: ["es2015"],
38+
plugins: ['transform-es2015-modules-systemjs', "transform-es2015-for-of"],
39+
},
40+
dist: {
41+
files: [{
42+
cwd: 'src',
43+
expand: true,
44+
src: ['**/*.js'],
45+
dest: 'dist',
46+
ext:'.js'
47+
}]
48+
},
49+
},
50+
51+
});
52+
53+
grunt.registerTask('default', ['clean', 'copy:src_to_dist', 'copy:pluginDef', 'babel']);
54+
};

examples/nginx-app/module.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/nginx-app/package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "kentik-app",
3+
"private": true,
4+
"version": "1.0.0",
5+
"description": "",
6+
"main": "index.js",
7+
"scripts": {
8+
"test": "echo \"Error: no test specified\" && exit 1"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/raintank/kentik-app-poc.git"
13+
},
14+
"author": "",
15+
"license": "ISC",
16+
"bugs": {
17+
"url": "https://github.com/raintank/kentik-app-poc/issues"
18+
},
19+
"devDependencies": {
20+
"grunt": "~0.4.5",
21+
"babel": "~6.5.1",
22+
"grunt-babel": "~6.0.0",
23+
"grunt-contrib-copy": "~0.8.2",
24+
"grunt-contrib-watch": "^0.6.1",
25+
"grunt-contrib-uglify": "~0.11.0",
26+
"grunt-systemjs-builder": "^0.2.5",
27+
"load-grunt-tasks": "~3.2.0",
28+
"grunt-execute": "~0.2.2",
29+
"grunt-contrib-clean": "~0.6.0"
30+
},
31+
"dependencies": {
32+
"babel-plugin-transform-es2015-modules-systemjs": "^6.5.0",
33+
"babel-preset-es2015": "^6.5.0",
34+
"lodash": "~4.0.0"
35+
},
36+
"homepage": "https://github.com/raintank/kentik-app-poc#readme"
37+
}

examples/nginx-app/panel/module.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

examples/nginx-app/partials/config.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/nginx-app/partials/logs.html

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/nginx-app/partials/stream.html

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<h3>
2+
Nginx config!
3+
</h3>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
export class NginxAppConfigCtrl {
3+
}
4+
NginxAppConfigCtrl.templateUrl = 'components/config.html';
5+
6+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<h3>
2+
Logs page!
3+
</h3>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
export class LogsPageCtrl {
3+
}
4+
LogsPageCtrl.templateUrl = 'components/logs.html';
5+
6+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<h3>
2+
Stream page!
3+
</h3>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
export class StreamPageCtrl {
3+
}
4+
StreamPageCtrl.templateUrl = 'components/stream.html';
5+
6+
File renamed without changes.

examples/nginx-app/src/module.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {LogsPageCtrl} from './components/logs';
2+
import {StreamPageCtrl} from './components/stream';
3+
import {NginxAppConfigCtrl} from './components/config';
4+
5+
export {
6+
NginxAppConfigCtrl as ConfigCtrl,
7+
StreamPageCtrl,
8+
LogsPageCtrl
9+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {PanelCtrl} from 'app/plugins/sdk';
2+
3+
class NginxPanelCtrl extends PanelCtrl {
4+
5+
constructor($scope, $injector) {
6+
super($scope, $injector);
7+
}
8+
9+
}
10+
NginxPanelCtrl.template = '<h2>nginx!</h2>';
11+
12+
export {
13+
NginxPanelCtrl as PanelCtrl
14+
};
15+

0 commit comments

Comments
 (0)