mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-22 16:51:35 +03:00
Init big refactoring of the web ui to move to components
This commit is contained in:
parent
5b3b7984e7
commit
27184adc6d
@ -41,8 +41,8 @@ gulp.task('build-js', function() {
|
||||
});
|
||||
|
||||
gulp.task('template', function () {
|
||||
return gulp.src('./html/plugins/*.html')
|
||||
.pipe(templateCache('templates.js', {'root': 'plugins/', 'module': 'glancesApp'}))
|
||||
return gulp.src('./js/components/**/*.html')
|
||||
.pipe(templateCache('templates.js', {'root': 'components/', 'module': 'glancesApp'}))
|
||||
.pipe(rename({suffix: '.min'}))
|
||||
.pipe(gulp.dest('./public/js'));
|
||||
});
|
||||
|
@ -1,7 +0,0 @@
|
||||
<div class="table">
|
||||
<div class="table-row" ng-repeat="alert in statsAlert.getAlerts()">
|
||||
<div class="table-cell text-left">
|
||||
{{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}})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,2 +0,0 @@
|
||||
<span class="title" ng-show="!statsAlert.hasAlerts()">No warning or critical alert detected</span>
|
||||
<span class="title" ng-show="statsAlert.hasAlerts()">Warning or critical alerts (lasts {{statsAlert.count()}} entries)</span>
|
@ -1,7 +0,0 @@
|
||||
<div class="table">
|
||||
<div class="table-row" ng-repeat="process in statsAmps.processes">
|
||||
<div class="table-cell text-left" ng-class="statsAmps.getDescriptionDecoration(process)">{{ process.name }}</div>
|
||||
<div class="table-cell text-left">{{ process.count }}</div>
|
||||
<div class="table-cell text-left process-result">{{ process.result }}</div>
|
||||
</div>
|
||||
</div>
|
@ -1 +0,0 @@
|
||||
<span class="title">{{ statsCloud.getProvider() }}</span> {{ statsCloud.getInstance() }}
|
@ -1,16 +0,0 @@
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">DISK I/O</div>
|
||||
<div class="table-cell" ng-show="!arguments.diskio_iops">R/s</div>
|
||||
<div class="table-cell" ng-show="!arguments.diskio_iops">W/s</div>
|
||||
|
||||
<div class="table-cell" ng-show="arguments.diskio_iops">IOR/s</div>
|
||||
<div class="table-cell" ng-show="arguments.diskio_iops">IOW/s</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="disk in statsDiskio.disks">
|
||||
<div class="table-cell text-left">{{(disk.alias ? disk.alias : disk.name) | min_size}}</div>
|
||||
<div class="table-cell" ng-show="!arguments.diskio_iops">{{disk.bitrate.txps }}</div>
|
||||
<div class="table-cell" ng-show="!arguments.diskio_iops">{{disk.bitrate.rxps }}</div>
|
||||
|
||||
<div class="table-cell" ng-show="arguments.diskio_iops">{{disk.count.txps }}</div>
|
||||
<div class="table-cell" ng-show="arguments.diskio_iops">{{disk.count.rxps }}</div>
|
||||
</div>
|
@ -1,26 +0,0 @@
|
||||
<span class="title">CONTAINERS</span> {{ statsDocker.containers.length }} (served by Docker {{ statsDocker.version }})
|
||||
|
||||
<div class="table">
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">Name</div>
|
||||
<div class="table-cell">Status</div>
|
||||
<div class="table-cell">CPU%</div>
|
||||
<div class="table-cell">MEM</div>
|
||||
<div class="table-cell">IOR/s</div>
|
||||
<div class="table-cell">IOW/s</div>
|
||||
<div class="table-cell">RX/s</div>
|
||||
<div class="table-cell">TX/s</div>
|
||||
<div class="table-cell text-left">Command</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="container in statsDocker.containers">
|
||||
<div class="table-cell text-left">{{ container.name }}</div>
|
||||
<div class="table-cell" ng-class="container.status == 'Paused' ? 'careful' : 'ok'">{{ container.status }}</div>
|
||||
<div class="table-cell">{{ container.cpu | number:1 }}</div>
|
||||
<div class="table-cell">{{ container.memory | bytes }}</div>
|
||||
<div class="table-cell">{{ container.ior / container.io_time_since_update | bits }}</div>
|
||||
<div class="table-cell">{{ container.iow / container.io_time_since_update | bits }}</div>
|
||||
<div class="table-cell">{{ container.rx / container.net_time_since_update | bits }}</div>
|
||||
<div class="table-cell">{{ container.tx / container.net_time_since_update | bits }}</div>
|
||||
<div class="table-cell text-left">{{ container.command }}</div>
|
||||
</div>
|
||||
</div>
|
@ -1,8 +0,0 @@
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">FOLDERS</div>
|
||||
<div class="table-cell">Size</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="folder in statsFolders.folders">
|
||||
<div class="table-cell text-left">{{ folder.path }}</div>
|
||||
<div class="table-cell" ng-class="statsFolders.getDecoration(folder)">{{ folder.size | bytes }}</div>
|
||||
</div>
|
@ -1,16 +0,0 @@
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">FILE SYS</div>
|
||||
<div class="table-cell">
|
||||
<span ng-show="!arguments.fs_free_space">Used</span>
|
||||
<span ng-show="arguments.fs_free_space">Free</span>
|
||||
</div>
|
||||
<div class="table-cell">Total</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="fs in statsFs.fileSystems | orderBy: 'mnt_point'">
|
||||
<div class="table-cell text-left">{{ fs.shortMountPoint }} <span class="visible-lg-inline" ng-show="fs.name.length <= 20">({{ fs.name }})<span></div>
|
||||
<div class="table-cell" ng-class="statsFs.getDecoration(fs.mountPoint, 'used')">
|
||||
<span ng-show="!arguments.fs_free_space">{{ fs.used | bytes }}</span>
|
||||
<span ng-show="arguments.fs_free_space">{{ fs.free | bytes }}</span>
|
||||
</div>
|
||||
<div class="table-cell">{{ fs.size | bytes }}</div>
|
||||
</div>
|
@ -1,25 +0,0 @@
|
||||
<div class="gpu-name title">
|
||||
{{ statsGpu.name }}
|
||||
</div>
|
||||
<div class="table">
|
||||
<div class="table-row" ng-if="arguments.meangpu || statsGpu.gpus.length === 1">
|
||||
<div class="table-cell text-left">proc:</div>
|
||||
<div class="table-cell" ng-class="statsGpu.getMeanDecoration('proc')" ng-if="statsGpu.mean.proc">{{ statsGpu.mean.proc | number : 0 }}%</div>
|
||||
<div class="table-cell" ng-if="!statsGpu.mean.proc">N/A</div>
|
||||
</div>
|
||||
<div class="table-row" ng-if="arguments.meangpu || statsGpu.gpus.length === 1">
|
||||
<div class="table-cell text-left">mem:</div>
|
||||
<div class="table-cell" ng-class="statsGpu.getMeanDecoration('mem')" ng-if="statsGpu.mean.mem">{{ statsGpu.mean.mem | number : 0 }}%</div>
|
||||
<div class="table-cell" ng-if="!statsGpu.mean.mem">N/A</div>
|
||||
</div>
|
||||
<div class="table-row" ng-if="!arguments.meangpu && statsGpu.gpus.length > 1" ng-repeat="gpu in statsGpu.gpus">
|
||||
<div class="table-cell text-left">
|
||||
{{ gpu.gpu_id }}:
|
||||
<span ng-class="statsGpu.getDecoration(gpu.gpu_id, 'proc')" ng-if="gpu.proc">{{ gpu.proc | number : 0 }}%</span>
|
||||
<span ng-if="!gpu.proc">N/A</span>
|
||||
mem:
|
||||
<span ng-class="statsGpu.getDecoration(gpu.gpu_id, 'mem')" ng-if="gpu.mem">{{ gpu.mem | number : 0 }}%</span>
|
||||
<span ng-if="!gpu.mem">N/A</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1 +0,0 @@
|
||||
- <span class="title">IP</span> <span>{{ statsIp.address }}/{{ statsIp.maskCidr }}</span> <span ng-if="statsIp.publicAddress" class="title">Pub</span> <span>{{ statsIp.publicAddress }}</span>
|
@ -1,10 +0,0 @@
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">IRQ</div>
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell">Rate/s</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="irq in statsIrq.irqs">
|
||||
<div class="table-cell text-left">{{irq.irq_line}}</div>
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell"><span>{{irq.irq_rate}}</span></div>
|
||||
</div>
|
@ -1,24 +0,0 @@
|
||||
<div class="table">
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">LOAD</div>
|
||||
<div class="table-cell">{{ statsLoad.cpucore }}-core</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">1 min:</div>
|
||||
<div class="table-cell">
|
||||
{{ statsLoad.min1 | number : 2}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">5 min:</div>
|
||||
<div class="table-cell" ng-class="statsLoad.getDecoration('min5')">
|
||||
{{ statsLoad.min5 | number : 2}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">15 min:</div>
|
||||
<div class="table-cell" ng-class="statsLoad.getDecoration('min15')">
|
||||
{{ statsLoad.min15 | number : 2}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,20 +0,0 @@
|
||||
<div class="table">
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">MEM</div>
|
||||
<div class="table-cell">{{ statsMem.percent }}%</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">total:</div>
|
||||
<div class="table-cell">{{ statsMem.total | bytes }}</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">used:</div>
|
||||
<div class="table-cell" ng-class="statsMem.getDecoration('used')">
|
||||
{{ statsMem.used | bytes:2 }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">free:</div>
|
||||
<div class="table-cell">{{ statsMem.free | bytes }}</div>
|
||||
</div>
|
||||
</div>
|
@ -1,20 +0,0 @@
|
||||
<div class="table">
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">SWAP</div>
|
||||
<div class="table-cell">{{ statsMemSwap.percent }}%</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">total:</div>
|
||||
<div class="table-cell">{{ statsMemSwap.total | bytes }}</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">used:</div>
|
||||
<div class="table-cell" ng-class="statsMemSwap.getDecoration('used')">
|
||||
{{ statsMemSwap.used | bytes }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">free:</div>
|
||||
<div class="table-cell">{{ statsMemSwap.free | bytes }}</div>
|
||||
</div>
|
||||
</div>
|
@ -1,28 +0,0 @@
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">NETWORK</div>
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && !arguments.network_sum">Rx/s</div>
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && !arguments.network_sum">Tx/s</div>
|
||||
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && arguments.network_sum"></div>
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && arguments.network_sum">Rx+Tx/s</div>
|
||||
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">Rx</div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">Tx</div>
|
||||
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum"></div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum">Rx+Tx</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="network in statsNetwork.networks | orderBy: 'interfaceName'">
|
||||
<div class="table-cell text-left">{{ network.interfaceName | min_size }}</div>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<div class="table-cell" ng-show="!arguments.network_cumul && arguments.network_sum"></div>
|
||||
<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>
|
||||
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">{{ arguments.byte ? (network.cumulativeRx | bytes) : (network.cumulativeRx | bits) }}</div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && !arguments.network_sum">{{ arguments.byte ? (network.cumulativeTx | bytes) : (network.cumulativeTx | bits) }}</div>
|
||||
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum"></div>
|
||||
<div class="table-cell" ng-show="arguments.network_cumul && arguments.network_sum">{{ arguments.byte ? (network.cumulativeCx | bytes) : (network.cumulativeCx | bits) }}</div>
|
||||
</div>
|
@ -1,34 +0,0 @@
|
||||
<div class="table">
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">PER CPU</div>
|
||||
<div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus">{{ percpu.total }}%</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">user:</div>
|
||||
<div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus" ng-class="statsPerCpu.getUserAlert(percpu)">
|
||||
{{ percpu.user }}%
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">system:</div>
|
||||
<div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus" ng-class="statsPerCpu.getSystemAlert(percpu)">
|
||||
{{ percpu.system }}%
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">idle:</div>
|
||||
<div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus">{{ percpu.idle }}%</div>
|
||||
</div>
|
||||
<div class="table-row" ng-show="statsPerCpu.cpus[0].iowait">
|
||||
<div class="table-cell text-left">iowait:</div>
|
||||
<div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus" ng-class="statsPerCpu.getSystemAlert(percpu)">
|
||||
{{ percpu.iowait }}%
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row" ng-show="statsPerCpu.cpus[0].steal">
|
||||
<div class="table-cell text-left">steal:</div>
|
||||
<div class="table-cell" ng-repeat="percpu in statsPerCpu.cpus" ng-class="statsPerCpu.getSystemAlert(percpu)">
|
||||
{{ percpu.steal }}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,10 +0,0 @@
|
||||
<div class="table-row" ng-repeat="port in statsPorts.ports">
|
||||
<div class="table-cell text-left">{{(port.description ? port.description : port.host + ' ' + port.port) | min_size: 20}}</div>
|
||||
<div class="table-cell"></div>
|
||||
<div ng-switch="port.status" ng-class="statsPorts.getDecoration(port)" class="table-cell">
|
||||
<span ng-switch-when="null">Scanning</span>
|
||||
<span ng-switch-when="false">Timeout</span>
|
||||
<span ng-switch-when="true">Open</span>
|
||||
<span ng-switch-default>{{port.status * 1000.0 | number:0}}ms</span>
|
||||
</div>
|
||||
</div>
|
@ -1,6 +0,0 @@
|
||||
<span class="title">TASKS</span>
|
||||
<span>{{ statsProcessCount.total }} ({{ statsProcessCount.thread }} thr),</span>
|
||||
<span>{{ statsProcessCount.running }} run,</span>
|
||||
<span>{{ statsProcessCount.sleeping }} slp,</span>
|
||||
<span>{{ statsProcessCount.stopped }} oth</span>
|
||||
<span> sorted {{ sorter.auto ? 'automatically' : '' }} by {{ sorter.getColumnLabel(sorter.column) }}, flat view</span>
|
@ -1,33 +0,0 @@
|
||||
<div class="table">
|
||||
<div class="table-row">
|
||||
<div sortable-th sorter="sorter" column="cpu_percent" class="table-cell">CPU%</div>
|
||||
<div sortable-th sorter="sorter" column="memory_percent" class="table-cell">MEM%</div>
|
||||
<div class="table-cell hidden-xs hidden-sm">VIRT</div>
|
||||
<div class="table-cell hidden-xs hidden-sm">RES</div>
|
||||
<div class="table-cell">PID</div>
|
||||
<div sortable-th sorter="sorter" column="username" class="table-cell text-left">USER</div>
|
||||
<div class="table-cell">NI</div>
|
||||
<div class="table-cell">S</div>
|
||||
<div sortable-th sorter="sorter" column="timemillis" class="table-cell hidden-xs hidden-sm">TIME+</div>
|
||||
<div sortable-th sorter="sorter" column="io_read" class="table-cell hidden-xs hidden-sm" ng-show="statsProcessList.ioReadWritePresent">IOR/s</div>
|
||||
<div sortable-th sorter="sorter" column="io_write" class="table-cell hidden-xs hidden-sm" ng-show="statsProcessList.ioReadWritePresent">IOW/s</div>
|
||||
<div sortable-th sorter="sorter" column="name" class="table-cell text-left">Command</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="process in statsProcessList.processes | orderBy:sorter.column:sorter.isReverseColumn(sorter.column) | limitTo: statsProcessList.getLimit()">
|
||||
<div class="table-cell" ng-class="statsProcessList.getCpuPercentAlert(process)">{{process.cpu_percent | number:1}}</div>
|
||||
<div class="table-cell" ng-class="statsProcessList.getMemoryPercentAlert(process)">{{process.memory_percent | number:1}}</div>
|
||||
<div class="table-cell hidden-xs hidden-sm">{{process.memvirt | bytes}}</div>
|
||||
<div class="table-cell hidden-xs hidden-sm">{{process.memres | bytes}}</div>
|
||||
<div class="table-cell">{{process.pid}}</div>
|
||||
<div class="table-cell text-left">{{process.username}}</div>
|
||||
<div class="table-cell" ng-class="{nice: process.isNice}">{{process.nice | exclamation}}</div>
|
||||
<div class="table-cell" ng-class="{status: process.status == 'R'}">{{process.status}}</div>
|
||||
<div class="table-cell hidden-xs hidden-sm">
|
||||
<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>
|
||||
</div>
|
||||
<div class="table-cell hidden-xs hidden-sm" ng-show="statsProcessList.ioReadWritePresent">{{process.ioRead}}</div>
|
||||
<div class="table-cell hidden-xs hidden-sm" ng-show="statsProcessList.ioReadWritePresent">{{process.ioWrite}}</div>
|
||||
<div class="table-cell text-left" ng-show="arguments.process_short_name">{{process.name}}</div>
|
||||
<div class="table-cell text-left" ng-show="!arguments.process_short_name">{{process.cmdline}}</div>
|
||||
</div>
|
||||
</div>
|
@ -1,57 +0,0 @@
|
||||
<div class="cpu-name">
|
||||
{{ statsQuicklook.cpu_name }}
|
||||
</div>
|
||||
<div class="table">
|
||||
<div class="table-row" ng-show="!arguments.percpu">
|
||||
<div class="table-cell text-left">CPU</div>
|
||||
<div class="table-cell">
|
||||
<div class="progress">
|
||||
<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 }}%;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ statsQuicklook.cpu }}%
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row" ng-show="arguments.percpu" ng-repeat="percpu in statsQuicklook.percpus">
|
||||
<div class="table-cell text-left">CPU{{ percpu.number }}</div>
|
||||
<div class="table-cell">
|
||||
<div class="progress">
|
||||
<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 }}%;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ percpu.total }}%
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">MEM</div>
|
||||
<div class="table-cell">
|
||||
<div class="progress">
|
||||
<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 }}%;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ statsQuicklook.mem }}%
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left">SWAP</div>
|
||||
<div class="table-cell">
|
||||
<div class="progress">
|
||||
<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 }}%;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-cell">
|
||||
{{ statsQuicklook.swap }}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,19 +0,0 @@
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">RAID disks</div>
|
||||
<div class="table-cell">Used</div>
|
||||
<div class="table-cell">Total</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="disk in statsRaid.disks | orderBy: 'name'">
|
||||
<div class="table-cell text-left">
|
||||
{{ disk.type | uppercase }} {{ disk.name }}
|
||||
<div class="warning" ng-show="disk.degraded">└─ Degraded mode</div>
|
||||
<div ng-show="disk.degraded"> └─ {{ disk.config }}</div>
|
||||
|
||||
<div class="critical" ng-show="disk.inactive">└─ Status {{ disk.status }}</div>
|
||||
<div ng-show="disk.inactive" ng-repeat="component in disk.components | orderBy: 'number'">
|
||||
{{ $last ? '└─' : '├─' }} disk {{ component.number }}: {{ component.name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-cell" ng-show="!disk.inactive" ng-class="statsRaid.getAlert(disk)">{{ disk.used }}</div>
|
||||
<div class="table-cell" ng-show="!disk.inactive" ng-class="statsRaid.getAlert(disk)">{{ disk.available }}</div>
|
||||
</div>
|
@ -1,9 +0,0 @@
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">SENSORS</div>
|
||||
</div>
|
||||
|
||||
<div class="table-row" ng-repeat="sensor in statsSensors.sensors">
|
||||
<div class="table-cell text-left">{{ sensor.label }}</div>
|
||||
<div class="table-cell">{{ sensor.unit }}</div>
|
||||
<div class="table-cell" ng-class="statsSensors.getAlert(sensor)">{{ sensor.value }}</div>
|
||||
</div>
|
@ -1,4 +0,0 @@
|
||||
<span ng-if="is_disconnected" class="critical">Disconnected from</span>
|
||||
<span class="title">{{ statsSystem.hostname }}</span>
|
||||
<span ng-show="statsSystem.isLinux()" class="hidden-xs hidden-sm">({{ statsSystem.humanReadableName }} / {{ statsSystem.os.name }} {{ statsSystem.os.version }})</span>
|
||||
<span ng-show="!statsSystem.isLinux()" class="hidden-xs hidden-sm">({{ statsSystem.os.name }} {{ statsSystem.os.version }} {{ statsSystem.platform }})</span>
|
@ -1 +0,0 @@
|
||||
<span>Uptime: {{ statsUptime.uptime }}</span>
|
@ -1,10 +0,0 @@
|
||||
<div class="table-row">
|
||||
<div class="table-cell text-left title">WIFI</div>
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell">dBm</div>
|
||||
</div>
|
||||
<div class="table-row" ng-repeat="hotspot in statsWifi.hotspots | orderBy: 'ssid'">
|
||||
<div class="table-cell text-left">{{ hotspot.ssid|limitTo:20 }} <span ng-if="hotspot.encrypted">{{ hotspot.encryption_type }}</span></div>
|
||||
<div class="table-cell"></div>
|
||||
<div class="table-cell" ng-class="statsWifi.getDecoration(hotspot, 'signal')">{{ hotspot.signal }}</div>
|
||||
</div>
|
@ -1,88 +1 @@
|
||||
<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="top-plugin">
|
||||
<div class="row">
|
||||
<div class="col-sm-24">
|
||||
<div class="pull-left">
|
||||
<section id="system" ng-include src="'plugins/system.html'"></section>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<section id="ip" ng-if="statsIp.address != undefined && !arguments.disable_ip" ng-include src="'plugins/ip.html'"></section>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<section id="uptime" ng-include src="'plugins/uptime.html'"></section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" ng-if="statsCloud.getProvider()">
|
||||
<div class="col-sm-24">
|
||||
<div class="pull-left">
|
||||
<section id="cloud" ng-include src="'plugins/cloud.html'"></section>
|
||||
</div>
|
||||
</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="hidden-xs hidden-sm col-md-4 col-lg-3" ng-if="!arguments.disable_gpu && statsGpu.gpus.length > 0">
|
||||
<section id="gpu" class="plugin" ng-include src="'plugins/gpu.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 && !(!arguments.disable_gpu && statsGpu.gpus.length > 0)">
|
||||
<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_memswap">
|
||||
<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="wifi" class="plugin table-row-group" ng-show="!arguments.disable_wifi && statsWifi.hotspots.length > 0" ng-include src="'plugins/wifi.html'"></section>
|
||||
<section id="ports" class="plugin table-row-group" ng-show="!arguments.disable_ports" 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="irq" class="plugin table-row-group" ng-show="arguments.enable_irq && statsIrq.irqs.length > 0" ng-include src="'plugins/irq.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_alert" ng-include src="'plugins/alerts.html'"></section>
|
||||
<section id="alert" class="plugin" ng-show="!arguments.disable_alert" 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>
|
||||
<glances help="help" arguments="arguments" config="config"></glances>
|
||||
|
12
glances/outputs/static/js/components/glances/component.js
Normal file
12
glances/outputs/static/js/components/glances/component.js
Normal file
@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
glancesApp.component('glances', {
|
||||
controller: GlancesController,
|
||||
bindings: {
|
||||
arguments: '<',
|
||||
config: '<',
|
||||
help: '<'
|
||||
},
|
||||
controllerAs: 'vm',
|
||||
templateUrl: 'components/glances/view.html'
|
||||
});
|
183
glances/outputs/static/js/components/glances/controller.js
Normal file
183
glances/outputs/static/js/components/glances/controller.js
Normal file
@ -0,0 +1,183 @@
|
||||
'use strict';
|
||||
|
||||
function GlancesController($interval, GlancesStats, favicoService) {
|
||||
var vm = this;
|
||||
|
||||
vm.sorter = {
|
||||
column: "cpu_percent",
|
||||
auto: true,
|
||||
isReverseColumn: function (column) {
|
||||
return !(column == 'username' || column == 'name');
|
||||
},
|
||||
getColumnLabel: function (column) {
|
||||
if (_.isEqual(column, ['io_read', 'io_write'])) {
|
||||
return 'io_counters';
|
||||
} else {
|
||||
return column;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
vm.dataLoaded = false;
|
||||
vm.stats = {};
|
||||
vm.refreshData = function () {
|
||||
GlancesStats.getData().then(function (data) {
|
||||
vm.stats = data;
|
||||
vm.is_disconnected = false;
|
||||
vm.dataLoaded = true;
|
||||
}, function() {
|
||||
vm.is_disconnected = true;
|
||||
});
|
||||
};
|
||||
|
||||
vm.refreshData();
|
||||
var refreshTime = 60; // arguments.time
|
||||
$interval(function () {
|
||||
vm.refreshData();
|
||||
}, refreshTime * 1000); // in milliseconds
|
||||
|
||||
vm.onKeyDown = function ($event) {
|
||||
|
||||
switch (true) {
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.a:
|
||||
// a => Sort processes automatically
|
||||
vm.sorter.column = "cpu_percent";
|
||||
vm.sorter.auto = true;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.A:
|
||||
// A => Enable/disable AMPs
|
||||
vm.arguments.disable_amps = !vm.arguments.disable_amps;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.c:
|
||||
// c => Sort processes by CPU%
|
||||
vm.sorter.column = "cpu_percent";
|
||||
vm.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.m:
|
||||
// m => Sort processes by MEM%
|
||||
vm.sorter.column = "memory_percent";
|
||||
vm.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.u:
|
||||
// u => Sort processes by user
|
||||
vm.sorter.column = "username";
|
||||
vm.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.p:
|
||||
// p => Sort processes by name
|
||||
vm.sorter.column = "name";
|
||||
vm.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.i:
|
||||
// i => Sort processes by I/O rate
|
||||
vm.sorter.column = ['io_read', 'io_write'];
|
||||
vm.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.t:
|
||||
// t => Sort processes by time
|
||||
vm.sorter.column = "timemillis";
|
||||
vm.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.d:
|
||||
// d => Show/hide disk I/O stats
|
||||
vm.arguments.disable_diskio = !vm.arguments.disable_diskio;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.Q:
|
||||
// Q => Show/hide IRQ
|
||||
vm.arguments.enable_irq = !vm.arguments.enable_irq;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.f:
|
||||
// f => Show/hide filesystem stats
|
||||
vm.arguments.disable_fs = !vm.arguments.disable_fs;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.n:
|
||||
// n => Show/hide network stats
|
||||
vm.arguments.disable_network = !vm.arguments.disable_network;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.s:
|
||||
// s => Show/hide sensors stats
|
||||
vm.arguments.disable_sensors = !vm.arguments.disable_sensors;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.TWO:
|
||||
// 2 => Show/hide left sidebar
|
||||
vm.arguments.disable_left_sidebar = !vm.arguments.disable_left_sidebar;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.z:
|
||||
// z => Enable/disable processes stats
|
||||
vm.arguments.disable_process = !vm.arguments.disable_process;
|
||||
break;
|
||||
case $event.keyCode == keycodes.SLASH:
|
||||
// SLASH => Enable/disable short processes name
|
||||
vm.arguments.process_short_name = !vm.arguments.process_short_name;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.D:
|
||||
// D => Enable/disable Docker stats
|
||||
vm.arguments.disable_docker = !vm.arguments.disable_docker;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.b:
|
||||
// b => Bytes or bits for network I/O
|
||||
vm.arguments.byte = !vm.arguments.byte;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.b:
|
||||
// 'B' => Switch between bit/s and IO/s for Disk IO
|
||||
vm.arguments.diskio_iops = !vm.arguments.diskio_iops;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.l:
|
||||
// l => Show/hide alert logs
|
||||
vm.arguments.disable_alert = !vm.arguments.disable_alert;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.ONE:
|
||||
// 1 => Global CPU or per-CPU stats
|
||||
vm.arguments.percpu = !vm.arguments.percpu;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.h:
|
||||
// h => Show/hide this help screen
|
||||
vm.arguments.help_tag = !vm.arguments.help_tag;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.T:
|
||||
// T => View network I/O as combination
|
||||
vm.arguments.network_sum = !vm.arguments.network_sum;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.u:
|
||||
// U => View cumulative network I/O
|
||||
vm.arguments.network_cumul = !vm.arguments.network_cumul;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.f:
|
||||
// F => Show filesystem free space
|
||||
vm.arguments.fs_free_space = !vm.arguments.fs_free_space;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.THREE:
|
||||
// 3 => Enable/disable quick look plugin
|
||||
vm.arguments.disable_quicklook = !vm.arguments.disable_quicklook;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.SIX:
|
||||
// 6 => Enable/disable mean gpu
|
||||
vm.arguments.meangpu = !vm.arguments.meangpu;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.g:
|
||||
// G => Enable/disable gpu
|
||||
vm.arguments.disable_gpu = !vm.arguments.disable_gpu;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.FIVE:
|
||||
vm.arguments.disable_quicklook = !vm.arguments.disable_quicklook;
|
||||
vm.arguments.disable_cpu = !vm.arguments.disable_cpu;
|
||||
vm.arguments.disable_mem = !vm.arguments.disable_mem;
|
||||
vm.arguments.disable_memswap = !vm.arguments.disable_memswap;
|
||||
vm.arguments.disable_load = !vm.arguments.disable_load;
|
||||
vm.arguments.disable_gpu = !vm.arguments.disable_gpu;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.i:
|
||||
// I => Show/hide IP module
|
||||
vm.arguments.disable_ip = !vm.arguments.disable_ip;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.p:
|
||||
// I => Enable/disable ports module
|
||||
vm.arguments.disable_ports = !vm.arguments.disable_ports;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.w:
|
||||
// 'W' > Enable/Disable Wifi plugin
|
||||
vm.arguments.disable_wifi = !vm.arguments.disable_wifi;
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
24
glances/outputs/static/js/components/glances/view.html
Normal file
24
glances/outputs/static/js/components/glances/view.html
Normal file
@ -0,0 +1,24 @@
|
||||
<div ng-show="!vm.dataLoaded" class="container-fluid" id="loading-page">
|
||||
<div class="glances-logo"></div>
|
||||
<div class="loader">Loading...</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="vm.arguments.help_tag" class="container-fluid" ng-include src="'help.html'"></div>
|
||||
|
||||
<div ng-show="vm.dataLoaded && !vm.arguments.help_tag" class="container-fluid">
|
||||
<div class="top-plugin">
|
||||
<div class="row">
|
||||
<div class="col-sm-24">
|
||||
<div class="pull-left">
|
||||
<glances-plugin-system stats="vm.stats"></glances-plugin-system>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<glances-plugin-ip stats="vm.stats" arguments="vm.arguments"></glances-plugin-ip>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<glances-plugin-uptime stats="vm.stats"></glances-plugin-uptime>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
10
glances/outputs/static/js/components/plugin-ip/component.js
Normal file
10
glances/outputs/static/js/components/plugin-ip/component.js
Normal file
@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
glancesApp.component('glancesPluginIp', {
|
||||
controller: GlancesPluginIpController,
|
||||
controllerAs: 'vm',
|
||||
bindings: {
|
||||
stats: '<',
|
||||
},
|
||||
templateUrl: 'components/plugin-ip/view.html'
|
||||
});
|
26
glances/outputs/static/js/components/plugin-ip/controller.js
Normal file
26
glances/outputs/static/js/components/plugin-ip/controller.js
Normal file
@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
function GlancesPluginIpController() {
|
||||
var vm = this;
|
||||
|
||||
this.address = null;
|
||||
this.gateway = null;
|
||||
this.mask = null;
|
||||
this.maskCidr = null;
|
||||
this.publicAddress = null;
|
||||
|
||||
vm.$onChanges = function (changes) {
|
||||
var stats = changes.stats.currentValue;
|
||||
if (stats === undefined || stats.stats === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = stats.stats['ip'];
|
||||
|
||||
vm.address = data.address;
|
||||
vm.gateway = data.gateway;
|
||||
vm.mask = data.mask;
|
||||
vm.maskCidr = data.mask_cidr;
|
||||
vm.publicAddress = data.public_address
|
||||
};
|
||||
}
|
3
glances/outputs/static/js/components/plugin-ip/view.html
Normal file
3
glances/outputs/static/js/components/plugin-ip/view.html
Normal file
@ -0,0 +1,3 @@
|
||||
<section id="ip" ng-if="vm.address != undefined && !vm.arguments.disable_ip">
|
||||
- <span class="title">IP</span> <span>{{ vm.address }}/{{ vm.maskCidr }}</span> <span ng-if="vm.publicAddress" class="title">Pub</span> <span>{{ vm.publicAddress }}</span>
|
||||
</section>
|
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
glancesApp.component('glancesPluginSystem', {
|
||||
controller: GlancesPluginSystemController,
|
||||
controllerAs: 'vm',
|
||||
bindings: {
|
||||
stats: '<',
|
||||
isDisconnected: '<'
|
||||
},
|
||||
templateUrl: 'components/plugin-system/view.html'
|
||||
});
|
@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
|
||||
function GlancesPluginSystemController() {
|
||||
var vm = this;
|
||||
var _pluginName = "system";
|
||||
|
||||
vm.hostname = null;
|
||||
vm.platform = null;
|
||||
vm.humanReadableName = null;
|
||||
vm.os = {
|
||||
'name': null,
|
||||
'version': null
|
||||
};
|
||||
|
||||
vm.$onChanges = function (changes) {
|
||||
var stats = changes.stats.currentValue;
|
||||
if (stats === undefined || stats.stats === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = stats.stats[_pluginName];
|
||||
|
||||
vm.hostname = data['hostname'];
|
||||
vm.platform = data['platform'];
|
||||
vm.os.name = data['os_name'];
|
||||
vm.os.version = data['os_version'];
|
||||
vm.humanReadableName = data['hr_name'];
|
||||
};
|
||||
|
||||
vm.isBsd = function() {
|
||||
return this.os.name === 'FreeBSD';
|
||||
};
|
||||
|
||||
vm.isLinux = function() {
|
||||
return this.os.name === 'Linux';
|
||||
};
|
||||
|
||||
vm.isMac = function() {
|
||||
return this.os.name === 'Darwin';
|
||||
};
|
||||
|
||||
vm.isWindows = function() {
|
||||
return this.os.name === 'Windows';
|
||||
};
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<section id="system">
|
||||
<span ng-if="vm.isDisconnected" class="critical">Disconnected from</span>
|
||||
<span class="title">{{ vm.hostname }}</span>
|
||||
<span ng-show="vm.isLinux()" class="hidden-xs hidden-sm">({{ vm.humanReadableName }} / {{ vm.os.name }} {{ vm.os.version }})</span>
|
||||
<span ng-show="!vm.isLinux()" class="hidden-xs hidden-sm">({{ vm.os.name }} {{ vm.os.version }} {{ vm.platform }})</span>
|
||||
</section>
|
@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
glancesApp.component('glancesPluginUptime', {
|
||||
controller: GlancesPluginUptimeController,
|
||||
controllerAs: 'vm',
|
||||
bindings: {
|
||||
stats: '<',
|
||||
},
|
||||
templateUrl: 'components/plugin-uptime/view.html'
|
||||
});
|
@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
function GlancesPluginUptimeController() {
|
||||
var vm = this;
|
||||
|
||||
this.value = null
|
||||
|
||||
vm.$onChanges = function (changes) {
|
||||
var stats = changes.stats.currentValue;
|
||||
if (stats === undefined || stats.stats === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
vm.value = stats.stats['uptime'];
|
||||
};
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
<section id="uptime">
|
||||
<span>Uptime: {{ vm.value }}</span>
|
||||
</section>
|
@ -1,214 +1,5 @@
|
||||
glancesApp.controller('statsController', function ($scope, $rootScope, $interval, GlancesStats, help, config, arguments, favicoService) {
|
||||
glancesApp.controller('statsController', function ($scope, help, config, arguments) {
|
||||
$scope.help = help;
|
||||
$scope.config = config;
|
||||
$scope.arguments = arguments;
|
||||
|
||||
$scope.sorter = {
|
||||
column: "cpu_percent",
|
||||
auto: true,
|
||||
isReverseColumn: function (column) {
|
||||
return !(column == 'username' || column == 'name');
|
||||
},
|
||||
getColumnLabel: function (column) {
|
||||
if (_.isEqual(column, ['io_read', 'io_write'])) {
|
||||
return 'io_counters';
|
||||
} else {
|
||||
return column;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.dataLoaded = false;
|
||||
$scope.refreshData = function () {
|
||||
GlancesStats.getData().then(function (data) {
|
||||
|
||||
$scope.statsAlert = GlancesStats.getPlugin('alert');
|
||||
$scope.statsCloud = GlancesStats.getPlugin('cloud');
|
||||
$scope.statsCpu = GlancesStats.getPlugin('cpu');
|
||||
$scope.statsDiskio = GlancesStats.getPlugin('diskio');
|
||||
$scope.statsIrq = GlancesStats.getPlugin('irq');
|
||||
$scope.statsDocker = GlancesStats.getPlugin('docker');
|
||||
$scope.statsFs = GlancesStats.getPlugin('fs');
|
||||
$scope.statsFolders = GlancesStats.getPlugin('folders');
|
||||
$scope.statsGpu = GlancesStats.getPlugin('gpu');
|
||||
$scope.statsIp = GlancesStats.getPlugin('ip');
|
||||
$scope.statsLoad = GlancesStats.getPlugin('load');
|
||||
$scope.statsMem = GlancesStats.getPlugin('mem');
|
||||
$scope.statsMemSwap = GlancesStats.getPlugin('memswap');
|
||||
$scope.statsAmps = GlancesStats.getPlugin('amps');
|
||||
$scope.statsNetwork = GlancesStats.getPlugin('network');
|
||||
$scope.statsPerCpu = GlancesStats.getPlugin('percpu');
|
||||
$scope.statsProcessCount = GlancesStats.getPlugin('processcount');
|
||||
$scope.statsProcessList = GlancesStats.getPlugin('processlist');
|
||||
$scope.statsQuicklook = GlancesStats.getPlugin('quicklook');
|
||||
$scope.statsRaid = GlancesStats.getPlugin('raid');
|
||||
$scope.statsSensors = GlancesStats.getPlugin('sensors');
|
||||
$scope.statsSystem = GlancesStats.getPlugin('system');
|
||||
$scope.statsUptime = GlancesStats.getPlugin('uptime');
|
||||
$scope.statsPorts = GlancesStats.getPlugin('ports');
|
||||
$scope.statsWifi = GlancesStats.getPlugin('wifi');
|
||||
|
||||
$rootScope.title = $scope.statsSystem.hostname + ' - Glances';
|
||||
|
||||
if ($scope.statsAlert.hasOngoingAlerts()) {
|
||||
favicoService.badge($scope.statsAlert.countOngoingAlerts());
|
||||
} else {
|
||||
favicoService.reset();
|
||||
}
|
||||
|
||||
$scope.is_disconnected = false;
|
||||
$scope.dataLoaded = true;
|
||||
}, function() {
|
||||
$scope.is_disconnected = true;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.refreshData();
|
||||
$interval(function () {
|
||||
$scope.refreshData();
|
||||
}, arguments.time * 1000); // in milliseconds
|
||||
|
||||
$scope.onKeyDown = function ($event) {
|
||||
|
||||
switch (true) {
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.a:
|
||||
// a => Sort processes automatically
|
||||
$scope.sorter.column = "cpu_percent";
|
||||
$scope.sorter.auto = true;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.A:
|
||||
// A => Enable/disable AMPs
|
||||
$scope.arguments.disable_amps = !$scope.arguments.disable_amps;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.c:
|
||||
// c => Sort processes by CPU%
|
||||
$scope.sorter.column = "cpu_percent";
|
||||
$scope.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.m:
|
||||
// m => Sort processes by MEM%
|
||||
$scope.sorter.column = "memory_percent";
|
||||
$scope.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.u:
|
||||
// u => Sort processes by user
|
||||
$scope.sorter.column = "username";
|
||||
$scope.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.p:
|
||||
// p => Sort processes by name
|
||||
$scope.sorter.column = "name";
|
||||
$scope.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.i:
|
||||
// i => Sort processes by I/O rate
|
||||
$scope.sorter.column = ['io_read', 'io_write'];
|
||||
$scope.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.t:
|
||||
// t => Sort processes by time
|
||||
$scope.sorter.column = "timemillis";
|
||||
$scope.sorter.auto = false;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.d:
|
||||
// d => Show/hide disk I/O stats
|
||||
$scope.arguments.disable_diskio = !$scope.arguments.disable_diskio;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.Q:
|
||||
// Q => Show/hide IRQ
|
||||
$scope.arguments.enable_irq = !$scope.arguments.enable_irq;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.f:
|
||||
// f => Show/hide filesystem stats
|
||||
$scope.arguments.disable_fs = !$scope.arguments.disable_fs;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.n:
|
||||
// n => Show/hide network stats
|
||||
$scope.arguments.disable_network = !$scope.arguments.disable_network;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.s:
|
||||
// s => Show/hide sensors stats
|
||||
$scope.arguments.disable_sensors = !$scope.arguments.disable_sensors;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.TWO:
|
||||
// 2 => Show/hide left sidebar
|
||||
$scope.arguments.disable_left_sidebar = !$scope.arguments.disable_left_sidebar;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.z:
|
||||
// z => Enable/disable processes stats
|
||||
$scope.arguments.disable_process = !$scope.arguments.disable_process;
|
||||
break;
|
||||
case $event.keyCode == keycodes.SLASH:
|
||||
// SLASH => Enable/disable short processes name
|
||||
$scope.arguments.process_short_name = !$scope.arguments.process_short_name;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.D:
|
||||
// D => Enable/disable Docker stats
|
||||
$scope.arguments.disable_docker = !$scope.arguments.disable_docker;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.b:
|
||||
// b => Bytes or bits for network I/O
|
||||
$scope.arguments.byte = !$scope.arguments.byte;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.b:
|
||||
// 'B' => Switch between bit/s and IO/s for Disk IO
|
||||
$scope.arguments.diskio_iops = !$scope.arguments.diskio_iops;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.l:
|
||||
// l => Show/hide alert logs
|
||||
$scope.arguments.disable_alert = !$scope.arguments.disable_alert;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.ONE:
|
||||
// 1 => Global CPU or per-CPU stats
|
||||
$scope.arguments.percpu = !$scope.arguments.percpu;
|
||||
break;
|
||||
case !$event.shiftKey && $event.keyCode == keycodes.h:
|
||||
// h => Show/hide this help screen
|
||||
$scope.arguments.help_tag = !$scope.arguments.help_tag;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.T:
|
||||
// T => View network I/O as combination
|
||||
$scope.arguments.network_sum = !$scope.arguments.network_sum;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.u:
|
||||
// U => View cumulative network I/O
|
||||
$scope.arguments.network_cumul = !$scope.arguments.network_cumul;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.f:
|
||||
// F => Show filesystem free space
|
||||
$scope.arguments.fs_free_space = !$scope.arguments.fs_free_space;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.THREE:
|
||||
// 3 => Enable/disable quick look plugin
|
||||
$scope.arguments.disable_quicklook = !$scope.arguments.disable_quicklook;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.SIX:
|
||||
// 6 => Enable/disable mean gpu
|
||||
$scope.arguments.meangpu = !$scope.arguments.meangpu;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.g:
|
||||
// G => Enable/disable gpu
|
||||
$scope.arguments.disable_gpu = !$scope.arguments.disable_gpu;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.FIVE:
|
||||
$scope.arguments.disable_quicklook = !$scope.arguments.disable_quicklook;
|
||||
$scope.arguments.disable_cpu = !$scope.arguments.disable_cpu;
|
||||
$scope.arguments.disable_mem = !$scope.arguments.disable_mem;
|
||||
$scope.arguments.disable_memswap = !$scope.arguments.disable_memswap;
|
||||
$scope.arguments.disable_load = !$scope.arguments.disable_load;
|
||||
$scope.arguments.disable_gpu = !$scope.arguments.disable_gpu;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.i:
|
||||
// I => Show/hide IP module
|
||||
$scope.arguments.disable_ip = !$scope.arguments.disable_ip;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.p:
|
||||
// I => Enable/disable ports module
|
||||
$scope.arguments.disable_ports = !$scope.arguments.disable_ports;
|
||||
break;
|
||||
case $event.shiftKey && $event.keyCode == keycodes.w:
|
||||
// 'W' > Enable/Disable Wifi plugin
|
||||
$scope.arguments.disable_wifi = !$scope.arguments.disable_wifi;
|
||||
break;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
@ -1,106 +0,0 @@
|
||||
glancesApp.service('GlancesStats', function($http, $injector, $q, GlancesPlugin) {
|
||||
var _stats = [], _views = [], _limits = [], _config = {};
|
||||
|
||||
var _plugins = {
|
||||
'alert': 'GlancesPluginAlert',
|
||||
'cloud': 'GlancesPluginCloud',
|
||||
'cpu': 'GlancesPluginCpu',
|
||||
'diskio': 'GlancesPluginDiskio',
|
||||
'irq' : 'GlancesPluginIrq',
|
||||
'docker': 'GlancesPluginDocker',
|
||||
'ip': 'GlancesPluginIp',
|
||||
'fs': 'GlancesPluginFs',
|
||||
'folders': 'GlancesPluginFolders',
|
||||
'gpu': 'GlancesPluginGpu',
|
||||
'load': 'GlancesPluginLoad',
|
||||
'mem': 'GlancesPluginMem',
|
||||
'memswap': 'GlancesPluginMemSwap',
|
||||
'amps': 'GlancesPluginAmps',
|
||||
'network': 'GlancesPluginNetwork',
|
||||
'percpu': 'GlancesPluginPerCpu',
|
||||
'processcount': 'GlancesPluginProcessCount',
|
||||
'processlist': 'GlancesPluginProcessList',
|
||||
'quicklook': 'GlancesPluginQuicklook',
|
||||
'raid': 'GlancesPluginRaid',
|
||||
'sensors': 'GlancesPluginSensors',
|
||||
'system': 'GlancesPluginSystem',
|
||||
'uptime': 'GlancesPluginUptime',
|
||||
'ports': 'GlancesPluginPorts',
|
||||
'wifi': 'GlancesPluginWifi'
|
||||
};
|
||||
|
||||
this.getData = function() {
|
||||
return $q.all([
|
||||
this.getAllStats(),
|
||||
this.getAllViews()
|
||||
]).then(function(results) {
|
||||
return {
|
||||
'stats': results[0],
|
||||
'view': results[1]
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
this.getAllStats = function() {
|
||||
return $http.get('/api/2/all').then(function (response) {
|
||||
_stats = response.data;
|
||||
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
this.getAllLimits = function() {
|
||||
return $http.get('/api/2/all/limits').then(function (response) {
|
||||
_limits = response.data;
|
||||
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
this.getAllViews = function() {
|
||||
return $http.get('/api/2/all/views').then(function (response) {
|
||||
_views = response.data;
|
||||
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
this.getHelp = function() {
|
||||
return $http.get('/api/2/help').then(function (response) {
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
this.getConfig = function() {
|
||||
return $http.get('/api/2/config').then(function (response) {
|
||||
_config = response.data;
|
||||
|
||||
return _config;
|
||||
});
|
||||
};
|
||||
|
||||
this.getArguments = function() {
|
||||
return $http.get('/api/2/args').then(function (response) {
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
this.getPlugin = function(name) {
|
||||
var plugin = _plugins[name];
|
||||
|
||||
if (plugin === undefined) {
|
||||
throw "Plugin '" + name + "' not found";
|
||||
}
|
||||
|
||||
plugin = $injector.get(plugin);
|
||||
plugin.setData(_stats, _views, _config);
|
||||
|
||||
return plugin;
|
||||
};
|
||||
|
||||
// load limits to init GlancePlugin helper
|
||||
this.getAllLimits().then(function(limits) {
|
||||
GlancesPlugin.setLimits(limits);
|
||||
});
|
||||
|
||||
});
|
@ -1,58 +0,0 @@
|
||||
glancesApp.service('GlancesPluginAlert', function () {
|
||||
var _pluginName = "alert";
|
||||
var _alerts = [];
|
||||
|
||||
this.setData = function (data, views) {
|
||||
data = data[_pluginName];
|
||||
_alerts = [];
|
||||
|
||||
if(!_.isArray(data)) {
|
||||
data = [];
|
||||
}
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var alertData = data[i];
|
||||
var alert = {};
|
||||
|
||||
alert.name = alertData[3];
|
||||
alert.level = alertData[2];
|
||||
alert.begin = alertData[0] * 1000;
|
||||
alert.end = alertData[1] * 1000;
|
||||
alert.ongoing = alertData[1] == -1;
|
||||
alert.min = alertData[6];
|
||||
alert.mean = alertData[5];
|
||||
alert.max = alertData[4];
|
||||
|
||||
if (!alert.ongoing) {
|
||||
var duration = alert.end - alert.begin;
|
||||
var seconds = parseInt((duration / 1000) % 60)
|
||||
, minutes = parseInt((duration / (1000 * 60)) % 60)
|
||||
, hours = parseInt((duration / (1000 * 60 * 60)) % 24);
|
||||
|
||||
alert.duration = _.padStart(hours, 2, '0') + ":" + _.padStart(minutes, 2, '0') + ":" + _.padStart(seconds, 2, '0');
|
||||
}
|
||||
|
||||
_alerts.push(alert);
|
||||
}
|
||||
};
|
||||
|
||||
this.hasAlerts = function () {
|
||||
return _alerts.length > 0;
|
||||
};
|
||||
|
||||
this.getAlerts = function () {
|
||||
return _alerts;
|
||||
};
|
||||
|
||||
this.count = function () {
|
||||
return _alerts.length;
|
||||
};
|
||||
|
||||
this.hasOngoingAlerts = function () {
|
||||
return _.filter(_alerts, { 'ongoing': true }).length > 0;
|
||||
};
|
||||
|
||||
this.countOngoingAlerts = function () {
|
||||
return _.filter(_alerts, { 'ongoing': true }).length;
|
||||
}
|
||||
});
|
@ -1,34 +0,0 @@
|
||||
glancesApp.service('GlancesPluginAmps', function() {
|
||||
var _pluginName = "amps";
|
||||
this.processes = [];
|
||||
|
||||
this.setData = function(data, views) {
|
||||
var processes = data[_pluginName];
|
||||
|
||||
this.processes = [];
|
||||
angular.forEach(processes, function(process) {
|
||||
if (process.result !== null) {
|
||||
this.processes.push(process);
|
||||
}
|
||||
}, this);
|
||||
};
|
||||
|
||||
this.getDescriptionDecoration = function(process) {
|
||||
var count = process.count;
|
||||
var countMin = process.countmin;
|
||||
var countMax = process.countmax;
|
||||
var decoration = "ok";
|
||||
|
||||
if (count > 0) {
|
||||
if ((countMin == null || count >= countMin) && (countMax == null || count <= countMax)) {
|
||||
decoration = 'ok';
|
||||
} else {
|
||||
decoration = 'careful';
|
||||
}
|
||||
} else {
|
||||
decoration = countMin == null ? 'ok' : 'critical';
|
||||
}
|
||||
|
||||
return decoration;
|
||||
}
|
||||
});
|
@ -1,22 +0,0 @@
|
||||
glancesApp.service('GlancesPluginCloud', function() {
|
||||
var _pluginName = "cloud";
|
||||
var _provider = null;
|
||||
var _instance = null;
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
|
||||
if (data['ami-id'] !== undefined) {
|
||||
_provider = 'AWS EC2';
|
||||
_instance = data['instance-type'] + ' instance ' + data['instance-id'] + ' (' + data['region'] + ')';
|
||||
}
|
||||
}
|
||||
|
||||
this.getProvider = function() {
|
||||
return _provider;
|
||||
}
|
||||
|
||||
this.getInstance = function() {
|
||||
return _instance;
|
||||
}
|
||||
});
|
@ -1,55 +0,0 @@
|
||||
glancesApp.service('GlancesPluginCpu', function() {
|
||||
var _pluginName = "cpu";
|
||||
var _view = {};
|
||||
|
||||
this.total = null;
|
||||
this.user = null;
|
||||
this.system = null;
|
||||
this.idle = null;
|
||||
this.nice = null;
|
||||
this.irq = null;
|
||||
this.iowait = null;
|
||||
this.steal = null;
|
||||
this.ctx_switches = null;
|
||||
this.interrupts = null;
|
||||
this.soft_interrupts = null;
|
||||
this.syscalls = null;
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
_view = views[_pluginName];
|
||||
|
||||
this.total = data.total;
|
||||
this.user = data.user;
|
||||
this.system = data.system;
|
||||
this.idle = data.idle;
|
||||
this.nice = data.nice;
|
||||
this.irq = data.irq;
|
||||
this.iowait = data.iowait;
|
||||
this.steal = data.steal;
|
||||
|
||||
if (data.ctx_switches) {
|
||||
this.ctx_switches = Math.floor(data.ctx_switches / data.time_since_update);
|
||||
}
|
||||
|
||||
if (data.interrupts) {
|
||||
this.interrupts = Math.floor(data.interrupts / data.time_since_update);
|
||||
}
|
||||
|
||||
if (data.soft_interrupts) {
|
||||
this.soft_interrupts = Math.floor(data.soft_interrupts / data.time_since_update);
|
||||
}
|
||||
|
||||
if (data.syscalls) {
|
||||
this.syscalls = Math.floor(data.syscalls / data.time_since_update);
|
||||
}
|
||||
}
|
||||
|
||||
this.getDecoration = function(value) {
|
||||
if(_view[value] == undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
return _view[value].decoration.toLowerCase();
|
||||
}
|
||||
});
|
@ -1,30 +0,0 @@
|
||||
glancesApp.service('GlancesPluginDiskio', function($filter) {
|
||||
var _pluginName = "diskio";
|
||||
this.disks = [];
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
data = $filter('orderBy')(data,'disk_name');
|
||||
this.disks = [];
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var diskioData = data[i];
|
||||
var timeSinceUpdate = diskioData['time_since_update'];
|
||||
|
||||
var diskio = {
|
||||
'name': diskioData['disk_name'],
|
||||
'bitrate': {
|
||||
'txps': $filter('bytes')(diskioData['read_bytes'] / timeSinceUpdate),
|
||||
'rxps': $filter('bytes')(diskioData['write_bytes'] / timeSinceUpdate)
|
||||
},
|
||||
'count': {
|
||||
'txps': $filter('bytes')(diskioData['read_count'] / timeSinceUpdate),
|
||||
'rxps': $filter('bytes')(diskioData['write_count'] / timeSinceUpdate)
|
||||
},
|
||||
'alias': diskioData['alias'] !== undefined ? diskioData['alias'] : null
|
||||
};
|
||||
|
||||
this.disks.push(diskio);
|
||||
}
|
||||
};
|
||||
});
|
@ -1,39 +0,0 @@
|
||||
glancesApp.service('GlancesPluginDocker', function(GlancesPlugin) {
|
||||
|
||||
var _pluginName = "docker";
|
||||
this.containers = [];
|
||||
this.version = null;
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
this.containers = [];
|
||||
|
||||
if(_.isEmpty(data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 0; i < data['containers'].length; i++) {
|
||||
var containerData = data['containers'][i];
|
||||
|
||||
var container = {
|
||||
'id': containerData.Id,
|
||||
'name': containerData.Names[0].split('/').splice(-1)[0],
|
||||
'status': containerData.Status,
|
||||
'cpu': containerData.cpu.total,
|
||||
'memory': containerData.memory.usage != undefined ? containerData.memory.usage : '?',
|
||||
'ior': containerData.io.ior != undefined ? containerData.io.ior : '?',
|
||||
'iow': containerData.io.iow != undefined ? containerData.io.iow : '?',
|
||||
'io_time_since_update': containerData.io.time_since_update,
|
||||
'rx': containerData.network.rx != undefined ? containerData.network.rx : '?',
|
||||
'tx': containerData.network.tx != undefined ? containerData.network.tx : '?',
|
||||
'net_time_since_update': containerData.network.time_since_update,
|
||||
'command': containerData.Command,
|
||||
'image': containerData.Image
|
||||
};
|
||||
|
||||
this.containers.push(container);
|
||||
}
|
||||
|
||||
this.version = data['version']['Version'];
|
||||
};
|
||||
});
|
@ -1,40 +0,0 @@
|
||||
glancesApp.service('GlancesPluginFolders', function() {
|
||||
var _pluginName = "folders";
|
||||
this.folders = [];
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
this.folders = [];
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var folderData = data[i];
|
||||
|
||||
var folder = {
|
||||
'path': folderData['path'],
|
||||
'size': folderData['size'],
|
||||
'careful': folderData['careful'],
|
||||
'warning': folderData['warning'],
|
||||
'critical': folderData['critical']
|
||||
};
|
||||
|
||||
this.folders.push(folder);
|
||||
}
|
||||
};
|
||||
|
||||
this.getDecoration = function(folder) {
|
||||
|
||||
if (!Number.isInteger(folder.size)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (folder.critical !== null && folder.size > (folder.critical * 1000000)) {
|
||||
return 'critical';
|
||||
} else if (folder.warning !== null && folder.size > (folder.warning * 1000000)) {
|
||||
return 'warning';
|
||||
} else if (folder.careful !== null && folder.size > (folder.careful * 1000000)) {
|
||||
return 'careful';
|
||||
}
|
||||
|
||||
return 'ok';
|
||||
};
|
||||
});
|
@ -1,40 +0,0 @@
|
||||
glancesApp.service('GlancesPluginFs', function() {
|
||||
var _pluginName = "fs";
|
||||
var _view = {};
|
||||
this.fileSystems = [];
|
||||
|
||||
this.setData = function(data, views) {
|
||||
_view = views[_pluginName];
|
||||
data = data[_pluginName];
|
||||
this.fileSystems = [];
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var fsData = data[i];
|
||||
|
||||
var shortMountPoint = fsData['mnt_point'];
|
||||
if (shortMountPoint.length > 9) {
|
||||
shortMountPoint = '_' + fsData['mnt_point'].slice(-8);
|
||||
}
|
||||
|
||||
var fs = {
|
||||
'name': fsData['device_name'],
|
||||
'mountPoint': fsData['mnt_point'],
|
||||
'shortMountPoint': shortMountPoint,
|
||||
'percent': fsData['percent'],
|
||||
'size': fsData['size'],
|
||||
'used': fsData['used'],
|
||||
'free': fsData['free']
|
||||
};
|
||||
|
||||
this.fileSystems.push(fs);
|
||||
}
|
||||
};
|
||||
|
||||
this.getDecoration = function(mountPoint, field) {
|
||||
if(_view[mountPoint][field] == undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
return _view[mountPoint][field].decoration.toLowerCase();
|
||||
};
|
||||
});
|
@ -1,56 +0,0 @@
|
||||
glancesApp.service('GlancesPluginGpu', function() {
|
||||
var _pluginName = "gpu";
|
||||
var _view = {};
|
||||
this.gpus = [];
|
||||
this.name = "GPU";
|
||||
this.mean = {};
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
_view = views[_pluginName];
|
||||
|
||||
if (data.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.gpus = [];
|
||||
this.name = "GPU";
|
||||
this.mean = {
|
||||
proc: null,
|
||||
mem: null
|
||||
};
|
||||
var sameName = true;
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var gpuData = data[i];
|
||||
|
||||
var gpu = gpuData;
|
||||
|
||||
this.mean.proc += gpu.proc;
|
||||
this.mean.mem += gpu.mem;
|
||||
|
||||
this.gpus.push(gpu);
|
||||
}
|
||||
|
||||
if (data.length === 1 ) {
|
||||
this.name = data[0].name;
|
||||
} else if (sameName) {
|
||||
this.name = data.length + ' GPU ' + data[0].name;
|
||||
}
|
||||
|
||||
this.mean.proc = this.mean.proc / data.length;
|
||||
this.mean.mem = this.mean.mem / data.length;
|
||||
};
|
||||
|
||||
this.getDecoration = function(gpuId, value) {
|
||||
if(_view[gpuId][value] == undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
return _view[gpuId][value].decoration.toLowerCase();
|
||||
};
|
||||
|
||||
this.getMeanDecoration = function(value) {
|
||||
return this.getDecoration(0, value);
|
||||
};
|
||||
});
|
@ -1,19 +0,0 @@
|
||||
glancesApp.service('GlancesPluginIp', function() {
|
||||
var _pluginName = "ip";
|
||||
|
||||
this.address = null;
|
||||
this.gateway = null;
|
||||
this.mask = null;
|
||||
this.maskCidr = null;
|
||||
this.publicAddress = null;
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
|
||||
this.address = data.address;
|
||||
this.gateway = data.gateway;
|
||||
this.mask = data.mask;
|
||||
this.maskCidr = data.mask_cidr;
|
||||
this.publicAddress = data.public_address
|
||||
};
|
||||
});
|
@ -1,21 +0,0 @@
|
||||
glancesApp.service('GlancesPluginIrq', function() {
|
||||
var _pluginName = "irq";
|
||||
this.irqs = [];
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
this.irqs = [];
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var IrqData = data[i];
|
||||
var timeSinceUpdate = IrqData['time_since_update'];
|
||||
|
||||
var irq = {
|
||||
'irq_line': IrqData['irq_line'],
|
||||
'irq_rate': IrqData['irq_rate']
|
||||
};
|
||||
|
||||
this.irqs.push(irq);
|
||||
}
|
||||
};
|
||||
});
|
@ -1,27 +0,0 @@
|
||||
glancesApp.service('GlancesPluginLoad', function() {
|
||||
var _pluginName = "load";
|
||||
var _view = {};
|
||||
|
||||
this.cpucore = null;
|
||||
this.min1 = null;
|
||||
this.min5 = null;
|
||||
this.min15 = null;
|
||||
|
||||
this.setData = function(data, views) {
|
||||
_view = views[_pluginName];
|
||||
data = data[_pluginName];
|
||||
|
||||
this.cpucore = data['cpucore'];
|
||||
this.min1 = data['min1'];
|
||||
this.min5 = data['min5'];
|
||||
this.min15 = data['min15'];
|
||||
};
|
||||
|
||||
this.getDecoration = function(value) {
|
||||
if(_view[value] == undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
return _view[value].decoration.toLowerCase();
|
||||
};
|
||||
});
|
@ -1,36 +0,0 @@
|
||||
glancesApp.service('GlancesPluginMem', function() {
|
||||
var _pluginName = "mem";
|
||||
var _view = {};
|
||||
|
||||
this.percent = null;
|
||||
this.total = null;
|
||||
this.used = null;
|
||||
this.free = null;
|
||||
this.version = null;
|
||||
this.active = null;
|
||||
this.inactive = null;
|
||||
this.buffers = null;
|
||||
this.cached = null;
|
||||
|
||||
this.setData = function(data, views) {
|
||||
_view = views[_pluginName];
|
||||
data = data[_pluginName];
|
||||
|
||||
this.percent = data['percent'];
|
||||
this.total = data['total'];
|
||||
this.used = data['used'];
|
||||
this.free = data['free'];
|
||||
this.active = data['active'];
|
||||
this.inactive = data['inactive'];
|
||||
this.buffers = data['buffers'];
|
||||
this.cached = data['cached'];
|
||||
};
|
||||
|
||||
this.getDecoration = function(value) {
|
||||
if(_view[value] == undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
return _view[value].decoration.toLowerCase();
|
||||
};
|
||||
});
|
@ -1,27 +0,0 @@
|
||||
glancesApp.service('GlancesPluginMemSwap', function() {
|
||||
var _pluginName = "memswap";
|
||||
var _view = {};
|
||||
|
||||
this.percent = null;
|
||||
this.total = null;
|
||||
this.used = null;
|
||||
this.free = null;
|
||||
|
||||
this.setData = function(data, views) {
|
||||
_view = views[_pluginName];
|
||||
data = data[_pluginName];
|
||||
|
||||
this.percent = data['percent'];
|
||||
this.total = data['total'];
|
||||
this.used = data['used'];
|
||||
this.free = data['free'];
|
||||
};
|
||||
|
||||
this.getDecoration = function(value) {
|
||||
if(_view[value] == undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
return _view[value].decoration.toLowerCase();
|
||||
};
|
||||
});
|
@ -1,25 +0,0 @@
|
||||
glancesApp.service('GlancesPluginNetwork', function() {
|
||||
var _pluginName = "network";
|
||||
this.networks = [];
|
||||
|
||||
this.setData = function(data, views) {
|
||||
this.networks = [];
|
||||
|
||||
for (var i = 0; i < data[_pluginName].length; i++) {
|
||||
var networkData = data[_pluginName][i];
|
||||
|
||||
var network = {
|
||||
'interfaceName': networkData['interface_name'],
|
||||
'rx': networkData['rx'],
|
||||
'tx': networkData['tx'],
|
||||
'cx': networkData['cx'],
|
||||
'time_since_update': networkData['time_since_update'],
|
||||
'cumulativeRx': networkData['cumulative_rx'],
|
||||
'cumulativeTx': networkData['cumulative_tx'],
|
||||
'cumulativeCx': networkData['cumulative_cx']
|
||||
};
|
||||
|
||||
this.networks.push(network);
|
||||
}
|
||||
};
|
||||
});
|
@ -1,30 +0,0 @@
|
||||
glancesApp.service('GlancesPluginPerCpu', function($filter, GlancesPlugin) {
|
||||
var _pluginName = "percpu";
|
||||
this.cpus = [];
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
this.cpus = [];
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var cpuData = data[i];
|
||||
|
||||
this.cpus.push({
|
||||
'total': cpuData.total,
|
||||
'user': cpuData.user,
|
||||
'system': cpuData.system,
|
||||
'idle': cpuData.idle,
|
||||
'iowait': cpuData.iowait,
|
||||
'steal': cpuData.steal
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
this.getUserAlert = function(cpu) {
|
||||
return GlancesPlugin.getAlert(_pluginName, 'percpu_user_', cpu.user)
|
||||
};
|
||||
|
||||
this.getSystemAlert = function(cpu) {
|
||||
return GlancesPlugin.getAlert(_pluginName, 'percpu_system_', cpu.system);
|
||||
};
|
||||
});
|
@ -1,42 +0,0 @@
|
||||
glancesApp.service('GlancesPlugin', function () {
|
||||
|
||||
var plugin = {
|
||||
'limits': {},
|
||||
'limitSuffix': ['critical', 'careful', 'warning']
|
||||
};
|
||||
|
||||
plugin.setLimits = function(limits){
|
||||
this.limits = limits;
|
||||
};
|
||||
|
||||
plugin.getAlert = function (pluginName, limitNamePrefix, current, maximum, log) {
|
||||
current = current || 0;
|
||||
maximum = maximum || 100;
|
||||
log = log || false;
|
||||
|
||||
var log_str = log ? '_log' : '';
|
||||
var value = (current * 100) / maximum;
|
||||
|
||||
if (this.limits[pluginName] != undefined) {
|
||||
for (var i = 0; i < this.limitSuffix.length; i++) {
|
||||
var limitName = limitNamePrefix + this.limitSuffix[i];
|
||||
var limit = this.limits[pluginName][limitName];
|
||||
|
||||
if (value >= limit) {
|
||||
var pos = limitName.lastIndexOf("_");
|
||||
var className = limitName.substring(pos + 1);
|
||||
|
||||
return className + log_str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "ok" + log_str;
|
||||
};
|
||||
|
||||
plugin.getAlertLog = function (pluginName, limitNamePrefix, current, maximum) {
|
||||
return this.getAlert(pluginName, limitNamePrefix, current, maximum, true);
|
||||
};
|
||||
|
||||
return plugin;
|
||||
});
|
@ -1,29 +0,0 @@
|
||||
glancesApp.service('GlancesPluginPorts', function() {
|
||||
var _pluginName = "ports";
|
||||
this.ports = [];
|
||||
|
||||
this.setData = function(data, views) {
|
||||
var ports = data[_pluginName];
|
||||
this.ports = [];
|
||||
|
||||
angular.forEach(ports, function(port) {
|
||||
this.ports.push(port);
|
||||
}, this);
|
||||
};
|
||||
|
||||
this.getDecoration = function(port) {
|
||||
if (port.status === null) {
|
||||
return 'careful';
|
||||
}
|
||||
|
||||
if (port.status === false) {
|
||||
return 'critical';
|
||||
}
|
||||
|
||||
if (port.rtt_warning !== null && port.status > port.rtt_warning) {
|
||||
return 'warning';
|
||||
}
|
||||
|
||||
return 'ok';
|
||||
};
|
||||
});
|
@ -1,19 +0,0 @@
|
||||
glancesApp.service('GlancesPluginProcessCount', function() {
|
||||
var _pluginName = "processcount";
|
||||
|
||||
this.total = null;
|
||||
this.running = null;
|
||||
this.sleeping = null;
|
||||
this.stopped = null;
|
||||
this.thread = null;
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
|
||||
this.total = data['total'] || 0;
|
||||
this.running = data['running'] || 0;
|
||||
this.sleeping = data['sleeping'] || 0;
|
||||
this.stopped = data['stopped'] || 0;
|
||||
this.thread = data['thread'] || 0;
|
||||
};
|
||||
});
|
@ -1,40 +0,0 @@
|
||||
glancesApp.service('GlancesPluginQuicklook', function() {
|
||||
var _pluginName = "quicklook";
|
||||
var _view = {};
|
||||
|
||||
this.mem = null;
|
||||
this.cpu = null;
|
||||
this.cpu_name = null;
|
||||
this.cpu_hz_current = null;
|
||||
this.cpu_hz = null;
|
||||
this.swap = null;
|
||||
this.percpus = [];
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
_view = views[_pluginName];
|
||||
|
||||
this.mem = data.mem;
|
||||
this.cpu = data.cpu;
|
||||
this.cpu_name = data.cpu_name;
|
||||
this.cpu_hz_current = data.cpu_hz_current;
|
||||
this.cpu_hz = data.cpu_hz;
|
||||
this.swap = data.swap;
|
||||
this.percpus = [];
|
||||
|
||||
angular.forEach(data.percpu, function(cpu) {
|
||||
this.percpus.push({
|
||||
'number': cpu.cpu_number,
|
||||
'total': cpu.total
|
||||
});
|
||||
}, this);
|
||||
}
|
||||
|
||||
this.getDecoration = function(value) {
|
||||
if(_view[value] == undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
return _view[value].decoration.toLowerCase();
|
||||
}
|
||||
});
|
@ -1,50 +0,0 @@
|
||||
glancesApp.service('GlancesPluginRaid', function () {
|
||||
var _pluginName = "raid";
|
||||
this.disks = [];
|
||||
|
||||
this.setData = function (data, views) {
|
||||
var disks = [];
|
||||
data = data[_pluginName];
|
||||
|
||||
_.forIn(data, function(diskData, diskKey) {
|
||||
var disk = {
|
||||
'name': diskKey,
|
||||
'type': diskData.type == null ? 'UNKNOWN' : diskData.type,
|
||||
'used': diskData.used,
|
||||
'available': diskData.available,
|
||||
'status': diskData.status,
|
||||
'degraded': diskData.used < diskData.available,
|
||||
'config': diskData.config == null ? '' : diskData.config.replace('_', 'A'),
|
||||
'inactive': diskData.status == 'inactive',
|
||||
'components': []
|
||||
};
|
||||
|
||||
_.forEach(diskData.components, function(number, name) {
|
||||
disk.components.push({
|
||||
'number': number,
|
||||
'name': name
|
||||
});
|
||||
});
|
||||
|
||||
disks.push(disk);
|
||||
});
|
||||
|
||||
this.disks = disks;
|
||||
};
|
||||
|
||||
this.hasDisks = function() {
|
||||
return this.disks.length > 0;
|
||||
}
|
||||
|
||||
this.getAlert = function(disk) {
|
||||
if (disk.inactive) {
|
||||
return 'critical';
|
||||
}
|
||||
|
||||
if (disk.degraded) {
|
||||
return 'warning';
|
||||
}
|
||||
|
||||
return 'ok'
|
||||
}
|
||||
});
|
@ -1,21 +0,0 @@
|
||||
glancesApp.service('GlancesPluginSensors', function(GlancesPlugin) {
|
||||
|
||||
var _pluginName = "sensors";
|
||||
this.sensors = [];
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
|
||||
_.remove(data, function(sensor) {
|
||||
return (_.isArray(sensor.value) && _.isEmpty(sensor.value)) || sensor.value === 0;
|
||||
});
|
||||
|
||||
this.sensors = data;
|
||||
};
|
||||
|
||||
this.getAlert = function(sensor) {
|
||||
var current = sensor.type == 'battery' ? 100 - sensor.value : sensor.value;
|
||||
|
||||
return GlancesPlugin.getAlert(_pluginName, 'sensors_' + sensor.type + '_', current);
|
||||
};
|
||||
});
|
@ -1,37 +0,0 @@
|
||||
glancesApp.service('GlancesPluginSystem', function() {
|
||||
var _pluginName = "system";
|
||||
|
||||
this.hostname = null;
|
||||
this.platform = null;
|
||||
this.humanReadableName = null;
|
||||
this.os = {
|
||||
'name': null,
|
||||
'version': null
|
||||
};
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
|
||||
this.hostname = data['hostname'];
|
||||
this.platform = data['platform'];
|
||||
this.os.name = data['os_name'];
|
||||
this.os.version = data['os_version'];
|
||||
this.humanReadableName = data['hr_name'];
|
||||
};
|
||||
|
||||
this.isBsd = function() {
|
||||
return this.os.name === 'FreeBSD';
|
||||
};
|
||||
|
||||
this.isLinux = function() {
|
||||
return this.os.name === 'Linux';
|
||||
};
|
||||
|
||||
this.isMac = function() {
|
||||
return this.os.name === 'Darwin';
|
||||
};
|
||||
|
||||
this.isWindows = function() {
|
||||
return this.os.name === 'Windows';
|
||||
};
|
||||
});
|
@ -1,7 +0,0 @@
|
||||
glancesApp.service('GlancesPluginUptime', function() {
|
||||
this.uptime = null;
|
||||
|
||||
this.setData = function(data, views) {
|
||||
this.uptime = data['uptime'];
|
||||
};
|
||||
});
|
@ -1,36 +0,0 @@
|
||||
glancesApp.service('GlancesPluginWifi', function() {
|
||||
var _pluginName = "wifi";
|
||||
var _view = {};
|
||||
this.hotspots = [];
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
_view = views[_pluginName];
|
||||
|
||||
this.hotspots = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var hotspotData = data[i];
|
||||
|
||||
if (hotspotData['ssid'] === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
var hotspot = {
|
||||
'ssid': hotspotData['ssid'],
|
||||
'encrypted': hotspotData['encrypted'],
|
||||
'signal': hotspotData['signal'],
|
||||
'encryption_type': hotspotData['encryption_type'],
|
||||
};
|
||||
|
||||
this.hotspots.push(hotspot);
|
||||
}
|
||||
};
|
||||
|
||||
this.getDecoration = function(hotpost, field) {
|
||||
if(_view[hotpost.ssid][field] == undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
return _view[hotpost.ssid][field].decoration.toLowerCase();
|
||||
};
|
||||
});
|
60
glances/outputs/static/js/stats.js
Normal file
60
glances/outputs/static/js/stats.js
Normal file
@ -0,0 +1,60 @@
|
||||
glancesApp.service('GlancesStats', function($http, $q) {
|
||||
var _stats = [], _views = [], _limits = [], _config = {};
|
||||
|
||||
this.getData = function() {
|
||||
return $q.all([
|
||||
this.getAllStats(),
|
||||
this.getAllViews()
|
||||
]).then(function(results) {
|
||||
return {
|
||||
'stats': results[0],
|
||||
'view': results[1]
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
this.getAllStats = function() {
|
||||
return $http.get('/api/2/all').then(function (response) {
|
||||
_stats = response.data;
|
||||
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
this.getAllLimits = function() {
|
||||
return $http.get('/api/2/all/limits').then(function (response) {
|
||||
_limits = response.data;
|
||||
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
this.getAllViews = function() {
|
||||
return $http.get('/api/2/all/views').then(function (response) {
|
||||
_views = response.data;
|
||||
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
this.getHelp = function() {
|
||||
return $http.get('/api/2/help').then(function (response) {
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
this.getConfig = function() {
|
||||
return $http.get('/api/2/config').then(function (response) {
|
||||
_config = response.data;
|
||||
|
||||
return _config;
|
||||
});
|
||||
};
|
||||
|
||||
this.getArguments = function() {
|
||||
return $http.get('/api/2/args').then(function (response) {
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
});
|
1481
glances/outputs/static/public/js/main.min.js
vendored
1481
glances/outputs/static/public/js/main.min.js
vendored
File diff suppressed because it is too large
Load Diff
@ -1,27 +1,4 @@
|
||||
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/cloud.html','<span class="title">{{ statsCloud.getProvider() }}</span> {{ statsCloud.getInstance() }}\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" ng-show="statsCpu.nice != undefined">\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.shortMountPoint }} <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/gpu.html','<div class="gpu-name title">\n {{ statsGpu.name }}\n</div>\n<div class="table">\n <div class="table-row" ng-if="arguments.meangpu || statsGpu.gpus.length === 1">\n <div class="table-cell text-left">proc:</div>\n <div class="table-cell" ng-class="statsGpu.getMeanDecoration(\'proc\')" ng-if="statsGpu.mean.proc">{{ statsGpu.mean.proc | number : 0 }}%</div>\n <div class="table-cell" ng-if="!statsGpu.mean.proc">N/A</div>\n </div>\n <div class="table-row" ng-if="arguments.meangpu || statsGpu.gpus.length === 1">\n <div class="table-cell text-left">mem:</div>\n <div class="table-cell" ng-class="statsGpu.getMeanDecoration(\'mem\')" ng-if="statsGpu.mean.mem">{{ statsGpu.mean.mem | number : 0 }}%</div>\n <div class="table-cell" ng-if="!statsGpu.mean.mem">N/A</div>\n </div>\n <div class="table-row" ng-if="!arguments.meangpu && statsGpu.gpus.length > 1" ng-repeat="gpu in statsGpu.gpus">\n <div class="table-cell text-left">\n {{ gpu.gpu_id }}:\n <span ng-class="statsGpu.getDecoration(gpu.gpu_id, \'proc\')" ng-if="gpu.proc">{{ gpu.proc | number : 0 }}%</span>\n <span ng-if="!gpu.proc">N/A</span>\n mem:\n <span ng-class="statsGpu.getDecoration(gpu.gpu_id, \'mem\')" ng-if="gpu.mem">{{ gpu.mem | number : 0 }}%</span>\n <span ng-if="!gpu.mem">N/A</span>\n </div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/ip.html',' - <span class="title">IP</span> <span>{{ statsIp.address }}/{{ statsIp.maskCidr }}</span> <span ng-if="statsIp.publicAddress" class="title">Pub</span> <span>{{ statsIp.publicAddress }}</span>\n');
|
||||
$templateCache.put('plugins/irq.html','<div class="table-row">\n <div class="table-cell text-left title">IRQ</div>\n <div class="table-cell"></div>\n <div class="table-cell">Rate/s</div>\n</div>\n<div class="table-row" ng-repeat="irq in statsIrq.irqs">\n <div class="table-cell text-left">{{irq.irq_line}}</div>\n <div class="table-cell"></div>\n <div class="table-cell"><span>{{irq.irq_rate}}</span></div>\n</div>\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" ng-show="statsMem.active != undefined">\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" ng-show="statsMem.inactive != undefined">\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) | limitTo: statsProcessList.getLimit()">\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');
|
||||
$templateCache.put('plugins/wifi.html','<div class="table-row">\n <div class="table-cell text-left title">WIFI</div>\n <div class="table-cell"></div>\n <div class="table-cell">dBm</div>\n</div>\n<div class="table-row" ng-repeat="hotspot in statsWifi.hotspots | orderBy: \'ssid\'">\n <div class="table-cell text-left">{{ hotspot.ssid|limitTo:20 }} <span ng-if="hotspot.encrypted">{{ hotspot.encryption_type }}</span></div>\n <div class="table-cell"></div>\n <div class="table-cell" ng-class="statsWifi.getDecoration(hotspot, \'signal\')">{{ hotspot.signal }}</div>\n</div>\n');}]);
|
||||
angular.module('glancesApp').run(['$templateCache', function($templateCache) {$templateCache.put('components/glances/view.html','<div ng-show="!vm.dataLoaded" class="container-fluid" id="loading-page">\n <div class="glances-logo"></div>\n <div class="loader">Loading...</div>\n</div>\n\n<div ng-show="vm.arguments.help_tag" class="container-fluid" ng-include src="\'help.html\'"></div>\n\n<div ng-show="vm.dataLoaded && !vm.arguments.help_tag" class="container-fluid">\n <div class="top-plugin">\n <div class="row">\n <div class="col-sm-24">\n <div class="pull-left">\n <glances-plugin-system stats="vm.stats"></glances-plugin-system>\n </div>\n <div class="pull-left">\n <glances-plugin-ip stats="vm.stats" arguments="vm.arguments"></glances-plugin-ip>\n </div>\n <div class="pull-right">\n <glances-plugin-uptime stats="vm.stats"></glances-plugin-uptime>\n </div>\n </div>\n </div>\n\n</div>\n');
|
||||
$templateCache.put('components/plugin-ip/view.html','<section id="ip" ng-if="vm.address != undefined && !vm.arguments.disable_ip">\n - <span class="title">IP</span> <span>{{ vm.address }}/{{ vm.maskCidr }}</span> <span ng-if="vm.publicAddress" class="title">Pub</span> <span>{{ vm.publicAddress }}</span>\n</section>\n');
|
||||
$templateCache.put('components/plugin-system/view.html','<section id="system">\n <span ng-if="vm.isDisconnected" class="critical">Disconnected from</span>\n <span class="title">{{ vm.hostname }}</span>\n <span ng-show="vm.isLinux()" class="hidden-xs hidden-sm">({{ vm.humanReadableName }} / {{ vm.os.name }} {{ vm.os.version }})</span>\n <span ng-show="!vm.isLinux()" class="hidden-xs hidden-sm">({{ vm.os.name }} {{ vm.os.version }} {{ vm.platform }})</span>\n</section>\n');
|
||||
$templateCache.put('components/plugin-uptime/view.html','<section id="uptime">\n <span>Uptime: {{ vm.value }}</span>\n</section>\n');}]);
|
89
glances/outputs/static/public/stats.html
vendored
89
glances/outputs/static/public/stats.html
vendored
@ -1,88 +1 @@
|
||||
<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="top-plugin">
|
||||
<div class="row">
|
||||
<div class="col-sm-24">
|
||||
<div class="pull-left">
|
||||
<section id="system" ng-include src="'plugins/system.html'"></section>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<section id="ip" ng-if="statsIp.address != undefined && !arguments.disable_ip" ng-include src="'plugins/ip.html'"></section>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<section id="uptime" ng-include src="'plugins/uptime.html'"></section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" ng-if="statsCloud.getProvider()">
|
||||
<div class="col-sm-24">
|
||||
<div class="pull-left">
|
||||
<section id="cloud" ng-include src="'plugins/cloud.html'"></section>
|
||||
</div>
|
||||
</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="hidden-xs hidden-sm col-md-4 col-lg-3" ng-if="!arguments.disable_gpu && statsGpu.gpus.length > 0">
|
||||
<section id="gpu" class="plugin" ng-include src="'plugins/gpu.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 && !(!arguments.disable_gpu && statsGpu.gpus.length > 0)">
|
||||
<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_memswap">
|
||||
<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="wifi" class="plugin table-row-group" ng-show="!arguments.disable_wifi && statsWifi.hotspots.length > 0" ng-include src="'plugins/wifi.html'"></section>
|
||||
<section id="ports" class="plugin table-row-group" ng-show="!arguments.disable_ports" 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="irq" class="plugin table-row-group" ng-show="arguments.enable_irq && statsIrq.irqs.length > 0" ng-include src="'plugins/irq.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_alert" ng-include src="'plugins/alerts.html'"></section>
|
||||
<section id="alert" class="plugin" ng-show="!arguments.disable_alert" 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>
|
||||
<glances help="help" arguments="arguments" config="config"></glances>
|
||||
|
Loading…
Reference in New Issue
Block a user