mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-22 16:51:35 +03:00
Merge pull request #1045 from notFloran/webui-fix-fs-mountpoint-too-long
[WebUI] Cut mount point if it's too long
This commit is contained in:
commit
411d22d047
@ -7,7 +7,7 @@
|
||||
<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.mountPoint }} <span class="visible-lg-inline" ng-show="fs.name.length <= 20">({{ fs.name }})<span></div>
|
||||
<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>
|
||||
|
@ -5,7 +5,6 @@ glancesApp.service('GlancesPluginCloud', function() {
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
data = {"region": "R", "instance-type": "IT", "ami-id": "AMI", "instance-id": "IID"};
|
||||
|
||||
if (data['ami-id'] !== undefined) {
|
||||
_provider = 'AWS EC2';
|
||||
|
@ -11,9 +11,15 @@ glancesApp.service('GlancesPluginFs', function() {
|
||||
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'],
|
||||
|
9
glances/outputs/static/public/js/main.min.js
vendored
9
glances/outputs/static/public/js/main.min.js
vendored
@ -654,7 +654,6 @@ glancesApp.service('GlancesPluginCloud', function() {
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
// data = {"region": "R", "instance-type": "IT", "ami-id": "AMI", "instance-id": "IID"};
|
||||
|
||||
if (data['ami-id'] !== undefined) {
|
||||
_provider = 'AWS EC2';
|
||||
@ -852,9 +851,15 @@ glancesApp.service('GlancesPluginFs', function() {
|
||||
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'],
|
||||
@ -1404,7 +1409,7 @@ glancesApp.service('GlancesPluginSystem', function() {
|
||||
|
||||
this.setData = function(data, views) {
|
||||
data = data[_pluginName];
|
||||
|
||||
|
||||
this.hostname = data['hostname'];
|
||||
this.platform = data['platform'];
|
||||
this.os.name = data['os_name'];
|
||||
|
@ -6,7 +6,7 @@ $templateCache.put('plugins/cpu.html','<div class="row">\n <div class="col-sm
|
||||
$templateCache.put('plugins/diskio.html','<div class="table-row">\n <div class="table-cell text-left title">DISK I/O</div>\n <div class="table-cell" ng-show="!arguments.diskio_iops">R/s</div>\n <div class="table-cell" ng-show="!arguments.diskio_iops">W/s</div>\n\n <div class="table-cell" ng-show="arguments.diskio_iops">IOR/s</div>\n <div class="table-cell" ng-show="arguments.diskio_iops">IOW/s</div>\n</div>\n<div class="table-row" ng-repeat="disk in statsDiskio.disks">\n <div class="table-cell text-left">{{(disk.alias ? disk.alias : disk.name) | min_size}}</div>\n <div class="table-cell" ng-show="!arguments.diskio_iops">{{disk.bitrate.txps }}</div>\n <div class="table-cell" ng-show="!arguments.diskio_iops">{{disk.bitrate.rxps }}</div>\n\n <div class="table-cell" ng-show="arguments.diskio_iops">{{disk.count.txps }}</div>\n <div class="table-cell" ng-show="arguments.diskio_iops">{{disk.count.rxps }}</div>\n</div>\n');
|
||||
$templateCache.put('plugins/docker.html','<span class="title">CONTAINERS</span> {{ statsDocker.containers.length }} (served by Docker {{ statsDocker.version }})\n\n<div class="table">\n <div class="table-row">\n <div class="table-cell text-left">Name</div>\n <div class="table-cell">Status</div>\n <div class="table-cell">CPU%</div>\n <div class="table-cell">MEM</div>\n <div class="table-cell">IOR/s</div>\n <div class="table-cell">IOW/s</div>\n <div class="table-cell">RX/s</div>\n <div class="table-cell">TX/s</div>\n <div class="table-cell text-left">Command</div>\n </div>\n <div class="table-row" ng-repeat="container in statsDocker.containers">\n <div class="table-cell text-left">{{ container.name }}</div>\n <div class="table-cell" ng-class="container.status == \'Paused\' ? \'careful\' : \'ok\'">{{ container.status }}</div>\n <div class="table-cell">{{ container.cpu | number:1 }}</div>\n <div class="table-cell">{{ container.memory | bytes }}</div>\n <div class="table-cell">{{ container.ior / container.io_time_since_update | bits }}</div>\n <div class="table-cell">{{ container.iow / container.io_time_since_update | bits }}</div>\n <div class="table-cell">{{ container.rx / container.net_time_since_update | bits }}</div>\n <div class="table-cell">{{ container.tx / container.net_time_since_update | bits }}</div>\n <div class="table-cell text-left">{{ container.command }}</div>\n </div>\n</div>\n');
|
||||
$templateCache.put('plugins/folders.html','<div class="table-row">\n <div class="table-cell text-left title">FOLDERS</div>\n <div class="table-cell">Size</div>\n</div>\n<div class="table-row" ng-repeat="folder in statsFolders.folders">\n <div class="table-cell text-left">{{ folder.path }}</div>\n <div class="table-cell" ng-class="statsFolders.getDecoration(folder)">{{ folder.size | bytes }}</div>\n</div>\n');
|
||||
$templateCache.put('plugins/fs.html','<div class="table-row">\n <div class="table-cell text-left title">FILE SYS</div>\n <div class="table-cell">\n <span ng-show="!arguments.fs_free_space">Used</span>\n <span ng-show="arguments.fs_free_space">Free</span>\n </div>\n <div class="table-cell">Total</div>\n</div>\n<div class="table-row" ng-repeat="fs in statsFs.fileSystems | orderBy: \'mnt_point\'">\n <div class="table-cell text-left">{{ fs.mountPoint }} <span class="visible-lg-inline" ng-show="fs.name.length <= 20">({{ fs.name }})<span></div>\n <div class="table-cell" ng-class="statsFs.getDecoration(fs.mountPoint, \'used\')">\n <span ng-show="!arguments.fs_free_space">{{ fs.used | bytes }}</span>\n <span ng-show="arguments.fs_free_space">{{ fs.free | bytes }}</span>\n </div>\n <div class="table-cell">{{ fs.size | bytes }}</div>\n</div>\n');
|
||||
$templateCache.put('plugins/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');
|
||||
|
Loading…
Reference in New Issue
Block a user