Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Initial hawkular ui project checkin using hawt.io 2 (https://github.c…
Browse files Browse the repository at this point in the history
  • Loading branch information
mtho11 committed Jan 26, 2015
1 parent 1a28106 commit 7458f6b
Show file tree
Hide file tree
Showing 36 changed files with 724 additions and 0 deletions.
1 change: 1 addition & 0 deletions ui/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.adoc
3 changes: 3 additions & 0 deletions ui/console/alerts/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory" : "libs"
}
2 changes: 2 additions & 0 deletions ui/console/alerts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
libs/
30 changes: 30 additions & 0 deletions ui/console/alerts/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "hawkular-alerts",
"version": "0.1.0",
"keywords": [
"hawtio"
],
"main": [
"dist/hawkular-alerts.js"
],
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"libs",
"test",
"tests",
"plugins"
],
"dependencies": {
"hawtio-core": "~2.0.0",
"hawtio-core-navigation": "~2.0.0",
"hawtio-utilities": "~2.0.0"
},
"devDependencies": {
"bootstrap": "~3.3.1",
"patternfly": "~1.1.2",
"hawtio-core-dts": "~2.0.0",
"angular-mocks": "~1.3.7"
}
}
4 changes: 4 additions & 0 deletions ui/console/alerts/d.ts/alerts/ts/alerts.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// <reference path="alertsPlugin.d.ts" />
declare module HawkularAlerts {
var AlertsController: ng.IModule;
}
6 changes: 6 additions & 0 deletions ui/console/alerts/d.ts/alerts/ts/alertsGlobals.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference path="../../includes.d.ts" />
declare module HawkularAlerts {
var pluginName: string;
var log: Logging.Logger;
var templatePath: string;
}
5 changes: 5 additions & 0 deletions ui/console/alerts/d.ts/alerts/ts/alertsPlugin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="alertsGlobals.d.ts" />
declare module HawkularAlerts {
var _module: ng.IModule;
}
1 change: 1 addition & 0 deletions ui/console/alerts/d.ts/includes.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference path="../libs/hawtio-utilities/defs.d.ts" />
4 changes: 4 additions & 0 deletions ui/console/alerts/defs.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// <reference path="d.ts/includes.d.ts"/>
/// <reference path="d.ts/alerts/ts/alertsGlobals.d.ts"/>
/// <reference path="d.ts/alerts/ts/alertsPlugin.d.ts"/>
/// <reference path="d.ts/alerts/ts/alerts.d.ts"/>
37 changes: 37 additions & 0 deletions ui/console/alerts/dist/hawkular-alerts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/// <reference path="../libs/hawtio-utilities/defs.d.ts"/>

/// <reference path="../../includes.ts"/>
var HawkularAlerts;
(function (HawkularAlerts) {
HawkularAlerts.pluginName = "hawtio-assembly";
HawkularAlerts.log = Logger.get(HawkularAlerts.pluginName);
HawkularAlerts.templatePath = "plugins/alerts/html";
})(HawkularAlerts || (HawkularAlerts = {}));

/// <reference path="../../includes.ts"/>
/// <reference path="alertsGlobals.ts"/>
var HawkularAlerts;
(function (HawkularAlerts) {
HawkularAlerts._module = angular.module(HawkularAlerts.pluginName, []);
var tab = undefined;
HawkularAlerts._module.config(['$locationProvider', '$routeProvider', 'HawtioNavBuilderProvider', function ($locationProvider, $routeProvider, builder) {
tab = builder.create().id(HawkularAlerts.pluginName).title(function () { return "Alerts"; }).href(function () { return "/alerts"; }).subPath("Alerts", "alerts", builder.join(HawkularAlerts.templatePath, 'alerts.html')).build();
builder.configureRouting($routeProvider, tab);
$locationProvider.html5Mode(true);
}]);
HawkularAlerts._module.run(['HawtioNav', function (HawtioNav) {
HawtioNav.add(tab);
//log.debug("loaded");
}]);
hawtioPluginLoader.addModule(HawkularAlerts.pluginName);
})(HawkularAlerts || (HawkularAlerts = {}));

/// <reference path="alertsPlugin.ts"/>
var HawkularAlerts;
(function (HawkularAlerts) {
HawkularAlerts.AlertsController = HawkularAlerts._module.controller("HawkularAlerts.AlertsController", ['$scope', function ($scope) {
$scope.target = "World!";
}]);
})(HawkularAlerts || (HawkularAlerts = {}));

angular.module("hawkular-alerts-templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("plugins/alerts/html/alerts.html","<div class=\"row\">\n <div class=\"col-md-12\" ng-controller=\"HawkularAlerts.AlertsController\">\n <h1>Alerts</h1>\n <p>Hello {{target}}</p>\n </div>\n</div>\n");}]); hawtioPluginLoader.addModule("hawkular-alerts-templates");
127 changes: 127 additions & 0 deletions ui/console/alerts/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
var gulp = require('gulp'),
wiredep = require('wiredep').stream,
eventStream = require('event-stream'),
gulpLoadPlugins = require('gulp-load-plugins'),
map = require('vinyl-map'),
fs = require('fs'),
path = require('path'),
s = require('underscore.string');

var plugins = gulpLoadPlugins({});
var pkg = require('./package.json');

var config = {
main: '.',
ts: ['plugins/**/*.ts'],
templates: ['plugins/**/*.html'],
templateModule: pkg.name + '-templates',
dist: './dist/',
js: pkg.name + '.js',
tsProject: plugins.typescript.createProject({
target: 'ES5',
module: 'commonjs',
declarationFiles: true,
noExternalResolve: false
})
};

gulp.task('bower', function() {
gulp.src('index.html')
.pipe(wiredep({}))
.pipe(gulp.dest('.'));
});

/** Adjust the reference path of any typescript-built plugin this project depends on */
gulp.task('path-adjust', function() {
gulp.src('libs/**/includes.d.ts')
.pipe(map(function(buf, filename) {
var textContent = buf.toString();
var newTextContent = textContent.replace(/"\.\.\/libs/gm, '"../../../libs');
// console.log("Filename: ", filename, " old: ", textContent, " new:", newTextContent);
return newTextContent;
}))
.pipe(gulp.dest('libs'));
});

gulp.task('clean-defs', function() {
return gulp.src('defs.d.ts', { read: false })
.pipe(plugins.clean());
});

gulp.task('tsc', ['clean-defs'], function() {
var cwd = process.cwd();
var tsResult = gulp.src(config.ts)
.pipe(plugins.typescript(config.tsProject))
.on('error', plugins.notify.onError({
message: '#{ error.message }',
title: 'Typescript compilation error'
}));

return eventStream.merge(
tsResult.js
.pipe(plugins.concat('compiled.js'))
.pipe(gulp.dest('.')),
tsResult.dts
.pipe(gulp.dest('d.ts')))
.pipe(map(function(buf, filename) {
if (!s.endsWith(filename, 'd.ts')) {
return buf;
}
var relative = path.relative(cwd, filename);
fs.appendFileSync('defs.d.ts', '/// <reference path="' + relative + '"/>\n');
return buf;
}));
});

gulp.task('template', ['tsc'], function() {
return gulp.src(config.templates)
.pipe(plugins.angularTemplatecache({
filename: 'templates.js',
root: 'plugins/',
standalone: true,
module: config.templateModule,
templateFooter: '}]); hawtioPluginLoader.addModule("' + config.templateModule + '");'
}))
.pipe(gulp.dest('.'));
});

gulp.task('concat', ['template'], function() {
return gulp.src(['compiled.js', 'templates.js'])
.pipe(plugins.concat(config.js))
.pipe(gulp.dest(config.dist));
});

gulp.task('clean', ['concat'], function() {
return gulp.src(['templates.js', 'compiled.js'], { read: false })
.pipe(plugins.clean());
});

gulp.task('watch', ['build'], function() {
plugins.watch(['libs/**/*.js', 'libs/**/*.css', 'index.html', config.dist + '/' + config.js], function() {
gulp.start('reload');
});
plugins.watch(['libs/**/*.d.ts', config.ts, config.templates], function() {
gulp.start(['tsc', 'template', 'concat', 'clean']);
});
});

gulp.task('connect', ['watch'], function() {
plugins.connect.server({
root: '.',
livereload: true,
port: 2772,
fallback: 'index.html'
});
});

gulp.task('reload', function() {
gulp.src('.')
.pipe(plugins.connect.reload());
});

gulp.task('build', ['bower', 'path-adjust', 'tsc', 'template', 'concat', 'clean']);

gulp.task('default', ['connect']);



65 changes: 65 additions & 0 deletions ui/console/alerts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>

<head>
<title>hawkular-alerts</title>
<base href='/'></base>
<meta charset="UTF8">


<link rel="stylesheet" href="libs/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="libs/patternfly/dist/css/patternfly.css" />

<!-- bower:css -->
<!-- endbower -->

<!-- ES6/ES6 shim -->
<!--[if IE 8]>
<script src="libs/es5-dom-shim/__COMIPLE/a.ie8.js"></script>
<![endif]-->
<script src="libs/es5-dom-shim/__COMPILE/a.js"></script>

<!-- bower:js -->
<script src="libs/jquery/dist/jquery.js"></script>
<script src="libs/angular/angular.js"></script>
<script src="libs/angular-sanitize/angular-sanitize.js"></script>
<script src="libs/js-logger/src/logger.js"></script>
<script src="libs/hawtio-core/hawtio-core.js"></script>
<script src="libs/lodash/dist/lodash.compat.js"></script>
<script src="libs/angular-route/angular-route.js"></script>
<script src="libs/hawtio-core-navigation/dist/hawtio-core-navigation.js"></script>
<script src="libs/uri.js/src/URI.js"></script>
<script src="libs/uri.js/src/IPv6.js"></script>
<script src="libs/uri.js/src/SecondLevelDomains.js"></script>
<script src="libs/uri.js/src/punycode.js"></script>
<script src="libs/uri.js/src/URITemplate.js"></script>
<script src="libs/uri.js/src/jquery.URI.js"></script>
<script src="libs/uri.js/src/URI.min.js"></script>
<script src="libs/uri.js/src/jquery.URI.min.js"></script>
<script src="libs/uri.js/src/URI.fragmentQuery.js"></script>
<script src="libs/uri.js/src/URI.fragmentURI.js"></script>
<script src="libs/hawtio-utilities/dist/sugar.js"></script>
<script src="libs/hawtio-utilities/dist/angular-file-upload.js"></script>
<script src="libs/hawtio-utilities/dist/hawtio-utilities.js"></script>
<!-- endbower -->

<script src="libs/bootstrap/dist/js/bootstrap.js"></script>
<script src="libs/patternfly/dist/js/patternfly.js"></script>

</head>

<body>
<nav class="navbar navbar-default navbar-pf" role="navigation">
<ul class="nav navbar-nav navbar-primary" hawtio-main-nav></ul>
<ul class="nav navbar-nav" hawtio-sub-tabs></ul>
</nav>

<div id="main" class="container-fluid ng-cloak" ng-controller="HawtioNav.ViewController">
<div ng-include src="viewPartial"></div>
</div>

<!-- add any scripts under dist/ here -->
<script src="dist/hawkular-alerts.js"></script>

</body>
</html>
22 changes: 22 additions & 0 deletions ui/console/alerts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "hawkular-alerts",
"version": "0.1.0",
"devDependencies": {
"bower": "^1.3.12",
"event-stream": "^3.1.7",
"gulp": "^3.8.10",
"gulp-angular-templatecache": "^1.5.0",
"gulp-clean": "^0.3.1",
"gulp-concat": "^2.4.2",
"gulp-connect": "^2.2.0",
"gulp-load-plugins": "^0.8.0",
"gulp-notify": "^2.1.0",
"gulp-typescript": "^2.3.0",
"gulp-watch": "^3.0.0",
"through2": "^0.6.3",
"underscore.string": "^2.4.0",
"vinyl-map": "^1.0.1",
"which": "^1.0.8",
"wiredep": "^2.2.2"
}
}
6 changes: 6 additions & 0 deletions ui/console/alerts/plugins/alerts/html/alerts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="row">
<div class="col-md-12" ng-controller="HawkularAlerts.AlertsController">
<h1>Alerts</h1>
<p>Hello {{target}}</p>
</div>
</div>
8 changes: 8 additions & 0 deletions ui/console/alerts/plugins/alerts/ts/alerts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference path="alertsPlugin.ts"/>
module HawkularAlerts {

export var AlertsController = _module.controller("HawkularAlerts.AlertsController", ['$scope', ($scope) => {
$scope.target = "World!";
}]);

}
10 changes: 10 additions & 0 deletions ui/console/alerts/plugins/alerts/ts/alertsGlobals.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// <reference path="../../includes.ts"/>
module HawkularAlerts {

export var pluginName = "hawtio-assembly";

export var log:Logging.Logger = Logger.get(pluginName);

export var templatePath = "plugins/alerts/html";

}
27 changes: 27 additions & 0 deletions ui/console/alerts/plugins/alerts/ts/alertsPlugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/// <reference path="../../includes.ts"/>
/// <reference path="alertsGlobals.ts"/>
module HawkularAlerts {

export var _module = angular.module(HawkularAlerts.pluginName, []);

var tab:any = undefined;

_module.config(['$locationProvider', '$routeProvider', 'HawtioNavBuilderProvider', ($locationProvider, $routeProvider:ng.route.IRouteProvider, builder:HawtioMainNav.BuilderFactory) => {
tab = builder.create()
.id(HawkularAlerts.pluginName)
.title(() => "Alerts")
.href(() => "/alerts")
.subPath("Alerts", "alerts", builder.join(HawkularAlerts.templatePath, 'alerts.html'))
.build();
builder.configureRouting($routeProvider, tab);
$locationProvider.html5Mode(true);
}]);

_module.run(['HawtioNav', (HawtioNav:HawtioMainNav.Registry) => {
HawtioNav.add(tab);
//log.debug("loaded");
}]);


hawtioPluginLoader.addModule(HawkularAlerts.pluginName);
}
1 change: 1 addition & 0 deletions ui/console/alerts/plugins/includes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference path="../libs/hawtio-utilities/defs.d.ts"/>
3 changes: 3 additions & 0 deletions ui/console/metrics/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory" : "libs"
}
3 changes: 3 additions & 0 deletions ui/console/metrics/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
libs/

0 comments on commit 7458f6b

Please sign in to comment.