forked from sensu/uchiwa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ngRoute, add JSHint/Gruntfile, add Morris directive
- Loading branch information
Showing
18 changed files
with
260 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"node": true, | ||
"browser": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 2, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"globals": { | ||
"angular": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
|
||
module.exports = function (grunt) { | ||
require('load-grunt-tasks')(grunt); | ||
require('time-grunt')(grunt); | ||
|
||
grunt.initConfig({ | ||
settings: { | ||
entryPoint: 'app.js', | ||
lib: 'lib', | ||
public: 'public' | ||
}, | ||
jshint: { | ||
options: { | ||
jshintrc: '.jshintrc', | ||
reporter: require('jshint-stylish') | ||
}, | ||
all: [ | ||
'Gruntfile.js', | ||
'<%= settings.entryPoint %>', | ||
'<%= settings.lib %>/{,*/}*.js', | ||
'<%= settings.app %>/js/{,*/}*.js', | ||
] | ||
} | ||
}); | ||
|
||
grunt.registerTask('default', [ | ||
'newer:jshint' | ||
]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" ng-app="uchiwa"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
|
||
<title>uchiwa</title> | ||
|
||
<!-- Customized Bootstrap --> | ||
<link href="css/bootstrap-uchiwa/bootstrap-uchiwa.css" rel="stylesheet"> | ||
|
||
<!-- 3rd Party CSS --> | ||
<link href="bower_components/fontawesome/css/font-awesome.min.css" rel="stylesheet"> | ||
<link href="bower_components/toastr/toastr.css" rel="stylesheet"> | ||
<link href="//fonts.googleapis.com/css?family=Lato:300,400,700" rel="stylesheet" type="text/css"> | ||
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,300,700" rel="stylesheet" type="text/css"> | ||
<link href="bower_components/morris.js/morris.css" rel="stylesheet"> | ||
|
||
<!-- Uchiwa CSS --> | ||
<link href="css/uchiwa-default/uchiwa-default.css" rel="stylesheet"> | ||
</head> | ||
|
||
<body ng-cloak> | ||
|
||
<div ng-controller="init"> | ||
<div ng-include="'partials/nav.html'"></div> | ||
<div ng-view></div> | ||
<div ng-include="'partials/client/show.html'"></div> | ||
</div> | ||
|
||
<!-- 3rd Party JS --> | ||
<script src="bower_components/jquery/dist/jquery.min.js"></script> | ||
<script src="bower_components/angular/angular.min.js"></script> | ||
<script src="bower_components/angular-route/angular-route.min.js"></script> | ||
<script src="/socket.io/socket.io.js"></script> | ||
<script src="bower_components/async/lib/async.js"></script> | ||
<script src="bower_components/underscore/underscore.js"></script> | ||
<script src="bower_components/toastr/toastr.min.js"></script> | ||
<script src="bower_components/raphael/raphael-min.js"></script> | ||
<script src="bower_components/morris.js/morris.min.js"></script> | ||
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> | ||
<script src="bower_components/angular-socket-io/socket.min.js"></script> | ||
|
||
<!-- Uchiwa JS --> | ||
<script src="js/uchiwa.js"></script> | ||
<script src="js/app.js"></script> | ||
<script src="js/services.js"></script> | ||
<script src="js/directives.js"></script> | ||
<script src="js/controllers.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
angular.module('uchiwa', [ | ||
'uchiwa.controllers', | ||
'uchiwa.services', | ||
'uchiwa.directives', | ||
// Angular dependencies | ||
'ngRoute', | ||
// 3rd party dependencies | ||
'btford.socket-io' | ||
]); | ||
|
||
angular.module('uchiwa').config(['$routeProvider', | ||
function ($routeProvider) { | ||
$routeProvider | ||
.when('/', {templateUrl: 'partials/dashboard/index.html', controller: 'dashboard'}) | ||
.when('/clients', {templateUrl: 'partials/client/index.html', controller: 'clients'}) | ||
.when('/checks', {templateUrl: 'partials/check/index.html', controller: 'checks'}) | ||
.when('/stashes', {templateUrl: 'partials/stash/index.html', controller: 'stashes'}) | ||
.otherwise('/'); | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var directiveModule = angular.module('uchiwa.directives', []); | ||
|
||
directiveModule.directive('morrisLine', function () { | ||
return { | ||
restrict: 'EA', | ||
replace: true, | ||
template: '<div class="graph"></div>', | ||
scope: { | ||
morrisLine: '=' | ||
}, | ||
link: function (scope, element) { | ||
scope.morrisLine.element = element; | ||
var chart = new Morris.Line(scope.morrisLine); | ||
scope.$watch('morrisLine.data', function (newValue) { | ||
chart.setData(newValue); | ||
}); | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.