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?
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.
## Install dependencies
You can use yarn or npm:
```bash
$ yarn
```
or:
```bash
$ 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;
}
#quicklook-plugin {
.progress {
#quicklook-plugin .progress {
margin-bottom: 0px;
min-width: 100px;
background-color: #000;
height: 12px;
border-radius: 0px;
text-align: right;
}
.progress-bar-ok {
}
#quicklook-plugin .progress-bar-ok {
background-color: #3E7B04;
}
.progress-bar-careful {
}
#quicklook-plugin .progress-bar-careful {
background-color: #295183;
}
.progress-bar-warning {
}
#quicklook-plugin .progress-bar-warning {
background-color: #5D4062;
}
.progress-bar-critical {
}
#quicklook-plugin .progress-bar-critical {
background-color: #A30000;
}
.cpu-name {
}
#quicklook-plugin .cpu-name {
white-space: nowrap;
overflow: hidden;
width: 100%;
text-overflow: ellipsis;
}
}
#amps-plugin .process-result {
max-width: 300px;
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";
import "../css/style.scss";
.value('CONFIG', {})
.value('ARGUMENTS', {})
import "./module";
import "./services";
import "./components";
import "./filters";
.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 @@
'use strict';
import angular from "angular";
import GlancesController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glances", {
glancesApp.component('glances', {
controller: GlancesController,
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;
vm.dataLoaded = false;
vm.arguments = ARGUMENTS;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesHelpController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesHelp", {
glancesApp.component('glancesHelp', {
controller: GlancesHelpController,
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;
$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";
import GlancesPluginAlertController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginAlert", {
glancesApp.component('glancesPluginAlert', {
controller: GlancesPluginAlertController,
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 _alerts = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginAmpsController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginAmps", {
glancesApp.component('glancesPluginAmps', {
controller: GlancesPluginAmpsController,
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;
vm.processes = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginCloudController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginCloud", {
glancesApp.component('glancesPluginCloud', {
controller: GlancesPluginCloudController,
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;
vm.provider = null;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginCpuController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginCpu", {
glancesApp.component('glancesPluginCpu', {
controller: GlancesPluginCpuController,
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 _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginDiskioController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginDiskio", {
glancesApp.component('glancesPluginDiskio', {
controller: GlancesPluginDiskioController,
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;
vm.arguments = ARGUMENTS;
vm.disks = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginDockerController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginDocker", {
glancesApp.component('glancesPluginDocker', {
controller: GlancesPluginDockerController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.containers = [];
vm.version = null;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginFsController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginFolders", {
glancesApp.component('glancesPluginFolders', {
controller: GlancesPluginFsController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.folders = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginFsController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginFs", {
glancesApp.component('glancesPluginFs', {
controller: GlancesPluginFsController,
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 _view = {};
vm.arguments = ARGUMENTS;
@ -26,7 +27,7 @@ export default function GlancesPluginFsController($scope, $filter, GlancesStats,
shortMountPoint = '_' + fsData['mnt_point'].slice(-8);
}
vm.fileSystems.push({
vm.fileSystems.push(fs = {
'name': fsData['device_name'],
'mountPoint': fsData['mnt_point'],
'shortMountPoint': shortMountPoint,

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginGpuController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginGpu", {
glancesApp.component('glancesPluginGpu', {
controller: GlancesPluginGpuController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.arguments = ARGUMENTS;
var _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginIpController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginIp", {
glancesApp.component('glancesPluginIp', {
controller: GlancesPluginIpController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.arguments = ARGUMENTS;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginIrqController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginIrq", {
glancesApp.component('glancesPluginIrq', {
controller: GlancesPluginIrqController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.irqs = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginLoadController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginLoad", {
glancesApp.component('glancesPluginLoad', {
controller: GlancesPluginLoadController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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 _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginMemMoreController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginMemMore", {
glancesApp.component('glancesPluginMemMore', {
controller: GlancesPluginMemMoreController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.active = null;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginMemController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginMem", {
glancesApp.component('glancesPluginMem', {
controller: GlancesPluginMemController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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 _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginMemswapController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginMemswap", {
glancesApp.component('glancesPluginMemswap', {
controller: GlancesPluginMemswapController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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 _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginNetworkController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginNetwork", {
glancesApp.component('glancesPluginNetwork', {
controller: GlancesPluginNetworkController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.arguments = ARGUMENTS;
vm.networks = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginPercpuController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginPercpu", {
glancesApp.component('glancesPluginPercpu', {
controller: GlancesPluginPercpuController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.cpus = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginPortsController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginPorts", {
glancesApp.component('glancesPluginPorts', {
controller: GlancesPluginPortsController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.ports = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginProcessController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginProcess", {
glancesApp.component('glancesPluginProcess', {
controller: GlancesPluginProcessController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.arguments = ARGUMENTS;

View File

@ -1,14 +1,10 @@
'use strict';
import angular from "angular";
import GlancesPluginProcesscountController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginProcesscount", {
glancesApp.component('glancesPluginProcesscount', {
controller: GlancesPluginProcesscountController,
controllerAs: "vm",
controllerAs: 'vm',
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;
vm.total = null;

View File

@ -1,14 +1,10 @@
'use strict';
import angular from "angular";
import GlancesPluginProcesslistController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginProcesslist", {
glancesApp.component('glancesPluginProcesslist', {
controller: GlancesPluginProcesslistController,
controllerAs: "vm",
controllerAs: 'vm',
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;
vm.arguments = ARGUMENTS;
vm.processes = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginQuicklookController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginQuicklook", {
glancesApp.component('glancesPluginQuicklook', {
controller: GlancesPluginQuicklookController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.arguments = ARGUMENTS;
var _view = {};

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginRaidController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginRaid", {
glancesApp.component('glancesPluginRaid', {
controller: GlancesPluginRaidController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.disks = [];

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginSensorsController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginSensors", {
glancesApp.component('glancesPluginSensors', {
controller: GlancesPluginSensorsController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.sensors = [];
var convertToFahrenheit = ARGUMENTS.fahrenheit;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginSystemController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginSystem", {
glancesApp.component('glancesPluginSystem', {
controller: GlancesPluginSystemController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.hostname = null;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginUptimeController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginUptime", {
glancesApp.component('glancesPluginUptime', {
controller: GlancesPluginUptimeController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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;
vm.value = null;

View File

@ -1,11 +1,7 @@
'use strict';
import angular from "angular";
import GlancesPluginWifiController from "./controller";
import template from "./view.html";
export default angular.module("glancesApp").component("glancesPluginWifi", {
glancesApp.component('glancesPluginWifi', {
controller: GlancesPluginWifiController,
controllerAs: "vm",
templateUrl: template,
controllerAs: 'vm',
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 _view = {};

View File

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

View File

@ -1,8 +1,4 @@
import angular from "angular";
import _ from "lodash";
function minSizeFilter() {
glancesApp.filter('min_size', function () {
return function (input, max) {
var max = max || 8;
if (input.length > max) {
@ -10,18 +6,17 @@ function minSizeFilter() {
}
return input
};
}
function exclamationFilter() {
});
glancesApp.filter('exclamation', function () {
return function (input) {
if (input === undefined || input === '') {
return '?';
}
return input;
};
}
});
function bytesFilter() {
glancesApp.filter('bytes', function () {
return function (bytes, low_precision) {
low_precision = low_precision || false;
if (isNaN(parseFloat(bytes)) || !isFinite(bytes) || bytes == 0) {
@ -73,24 +68,24 @@ function bytesFilter() {
return bytes.toFixed(0);
}
}
});
function bitsFilter($filter) {
glancesApp.filter('bits', function ($filter) {
return function (bits, low_precision) {
bits = Math.round(bits) * 8;
return $filter('bytes')(bits, low_precision) + 'b';
}
}
});
function leftPadFilter() {
glancesApp.filter('leftPad', function () {
return function (value, length, chars) {
length = length || 0;
chars = chars || ' ';
return _.padStart(value, length, chars);
}
}
});
function timemillisFilter() {
glancesApp.filter('timemillis', function () {
return function (array) {
var sum = 0.0;
for (var i = 0; i < array.length; i++) {
@ -98,9 +93,9 @@ function timemillisFilter() {
}
return sum;
}
}
});
function timedeltaFilter($filter) {
glancesApp.filter('timedelta', function ($filter) {
return function (value) {
var sum = $filter('timemillis')(value);
var d = new Date(sum);
@ -112,13 +107,4 @@ function timedeltaFilter($filter) {
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 @@
import angular from "angular";
import Favico from "favico.js";
function favicoService () {
glancesApp.service('favicoService', function () {
var favico = new Favico({
animation: "none"
animation: 'none'
});
this.badge = function (nb) {
@ -15,6 +11,4 @@ function favicoService () {
this.reset = function () {
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 @@
import angular from "angular";
function GlancesPluginHelper () {
glancesApp.service('GlancesPluginHelper', function () {
var plugin = {
'limits': {},
@ -42,6 +39,4 @@ function GlancesPluginHelper () {
};
return plugin;
}
export default angular.module("glancesApp").service("GlancesPluginHelper", GlancesPluginHelper);
});

View File

@ -1,7 +1,4 @@
import angular from "angular";
function GlancesStats ($http, $q, $rootScope, $timeout, GlancesPluginHelper, REFRESH_TIME, CONFIG, ARGUMENTS) {
glancesApp.service('GlancesStats', function ($http, $q, $rootScope, $timeout, GlancesPluginHelper, REFRESH_TIME, CONFIG, ARGUMENTS) {
var _data = false;
@ -68,6 +65,4 @@ function GlancesStats ($http, $q, $rootScope, $timeout, GlancesPluginHelper, REF
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,
"dependencies": {
"angular": "^1.5.8",
"angular-hotkeys": "^1.7.0",
"bootstrap": "^3.3.5",
"favico.js": "^0.3.10",
"lodash": "^4.13.1"
},
"dependencies": {},
"devDependencies": {
"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",
"exports-loader": "^0.7.0",
"file-loader": "^1.1.6",
"html-loader": "^0.5.5",
"less": "^3.0.1",
"less-loader": "^4.0.5",
"ngtemplate-loader": "^2.0.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"
"gulp": "^3.9.1",
"gulp-angular-templatecache": "^2.0.0",
"gulp-concat": "^2.6.0",
"gulp-ng-annotate": "^2.0.0",
"gulp-rename": "^1.2.2",
"main-bower-files": "^2.13.1"
},
"scripts": {
"build": "webpack --bail --progress --profile",
"watch": "webpack --bail --progress --profile --watch"
"build": "gulp build",
"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>
<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>
angular
.module('glances.config', [])
.constant('REFRESH_TIME', {{ refresh_time }});
</script>
<script type="text/javascript" src="js/main.min.js"></script>
<script type="text/javascript" src="js/templates.min.js"></script>
</head>
<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