mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
docs(): work on example app
This commit is contained in:
7
examples/nginx-app/.gitignore
vendored
Normal file
7
examples/nginx-app/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.DS_Store
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
tmp/*
|
||||||
|
npm-debug.log
|
||||||
|
dist/*
|
||||||
|
|
||||||
13
examples/nginx-app/.jscs.json
Normal file
13
examples/nginx-app/.jscs.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"disallowImplicitTypeConversion": ["string"],
|
||||||
|
"disallowKeywords": ["with"],
|
||||||
|
"disallowMultipleLineBreaks": true,
|
||||||
|
"disallowMixedSpacesAndTabs": true,
|
||||||
|
"disallowTrailingWhitespace": true,
|
||||||
|
"requireSpacesInFunctionExpression": {
|
||||||
|
"beforeOpeningCurlyBrace": true
|
||||||
|
},
|
||||||
|
"disallowSpacesInsideArrayBrackets": true,
|
||||||
|
"disallowSpacesInsideParentheses": true,
|
||||||
|
"validateIndentation": 2
|
||||||
|
}
|
||||||
36
examples/nginx-app/.jshintrc
Normal file
36
examples/nginx-app/.jshintrc
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"browser": true,
|
||||||
|
"esnext": true,
|
||||||
|
|
||||||
|
"bitwise":false,
|
||||||
|
"curly": true,
|
||||||
|
"eqnull": true,
|
||||||
|
"devel": true,
|
||||||
|
"eqeqeq": true,
|
||||||
|
"forin": false,
|
||||||
|
"immed": true,
|
||||||
|
"supernew": true,
|
||||||
|
"expr": true,
|
||||||
|
"indent": 2,
|
||||||
|
"latedef": true,
|
||||||
|
"newcap": true,
|
||||||
|
"noarg": true,
|
||||||
|
"noempty": true,
|
||||||
|
"undef": true,
|
||||||
|
"boss": true,
|
||||||
|
"trailing": true,
|
||||||
|
"laxbreak": true,
|
||||||
|
"laxcomma": true,
|
||||||
|
"sub": true,
|
||||||
|
"unused": true,
|
||||||
|
"maxdepth": 6,
|
||||||
|
"maxlen": 140,
|
||||||
|
|
||||||
|
"globals": {
|
||||||
|
"System": true,
|
||||||
|
"define": true,
|
||||||
|
"require": true,
|
||||||
|
"Chromath": false,
|
||||||
|
"setImmediate": true
|
||||||
|
}
|
||||||
|
}
|
||||||
54
examples/nginx-app/Gruntfile.js
Normal file
54
examples/nginx-app/Gruntfile.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
|
require('load-grunt-tasks')(grunt);
|
||||||
|
|
||||||
|
grunt.loadNpmTasks('grunt-execute');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||||
|
|
||||||
|
grunt.initConfig({
|
||||||
|
|
||||||
|
clean: ["dist"],
|
||||||
|
|
||||||
|
copy: {
|
||||||
|
src_to_dist: {
|
||||||
|
cwd: 'src',
|
||||||
|
expand: true,
|
||||||
|
src: ['**/*', '!**/*.js', '!**/*.scss'],
|
||||||
|
dest: 'dist'
|
||||||
|
},
|
||||||
|
pluginDef: {
|
||||||
|
expand: true,
|
||||||
|
src: 'plugin.json',
|
||||||
|
dest: 'dist',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
rebuild_all: {
|
||||||
|
files: ['src/**/*', 'plugin.json'],
|
||||||
|
tasks: ['default'],
|
||||||
|
options: {spawn: false}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
babel: {
|
||||||
|
options: {
|
||||||
|
sourceMap: true,
|
||||||
|
presets: ["es2015"],
|
||||||
|
plugins: ['transform-es2015-modules-systemjs', "transform-es2015-for-of"],
|
||||||
|
},
|
||||||
|
dist: {
|
||||||
|
files: [{
|
||||||
|
cwd: 'src',
|
||||||
|
expand: true,
|
||||||
|
src: ['**/*.js'],
|
||||||
|
dest: 'dist',
|
||||||
|
ext:'.js'
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
grunt.registerTask('default', ['clean', 'copy:src_to_dist', 'copy:pluginDef', 'babel']);
|
||||||
|
};
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
define([
|
|
||||||
], function() {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
function StreamPageCtrl() {}
|
|
||||||
StreamPageCtrl.templateUrl = 'partials/stream.html';
|
|
||||||
|
|
||||||
function LogsPageCtrl() {}
|
|
||||||
LogsPageCtrl.templateUrl = 'partials/logs.html';
|
|
||||||
|
|
||||||
function NginxConfigCtrl() {}
|
|
||||||
NginxConfigCtrl.templateUrl = 'partials/config.html';
|
|
||||||
|
|
||||||
return {
|
|
||||||
ConfigCtrl: NginxConfigCtrl,
|
|
||||||
StreamPageCtrl: StreamPageCtrl,
|
|
||||||
LogsPageCtrl: LogsPageCtrl,
|
|
||||||
};
|
|
||||||
|
|
||||||
});
|
|
||||||
37
examples/nginx-app/package.json
Normal file
37
examples/nginx-app/package.json
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"name": "kentik-app",
|
||||||
|
"private": true,
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/raintank/kentik-app-poc.git"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/raintank/kentik-app-poc/issues"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"grunt": "~0.4.5",
|
||||||
|
"babel": "~6.5.1",
|
||||||
|
"grunt-babel": "~6.0.0",
|
||||||
|
"grunt-contrib-copy": "~0.8.2",
|
||||||
|
"grunt-contrib-watch": "^0.6.1",
|
||||||
|
"grunt-contrib-uglify": "~0.11.0",
|
||||||
|
"grunt-systemjs-builder": "^0.2.5",
|
||||||
|
"load-grunt-tasks": "~3.2.0",
|
||||||
|
"grunt-execute": "~0.2.2",
|
||||||
|
"grunt-contrib-clean": "~0.6.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"babel-plugin-transform-es2015-modules-systemjs": "^6.5.0",
|
||||||
|
"babel-preset-es2015": "^6.5.0",
|
||||||
|
"lodash": "~4.0.0"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/raintank/kentik-app-poc#readme"
|
||||||
|
}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
define([
|
|
||||||
'app/plugins/sdk'
|
|
||||||
], function(sdk) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var NginxPanel = (function(_super) {
|
|
||||||
function NginxPanel($scope, $injector) {
|
|
||||||
_super.call(this, $scope, $injector);
|
|
||||||
}
|
|
||||||
|
|
||||||
NginxPanel.template = '<h2>nginx!</h2>';
|
|
||||||
NginxPanel.prototype = Object.create(_super.prototype);
|
|
||||||
NginxPanel.prototype.constructor = NginxPanel;
|
|
||||||
|
|
||||||
return NginxPanel;
|
|
||||||
})(sdk.PanelCtrl);
|
|
||||||
|
|
||||||
return {
|
|
||||||
PanelCtrl: NginxPanel
|
|
||||||
};
|
|
||||||
});
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<h2>nginx config</h2>
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
Logs!
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
streams!
|
|
||||||
3
examples/nginx-app/src/components/config.html
Normal file
3
examples/nginx-app/src/components/config.html
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<h3>
|
||||||
|
Nginx config!
|
||||||
|
</h3>
|
||||||
6
examples/nginx-app/src/components/config.js
Normal file
6
examples/nginx-app/src/components/config.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
export class NginxAppConfigCtrl {
|
||||||
|
}
|
||||||
|
NginxAppConfigCtrl.templateUrl = 'components/config.html';
|
||||||
|
|
||||||
|
|
||||||
3
examples/nginx-app/src/components/logs.html
Normal file
3
examples/nginx-app/src/components/logs.html
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<h3>
|
||||||
|
Logs page!
|
||||||
|
</h3>
|
||||||
6
examples/nginx-app/src/components/logs.js
Normal file
6
examples/nginx-app/src/components/logs.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
export class LogsPageCtrl {
|
||||||
|
}
|
||||||
|
LogsPageCtrl.templateUrl = 'components/logs.html';
|
||||||
|
|
||||||
|
|
||||||
3
examples/nginx-app/src/components/stream.html
Normal file
3
examples/nginx-app/src/components/stream.html
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<h3>
|
||||||
|
Stream page!
|
||||||
|
</h3>
|
||||||
6
examples/nginx-app/src/components/stream.js
Normal file
6
examples/nginx-app/src/components/stream.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
export class StreamPageCtrl {
|
||||||
|
}
|
||||||
|
StreamPageCtrl.templateUrl = 'components/stream.html';
|
||||||
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
9
examples/nginx-app/src/module.js
Normal file
9
examples/nginx-app/src/module.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import {LogsPageCtrl} from './components/logs';
|
||||||
|
import {StreamPageCtrl} from './components/stream';
|
||||||
|
import {NginxAppConfigCtrl} from './components/config';
|
||||||
|
|
||||||
|
export {
|
||||||
|
NginxAppConfigCtrl as ConfigCtrl,
|
||||||
|
StreamPageCtrl,
|
||||||
|
LogsPageCtrl
|
||||||
|
};
|
||||||
15
examples/nginx-app/src/panel/module.js
Normal file
15
examples/nginx-app/src/panel/module.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import {PanelCtrl} from 'app/plugins/sdk';
|
||||||
|
|
||||||
|
class NginxPanelCtrl extends PanelCtrl {
|
||||||
|
|
||||||
|
constructor($scope, $injector) {
|
||||||
|
super($scope, $injector);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
NginxPanelCtrl.template = '<h2>nginx!</h2>';
|
||||||
|
|
||||||
|
export {
|
||||||
|
NginxPanelCtrl as PanelCtrl
|
||||||
|
};
|
||||||
|
|
||||||
Reference in New Issue
Block a user