Commit 82d5d1b0 by Torkel Ödegaard

feat(plugins): working on plugin examples

parent f4e90df4
define([
'angular',
'app/app'
], function(angular, app) {
var module = angular.module('nginx-app', []);
app.default.useModule(module);
module.config(function($routeProvider) {
$routeProvider
.when('/nginx/stream', {
templateUrl: 'public/plugins/nginx-app/partials/stream.html',
});
});
function NginxConfigCtrl() {
this.appEditCtrl.beforeUpdate = function() {
alert('before!');
};
}
NginxConfigCtrl.templateUrl = 'public/plugins/nginx-app/partials/config.html';
return {
ConfigCtrl: NginxConfigCtrl
};
});
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
};
});
{
"type": "panel",
"name": "Nginx Panel",
"id": "nginx-panel",
"staticRoot": "."
}
<topnav title="Nginx" icon="fa fa-fw fa-cubes" subnav="true">
<ul class="nav">
<li class="active" ><a href="org/apps">Overview</a></li>
</ul>
</topnav>
<div class="page-container" style="background: transparent; border: 0;">
<div class="page-wide" ng-init="ctrl.init()">
<h1>NGINX app</h1>
</div>
</div>
{
"type": "app",
"name": "Nginx",
"id": "nginx-app",
"staticRoot": ".",
"pages": [
{"name": "Live stream", "url": "nginx/stream", "reqRole": "Editor"},
{"name": "Log view", "url": "nginx/log", "reqRole": "Editor"}
],
"css": {
"dark": "css/dark.css",
"light": "css/light.css"
},
"info": {
"description": "Official Grafana Nginx App & Dashboard bundle",
"author": {
"name": "Nginx Inc.",
"url": "http://nginx.com"
},
"keywords": ["nginx"],
"logos": {
"small": "img/logo_small.png",
"large": "img/logo_large.png"
},
"links": [
{"name": "Project site", "url": "http://project.com"},
{"name": "License & Terms", "url": "http://license.com"}
],
"version": "1.0.0",
"updated": "2015-02-10"
},
"dependencies": {
"grafanaVersion": "2.6.x",
"plugins": [
{"type": "datasource", "id": "graphite", "name": "Graphite", "version": "1.0.0"},
{"type": "panel", "id": "graph", "name": "Graph", "version": "1.0.0"}
]
}
}
(function bootGrafana() {
'use strict';
System.import('app/grafana').then(function(grafana) {
grafana.default.init();
System.import('app/app').then(function(app) {
app.default.init();
}).catch(function(err) {
console.log('Loading app module failed: ', err);
});
......
......@@ -11,7 +11,7 @@ module.exports = function(grunt) {
console.log('Starting systemjs-builder');
var modules = [
'app/grafana',
'app/app',
'app/features/all',
'app/plugins/panel/**/module',
'app/plugins/datasource/graphite/datasource',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment