mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-25 02:02:32 +03:00
[Web UI] dependency manager and build system
This commit is contained in:
parent
215d19e8f9
commit
483fa29cfa
4
.gitignore
vendored
4
.gitignore
vendored
@ -43,3 +43,7 @@ _build
|
||||
|
||||
# Tox
|
||||
.tox/
|
||||
|
||||
# web ui
|
||||
node_modules/
|
||||
bower_components/
|
||||
|
@ -57,7 +57,7 @@ class GlancesBottle(object):
|
||||
self._route()
|
||||
|
||||
# Path where the statics files are stored
|
||||
self.STATIC_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'static')
|
||||
self.STATIC_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'static/public')
|
||||
|
||||
def app(self):
|
||||
return self._app()
|
||||
@ -76,13 +76,7 @@ class GlancesBottle(object):
|
||||
self._app.route('/', method="GET", callback=self._index)
|
||||
self._app.route('/<refresh_time:int>', method=["GET"], callback=self._index)
|
||||
|
||||
self._app.route('/<filename:re:.*\.css>', method="GET", callback=self._css)
|
||||
self._app.route('/<filename:re:.*\.js>', method="GET", callback=self._js)
|
||||
self._app.route('/<filename:re:.*\.js.map>', method="GET", callback=self._js_map)
|
||||
self._app.route('/<filename:re:.*\.html>', method="GET", callback=self._html)
|
||||
|
||||
self._app.route('/<filename:re:.*\.png>', method="GET", callback=self._images)
|
||||
self._app.route('/favicon.ico', method="GET", callback=self._favicon)
|
||||
self._app.route('/<filepath:path>', method="GET", callback=self._resource)
|
||||
|
||||
# REST API
|
||||
self._app.route('/api/2/args', method="GET", callback=self._api_args)
|
||||
@ -126,37 +120,12 @@ class GlancesBottle(object):
|
||||
self.stats.update()
|
||||
|
||||
# Display
|
||||
return static_file("index.html", root=os.path.join(self.STATIC_PATH, 'html'))
|
||||
return static_file("index.html", root=self.STATIC_PATH)
|
||||
|
||||
def _html(self, filename):
|
||||
"""Bottle callback for *.html files."""
|
||||
def _resource(self, filepath):
|
||||
"""Bottle callback for resources files."""
|
||||
# Return the static file
|
||||
return static_file(filename, root=os.path.join(self.STATIC_PATH, 'html'))
|
||||
|
||||
def _css(self, filename):
|
||||
"""Bottle callback for *.css files."""
|
||||
# Return the static file
|
||||
return static_file(filename, root=os.path.join(self.STATIC_PATH, 'css'))
|
||||
|
||||
def _js(self, filename):
|
||||
"""Bottle callback for *.js files."""
|
||||
# Return the static file
|
||||
return static_file(filename, root=os.path.join(self.STATIC_PATH, 'js'))
|
||||
|
||||
def _js_map(self, filename):
|
||||
"""Bottle callback for *.js.map files."""
|
||||
# Return the static file
|
||||
return static_file(filename, root=os.path.join(self.STATIC_PATH, 'js'))
|
||||
|
||||
def _images(self, filename):
|
||||
"""Bottle callback for *.png files."""
|
||||
# Return the static file
|
||||
return static_file(filename, root=os.path.join(self.STATIC_PATH, 'images'))
|
||||
|
||||
def _favicon(self):
|
||||
"""Bottle callback for favicon."""
|
||||
# Return the static file
|
||||
return static_file('favicon.ico', root=self.STATIC_PATH)
|
||||
return static_file(filepath, root=self.STATIC_PATH)
|
||||
|
||||
def _api_help(self):
|
||||
"""Glances API RESTFul implementation.
|
||||
|
37
glances/outputs/static/README.md
Normal file
37
glances/outputs/static/README.md
Normal file
@ -0,0 +1,37 @@
|
||||
# How to contribute?
|
||||
|
||||
In order to build the assets of the Web UI, you'll need [npm](https://docs.npmjs.com/getting-started/what-is-npm).
|
||||
|
||||
## Install dependencies
|
||||
|
||||
```bash
|
||||
$ npm install
|
||||
```
|
||||
|
||||
## Build assets
|
||||
|
||||
```bash
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
## Watch assets
|
||||
|
||||
```bash
|
||||
$ npm run watch
|
||||
```
|
||||
|
||||
# Anatomy
|
||||
|
||||
```bash
|
||||
static
|
||||
|
|
||||
|--- css
|
||||
|
|
||||
|--- html
|
||||
|
|
||||
|--- images
|
||||
|
|
||||
|--- js
|
||||
|
|
||||
|--- public # path where builds are put
|
||||
```
|
9
glances/outputs/static/bower.json
Normal file
9
glances/outputs/static/bower.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "Glances",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"angular": "^1.5.8",
|
||||
"angular-route": "^1.5.8",
|
||||
"lodash": "^4.13.1"
|
||||
}
|
||||
}
|
@ -144,7 +144,7 @@ body {
|
||||
/* Loading page */
|
||||
|
||||
#loading-page .glances-logo {
|
||||
background: url('glances.png') no-repeat center center;
|
||||
background: url('../images/glances.png') no-repeat center center;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
|
56
glances/outputs/static/gulpfile.js
Normal file
56
glances/outputs/static/gulpfile.js
Normal file
@ -0,0 +1,56 @@
|
||||
var gulp = require('gulp');
|
||||
var uglify = require('gulp-uglify');
|
||||
var concat = require('gulp-concat');
|
||||
var mainBowerFiles = require('main-bower-files');
|
||||
var ngAnnotate = require('gulp-ng-annotate');
|
||||
var templateCache = require('gulp-angular-templatecache');
|
||||
var del = require('del');
|
||||
|
||||
gulp.task('clean', function() {
|
||||
del('./public/*')
|
||||
});
|
||||
|
||||
gulp.task('copy', function() {
|
||||
gulp.src('./html/*.html')
|
||||
.pipe(gulp.dest('./public'));
|
||||
|
||||
gulp.src('./css/*.css')
|
||||
.pipe(gulp.dest('./public/css'));
|
||||
|
||||
gulp.src('./images/*.png')
|
||||
.pipe(gulp.dest('./public/images'));
|
||||
|
||||
gulp.src('favicon.ico')
|
||||
.pipe(gulp.dest('./public'));
|
||||
});
|
||||
|
||||
gulp.task('bower', function() {
|
||||
return gulp.src(mainBowerFiles())
|
||||
.pipe(concat('vendor.js'))
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest('./public/js'))
|
||||
});
|
||||
|
||||
gulp.task('build-js', function() {
|
||||
return gulp.src('./js/**/*.js')
|
||||
.pipe(ngAnnotate())
|
||||
.pipe(concat('main.js'))
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest('./public/js'))
|
||||
});
|
||||
|
||||
gulp.task('template', function () {
|
||||
return gulp.src('./html/plugins/*.html')
|
||||
.pipe(templateCache('templates.js', {'root': 'plugins/', 'module': 'glancesApp'}))
|
||||
.pipe(gulp.dest('./public/js'));
|
||||
});
|
||||
|
||||
gulp.task('watch', function () {
|
||||
gulp.watch(['./html/*.html','./css/*.css', './images/*.png'], ['copy']);
|
||||
gulp.watch('bower.json', ['bower']);
|
||||
gulp.watch('./js/**/*.js', ['build-js']);
|
||||
gulp.watch('./html/plugins/*.html', ['template']);
|
||||
});
|
||||
|
||||
gulp.task('build', ['clean', 'bower', 'build-js', 'template', 'copy']);
|
||||
gulp.task('default', ['build']);
|
@ -8,42 +8,13 @@
|
||||
<base href="/">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="normalize.css" />
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css" />
|
||||
|
||||
<script type="text/javascript" src="vendors/angular.js"></script>
|
||||
<script type="text/javascript" src="vendors/angular-route.js"></script>
|
||||
<script type="text/javascript" src="vendors/lodash.js"></script>
|
||||
<script type="text/javascript" src="app.js"></script>
|
||||
<script type="text/javascript" src="filters.js"></script>
|
||||
<script type="text/javascript" src="variables.js"></script>
|
||||
<script type="text/javascript" src="directives.js"></script>
|
||||
<script type="text/javascript" src="services/core/glances_stats.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_plugin.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_alert.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_cpu.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_diskio.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_docker.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_fs.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_folders.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_ip.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_load.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_mem.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_memswap.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_amps.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_network.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_percpu.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_processcount.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_processlist.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_quicklook.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_raid.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_sensors.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_system.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_uptime.js"></script>
|
||||
<script type="text/javascript" src="services/plugins/glances_ports.js"></script>
|
||||
|
||||
<script type="text/javascript" src="stats_controller.js"></script>
|
||||
<script type="text/javascript" src="js/vendor.js"></script>
|
||||
<script type="text/javascript" src="js/main.js"></script>
|
||||
<script type="text/javascript" src="js/templates.js"></script>
|
||||
</head>
|
||||
|
||||
<body ng-view="" ng-keydown="onKeyDown($event)">
|
||||
|
@ -81,7 +81,7 @@ glancesApp.filter('leftPad', function($filter) {
|
||||
return function (value, length, chars) {
|
||||
length = length || 0;
|
||||
chars = chars || ' ';
|
||||
return _.padLeft(value, length, chars);
|
||||
return _.padStart(value, length, chars);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -22,7 +22,7 @@ glancesApp.service('GlancesPluginQuicklook', function() {
|
||||
this.swap = data.swap;
|
||||
this.percpus = [];
|
||||
|
||||
_.forEach(data.percpu, function(cpu, key) {
|
||||
angular.forEach(data.percpu, function(cpu) {
|
||||
this.percpus.push({
|
||||
'number': cpu.cpu_number,
|
||||
'total': cpu.total
|
||||
|
991
glances/outputs/static/js/vendors/angular-route.js
vendored
991
glances/outputs/static/js/vendors/angular-route.js
vendored
@ -1,991 +0,0 @@
|
||||
/**
|
||||
* @license AngularJS v1.4.9
|
||||
* (c) 2010-2015 Google, Inc. http://angularjs.org
|
||||
* License: MIT
|
||||
*/
|
||||
(function(window, angular, undefined) {'use strict';
|
||||
|
||||
/**
|
||||
* @ngdoc module
|
||||
* @name ngRoute
|
||||
* @description
|
||||
*
|
||||
* # ngRoute
|
||||
*
|
||||
* The `ngRoute` module provides routing and deeplinking services and directives for angular apps.
|
||||
*
|
||||
* ## Example
|
||||
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
|
||||
*
|
||||
*
|
||||
* <div doc-module-components="ngRoute"></div>
|
||||
*/
|
||||
/* global -ngRouteModule */
|
||||
var ngRouteModule = angular.module('ngRoute', ['ng']).
|
||||
provider('$route', $RouteProvider),
|
||||
$routeMinErr = angular.$$minErr('ngRoute');
|
||||
|
||||
/**
|
||||
* @ngdoc provider
|
||||
* @name $routeProvider
|
||||
*
|
||||
* @description
|
||||
*
|
||||
* Used for configuring routes.
|
||||
*
|
||||
* ## Example
|
||||
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
|
||||
*
|
||||
* ## Dependencies
|
||||
* Requires the {@link ngRoute `ngRoute`} module to be installed.
|
||||
*/
|
||||
function $RouteProvider() {
|
||||
function inherit(parent, extra) {
|
||||
return angular.extend(Object.create(parent), extra);
|
||||
}
|
||||
|
||||
var routes = {};
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name $routeProvider#when
|
||||
*
|
||||
* @param {string} path Route path (matched against `$location.path`). If `$location.path`
|
||||
* contains redundant trailing slash or is missing one, the route will still match and the
|
||||
* `$location.path` will be updated to add or drop the trailing slash to exactly match the
|
||||
* route definition.
|
||||
*
|
||||
* * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up
|
||||
* to the next slash are matched and stored in `$routeParams` under the given `name`
|
||||
* when the route matches.
|
||||
* * `path` can contain named groups starting with a colon and ending with a star:
|
||||
* e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name`
|
||||
* when the route matches.
|
||||
* * `path` can contain optional named groups with a question mark: e.g.`:name?`.
|
||||
*
|
||||
* For example, routes like `/color/:color/largecode/:largecode*\/edit` will match
|
||||
* `/color/brown/largecode/code/with/slashes/edit` and extract:
|
||||
*
|
||||
* * `color: brown`
|
||||
* * `largecode: code/with/slashes`.
|
||||
*
|
||||
*
|
||||
* @param {Object} route Mapping information to be assigned to `$route.current` on route
|
||||
* match.
|
||||
*
|
||||
* Object properties:
|
||||
*
|
||||
* - `controller` – `{(string|function()=}` – Controller fn that should be associated with
|
||||
* newly created scope or the name of a {@link angular.Module#controller registered
|
||||
* controller} if passed as a string.
|
||||
* - `controllerAs` – `{string=}` – An identifier name for a reference to the controller.
|
||||
* If present, the controller will be published to scope under the `controllerAs` name.
|
||||
* - `template` – `{string=|function()=}` – html template as a string or a function that
|
||||
* returns an html template as a string which should be used by {@link
|
||||
* ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.
|
||||
* This property takes precedence over `templateUrl`.
|
||||
*
|
||||
* If `template` is a function, it will be called with the following parameters:
|
||||
*
|
||||
* - `{Array.<Object>}` - route parameters extracted from the current
|
||||
* `$location.path()` by applying the current route
|
||||
*
|
||||
* - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html
|
||||
* template that should be used by {@link ngRoute.directive:ngView ngView}.
|
||||
*
|
||||
* If `templateUrl` is a function, it will be called with the following parameters:
|
||||
*
|
||||
* - `{Array.<Object>}` - route parameters extracted from the current
|
||||
* `$location.path()` by applying the current route
|
||||
*
|
||||
* - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should
|
||||
* be injected into the controller. If any of these dependencies are promises, the router
|
||||
* will wait for them all to be resolved or one to be rejected before the controller is
|
||||
* instantiated.
|
||||
* If all the promises are resolved successfully, the values of the resolved promises are
|
||||
* injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is
|
||||
* fired. If any of the promises are rejected the
|
||||
* {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. The map object
|
||||
* is:
|
||||
*
|
||||
* - `key` – `{string}`: a name of a dependency to be injected into the controller.
|
||||
* - `factory` - `{string|function}`: If `string` then it is an alias for a service.
|
||||
* Otherwise if function, then it is {@link auto.$injector#invoke injected}
|
||||
* and the return value is treated as the dependency. If the result is a promise, it is
|
||||
* resolved before its value is injected into the controller. Be aware that
|
||||
* `ngRoute.$routeParams` will still refer to the previous route within these resolve
|
||||
* functions. Use `$route.current.params` to access the new route parameters, instead.
|
||||
*
|
||||
* - `redirectTo` – {(string|function())=} – value to update
|
||||
* {@link ng.$location $location} path with and trigger route redirection.
|
||||
*
|
||||
* If `redirectTo` is a function, it will be called with the following parameters:
|
||||
*
|
||||
* - `{Object.<string>}` - route parameters extracted from the current
|
||||
* `$location.path()` by applying the current route templateUrl.
|
||||
* - `{string}` - current `$location.path()`
|
||||
* - `{Object}` - current `$location.search()`
|
||||
*
|
||||
* The custom `redirectTo` function is expected to return a string which will be used
|
||||
* to update `$location.path()` and `$location.search()`.
|
||||
*
|
||||
* - `[reloadOnSearch=true]` - {boolean=} - reload route when only `$location.search()`
|
||||
* or `$location.hash()` changes.
|
||||
*
|
||||
* If the option is set to `false` and url in the browser changes, then
|
||||
* `$routeUpdate` event is broadcasted on the root scope.
|
||||
*
|
||||
* - `[caseInsensitiveMatch=false]` - {boolean=} - match routes without being case sensitive
|
||||
*
|
||||
* If the option is set to `true`, then the particular route can be matched without being
|
||||
* case sensitive
|
||||
*
|
||||
* @returns {Object} self
|
||||
*
|
||||
* @description
|
||||
* Adds a new route definition to the `$route` service.
|
||||
*/
|
||||
this.when = function(path, route) {
|
||||
//copy original route object to preserve params inherited from proto chain
|
||||
var routeCopy = angular.copy(route);
|
||||
if (angular.isUndefined(routeCopy.reloadOnSearch)) {
|
||||
routeCopy.reloadOnSearch = true;
|
||||
}
|
||||
if (angular.isUndefined(routeCopy.caseInsensitiveMatch)) {
|
||||
routeCopy.caseInsensitiveMatch = this.caseInsensitiveMatch;
|
||||
}
|
||||
routes[path] = angular.extend(
|
||||
routeCopy,
|
||||
path && pathRegExp(path, routeCopy)
|
||||
);
|
||||
|
||||
// create redirection for trailing slashes
|
||||
if (path) {
|
||||
var redirectPath = (path[path.length - 1] == '/')
|
||||
? path.substr(0, path.length - 1)
|
||||
: path + '/';
|
||||
|
||||
routes[redirectPath] = angular.extend(
|
||||
{redirectTo: path},
|
||||
pathRegExp(redirectPath, routeCopy)
|
||||
);
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name $routeProvider#caseInsensitiveMatch
|
||||
* @description
|
||||
*
|
||||
* A boolean property indicating if routes defined
|
||||
* using this provider should be matched using a case insensitive
|
||||
* algorithm. Defaults to `false`.
|
||||
*/
|
||||
this.caseInsensitiveMatch = false;
|
||||
|
||||
/**
|
||||
* @param path {string} path
|
||||
* @param opts {Object} options
|
||||
* @return {?Object}
|
||||
*
|
||||
* @description
|
||||
* Normalizes the given path, returning a regular expression
|
||||
* and the original path.
|
||||
*
|
||||
* Inspired by pathRexp in visionmedia/express/lib/utils.js.
|
||||
*/
|
||||
function pathRegExp(path, opts) {
|
||||
var insensitive = opts.caseInsensitiveMatch,
|
||||
ret = {
|
||||
originalPath: path,
|
||||
regexp: path
|
||||
},
|
||||
keys = ret.keys = [];
|
||||
|
||||
path = path
|
||||
.replace(/([().])/g, '\\$1')
|
||||
.replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option) {
|
||||
var optional = option === '?' ? option : null;
|
||||
var star = option === '*' ? option : null;
|
||||
keys.push({ name: key, optional: !!optional });
|
||||
slash = slash || '';
|
||||
return ''
|
||||
+ (optional ? '' : slash)
|
||||
+ '(?:'
|
||||
+ (optional ? slash : '')
|
||||
+ (star && '(.+?)' || '([^/]+)')
|
||||
+ (optional || '')
|
||||
+ ')'
|
||||
+ (optional || '');
|
||||
})
|
||||
.replace(/([\/$\*])/g, '\\$1');
|
||||
|
||||
ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name $routeProvider#otherwise
|
||||
*
|
||||
* @description
|
||||
* Sets route definition that will be used on route change when no other route definition
|
||||
* is matched.
|
||||
*
|
||||
* @param {Object|string} params Mapping information to be assigned to `$route.current`.
|
||||
* If called with a string, the value maps to `redirectTo`.
|
||||
* @returns {Object} self
|
||||
*/
|
||||
this.otherwise = function(params) {
|
||||
if (typeof params === 'string') {
|
||||
params = {redirectTo: params};
|
||||
}
|
||||
this.when(null, params);
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
this.$get = ['$rootScope',
|
||||
'$location',
|
||||
'$routeParams',
|
||||
'$q',
|
||||
'$injector',
|
||||
'$templateRequest',
|
||||
'$sce',
|
||||
function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce) {
|
||||
|
||||
/**
|
||||
* @ngdoc service
|
||||
* @name $route
|
||||
* @requires $location
|
||||
* @requires $routeParams
|
||||
*
|
||||
* @property {Object} current Reference to the current route definition.
|
||||
* The route definition contains:
|
||||
*
|
||||
* - `controller`: The controller constructor as define in route definition.
|
||||
* - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for
|
||||
* controller instantiation. The `locals` contain
|
||||
* the resolved values of the `resolve` map. Additionally the `locals` also contain:
|
||||
*
|
||||
* - `$scope` - The current route scope.
|
||||
* - `$template` - The current route template HTML.
|
||||
*
|
||||
* @property {Object} routes Object with all route configuration Objects as its properties.
|
||||
*
|
||||
* @description
|
||||
* `$route` is used for deep-linking URLs to controllers and views (HTML partials).
|
||||
* It watches `$location.url()` and tries to map the path to an existing route definition.
|
||||
*
|
||||
* Requires the {@link ngRoute `ngRoute`} module to be installed.
|
||||
*
|
||||
* You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.
|
||||
*
|
||||
* The `$route` service is typically used in conjunction with the
|
||||
* {@link ngRoute.directive:ngView `ngView`} directive and the
|
||||
* {@link ngRoute.$routeParams `$routeParams`} service.
|
||||
*
|
||||
* @example
|
||||
* This example shows how changing the URL hash causes the `$route` to match a route against the
|
||||
* URL, and the `ngView` pulls in the partial.
|
||||
*
|
||||
* <example name="$route-service" module="ngRouteExample"
|
||||
* deps="angular-route.js" fixBase="true">
|
||||
* <file name="index.html">
|
||||
* <div ng-controller="MainController">
|
||||
* Choose:
|
||||
* <a href="Book/Moby">Moby</a> |
|
||||
* <a href="Book/Moby/ch/1">Moby: Ch1</a> |
|
||||
* <a href="Book/Gatsby">Gatsby</a> |
|
||||
* <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
|
||||
* <a href="Book/Scarlet">Scarlet Letter</a><br/>
|
||||
*
|
||||
* <div ng-view></div>
|
||||
*
|
||||
* <hr />
|
||||
*
|
||||
* <pre>$location.path() = {{$location.path()}}</pre>
|
||||
* <pre>$route.current.templateUrl = {{$route.current.templateUrl}}</pre>
|
||||
* <pre>$route.current.params = {{$route.current.params}}</pre>
|
||||
* <pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
|
||||
* <pre>$routeParams = {{$routeParams}}</pre>
|
||||
* </div>
|
||||
* </file>
|
||||
*
|
||||
* <file name="book.html">
|
||||
* controller: {{name}}<br />
|
||||
* Book Id: {{params.bookId}}<br />
|
||||
* </file>
|
||||
*
|
||||
* <file name="chapter.html">
|
||||
* controller: {{name}}<br />
|
||||
* Book Id: {{params.bookId}}<br />
|
||||
* Chapter Id: {{params.chapterId}}
|
||||
* </file>
|
||||
*
|
||||
* <file name="script.js">
|
||||
* angular.module('ngRouteExample', ['ngRoute'])
|
||||
*
|
||||
* .controller('MainController', function($scope, $route, $routeParams, $location) {
|
||||
* $scope.$route = $route;
|
||||
* $scope.$location = $location;
|
||||
* $scope.$routeParams = $routeParams;
|
||||
* })
|
||||
*
|
||||
* .controller('BookController', function($scope, $routeParams) {
|
||||
* $scope.name = "BookController";
|
||||
* $scope.params = $routeParams;
|
||||
* })
|
||||
*
|
||||
* .controller('ChapterController', function($scope, $routeParams) {
|
||||
* $scope.name = "ChapterController";
|
||||
* $scope.params = $routeParams;
|
||||
* })
|
||||
*
|
||||
* .config(function($routeProvider, $locationProvider) {
|
||||
* $routeProvider
|
||||
* .when('/Book/:bookId', {
|
||||
* templateUrl: 'book.html',
|
||||
* controller: 'BookController',
|
||||
* resolve: {
|
||||
* // I will cause a 1 second delay
|
||||
* delay: function($q, $timeout) {
|
||||
* var delay = $q.defer();
|
||||
* $timeout(delay.resolve, 1000);
|
||||
* return delay.promise;
|
||||
* }
|
||||
* }
|
||||
* })
|
||||
* .when('/Book/:bookId/ch/:chapterId', {
|
||||
* templateUrl: 'chapter.html',
|
||||
* controller: 'ChapterController'
|
||||
* });
|
||||
*
|
||||
* // configure html5 to get links working on jsfiddle
|
||||
* $locationProvider.html5Mode(true);
|
||||
* });
|
||||
*
|
||||
* </file>
|
||||
*
|
||||
* <file name="protractor.js" type="protractor">
|
||||
* it('should load and compile correct template', function() {
|
||||
* element(by.linkText('Moby: Ch1')).click();
|
||||
* var content = element(by.css('[ng-view]')).getText();
|
||||
* expect(content).toMatch(/controller\: ChapterController/);
|
||||
* expect(content).toMatch(/Book Id\: Moby/);
|
||||
* expect(content).toMatch(/Chapter Id\: 1/);
|
||||
*
|
||||
* element(by.partialLinkText('Scarlet')).click();
|
||||
*
|
||||
* content = element(by.css('[ng-view]')).getText();
|
||||
* expect(content).toMatch(/controller\: BookController/);
|
||||
* expect(content).toMatch(/Book Id\: Scarlet/);
|
||||
* });
|
||||
* </file>
|
||||
* </example>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ngdoc event
|
||||
* @name $route#$routeChangeStart
|
||||
* @eventType broadcast on root scope
|
||||
* @description
|
||||
* Broadcasted before a route change. At this point the route services starts
|
||||
* resolving all of the dependencies needed for the route change to occur.
|
||||
* Typically this involves fetching the view template as well as any dependencies
|
||||
* defined in `resolve` route property. Once all of the dependencies are resolved
|
||||
* `$routeChangeSuccess` is fired.
|
||||
*
|
||||
* The route change (and the `$location` change that triggered it) can be prevented
|
||||
* by calling `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on}
|
||||
* for more details about event object.
|
||||
*
|
||||
* @param {Object} angularEvent Synthetic event object.
|
||||
* @param {Route} next Future route information.
|
||||
* @param {Route} current Current route information.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ngdoc event
|
||||
* @name $route#$routeChangeSuccess
|
||||
* @eventType broadcast on root scope
|
||||
* @description
|
||||
* Broadcasted after a route change has happened successfully.
|
||||
* The `resolve` dependencies are now available in the `current.locals` property.
|
||||
*
|
||||
* {@link ngRoute.directive:ngView ngView} listens for the directive
|
||||
* to instantiate the controller and render the view.
|
||||
*
|
||||
* @param {Object} angularEvent Synthetic event object.
|
||||
* @param {Route} current Current route information.
|
||||
* @param {Route|Undefined} previous Previous route information, or undefined if current is
|
||||
* first route entered.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ngdoc event
|
||||
* @name $route#$routeChangeError
|
||||
* @eventType broadcast on root scope
|
||||
* @description
|
||||
* Broadcasted if any of the resolve promises are rejected.
|
||||
*
|
||||
* @param {Object} angularEvent Synthetic event object
|
||||
* @param {Route} current Current route information.
|
||||
* @param {Route} previous Previous route information.
|
||||
* @param {Route} rejection Rejection of the promise. Usually the error of the failed promise.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ngdoc event
|
||||
* @name $route#$routeUpdate
|
||||
* @eventType broadcast on root scope
|
||||
* @description
|
||||
* The `reloadOnSearch` property has been set to false, and we are reusing the same
|
||||
* instance of the Controller.
|
||||
*
|
||||
* @param {Object} angularEvent Synthetic event object
|
||||
* @param {Route} current Current/previous route information.
|
||||
*/
|
||||
|
||||
var forceReload = false,
|
||||
preparedRoute,
|
||||
preparedRouteIsUpdateOnly,
|
||||
$route = {
|
||||
routes: routes,
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name $route#reload
|
||||
*
|
||||
* @description
|
||||
* Causes `$route` service to reload the current route even if
|
||||
* {@link ng.$location $location} hasn't changed.
|
||||
*
|
||||
* As a result of that, {@link ngRoute.directive:ngView ngView}
|
||||
* creates new scope and reinstantiates the controller.
|
||||
*/
|
||||
reload: function() {
|
||||
forceReload = true;
|
||||
$rootScope.$evalAsync(function() {
|
||||
// Don't support cancellation of a reload for now...
|
||||
prepareRoute();
|
||||
commitRoute();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name $route#updateParams
|
||||
*
|
||||
* @description
|
||||
* Causes `$route` service to update the current URL, replacing
|
||||
* current route parameters with those specified in `newParams`.
|
||||
* Provided property names that match the route's path segment
|
||||
* definitions will be interpolated into the location's path, while
|
||||
* remaining properties will be treated as query params.
|
||||
*
|
||||
* @param {!Object<string, string>} newParams mapping of URL parameter names to values
|
||||
*/
|
||||
updateParams: function(newParams) {
|
||||
if (this.current && this.current.$$route) {
|
||||
newParams = angular.extend({}, this.current.params, newParams);
|
||||
$location.path(interpolate(this.current.$$route.originalPath, newParams));
|
||||
// interpolate modifies newParams, only query params are left
|
||||
$location.search(newParams);
|
||||
} else {
|
||||
throw $routeMinErr('norout', 'Tried updating route when with no current route');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$rootScope.$on('$locationChangeStart', prepareRoute);
|
||||
$rootScope.$on('$locationChangeSuccess', commitRoute);
|
||||
|
||||
return $route;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* @param on {string} current url
|
||||
* @param route {Object} route regexp to match the url against
|
||||
* @return {?Object}
|
||||
*
|
||||
* @description
|
||||
* Check if the route matches the current url.
|
||||
*
|
||||
* Inspired by match in
|
||||
* visionmedia/express/lib/router/router.js.
|
||||
*/
|
||||
function switchRouteMatcher(on, route) {
|
||||
var keys = route.keys,
|
||||
params = {};
|
||||
|
||||
if (!route.regexp) return null;
|
||||
|
||||
var m = route.regexp.exec(on);
|
||||
if (!m) return null;
|
||||
|
||||
for (var i = 1, len = m.length; i < len; ++i) {
|
||||
var key = keys[i - 1];
|
||||
|
||||
var val = m[i];
|
||||
|
||||
if (key && val) {
|
||||
params[key.name] = val;
|
||||
}
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
function prepareRoute($locationEvent) {
|
||||
var lastRoute = $route.current;
|
||||
|
||||
preparedRoute = parseRoute();
|
||||
preparedRouteIsUpdateOnly = preparedRoute && lastRoute && preparedRoute.$$route === lastRoute.$$route
|
||||
&& angular.equals(preparedRoute.pathParams, lastRoute.pathParams)
|
||||
&& !preparedRoute.reloadOnSearch && !forceReload;
|
||||
|
||||
if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) {
|
||||
if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) {
|
||||
if ($locationEvent) {
|
||||
$locationEvent.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function commitRoute() {
|
||||
var lastRoute = $route.current;
|
||||
var nextRoute = preparedRoute;
|
||||
|
||||
if (preparedRouteIsUpdateOnly) {
|
||||
lastRoute.params = nextRoute.params;
|
||||
angular.copy(lastRoute.params, $routeParams);
|
||||
$rootScope.$broadcast('$routeUpdate', lastRoute);
|
||||
} else if (nextRoute || lastRoute) {
|
||||
forceReload = false;
|
||||
$route.current = nextRoute;
|
||||
if (nextRoute) {
|
||||
if (nextRoute.redirectTo) {
|
||||
if (angular.isString(nextRoute.redirectTo)) {
|
||||
$location.path(interpolate(nextRoute.redirectTo, nextRoute.params)).search(nextRoute.params)
|
||||
.replace();
|
||||
} else {
|
||||
$location.url(nextRoute.redirectTo(nextRoute.pathParams, $location.path(), $location.search()))
|
||||
.replace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$q.when(nextRoute).
|
||||
then(function() {
|
||||
if (nextRoute) {
|
||||
var locals = angular.extend({}, nextRoute.resolve),
|
||||
template, templateUrl;
|
||||
|
||||
angular.forEach(locals, function(value, key) {
|
||||
locals[key] = angular.isString(value) ?
|
||||
$injector.get(value) : $injector.invoke(value, null, null, key);
|
||||
});
|
||||
|
||||
if (angular.isDefined(template = nextRoute.template)) {
|
||||
if (angular.isFunction(template)) {
|
||||
template = template(nextRoute.params);
|
||||
}
|
||||
} else if (angular.isDefined(templateUrl = nextRoute.templateUrl)) {
|
||||
if (angular.isFunction(templateUrl)) {
|
||||
templateUrl = templateUrl(nextRoute.params);
|
||||
}
|
||||
if (angular.isDefined(templateUrl)) {
|
||||
nextRoute.loadedTemplateUrl = $sce.valueOf(templateUrl);
|
||||
template = $templateRequest(templateUrl);
|
||||
}
|
||||
}
|
||||
if (angular.isDefined(template)) {
|
||||
locals['$template'] = template;
|
||||
}
|
||||
return $q.all(locals);
|
||||
}
|
||||
}).
|
||||
then(function(locals) {
|
||||
// after route change
|
||||
if (nextRoute == $route.current) {
|
||||
if (nextRoute) {
|
||||
nextRoute.locals = locals;
|
||||
angular.copy(nextRoute.params, $routeParams);
|
||||
}
|
||||
$rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute);
|
||||
}
|
||||
}, function(error) {
|
||||
if (nextRoute == $route.current) {
|
||||
$rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @returns {Object} the current active route, by matching it against the URL
|
||||
*/
|
||||
function parseRoute() {
|
||||
// Match a route
|
||||
var params, match;
|
||||
angular.forEach(routes, function(route, path) {
|
||||
if (!match && (params = switchRouteMatcher($location.path(), route))) {
|
||||
match = inherit(route, {
|
||||
params: angular.extend({}, $location.search(), params),
|
||||
pathParams: params});
|
||||
match.$$route = route;
|
||||
}
|
||||
});
|
||||
// No route matched; fallback to "otherwise" route
|
||||
return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string} interpolation of the redirect path with the parameters
|
||||
*/
|
||||
function interpolate(string, params) {
|
||||
var result = [];
|
||||
angular.forEach((string || '').split(':'), function(segment, i) {
|
||||
if (i === 0) {
|
||||
result.push(segment);
|
||||
} else {
|
||||
var segmentMatch = segment.match(/(\w+)(?:[?*])?(.*)/);
|
||||
var key = segmentMatch[1];
|
||||
result.push(params[key]);
|
||||
result.push(segmentMatch[2] || '');
|
||||
delete params[key];
|
||||
}
|
||||
});
|
||||
return result.join('');
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
ngRouteModule.provider('$routeParams', $RouteParamsProvider);
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc service
|
||||
* @name $routeParams
|
||||
* @requires $route
|
||||
*
|
||||
* @description
|
||||
* The `$routeParams` service allows you to retrieve the current set of route parameters.
|
||||
*
|
||||
* Requires the {@link ngRoute `ngRoute`} module to be installed.
|
||||
*
|
||||
* The route parameters are a combination of {@link ng.$location `$location`}'s
|
||||
* {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}.
|
||||
* The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched.
|
||||
*
|
||||
* In case of parameter name collision, `path` params take precedence over `search` params.
|
||||
*
|
||||
* The service guarantees that the identity of the `$routeParams` object will remain unchanged
|
||||
* (but its properties will likely change) even when a route change occurs.
|
||||
*
|
||||
* Note that the `$routeParams` are only updated *after* a route change completes successfully.
|
||||
* This means that you cannot rely on `$routeParams` being correct in route resolve functions.
|
||||
* Instead you can use `$route.current.params` to access the new route's parameters.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* // Given:
|
||||
* // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
|
||||
* // Route: /Chapter/:chapterId/Section/:sectionId
|
||||
* //
|
||||
* // Then
|
||||
* $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'}
|
||||
* ```
|
||||
*/
|
||||
function $RouteParamsProvider() {
|
||||
this.$get = function() { return {}; };
|
||||
}
|
||||
|
||||
ngRouteModule.directive('ngView', ngViewFactory);
|
||||
ngRouteModule.directive('ngView', ngViewFillContentFactory);
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name ngView
|
||||
* @restrict ECA
|
||||
*
|
||||
* @description
|
||||
* # Overview
|
||||
* `ngView` is a directive that complements the {@link ngRoute.$route $route} service by
|
||||
* including the rendered template of the current route into the main layout (`index.html`) file.
|
||||
* Every time the current route changes, the included view changes with it according to the
|
||||
* configuration of the `$route` service.
|
||||
*
|
||||
* Requires the {@link ngRoute `ngRoute`} module to be installed.
|
||||
*
|
||||
* @animations
|
||||
* enter - animation is used to bring new content into the browser.
|
||||
* leave - animation is used to animate existing content away.
|
||||
*
|
||||
* The enter and leave animation occur concurrently.
|
||||
*
|
||||
* @scope
|
||||
* @priority 400
|
||||
* @param {string=} onload Expression to evaluate whenever the view updates.
|
||||
*
|
||||
* @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll
|
||||
* $anchorScroll} to scroll the viewport after the view is updated.
|
||||
*
|
||||
* - If the attribute is not set, disable scrolling.
|
||||
* - If the attribute is set without value, enable scrolling.
|
||||
* - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated
|
||||
* as an expression yields a truthy value.
|
||||
* @example
|
||||
<example name="ngView-directive" module="ngViewExample"
|
||||
deps="angular-route.js;angular-animate.js"
|
||||
animations="true" fixBase="true">
|
||||
<file name="index.html">
|
||||
<div ng-controller="MainCtrl as main">
|
||||
Choose:
|
||||
<a href="Book/Moby">Moby</a> |
|
||||
<a href="Book/Moby/ch/1">Moby: Ch1</a> |
|
||||
<a href="Book/Gatsby">Gatsby</a> |
|
||||
<a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
|
||||
<a href="Book/Scarlet">Scarlet Letter</a><br/>
|
||||
|
||||
<div class="view-animate-container">
|
||||
<div ng-view class="view-animate"></div>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<pre>$location.path() = {{main.$location.path()}}</pre>
|
||||
<pre>$route.current.templateUrl = {{main.$route.current.templateUrl}}</pre>
|
||||
<pre>$route.current.params = {{main.$route.current.params}}</pre>
|
||||
<pre>$routeParams = {{main.$routeParams}}</pre>
|
||||
</div>
|
||||
</file>
|
||||
|
||||
<file name="book.html">
|
||||
<div>
|
||||
controller: {{book.name}}<br />
|
||||
Book Id: {{book.params.bookId}}<br />
|
||||
</div>
|
||||
</file>
|
||||
|
||||
<file name="chapter.html">
|
||||
<div>
|
||||
controller: {{chapter.name}}<br />
|
||||
Book Id: {{chapter.params.bookId}}<br />
|
||||
Chapter Id: {{chapter.params.chapterId}}
|
||||
</div>
|
||||
</file>
|
||||
|
||||
<file name="animations.css">
|
||||
.view-animate-container {
|
||||
position:relative;
|
||||
height:100px!important;
|
||||
background:white;
|
||||
border:1px solid black;
|
||||
height:40px;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.view-animate {
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
.view-animate.ng-enter, .view-animate.ng-leave {
|
||||
transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
|
||||
|
||||
display:block;
|
||||
width:100%;
|
||||
border-left:1px solid black;
|
||||
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
.view-animate.ng-enter {
|
||||
left:100%;
|
||||
}
|
||||
.view-animate.ng-enter.ng-enter-active {
|
||||
left:0;
|
||||
}
|
||||
.view-animate.ng-leave.ng-leave-active {
|
||||
left:-100%;
|
||||
}
|
||||
</file>
|
||||
|
||||
<file name="script.js">
|
||||
angular.module('ngViewExample', ['ngRoute', 'ngAnimate'])
|
||||
.config(['$routeProvider', '$locationProvider',
|
||||
function($routeProvider, $locationProvider) {
|
||||
$routeProvider
|
||||
.when('/Book/:bookId', {
|
||||
templateUrl: 'book.html',
|
||||
controller: 'BookCtrl',
|
||||
controllerAs: 'book'
|
||||
})
|
||||
.when('/Book/:bookId/ch/:chapterId', {
|
||||
templateUrl: 'chapter.html',
|
||||
controller: 'ChapterCtrl',
|
||||
controllerAs: 'chapter'
|
||||
});
|
||||
|
||||
$locationProvider.html5Mode(true);
|
||||
}])
|
||||
.controller('MainCtrl', ['$route', '$routeParams', '$location',
|
||||
function($route, $routeParams, $location) {
|
||||
this.$route = $route;
|
||||
this.$location = $location;
|
||||
this.$routeParams = $routeParams;
|
||||
}])
|
||||
.controller('BookCtrl', ['$routeParams', function($routeParams) {
|
||||
this.name = "BookCtrl";
|
||||
this.params = $routeParams;
|
||||
}])
|
||||
.controller('ChapterCtrl', ['$routeParams', function($routeParams) {
|
||||
this.name = "ChapterCtrl";
|
||||
this.params = $routeParams;
|
||||
}]);
|
||||
|
||||
</file>
|
||||
|
||||
<file name="protractor.js" type="protractor">
|
||||
it('should load and compile correct template', function() {
|
||||
element(by.linkText('Moby: Ch1')).click();
|
||||
var content = element(by.css('[ng-view]')).getText();
|
||||
expect(content).toMatch(/controller\: ChapterCtrl/);
|
||||
expect(content).toMatch(/Book Id\: Moby/);
|
||||
expect(content).toMatch(/Chapter Id\: 1/);
|
||||
|
||||
element(by.partialLinkText('Scarlet')).click();
|
||||
|
||||
content = element(by.css('[ng-view]')).getText();
|
||||
expect(content).toMatch(/controller\: BookCtrl/);
|
||||
expect(content).toMatch(/Book Id\: Scarlet/);
|
||||
});
|
||||
</file>
|
||||
</example>
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc event
|
||||
* @name ngView#$viewContentLoaded
|
||||
* @eventType emit on the current ngView scope
|
||||
* @description
|
||||
* Emitted every time the ngView content is reloaded.
|
||||
*/
|
||||
ngViewFactory.$inject = ['$route', '$anchorScroll', '$animate'];
|
||||
function ngViewFactory($route, $anchorScroll, $animate) {
|
||||
return {
|
||||
restrict: 'ECA',
|
||||
terminal: true,
|
||||
priority: 400,
|
||||
transclude: 'element',
|
||||
link: function(scope, $element, attr, ctrl, $transclude) {
|
||||
var currentScope,
|
||||
currentElement,
|
||||
previousLeaveAnimation,
|
||||
autoScrollExp = attr.autoscroll,
|
||||
onloadExp = attr.onload || '';
|
||||
|
||||
scope.$on('$routeChangeSuccess', update);
|
||||
update();
|
||||
|
||||
function cleanupLastView() {
|
||||
if (previousLeaveAnimation) {
|
||||
$animate.cancel(previousLeaveAnimation);
|
||||
previousLeaveAnimation = null;
|
||||
}
|
||||
|
||||
if (currentScope) {
|
||||
currentScope.$destroy();
|
||||
currentScope = null;
|
||||
}
|
||||
if (currentElement) {
|
||||
previousLeaveAnimation = $animate.leave(currentElement);
|
||||
previousLeaveAnimation.then(function() {
|
||||
previousLeaveAnimation = null;
|
||||
});
|
||||
currentElement = null;
|
||||
}
|
||||
}
|
||||
|
||||
function update() {
|
||||
var locals = $route.current && $route.current.locals,
|
||||
template = locals && locals.$template;
|
||||
|
||||
if (angular.isDefined(template)) {
|
||||
var newScope = scope.$new();
|
||||
var current = $route.current;
|
||||
|
||||
// Note: This will also link all children of ng-view that were contained in the original
|
||||
// html. If that content contains controllers, ... they could pollute/change the scope.
|
||||
// However, using ng-view on an element with additional content does not make sense...
|
||||
// Note: We can't remove them in the cloneAttchFn of $transclude as that
|
||||
// function is called before linking the content, which would apply child
|
||||
// directives to non existing elements.
|
||||
var clone = $transclude(newScope, function(clone) {
|
||||
$animate.enter(clone, null, currentElement || $element).then(function onNgViewEnter() {
|
||||
if (angular.isDefined(autoScrollExp)
|
||||
&& (!autoScrollExp || scope.$eval(autoScrollExp))) {
|
||||
$anchorScroll();
|
||||
}
|
||||
});
|
||||
cleanupLastView();
|
||||
});
|
||||
|
||||
currentElement = clone;
|
||||
currentScope = current.scope = newScope;
|
||||
currentScope.$emit('$viewContentLoaded');
|
||||
currentScope.$eval(onloadExp);
|
||||
} else {
|
||||
cleanupLastView();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// This directive is called during the $transclude call of the first `ngView` directive.
|
||||
// It will replace and compile the content of the element with the loaded template.
|
||||
// We need this directive so that the element content is already filled when
|
||||
// the link function of another directive on the same element as ngView
|
||||
// is called.
|
||||
ngViewFillContentFactory.$inject = ['$compile', '$controller', '$route'];
|
||||
function ngViewFillContentFactory($compile, $controller, $route) {
|
||||
return {
|
||||
restrict: 'ECA',
|
||||
priority: -400,
|
||||
link: function(scope, $element) {
|
||||
var current = $route.current,
|
||||
locals = current.locals;
|
||||
|
||||
$element.html(locals.$template);
|
||||
|
||||
var link = $compile($element.contents());
|
||||
|
||||
if (current.controller) {
|
||||
locals.$scope = scope;
|
||||
var controller = $controller(current.controller, locals);
|
||||
if (current.controllerAs) {
|
||||
scope[current.controllerAs] = controller;
|
||||
}
|
||||
$element.data('$ngControllerController', controller);
|
||||
$element.children().data('$ngControllerController', controller);
|
||||
}
|
||||
|
||||
link(scope);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
})(window, window.angular);
|
29657
glances/outputs/static/js/vendors/angular.js
vendored
29657
glances/outputs/static/js/vendors/angular.js
vendored
File diff suppressed because it is too large
Load Diff
12352
glances/outputs/static/js/vendors/lodash.js
vendored
12352
glances/outputs/static/js/vendors/lodash.js
vendored
File diff suppressed because it is too large
Load Diff
19
glances/outputs/static/package.json
Normal file
19
glances/outputs/static/package.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"bower": "^1.7.9",
|
||||
"del": "^2.2.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-angular-templatecache": "^2.0.0",
|
||||
"gulp-concat": "^2.6.0",
|
||||
"gulp-ng-annotate": "^2.0.0",
|
||||
"gulp-uglify": "^1.5.4",
|
||||
"main-bower-files": "^2.13.1"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "gulp build",
|
||||
"watch": "gulp watch",
|
||||
"postinstall": "bower install"
|
||||
}
|
||||
}
|
14
glances/outputs/static/public/css/bootstrap.min.css
vendored
Normal file
14
glances/outputs/static/public/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
glances/outputs/static/public/css/normalize.css
vendored
Normal file
1
glances/outputs/static/public/css/normalize.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden]{display:none;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em 0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C" "\201D" "\2018" "\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:0;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;}legend{border:0;padding:0;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}textarea{overflow:auto;vertical-align:top;}table{border-collapse:collapse;border-spacing:0;}
|
215
glances/outputs/static/public/css/style.css
Normal file
215
glances/outputs/static/public/css/style.css
Normal file
@ -0,0 +1,215 @@
|
||||
body {
|
||||
background: black;
|
||||
color: #BBB;
|
||||
font-family: "Lucida Sans Typewriter", "Lucida Console", Monaco, "Bitstream Vera Sans Mono", monospace;
|
||||
}
|
||||
|
||||
.table {
|
||||
display: table;
|
||||
width: 100%;
|
||||
max-width:100%;
|
||||
}
|
||||
.table-row-group {
|
||||
display: table-row-group
|
||||
}
|
||||
.table-row {
|
||||
display: table-row;
|
||||
}
|
||||
.table-cell {
|
||||
display: table-cell;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.plugin {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.plugin.table-row-group .table-row:last-child .table-cell {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.underline {
|
||||
text-decoration: underline
|
||||
}
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
.sort {
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
}
|
||||
.sortable {
|
||||
cursor: pointer;
|
||||
}
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
.text-left {
|
||||
text-align: left;
|
||||
}
|
||||
.sidebar .table-cell:not(.text-left) {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
/* Theme */
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
}
|
||||
.highlight {
|
||||
font-weight: bold;
|
||||
color: #5D4062;
|
||||
}
|
||||
.ok, .status, .process {
|
||||
color: #3E7B04;
|
||||
font-weight: bold;
|
||||
}
|
||||
.ok_log {
|
||||
background-color: #3E7B04;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
.careful {
|
||||
color: #295183;
|
||||
font-weight: bold;
|
||||
}
|
||||
.careful_log {
|
||||
background-color: #295183;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
.warning, .nice {
|
||||
color: #5D4062;
|
||||
font-weight: bold;
|
||||
}
|
||||
.warning_log {
|
||||
background-color: #5D4062;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
.critical {
|
||||
color: #A30000;
|
||||
font-weight: bold;
|
||||
}
|
||||
.critical_log {
|
||||
background-color: #A30000;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Plugins */
|
||||
#processlist .table-cell {
|
||||
padding: 0px 5px 0px 5px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#containers .table-cell {
|
||||
padding: 0px 10px 0px 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#quicklook .progress {
|
||||
margin-bottom: 0px;
|
||||
min-width: 100px;
|
||||
background-color: #000;
|
||||
height: 12px;
|
||||
border-radius: 0px;
|
||||
text-align: right;
|
||||
}
|
||||
#quicklook .progress-bar-ok {
|
||||
background-color: #3E7B04;
|
||||
}
|
||||
#quicklook .progress-bar-careful {
|
||||
background-color: #295183;
|
||||
}
|
||||
#quicklook .progress-bar-warning {
|
||||
background-color: #5D4062;
|
||||
}
|
||||
#quicklook .progress-bar-critical {
|
||||
background-color: #A30000;
|
||||
}
|
||||
#quicklook .cpu-name {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
#amps .process-result {
|
||||
max-width: 300px;
|
||||
overflow: hidden;
|
||||
white-space: pre-wrap;
|
||||
padding-left: 10px;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* Loading page */
|
||||
|
||||
#loading-page .glances-logo {
|
||||
background: url('../images/glances.png') no-repeat center center;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
@media (max-width: 750px) {
|
||||
#loading-page .glances-logo {
|
||||
height: 400px;
|
||||
}
|
||||
}
|
||||
@media (min-width: 750px) {
|
||||
#loading-page .glances-logo {
|
||||
height: 500px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Loading animation
|
||||
source : https://github.com/lukehaas/css-loaders
|
||||
*/
|
||||
#loading-page .loader:before,
|
||||
#loading-page .loader:after,
|
||||
#loading-page .loader {
|
||||
border-radius: 50%;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
-webkit-animation-fill-mode: both;
|
||||
animation-fill-mode: both;
|
||||
-webkit-animation: loader 1.8s infinite ease-in-out;
|
||||
animation: loader 1.8s infinite ease-in-out;
|
||||
}
|
||||
#loading-page .loader {
|
||||
margin: auto;
|
||||
font-size: 10px;
|
||||
position: relative;
|
||||
text-indent: -9999em;
|
||||
-webkit-animation-delay: 0.16s;
|
||||
animation-delay: 0.16s;
|
||||
}
|
||||
#loading-page .loader:before {
|
||||
left: -3.5em;
|
||||
}
|
||||
#loading-page .loader:after {
|
||||
left: 3.5em;
|
||||
-webkit-animation-delay: 0.32s;
|
||||
animation-delay: 0.32s;
|
||||
}
|
||||
#loading-page .loader:before,
|
||||
#loading-page .loader:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
@-webkit-keyframes loader {
|
||||
0%, 80%, 100% {
|
||||
box-shadow: 0 2.5em 0 -1.3em #56CA69;
|
||||
}
|
||||
40% {
|
||||
box-shadow: 0 2.5em 0 0 #56CA69;
|
||||
}
|
||||
}
|
||||
@keyframes loader {
|
||||
0%, 80%, 100% {
|
||||
box-shadow: 0 2.5em 0 -1.3em #56CA69;
|
||||
}
|
||||
40% {
|
||||
box-shadow: 0 2.5em 0 0 #56CA69;
|
||||
}
|
||||
}
|
BIN
glances/outputs/static/public/favicon.ico
Normal file
BIN
glances/outputs/static/public/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
68
glances/outputs/static/public/help.html
Normal file
68
glances/outputs/static/public/help.html
Normal file
@ -0,0 +1,68 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-24">{{help.version}} {{help.psutil_version}}</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-24">{{help.configuration_file}}</div>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.sort_auto}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.sort_network}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.sort_cpu}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.show_hide_alert}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.sort_mem}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.percpu}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.sort_user}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.show_hide_ip}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.sort_proc}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.enable_disable_docker}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.sort_io}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.view_network_io_combination}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.sort_cpu_times}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.view_cumulative_network}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.show_hide_diskio}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.show_hide_filesytem_freespace}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.show_hide_filesystem}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.show_hide_help}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.show_hide_network}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.diskio_iops}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.show_hide_sensors}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.show_hide_top_menu}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.show_hide_left_sidebar}}</div>
|
||||
<div class="col-sm-12 col-lg-6">{{help.show_hide_amp}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.enable_disable_process_stats}}</div>
|
||||
<div class="col-sm-12 col-lg-6"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.enable_disable_quick_look}}</div>
|
||||
<div class="col-sm-12 col-lg-6"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-6">{{help.enable_disable_short_processname}}</div>
|
||||
<div class="col-sm-12 col-lg-6"></div>
|
||||
</div>
|
BIN
glances/outputs/static/public/images/glances.png
Normal file
BIN
glances/outputs/static/public/images/glances.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
23
glances/outputs/static/public/index.html
Normal file
23
glances/outputs/static/public/index.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html ng-app="glancesApp">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title ng-bind="title">Glances</title>
|
||||
<base href="/">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css" />
|
||||
|
||||
<script type="text/javascript" src="js/vendor.js"></script>
|
||||
<script type="text/javascript" src="js/main.js"></script>
|
||||
<script type="text/javascript" src="js/templates.js"></script>
|
||||
</head>
|
||||
|
||||
<body ng-view="" ng-keydown="onKeyDown($event)">
|
||||
|
||||
</body>
|
||||
</html>
|
1
glances/outputs/static/public/js/main.js
Normal file
1
glances/outputs/static/public/js/main.js
Normal file
File diff suppressed because one or more lines are too long
23
glances/outputs/static/public/js/templates.js
Normal file
23
glances/outputs/static/public/js/templates.js
Normal file
@ -0,0 +1,23 @@
|
||||
angular.module('glancesApp').run(['$templateCache', function($templateCache) {$templateCache.put('plugins/alert.html','<div class="table">\n <div class="table-row" ng-repeat="alert in statsAlert.getAlerts()">\n <div class="table-cell text-left">\n{{alert.begin | date : \'yyyy-MM-dd H:mm:ss\'}} ({{ alert.ongoing ? \'ongoing\' : alert.duration }}) - <span ng-hide="alert.ongoing">{{alert.level}} on</span> <span class="{{ alert.level | lowercase }}">{{alert.name}}</span> ({{alert.max}})\n\t\t</div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/alerts.html','<span class="title" ng-show="!statsAlert.hasAlerts()">No warning or critical alert detected</span>\n<span class="title" ng-show="statsAlert.hasAlerts()">Warning or critical alerts (lasts {{statsAlert.count()}} entries)</span>\n');
|
||||
$templateCache.put('plugins/amps.html','<div class="table">\n <div class="table-row" ng-repeat="process in statsAmps.processes">\n <div class="table-cell text-left" ng-class="statsAmps.getDescriptionDecoration(process)">{{ process.name }}</div>\n <div class="table-cell text-left">{{ process.count }}</div>\n <div class="table-cell text-left process-result">{{ process.result }}</div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/cpu.html','<div class="row">\n <div class="col-sm-24 col-md-12 col-lg-8">\n <div class="table">\n <div class="table-row">\n <div class="table-cell text-left title">CPU</div>\n <div class="table-cell">{{ statsCpu.total }}%</div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">user:</div>\n <div class="table-cell" ng-class="statsCpu.getDecoration(\'user\')">\n {{ statsCpu.user }}%\n </div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">system:</div>\n <div class="table-cell" ng-class="statsCpu.getDecoration(\'system\')">\n {{ statsCpu.system }}%\n </div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">idle:</div>\n <div class="table-cell">{{ statsCpu.idle }}%</div>\n </div>\n </div>\n </div>\n <div class="hidden-xs hidden-sm col-md-12 col-lg-8">\n <div class="table">\n <div class="table-row">\n <div class="table-cell text-left">nice:</div>\n <div class="table-cell">\n {{ statsCpu.nice }}%\n </div>\n </div>\n <div class="table-row" ng-show="statsCpu.irq != undefined">\n <div class="table-cell text-left">irq:</div>\n <div class="table-cell">\n {{ statsCpu.irq }}%\n </div>\n </div>\n <div class="table-row" ng-show="statsCpu.iowait != undefined">\n <div class="table-cell text-left">iowait:</div>\n <div class="table-cell" ng-class="statsCpu.getDecoration(\'iowait\')">\n {{ statsCpu.iowait }}%\n </div>\n </div>\n <div class="table-row" ng-show="statsCpu.steal != undefined">\n <div class="table-cell text-left">steal:</div>\n <div class="table-cell" ng-class="statsCpu.getDecoration(\'steal\')">\n {{ statsCpu.steal }}%\n </div>\n </div>\n </div>\n </div>\n <div class="hidden-xs hidden-sm hidden-md col-lg-8">\n <div class="table">\n <div class="table-row" ng-if="statsCpu.ctx_switches">\n <div class="table-cell text-left">ctx_sw:</div>\n <div class="table-cell" ng-class="statsCpu.getDecoration(\'ctx_switches\')">\n {{ statsCpu.ctx_switches }}\n </div>\n </div>\n <div class="table-row" ng-if="statsCpu.interrupts">\n <div class="table-cell text-left">inter:</div>\n <div class="table-cell">\n {{ statsCpu.interrupts }}\n </div>\n </div>\n <div class="table-row" ng-if="statsCpu.soft_interrupts">\n <div class="table-cell text-left">sw_int:</div>\n <div class="table-cell">\n {{ statsCpu.soft_interrupts }}\n </div>\n </div>\n <div class="table-row" ng-if="!statsSystem.isLinux() && statsCpu.syscalls">\n <div class="table-cell text-left">syscal:</div>\n <div class="table-cell">\n {{ statsCpu.syscalls }}\n </div>\n </div>\n </div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/diskio.html','<div class="table-row">\n <div class="table-cell text-left title">DISK I/O</div>\n <div class="table-cell" ng-show="!arguments.diskio_iops">R/s</div>\n <div class="table-cell" ng-show="!arguments.diskio_iops">W/s</div>\n\n <div class="table-cell" ng-show="arguments.diskio_iops">IOR/s</div>\n <div class="table-cell" ng-show="arguments.diskio_iops">IOW/s</div>\n</div>\n<div class="table-row" ng-repeat="disk in statsDiskio.disks">\n <div class="table-cell text-left">{{(disk.alias ? disk.alias : disk.name) | min_size}}</div>\n <div class="table-cell" ng-show="!arguments.diskio_iops">{{disk.bitrate.txps }}</div>\n <div class="table-cell" ng-show="!arguments.diskio_iops">{{disk.bitrate.rxps }}</div>\n\n <div class="table-cell" ng-show="arguments.diskio_iops">{{disk.count.txps }}</div>\n <div class="table-cell" ng-show="arguments.diskio_iops">{{disk.count.rxps }}</div>\n</div>\n');
|
||||
$templateCache.put('plugins/docker.html','<span class="title">CONTAINERS</span> {{ statsDocker.containers.length }} (served by Docker {{ statsDocker.version }})\n\n<div class="table">\n <div class="table-row">\n <div class="table-cell text-left">Name</div>\n <div class="table-cell">Status</div>\n <div class="table-cell">CPU%</div>\n <div class="table-cell">MEM</div>\n <div class="table-cell">IOR/s</div>\n <div class="table-cell">IOW/s</div>\n <div class="table-cell">RX/s</div>\n <div class="table-cell">TX/s</div>\n <div class="table-cell text-left">Command</div>\n </div>\n <div class="table-row" ng-repeat="container in statsDocker.containers">\n <div class="table-cell text-left">{{ container.name }}</div>\n <div class="table-cell" ng-class="container.status == \'Paused\' ? \'careful\' : \'ok\'">{{ container.status }}</div>\n <div class="table-cell">{{ container.cpu | number:1 }}</div>\n <div class="table-cell">{{ container.memory | bytes }}</div>\n <div class="table-cell">{{ container.ior / container.io_time_since_update | bits }}</div>\n <div class="table-cell">{{ container.iow / container.io_time_since_update | bits }}</div>\n <div class="table-cell">{{ container.rx / container.net_time_since_update | bits }}</div>\n <div class="table-cell">{{ container.tx / container.net_time_since_update | bits }}</div>\n <div class="table-cell text-left">{{ container.command }}</div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/folders.html','<div class="table-row">\n <div class="table-cell text-left title">FOLDERS</div>\n <div class="table-cell">Size</div>\n</div>\n<div class="table-row" ng-repeat="folder in statsFolders.folders">\n <div class="table-cell text-left">{{ folder.path }}</div>\n <div class="table-cell" ng-class="statsFolders.getDecoration(folder)">{{ folder.size | bytes }}</div>\n</div>\n');
|
||||
$templateCache.put('plugins/fs.html','<div class="table-row">\n <div class="table-cell text-left title">FILE SYS</div>\n <div class="table-cell">\n <span ng-show="!arguments.fs_free_space">Used</span>\n <span ng-show="arguments.fs_free_space">Free</span>\n </div>\n <div class="table-cell">Total</div>\n</div>\n<div class="table-row" ng-repeat="fs in statsFs.fileSystems | orderBy: \'mnt_point\'">\n <div class="table-cell text-left">{{ fs.mountPoint }} <span class="visible-lg-inline" ng-show="fs.name.length <= 20">({{ fs.name }})<span></div>\n <div class="table-cell" ng-class="statsFs.getDecoration(fs.mountPoint, \'used\')">\n <span ng-show="!arguments.fs_free_space">{{ fs.used | bytes }}</span>\n <span ng-show="arguments.fs_free_space">{{ fs.free | bytes }}</span>\n </div>\n <div class="table-cell">{{ fs.size | bytes }}</div>\n</div>\n');
|
||||
$templateCache.put('plugins/ip.html',' - <span class="title">IP</span> <span>{{ statsIp.address }}/{{ statsIp.maskCidr }}</span> <span class="title">Pub</span> <span>{{ statsIp.publicAddress }}</span>\n');
|
||||
$templateCache.put('plugins/load.html','<div class="table">\n <div class="table-row">\n <div class="table-cell text-left title">LOAD</div>\n <div class="table-cell">{{ statsLoad.cpucore }}-core</div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">1 min:</div>\n <div class="table-cell">\n {{ statsLoad.min1 | number : 2}}\n </div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">5 min:</div>\n <div class="table-cell" ng-class="statsLoad.getDecoration(\'min5\')">\n {{ statsLoad.min5 | number : 2}}\n </div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">15 min:</div>\n <div class="table-cell" ng-class="statsLoad.getDecoration(\'min15\')">\n {{ statsLoad.min15 | number : 2}}\n </div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/mem.html','<div class="table">\n <div class="table-row">\n <div class="table-cell text-left title">MEM</div>\n <div class="table-cell">{{ statsMem.percent }}%</div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">total:</div>\n <div class="table-cell">{{ statsMem.total | bytes }}</div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">used:</div>\n <div class="table-cell" ng-class="statsMem.getDecoration(\'used\')">\n {{ statsMem.used | bytes:2 }}\n </div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">free:</div>\n <div class="table-cell">{{ statsMem.free | bytes }}</div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/mem_more.html','<div class="table">\n <div class="table-row">\n <div class="table-cell text-left">active:</div>\n <div class="table-cell">{{ statsMem.active | bytes }}</div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">inactive:</div>\n <div class="table-cell">{{ statsMem.inactive | bytes }}</div>\n </div>\n <div class="table-row" ng-show="statsMem.buffers != undefined">\n <div class="table-cell text-left">buffers:</div>\n <div class="table-cell">{{ statsMem.buffers | bytes }}</div>\n </div>\n <div class="table-row" ng-show="statsMem.cached != undefined">\n <div class="table-cell text-left">cached:</div>\n <div class="table-cell">{{ statsMem.cached | bytes }}</div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/memswap.html','<div class="table">\n <div class="table-row">\n <div class="table-cell text-left title">SWAP</div>\n <div class="table-cell">{{ statsMemSwap.percent }}%</div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">total:</div>\n <div class="table-cell">{{ statsMemSwap.total | bytes }}</div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">used:</div>\n <div class="table-cell" ng-class="statsMemSwap.getDecoration(\'used\')">\n {{ statsMemSwap.used | bytes }}\n </div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">free:</div>\n <div class="table-cell">{{ statsMemSwap.free | bytes }}</div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/network.html','<div class="table-row">\n <div class="table-cell text-left title">NETWORK</div>\n <div class="table-cell" ng-show="!arguments.network_cumul && !arguments.network_sum">Rx/s</div>\n <div class="table-cell" ng-show="!arguments.network_cumul && !arguments.network_sum">Tx/s</div>\n\n <div class="table-cell" ng-show="!arguments.network_cumul && arguments.network_sum"></div>\n <div class="table-cell" ng-show="!arguments.network_cumul && arguments.network_sum">Rx+Tx/s</div>\n\n <div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">Rx</div>\n <div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">Tx</div>\n\n <div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum"></div>\n <div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum">Rx+Tx</div>\n</div>\n<div class="table-row" ng-repeat="network in statsNetwork.networks | orderBy: \'interfaceName\'">\n <div class="table-cell text-left">{{ network.interfaceName | min_size }}</div>\n <div class="table-cell" ng-show="!arguments.network_cumul && !arguments.network_sum">{{ arguments.byte ? (network.rx / network.time_since_update | bytes) : (network.rx / network.time_since_update | bits) }}</div>\n <div class="table-cell" ng-show="!arguments.network_cumul && !arguments.network_sum">{{ arguments.byte ? (network.tx / network.time_since_update | bytes) : (network.tx / network.time_since_update | bits) }}</div>\n\n <div class="table-cell" ng-show="!arguments.network_cumul && arguments.network_sum"></div>\n <div class="table-cell" ng-show="!arguments.network_cumul && arguments.network_sum">{{ arguments.byte ? (network.cx / network.time_since_update | bytes) : (network.cx / network.time_since_update | bits) }}</div>\n\n <div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">{{ arguments.byte ? (network.cumulativeRx | bytes) : (network.cumulativeRx | bits) }}</div>\n <div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">{{ arguments.byte ? (network.cumulativeTx | bytes) : (network.cumulativeTx | bits) }}</div>\n\n <div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum"></div>\n <div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum">{{ arguments.byte ? (network.cumulativeCx | bytes) : (network.cumulativeCx | bits) }}</div>\n</div>\n');
|
||||
$templateCache.put('plugins/per_cpu.html','<div class="table">\n <div class="table-row">\n <div class="table-cell text-left title">PER CPU</div>\n <div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus">{{ percpu.total }}%</div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">user:</div>\n <div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus" ng-class="statsPerCpu.getUserAlert(percpu)">\n {{ percpu.user }}%\n </div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">system:</div>\n <div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus" ng-class="statsPerCpu.getSystemAlert(percpu)">\n {{ percpu.system }}%\n </div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">idle:</div>\n <div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus">{{ percpu.idle }}%</div>\n </div>\n <div class="table-row" ng-show="statsPerCpu.cpus[0].iowait">\n <div class="table-cell text-left">iowait:</div>\n <div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus" ng-class="statsPerCpu.getSystemAlert(percpu)">\n {{ percpu.iowait }}%\n </div>\n </div>\n <div class="table-row" ng-show="statsPerCpu.cpus[0].steal">\n <div class="table-cell text-left">steal:</div>\n <div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus" ng-class="statsPerCpu.getSystemAlert(percpu)">\n {{ percpu.steal }}%\n </div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/ports.html','<div class="table-row" ng-repeat="port in statsPorts.ports">\n <div class="table-cell text-left">{{(port.description ? port.description : port.host + \' \' + port.port) | min_size: 20}}</div>\n <div class="table-cell"></div>\n <div ng-switch="port.status" ng-class="statsPorts.getDecoration(port)" class="table-cell">\n <span ng-switch-when="null">Scanning</span>\n <span ng-switch-when="false">Timeout</span>\n <span ng-switch-when="true">Open</span>\n <span ng-switch-default>{{port.status * 1000.0 | number:0}}ms</span>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/processcount.html','<span class="title">TASKS</span>\n<span>{{ statsProcessCount.total }} ({{ statsProcessCount.thread }} thr),</span>\n<span>{{ statsProcessCount.running }} run,</span>\n<span>{{ statsProcessCount.sleeping }} slp,</span>\n<span>{{ statsProcessCount.stopped }} oth</span>\n<span> sorted {{ sorter.auto ? \'automatically\' : \'\' }} by {{ sorter.getColumnLabel(sorter.column) }}, flat view</span>\n');
|
||||
$templateCache.put('plugins/processlist.html','<div class="table">\n <div class="table-row">\n <div sortable-th sorter="sorter" column="cpu_percent" class="table-cell">CPU%</div>\n <div sortable-th sorter="sorter" column="memory_percent" class="table-cell">MEM%</div>\n <div class="table-cell hidden-xs hidden-sm">VIRT</div>\n <div class="table-cell hidden-xs hidden-sm">RES</div>\n <div class="table-cell">PID</div>\n <div sortable-th sorter="sorter" column="username" class="table-cell text-left">USER</div>\n <div class="table-cell">NI</div>\n <div class="table-cell">S</div>\n <div sortable-th sorter="sorter" column="timemillis" class="table-cell hidden-xs hidden-sm">TIME+</div>\n <div sortable-th sorter="sorter" column="io_read" class="table-cell hidden-xs hidden-sm" ng-show="statsProcessList.ioReadWritePresent">IOR/s</div>\n <div sortable-th sorter="sorter" column="io_write" class="table-cell hidden-xs hidden-sm" ng-show="statsProcessList.ioReadWritePresent">IOW/s</div>\n <div sortable-th sorter="sorter" column="name" class="table-cell text-left">Command</div>\n </div>\n <div class="table-row" ng-repeat="process in statsProcessList.processes | orderBy:sorter.column:sorter.isReverseColumn(sorter.column)">\n <div class="table-cell" ng-class="statsProcessList.getCpuPercentAlert(process)">{{process.cpu_percent | number:1}}</div>\n <div class="table-cell" ng-class="statsProcessList.getMemoryPercentAlert(process)">{{process.memory_percent | number:1}}</div>\n <div class="table-cell hidden-xs hidden-sm">{{process.memvirt | bytes}}</div>\n <div class="table-cell hidden-xs hidden-sm">{{process.memres | bytes}}</div>\n <div class="table-cell">{{process.pid}}</div>\n <div class="table-cell text-left">{{process.username}}</div>\n <div class="table-cell" ng-class="{nice: process.isNice}">{{process.nice | exclamation}}</div>\n <div class="table-cell" ng-class="{status: process.status == \'R\'}">{{process.status}}</div>\n <div class="table-cell hidden-xs hidden-sm">\n <span ng-show="process.timeplus.hours > 0" class="highlight">{{ process.timeplus.hours }}h</span>{{ process.timeplus.minutes | leftPad:2:\'0\' }}:{{ process.timeplus.seconds | leftPad:2:\'0\' }}<span ng-show="process.timeplus.hours <= 0">.{{ process.timeplus.milliseconds | leftPad:2:\'0\' }}</span>\n </div>\n <div class="table-cell hidden-xs hidden-sm" ng-show="statsProcessList.ioReadWritePresent">{{process.ioRead}}</div>\n <div class="table-cell hidden-xs hidden-sm" ng-show="statsProcessList.ioReadWritePresent">{{process.ioWrite}}</div>\n <div class="table-cell text-left" ng-show="arguments.process_short_name">{{process.name}}</div>\n <div class="table-cell text-left" ng-show="!arguments.process_short_name">{{process.cmdline}}</div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/quicklook.html','<div class="cpu-name">\n {{ statsQuicklook.cpu_name }}\n</div>\n<div class="table">\n <div class="table-row" ng-show="!arguments.percpu">\n <div class="table-cell text-left">CPU</div>\n <div class="table-cell">\n <div class="progress">\n <div class="progress-bar progress-bar-{{ statsQuicklook.getDecoration(\'cpu\') }}" role="progressbar" aria-valuenow="{{ statsQuicklook.cpu }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ statsQuicklook.cpu }}%;">\n \n </div>\n </div>\n </div>\n <div class="table-cell">\n {{ statsQuicklook.cpu }}%\n </div>\n </div>\n <div class="table-row" ng-show="arguments.percpu" ng-repeat="percpu in statsQuicklook.percpus">\n <div class="table-cell text-left">CPU{{ percpu.number }}</div>\n <div class="table-cell">\n <div class="progress">\n <div class="progress-bar progress-bar-{{ statsQuicklook.getDecoration(\'cpu\') }}" role="progressbar" aria-valuenow="{{ percpu.total }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ percpu.total }}%;">\n \n </div>\n </div>\n </div>\n <div class="table-cell">\n {{ percpu.total }}%\n </div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">MEM</div>\n <div class="table-cell">\n <div class="progress">\n <div class="progress-bar progress-bar-{{ statsQuicklook.getDecoration(\'mem\') }}" role="progressbar" aria-valuenow="{{ statsQuicklook.mem }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ statsQuicklook.mem }}%;">\n \n </div>\n </div>\n </div>\n <div class="table-cell">\n {{ statsQuicklook.mem }}%\n </div>\n </div>\n <div class="table-row">\n <div class="table-cell text-left">SWAP</div>\n <div class="table-cell">\n <div class="progress">\n <div class="progress-bar progress-bar-{{ statsQuicklook.getDecoration(\'swap\') }}" role="progressbar" aria-valuenow="{{ statsQuicklook.swap }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ statsQuicklook.swap }}%;">\n \n </div>\n </div>\n </div>\n <div class="table-cell">\n {{ statsQuicklook.swap }}%\n </div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/raid.html','<div class="table-row">\n <div class="table-cell text-left title">RAID disks</div>\n <div class="table-cell">Used</div>\n <div class="table-cell">Total</div>\n</div>\n<div class="table-row" ng-repeat="disk in statsRaid.disks | orderBy: \'name\'">\n <div class="table-cell text-left">\n {{ disk.type | uppercase }} {{ disk.name }}\n <div class="warning" ng-show="disk.degraded">\u2514\u2500 Degraded mode</div>\n <div ng-show="disk.degraded"> \u2514\u2500 {{ disk.config }}</div>\n\n <div class="critical" ng-show="disk.inactive">\u2514\u2500 Status {{ disk.status }}</div>\n <div ng-show="disk.inactive" ng-repeat="component in disk.components | orderBy: \'number\'">\n {{ $last ? \'\u2514\u2500\' : \'\u251C\u2500\' }} disk {{ component.number }}: {{ component.name }}\n </div>\n </div>\n <div class="table-cell" ng-show="!disk.inactive" ng-class="statsRaid.getAlert(disk)">{{ disk.used }}</div>\n <div class="table-cell" ng-show="!disk.inactive" ng-class="statsRaid.getAlert(disk)">{{ disk.available }}</div>\n</div>');
|
||||
$templateCache.put('plugins/sensors.html','<div class="table-row">\n <div class="table-cell text-left title">SENSORS</div>\n</div>\n\n<div class="table-row" ng-repeat="sensor in statsSensors.sensors">\n <div class="table-cell text-left">{{ sensor.label }}</div>\n <div class="table-cell">{{ sensor.unit }}</div>\n <div class="table-cell" ng-class="statsSensors.getAlert(sensor)">{{ sensor.value }}</div>\n</div>\n');
|
||||
$templateCache.put('plugins/system.html','<span ng-if="is_disconnected" class="critical">Disconnected from</span>\n<span class="title">{{ statsSystem.hostname }}</span>\n<span ng-show="statsSystem.isLinux()" class="hidden-xs hidden-sm">({{ statsSystem.humanReadableName }} / {{ statsSystem.os.name }} {{ statsSystem.os.version }})</span>\n<span ng-show="!statsSystem.isLinux()" class="hidden-xs hidden-sm">({{ statsSystem.os.name }} {{ statsSystem.os.version }} {{ statsSystem.platform }})</span>');
|
||||
$templateCache.put('plugins/uptime.html','<span>Uptime: {{ statsUptime.uptime }}</span>\n');}]);
|
8
glances/outputs/static/public/js/vendor.js
Normal file
8
glances/outputs/static/public/js/vendor.js
Normal file
File diff suppressed because one or more lines are too long
73
glances/outputs/static/public/stats.html
Normal file
73
glances/outputs/static/public/stats.html
Normal file
@ -0,0 +1,73 @@
|
||||
<div ng-show="!dataLoaded" class="container-fluid" id="loading-page">
|
||||
<div class="glances-logo"></div>
|
||||
<div class="loader">Loading...</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="arguments.help_tag" class="container-fluid" ng-include src="'help.html'"></div>
|
||||
|
||||
<div ng-show="dataLoaded && !arguments.help_tag" class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-24">
|
||||
<div class="pull-left">
|
||||
<section id="system" class="plugin" ng-include src="'plugins/system.html'"></section>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<section id="ip" class="plugin" ng-if="statsIp.address != undefined && !arguments.disable_ip" ng-include src="'plugins/ip.html'"></section>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<section id="uptime" class="plugin" ng-include src="'plugins/uptime.html'"></section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="hidden-xs hidden-sm hidden-md col-lg-6" ng-if="!arguments.disable_quicklook">
|
||||
<section id="quicklook" class="plugin" ng-include src="'plugins/quicklook.html'"></section>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-8 col-lg-6" ng-if="!arguments.disable_cpu && !arguments.percpu">
|
||||
<section id="cpu" class="plugin" ng-include src="'plugins/cpu.html'"></section>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-8 col-lg-6" ng-if="!arguments.disable_cpu && arguments.percpu">
|
||||
<section id="per_cpu" class="plugin" ng-include src="'plugins/per_cpu.html'"></section>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="!arguments.disable_mem">
|
||||
<section id="mem" class="plugin" ng-include src="'plugins/mem.html'"></section>
|
||||
</div>
|
||||
<div class="hidden-xs hidden-sm col-md-4 col-lg-3" ng-if="!arguments.disable_mem">
|
||||
<section id="mem_more" class="plugin" ng-include src="'plugins/mem_more.html'"></section>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="!arguments.disable_swap">
|
||||
<section id="memswap" class="plugin" ng-include src="'plugins/memswap.html'"></section>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-4 col-lg-3" ng-if="!arguments.disable_load">
|
||||
<section id="load" class="plugin" ng-if="statsLoad.cpucore != undefined" ng-include src="'plugins/load.html'"></section>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 sidebar" ng-show="!arguments.disable_left_sidebar">
|
||||
<div class="table">
|
||||
<section id="network" class="plugin table-row-group" ng-show="!arguments.disable_network" ng-include src="'plugins/network.html'"></section>
|
||||
<section id="ports" class="plugin table-row-group" ng-include src="'plugins/ports.html'"></section>
|
||||
<section id="diskio" class="plugin table-row-group" ng-show="!arguments.disable_diskio && statsDiskio.disks.length > 0" ng-include src="'plugins/diskio.html'"></section>
|
||||
<section id="fs" class="plugin table-row-group" ng-show="!arguments.disable_fs" ng-include src="'plugins/fs.html'"></section>
|
||||
<section id="folders" class="plugin table-row-group" ng-show="!arguments.disable_fs && statsFolders.folders.length > 0" ng-include src="'plugins/folders.html'"></section>
|
||||
<section id="raid" class="plugin table-row-group" ng-show="statsRaid.hasDisks()" ng-include src="'plugins/raid.html'"></section>
|
||||
<section id="sensors" class="plugin table-row-group" ng-show="!arguments.disable_sensors && statsSensors.sensors.length > 0" ng-include src="'plugins/sensors.html'"></section>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-18">
|
||||
<section id="containers" class="plugin" ng-show="statsDocker.containers.length && !arguments.disable_docker" ng-include src="'plugins/docker.html'"></section>
|
||||
<section id="alerts" ng-show="!arguments.disable_log" ng-include src="'plugins/alerts.html'"></section>
|
||||
<section id="alert" class="plugin" ng-show="!arguments.disable_log" ng-include src="'plugins/alert.html'"></section>
|
||||
<div ng-show="!arguments.disable_process">
|
||||
<section id="processcount" class="plugin" ng-include src="'plugins/processcount.html'"></section>
|
||||
<div class="row" ng-if="!arguments.disable_amps">
|
||||
<div class="col-lg-18">
|
||||
<section id="amps" class="plugin" ng-include src="'plugins/amps.html'"></section>
|
||||
</div>
|
||||
</div>
|
||||
<section id="processlist" class="plugin" ng-include src="'plugins/processlist.html'"></section>
|
||||
</div>
|
||||
<div ng-show="arguments.disable_process">PROCESSES DISABLED (press 'z' to display)</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user