Merge pull request #1238 from nicolargo/revert-1237-feature/webpack

Revert "Migrate from gulp & bower to webpack & yarn"
This commit is contained in:
Nicolas Hennion 2018-02-20 21:01:03 +01:00 committed by GitHub
commit 0117faa797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
82 changed files with 342 additions and 11811 deletions

View File

@ -1 +0,0 @@
public

View File

@ -1,19 +1,11 @@
# How to contribute? # 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) or [yarn](https://yarnpkg.com). In order to build the assets of the Web UI, you'll need [npm](https://docs.npmjs.com/getting-started/what-is-npm).
You must run the following command from the `glances/outputs/static/` directory. You must run the following command from the `glances/outputs/static/` directory.
## Install dependencies ## Install dependencies
You can use yarn or npm:
```bash
$ yarn
```
or:
```bash ```bash
$ npm install $ npm install
``` ```

View File

@ -0,0 +1,17 @@
{
"name": "glances",
"private": true,
"dependencies": {
"angular": "^1.5.8",
"lodash": "^4.13.1",
"favico.js": "^0.3.10",
"angular-hotkeys": "chieffancypants/angular-hotkeys#^1.7.0"
},
"overrides": {
"angular-hotkeys": {
"main": [
"build/hotkeys.js"
]
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,56 +0,0 @@
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
// Core variables and mixins
@import "./variables.less";
@import "~bootstrap/less/mixins.less";
// Reset and dependencies
@import "~bootstrap/less/normalize.less";
// @import "~bootstrap/less/print.less";
// @import "~bootstrap/less/glyphicons.less";
// Core CSS
@import "~bootstrap/less/scaffolding.less";
// @import "~bootstrap/less/type.less";
// @import "~bootstrap/less/code.less";
@import "~bootstrap/less/grid.less";
@import "~bootstrap/less/tables.less";
// @import "~bootstrap/less/forms.less";
// @import "~bootstrap/less/buttons.less";
// Components
// @import "~bootstrap/less/component-animations.less";
// @import "~bootstrap/less/dropdowns.less";
// @import "~bootstrap/less/button-groups.less";
// @import "~bootstrap/less/input-groups.less";
// @import "~bootstrap/less/navs.less";
// @import "~bootstrap/less/navbar.less";
// @import "~bootstrap/less/breadcrumbs.less";
// @import "~bootstrap/less/pagination.less";
// @import "~bootstrap/less/pager.less";
// @import "~bootstrap/less/labels.less";
// @import "~bootstrap/less/badges.less";
// @import "~bootstrap/less/jumbotron.less";
// @import "~bootstrap/less/thumbnails.less";
// @import "~bootstrap/less/alerts.less";
@import "~bootstrap/less/progress-bars.less";
// @import "~bootstrap/less/media.less";
// @import "~bootstrap/less/list-group.less";
// @import "~bootstrap/less/panels.less";
// @import "~bootstrap/less/responsive-embed.less";
// @import "~bootstrap/less/wells.less";
// @import "~bootstrap/less/close.less";
// Components w/ JavaScript
// @import "~bootstrap/less/modals.less";
// @import "~bootstrap/less/tooltip.less";
// @import "~bootstrap/less/popovers.less";
// @import "~bootstrap/less/carousel.less";
// Utility classes
@import "~bootstrap/less/utilities.less";
@import "~bootstrap/less/responsive-utilities.less";

View 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;}

View File

@ -115,35 +115,32 @@ body {
white-space: nowrap; white-space: nowrap;
} }
#quicklook-plugin { #quicklook-plugin .progress {
.progress { margin-bottom: 0px;
margin-bottom: 0px; min-width: 100px;
min-width: 100px; background-color: #000;
background-color: #000; height: 12px;
height: 12px; border-radius: 0px;
border-radius: 0px; text-align: right;
text-align: right; }
} #quicklook-plugin .progress-bar-ok {
.progress-bar-ok { background-color: #3E7B04;
background-color: #3E7B04; }
} #quicklook-plugin .progress-bar-careful {
.progress-bar-careful { background-color: #295183;
background-color: #295183; }
} #quicklook-plugin .progress-bar-warning {
.progress-bar-warning { background-color: #5D4062;
background-color: #5D4062; }
} #quicklook-plugin .progress-bar-critical {
.progress-bar-critical { background-color: #A30000;
background-color: #A30000; }
} #quicklook-plugin .cpu-name {
.cpu-name { white-space: nowrap;
white-space: nowrap; overflow: hidden;
overflow: hidden; width: 100%;
width: 100%; text-overflow: ellipsis;
text-overflow: ellipsis; }
}
}
#amps-plugin .process-result { #amps-plugin .process-result {
max-width: 300px; max-width: 300px;
overflow: hidden; overflow: hidden;

View File

@ -1,4 +0,0 @@
@import "~bootstrap/less/variables.less";
@grid-columns: 24;

View File

@ -0,0 +1,58 @@
var gulp = require('gulp');
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');
var rename = require('gulp-rename');
gulp.task('clean', function() {
del('./public/*')
});
gulp.task('copy', function() {
gulp.src('./html/*.html')
.pipe(gulp.dest('./public'));
gulp.src('./css/*.css')
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./public/css'));
gulp.src('./images/*.png')
.pipe(gulp.dest('./public/images'));
gulp.src('./images/favicon.ico')
.pipe(gulp.dest('./public'));
});
gulp.task('bower', function() {
return gulp.src(mainBowerFiles())
.pipe(concat('vendor.js'))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./public/js'))
});
gulp.task('build-js', function() {
return gulp.src('./js/**/*.js')
.pipe(ngAnnotate())
.pipe(concat('main.js'))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./public/js'))
});
gulp.task('template', function () {
return gulp.src('./js/components/**/*.html')
.pipe(templateCache('templates.js', {'root': 'components/', 'module': 'glancesApp'}))
.pipe(rename({suffix: '.min'}))
.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']);

View File

@ -1,8 +1,19 @@
var glancesApp = angular.module('glancesApp', ['glances.config', 'cfp.hotkeys'])
import "../css/bootstrap.less"; .value('CONFIG', {})
import "../css/style.scss"; .value('ARGUMENTS', {})
import "./module"; .config(function (hotkeysProvider) {
import "./services"; hotkeysProvider.useNgRoute = false;
import "./components"; hotkeysProvider.includeCheatSheet = false;
import "./filters"; })
.run(function ($rootScope, GlancesStats) {
$rootScope.title = "Glances";
$rootScope.$on('data_refreshed', function (event, data) {
$rootScope.title = data.stats.system.hostname + ' - Glances';
});
GlancesStats.init();
});

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glances', {
import GlancesController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glances", {
controller: GlancesController, controller: GlancesController,
controllerAs: 'vm', controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/glances/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesController($scope, GlancesStats, hotkeys, ARGUMENTS) { function GlancesController($scope, GlancesStats, hotkeys, ARGUMENTS) {
var vm = this; var vm = this;
vm.dataLoaded = false; vm.dataLoaded = false;
vm.arguments = ARGUMENTS; vm.arguments = ARGUMENTS;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesHelp', {
import GlancesHelpController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesHelp", {
controller: GlancesHelpController, controller: GlancesHelpController,
controllerAs: 'vm', controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/help/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesHelpController($http) { function GlancesHelpController($http) {
var vm = this; var vm = this;
$http.get('api/2/help').then(function (response) { $http.get('api/2/help').then(function (response) {

View File

@ -1,32 +0,0 @@
// import all components
import "./glances/component";
import "./help/component";
import "./plugin-alert/component";
import "./plugin-amps/component";
import "./plugin-cloud/component";
import "./plugin-cpu/component";
import "./plugin-diskio/component";
import "./plugin-docker/component";
import "./plugin-folders/component";
import "./plugin-fs/component";
import "./plugin-gpu/component";
import "./plugin-ip/component";
import "./plugin-irq/component";
import "./plugin-load/component";
import "./plugin-mem/component";
import "./plugin-mem-more/component";
import "./plugin-memswap/component";
import "./plugin-network/component";
import "./plugin-percpu/component";
import "./plugin-ports/component";
import "./plugin-process/component";
import "./plugin-processcount/component";
import "./plugin-processlist/component";
import "./plugin-quicklook/component";
import "./plugin-raid/component";
import "./plugin-sensors/component";
import "./plugin-system/component";
import "./plugin-uptime/component";
import "./plugin-wifi/component";

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginAlert', {
import GlancesPluginAlertController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginAlert", {
controller: GlancesPluginAlertController, controller: GlancesPluginAlertController,
controllerAs: 'vm', controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-alert/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginAlertController($scope, favicoService) { function GlancesPluginAlertController($scope, favicoService) {
var vm = this; var vm = this;
var _alerts = []; var _alerts = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginAmps', {
import GlancesPluginAmpsController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginAmps", {
controller: GlancesPluginAmpsController, controller: GlancesPluginAmpsController,
controllerAs: 'vm', controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-amps/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginAmpsController($scope, GlancesStats, favicoService) { function GlancesPluginAmpsController($scope, GlancesStats, favicoService) {
var vm = this; var vm = this;
vm.processes = []; vm.processes = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginCloud', {
import GlancesPluginCloudController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginCloud", {
controller: GlancesPluginCloudController, controller: GlancesPluginCloudController,
controllerAs: 'vm', controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-cloud/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginCloudController($scope, GlancesStats) { function GlancesPluginCloudController($scope, GlancesStats) {
var vm = this; var vm = this;
vm.provider = null; vm.provider = null;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginCpu', {
import GlancesPluginCpuController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginCpu", {
controller: GlancesPluginCpuController, controller: GlancesPluginCpuController,
controllerAs: 'vm', controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-cpu/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginCpuController($scope, GlancesStats) { function GlancesPluginCpuController($scope, GlancesStats) {
var vm = this; var vm = this;
var _view = {}; var _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginDiskio', {
import GlancesPluginDiskioController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginDiskio", {
controller: GlancesPluginDiskioController, controller: GlancesPluginDiskioController,
controllerAs: 'vm', controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-diskio/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginDiskioController($scope, $filter, GlancesStats, ARGUMENTS) { function GlancesPluginDiskioController($scope, $filter, GlancesStats, ARGUMENTS) {
var vm = this; var vm = this;
vm.arguments = ARGUMENTS; vm.arguments = ARGUMENTS;
vm.disks = []; vm.disks = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginDocker', {
import GlancesPluginDockerController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginDocker", {
controller: GlancesPluginDockerController, controller: GlancesPluginDockerController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-docker/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginDockerController($scope, GlancesStats) { function GlancesPluginDockerController($scope, GlancesStats) {
var vm = this; var vm = this;
vm.containers = []; vm.containers = [];
vm.version = null; vm.version = null;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginFolders', {
import GlancesPluginFsController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginFolders", {
controller: GlancesPluginFsController, controller: GlancesPluginFsController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-folders/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginFoldersController($scope, GlancesStats) { function GlancesPluginFoldersController($scope, GlancesStats) {
var vm = this; var vm = this;
vm.folders = []; vm.folders = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginFs', {
import GlancesPluginFsController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginFs", {
controller: GlancesPluginFsController, controller: GlancesPluginFsController,
controllerAs: 'vm', controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-fs/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginFsController($scope, $filter, GlancesStats, ARGUMENTS) { function GlancesPluginFsController($scope, $filter, GlancesStats, ARGUMENTS) {
var vm = this; var vm = this;
var _view = {}; var _view = {};
vm.arguments = ARGUMENTS; vm.arguments = ARGUMENTS;
@ -26,7 +27,7 @@ export default function GlancesPluginFsController($scope, $filter, GlancesStats,
shortMountPoint = '_' + fsData['mnt_point'].slice(-8); shortMountPoint = '_' + fsData['mnt_point'].slice(-8);
} }
vm.fileSystems.push({ vm.fileSystems.push(fs = {
'name': fsData['device_name'], 'name': fsData['device_name'],
'mountPoint': fsData['mnt_point'], 'mountPoint': fsData['mnt_point'],
'shortMountPoint': shortMountPoint, 'shortMountPoint': shortMountPoint,

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginGpu', {
import GlancesPluginGpuController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginGpu", {
controller: GlancesPluginGpuController, controller: GlancesPluginGpuController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-gpu/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginGpuController($scope, GlancesStats, ARGUMENTS) { function GlancesPluginGpuController($scope, GlancesStats, ARGUMENTS) {
var vm = this; var vm = this;
vm.arguments = ARGUMENTS; vm.arguments = ARGUMENTS;
var _view = {}; var _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginIp', {
import GlancesPluginIpController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginIp", {
controller: GlancesPluginIpController, controller: GlancesPluginIpController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-ip/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginIpController($scope, GlancesStats, ARGUMENTS) { function GlancesPluginIpController($scope, GlancesStats, ARGUMENTS) {
var vm = this; var vm = this;
vm.arguments = ARGUMENTS; vm.arguments = ARGUMENTS;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginIrq', {
import GlancesPluginIrqController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginIrq", {
controller: GlancesPluginIrqController, controller: GlancesPluginIrqController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-irq/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginIrqController($scope, GlancesStats) { function GlancesPluginIrqController($scope, GlancesStats) {
var vm = this; var vm = this;
vm.irqs = []; vm.irqs = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginLoad', {
import GlancesPluginLoadController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginLoad", {
controller: GlancesPluginLoadController, controller: GlancesPluginLoadController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-load/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginLoadController($scope, GlancesStats) { function GlancesPluginLoadController($scope, GlancesStats) {
var vm = this; var vm = this;
var _view = {}; var _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginMemMore', {
import GlancesPluginMemMoreController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginMemMore", {
controller: GlancesPluginMemMoreController, controller: GlancesPluginMemMoreController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-mem-more/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginMemMoreController($scope, GlancesStats) { function GlancesPluginMemMoreController($scope, GlancesStats) {
var vm = this; var vm = this;
vm.active = null; vm.active = null;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginMem', {
import GlancesPluginMemController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginMem", {
controller: GlancesPluginMemController, controller: GlancesPluginMemController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-mem/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginMemController($scope, GlancesStats) { function GlancesPluginMemController($scope, GlancesStats) {
var vm = this; var vm = this;
var _view = {}; var _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginMemswap', {
import GlancesPluginMemswapController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginMemswap", {
controller: GlancesPluginMemswapController, controller: GlancesPluginMemswapController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-memswap/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginMemswapController($scope, GlancesStats) { function GlancesPluginMemswapController($scope, GlancesStats) {
var vm = this; var vm = this;
var _view = {}; var _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginNetwork', {
import GlancesPluginNetworkController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginNetwork", {
controller: GlancesPluginNetworkController, controller: GlancesPluginNetworkController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-network/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginNetworkController($scope, $filter, GlancesStats, ARGUMENTS) { function GlancesPluginNetworkController($scope, $filter, GlancesStats, ARGUMENTS) {
var vm = this; var vm = this;
vm.arguments = ARGUMENTS; vm.arguments = ARGUMENTS;
vm.networks = []; vm.networks = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginPercpu', {
import GlancesPluginPercpuController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginPercpu", {
controller: GlancesPluginPercpuController, controller: GlancesPluginPercpuController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-percpu/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginPercpuController($scope, GlancesStats, GlancesPluginHelper) { function GlancesPluginPercpuController($scope, GlancesStats, GlancesPluginHelper) {
var vm = this; var vm = this;
vm.cpus = []; vm.cpus = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginPorts', {
import GlancesPluginPortsController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginPorts", {
controller: GlancesPluginPortsController, controller: GlancesPluginPortsController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-ports/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginPortsController($scope, GlancesStats) { function GlancesPluginPortsController($scope, GlancesStats) {
var vm = this; var vm = this;
vm.ports = []; vm.ports = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginProcess', {
import GlancesPluginProcessController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginProcess", {
controller: GlancesPluginProcessController, controller: GlancesPluginProcessController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-process/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginProcessController(ARGUMENTS, hotkeys) { function GlancesPluginProcessController(ARGUMENTS, hotkeys) {
var vm = this; var vm = this;
vm.arguments = ARGUMENTS; vm.arguments = ARGUMENTS;

View File

@ -1,14 +1,10 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginProcesscount', {
import GlancesPluginProcesscountController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginProcesscount", {
controller: GlancesPluginProcesscountController, controller: GlancesPluginProcesscountController,
controllerAs: "vm", controllerAs: 'vm',
bindings: { bindings: {
sorter: "<" sorter: '<'
}, },
templateUrl: template, templateUrl: 'components/plugin-processcount/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginProcesscountController($scope, GlancesStats) { function GlancesPluginProcesscountController($scope, GlancesStats) {
var vm = this; var vm = this;
vm.total = null; vm.total = null;

View File

@ -1,14 +1,10 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginProcesslist', {
import GlancesPluginProcesslistController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginProcesslist", {
controller: GlancesPluginProcesslistController, controller: GlancesPluginProcesslistController,
controllerAs: "vm", controllerAs: 'vm',
bindings: { bindings: {
sorter: "<" sorter: '<'
}, },
templateUrl: template, templateUrl: 'components/plugin-processlist/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginProcesslistController($scope, GlancesStats, GlancesPluginHelper, $filter, CONFIG, ARGUMENTS) { function GlancesPluginProcesslistController($scope, GlancesStats, GlancesPluginHelper, $filter, CONFIG, ARGUMENTS) {
var vm = this; var vm = this;
vm.arguments = ARGUMENTS; vm.arguments = ARGUMENTS;
vm.processes = []; vm.processes = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginQuicklook', {
import GlancesPluginQuicklookController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginQuicklook", {
controller: GlancesPluginQuicklookController, controller: GlancesPluginQuicklookController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-quicklook/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginQuicklookController($scope, GlancesStats, ARGUMENTS) { function GlancesPluginQuicklookController($scope, GlancesStats, ARGUMENTS) {
var vm = this; var vm = this;
vm.arguments = ARGUMENTS; vm.arguments = ARGUMENTS;
var _view = {}; var _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginRaid', {
import GlancesPluginRaidController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginRaid", {
controller: GlancesPluginRaidController, controller: GlancesPluginRaidController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-raid/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginRaidController($scope, GlancesStats) { function GlancesPluginRaidController($scope, GlancesStats) {
var vm = this; var vm = this;
vm.disks = []; vm.disks = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginSensors', {
import GlancesPluginSensorsController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginSensors", {
controller: GlancesPluginSensorsController, controller: GlancesPluginSensorsController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-sensors/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginSensorsController($scope, GlancesStats, GlancesPluginHelper, ARGUMENTS) { function GlancesPluginSensorsController($scope, GlancesStats, GlancesPluginHelper, ARGUMENTS) {
var vm = this; var vm = this;
vm.sensors = []; vm.sensors = [];
var convertToFahrenheit = ARGUMENTS.fahrenheit; var convertToFahrenheit = ARGUMENTS.fahrenheit;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginSystem', {
import GlancesPluginSystemController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginSystem", {
controller: GlancesPluginSystemController, controller: GlancesPluginSystemController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-system/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginSystemController($scope, GlancesStats) { function GlancesPluginSystemController($scope, GlancesStats) {
var vm = this; var vm = this;
vm.hostname = null; vm.hostname = null;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginUptime', {
import GlancesPluginUptimeController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginUptime", {
controller: GlancesPluginUptimeController, controller: GlancesPluginUptimeController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-uptime/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginUptimeController($scope, GlancesStats) { function GlancesPluginUptimeController($scope, GlancesStats) {
var vm = this; var vm = this;
vm.value = null; vm.value = null;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular"; glancesApp.component('glancesPluginWifi', {
import GlancesPluginWifiController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginWifi", {
controller: GlancesPluginWifiController, controller: GlancesPluginWifiController,
controllerAs: "vm", controllerAs: 'vm',
templateUrl: template, templateUrl: 'components/plugin-wifi/view.html'
}); });

View File

@ -1,5 +1,6 @@
'use strict';
export default function GlancesPluginWifiController($scope, $filter, GlancesStats) { function GlancesPluginWifiController($scope, $filter, GlancesStats) {
var vm = this; var vm = this;
var _view = {}; var _view = {};

View File

@ -1,7 +1,4 @@
glancesApp.directive("sortableTh", function () {
import angular from "angular";
export default angular.module("glancesApp").directive("sortableTh", function () {
return { return {
restrict: 'A', restrict: 'A',
scope: { scope: {

View File

@ -1,8 +1,4 @@
glancesApp.filter('min_size', function () {
import angular from "angular";
import _ from "lodash";
function minSizeFilter() {
return function (input, max) { return function (input, max) {
var max = max || 8; var max = max || 8;
if (input.length > max) { if (input.length > max) {
@ -10,18 +6,17 @@ function minSizeFilter() {
} }
return input return input
}; };
} });
glancesApp.filter('exclamation', function () {
function exclamationFilter() {
return function (input) { return function (input) {
if (input === undefined || input === '') { if (input === undefined || input === '') {
return '?'; return '?';
} }
return input; return input;
}; };
} });
function bytesFilter() { glancesApp.filter('bytes', function () {
return function (bytes, low_precision) { return function (bytes, low_precision) {
low_precision = low_precision || false; low_precision = low_precision || false;
if (isNaN(parseFloat(bytes)) || !isFinite(bytes) || bytes == 0) { if (isNaN(parseFloat(bytes)) || !isFinite(bytes) || bytes == 0) {
@ -73,24 +68,24 @@ function bytesFilter() {
return bytes.toFixed(0); return bytes.toFixed(0);
} }
} });
function bitsFilter($filter) { glancesApp.filter('bits', function ($filter) {
return function (bits, low_precision) { return function (bits, low_precision) {
bits = Math.round(bits) * 8; bits = Math.round(bits) * 8;
return $filter('bytes')(bits, low_precision) + 'b'; return $filter('bytes')(bits, low_precision) + 'b';
} }
} });
function leftPadFilter() { glancesApp.filter('leftPad', function () {
return function (value, length, chars) { return function (value, length, chars) {
length = length || 0; length = length || 0;
chars = chars || ' '; chars = chars || ' ';
return _.padStart(value, length, chars); return _.padStart(value, length, chars);
} }
} });
function timemillisFilter() { glancesApp.filter('timemillis', function () {
return function (array) { return function (array) {
var sum = 0.0; var sum = 0.0;
for (var i = 0; i < array.length; i++) { for (var i = 0; i < array.length; i++) {
@ -98,9 +93,9 @@ function timemillisFilter() {
} }
return sum; return sum;
} }
} });
function timedeltaFilter($filter) { glancesApp.filter('timedelta', function ($filter) {
return function (value) { return function (value) {
var sum = $filter('timemillis')(value); var sum = $filter('timemillis')(value);
var d = new Date(sum); var d = new Date(sum);
@ -112,13 +107,4 @@ function timedeltaFilter($filter) {
milliseconds: parseInt("" + d.getUTCMilliseconds() / 10) milliseconds: parseInt("" + d.getUTCMilliseconds() / 10)
}; };
} }
} });
export default angular.module("glancesApp")
.filter("min_size", minSizeFilter)
.filter("exclamation", exclamationFilter)
.filter("bytes", bytesFilter)
.filter("bits", bitsFilter)
.filter("leftPad", leftPadFilter)
.filter("timemillis", timemillisFilter)
.filter("timedelta", timedeltaFilter);

View File

@ -1,23 +0,0 @@
import angular from "angular";
import "angular-hotkeys";
export default angular.module("glancesApp", ["glances.config", "cfp.hotkeys"])
.value("CONFIG", {})
.value("ARGUMENTS", {})
.config(function (hotkeysProvider) {
hotkeysProvider.useNgRoute = false;
hotkeysProvider.includeCheatSheet = false;
})
.run(function ($rootScope, GlancesStats) {
$rootScope.title = "Glances";
$rootScope.$on("data_refreshed", function (event, data) {
$rootScope.title = `${data.stats.system.hostname} - Glances`;
});
GlancesStats.init();
});

View File

@ -1,11 +1,7 @@
glancesApp.service('favicoService', function () {
import angular from "angular";
import Favico from "favico.js";
function favicoService () {
var favico = new Favico({ var favico = new Favico({
animation: "none" animation: 'none'
}); });
this.badge = function (nb) { this.badge = function (nb) {
@ -15,6 +11,4 @@ function favicoService () {
this.reset = function () { this.reset = function () {
favico.reset(); favico.reset();
}; };
} });
export default angular.module("glancesApp").service("favicoService", favicoService);

View File

@ -1,4 +0,0 @@
import "./stats";
import "./plugin_helper";
import "./favicon";

View File

@ -1,7 +1,4 @@
glancesApp.service('GlancesPluginHelper', function () {
import angular from "angular";
function GlancesPluginHelper () {
var plugin = { var plugin = {
'limits': {}, 'limits': {},
@ -42,6 +39,4 @@ function GlancesPluginHelper () {
}; };
return plugin; return plugin;
} });
export default angular.module("glancesApp").service("GlancesPluginHelper", GlancesPluginHelper);

View File

@ -1,7 +1,4 @@
glancesApp.service('GlancesStats', function ($http, $q, $rootScope, $timeout, GlancesPluginHelper, REFRESH_TIME, CONFIG, ARGUMENTS) {
import angular from "angular";
function GlancesStats ($http, $q, $rootScope, $timeout, GlancesPluginHelper, REFRESH_TIME, CONFIG, ARGUMENTS) {
var _data = false; var _data = false;
@ -68,6 +65,4 @@ function GlancesStats ($http, $q, $rootScope, $timeout, GlancesPluginHelper, REF
return response.data; return response.data;
}); });
}; };
} });
export default angular.module("glancesApp").service("GlancesStats", GlancesStats);

File diff suppressed because it is too large Load Diff

View File

@ -1,32 +1,19 @@
{ {
"private": true, "private": true,
"dependencies": { "dependencies": {},
"angular": "^1.5.8",
"angular-hotkeys": "^1.7.0",
"bootstrap": "^3.3.5",
"favico.js": "^0.3.10",
"lodash": "^4.13.1"
},
"devDependencies": { "devDependencies": {
"bower": "^1.8.0", "bower": "^1.8.0",
"clean-webpack-plugin": "^0.1.18",
"copy-webpack-plugin": "^4.4.1",
"css-loader": "^0.28.9",
"del": "^2.2.1", "del": "^2.2.1",
"exports-loader": "^0.7.0", "gulp": "^3.9.1",
"file-loader": "^1.1.6", "gulp-angular-templatecache": "^2.0.0",
"html-loader": "^0.5.5", "gulp-concat": "^2.6.0",
"less": "^3.0.1", "gulp-ng-annotate": "^2.0.0",
"less-loader": "^4.0.5", "gulp-rename": "^1.2.2",
"ngtemplate-loader": "^2.0.1", "main-bower-files": "^2.13.1"
"node-sass": "^4.7.2",
"sass-loader": "^6.0.6",
"style-loader": "^0.20.1",
"url-loader": "^0.6.2",
"webpack": "^3.11.0"
}, },
"scripts": { "scripts": {
"build": "webpack --bail --progress --profile", "build": "gulp build",
"watch": "webpack --bail --progress --profile --watch" "watch": "gulp watch",
"postinstall": "bower install"
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -7,12 +7,18 @@
<title ng-bind="title">Glances</title> <title ng-bind="title">Glances</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="icon" type="image/x-icon" href="favicon.ico" />
<script type="text/javascript" src="glances.js"></script> <link rel="stylesheet" type="text/css" href="css/normalize.min.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="css/style.min.css" />
<script type="text/javascript" src="js/vendor.min.js"></script>
<script> <script>
angular angular
.module('glances.config', []) .module('glances.config', [])
.constant('REFRESH_TIME', {{ refresh_time }}); .constant('REFRESH_TIME', {{ refresh_time }});
</script> </script>
<script type="text/javascript" src="js/main.min.js"></script>
<script type="text/javascript" src="js/templates.min.js"></script>
</head> </head>
<body> <body>

View File

@ -1,61 +0,0 @@
const webpack = require("webpack");
const path = require("path");
const CleanWebpackPlugin = require("clean-webpack-plugin");
module.exports = {
entry: "./js/app.js",
output: {
path: path.join(__dirname, "public"),
filename: "glances.js",
sourceMapFilename: "glances.map.js",
},
devtool: "#source-map",
module: {
loaders: [
{
test: /\.scss$/,
use: [{
loader: "style-loader",
}, {
loader: "css-loader",
}, {
loader: "sass-loader",
}]
},
{
test: /\.less$/,
use: [{
loader: "style-loader",
}, {
loader: "css-loader",
}, {
loader: "less-loader",
}]
},
{
test: /\.css$/,
loader: "style-loader!css-loader",
},
{
test: /\.(png|jpg|gif|svg|ttf|woff|woff2|eot)$/,
loader: "url-loader",
options: {
limit: 10000,
}
},
{
test: /\.html/,
loader: "ngtemplate-loader!html-loader"
},
{
test: require.resolve("angular"),
loader: "exports-loader?window.angular"
},
],
},
plugins: [
new CleanWebpackPlugin("./public/*.*"),
]
};

File diff suppressed because it is too large Load Diff