Skip to content

Commit be0cf33

Browse files
committed
Merge branch 'development' of https://github.com/xcjs/blur-monitor
2 parents 3a7441f + b0e249a commit be0cf33

File tree

21 files changed

+263
-29
lines changed

21 files changed

+263
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Currently the tool can be used to monitor the following information:
99

1010
* Processor model
1111
* Processor clock speed on variable clock speed models
12-
* Processor Utilization
12+
* Processor utilization
1313
* Memory utilization
1414
* Swap utilization
1515
* Mount points and disk utilization

blurmonitor/routes/system.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,7 @@ function getRoutes() {
2525

2626
var promise = new Promise(function (resolve) {
2727
lsbRelease.getRelease.then(function (release) {
28-
release = lsbRelease.parse(release);
29-
30-
response.distro = {};
31-
response.distro.id = release.DISTRIB_ID;
32-
response.distro.release = release.DISTRIB_RELEASE;
33-
response.distro.codeName = release.DISTRIB_CODENAME;
34-
response.distro.description = release.DISTRIB_DESCRIPTION;
35-
28+
response.distro = lsbRelease.parse(release);
3629
resolve(response);
3730
});
3831
});

blurmonitor/services/lsb-release.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,12 @@ function parseRelease(stdout) {
3131
}
3232
});
3333

34-
return lsbRelease;
34+
var parsedRelease = {
35+
id: lsbRelease.DISTRIB_ID,
36+
release: lsbRelease.DISTRIB_RELEASE,
37+
codeName: lsbRelease.DISTRIB_CODENAME,
38+
description: lsbRelease.DISTRIB_DESCRIPTION
39+
};
40+
41+
return parsedRelease;
3542
}

gulp/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ gulp.task('fonts', function () {
101101

102102
gulp.task('other', ['copyVendorImages'], function () {
103103
var fileFilter = $.filter(function (file) {
104-
return file.stat.isFile();
104+
return file.stat.isFile() || file.stat.isSymbolicLink();
105105
});
106106

107107
return gulp.src([

src/app/pages/processes/processes.controller.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
vm.treeConfig = {
1717
core: {
1818
multiple: false,
19-
worker: true
19+
worker: false
2020
},
2121
types: {
2222
process: {
@@ -45,10 +45,11 @@
4545
});
4646

4747
getProcesses(false);
48+
getProcesses(true);
4849

4950
vm.interval = $interval(function() {
5051
getProcesses(false);
51-
}, refreshInterval);
52+
}, refreshInterval * 999999);
5253
});
5354

5455
$scope.$on("$destroy", function() {
@@ -60,7 +61,7 @@
6061
vm.processes = response;
6162

6263
if(updateTree) {
63-
mapProcessesToTree(vm.processes);
64+
mapProcessesToTree(vm.processes);
6465
} else {
6566
// Update top lists instead.
6667
getTopCpuProcesses();
@@ -81,7 +82,11 @@
8182
});
8283

8384
angular.forEach(vm.topCpuProcesses, function(process) {
84-
process.displayName = process.command.length <= 50 ? process.command : process.command.substring(0, 50) + '...'
85+
var iconName = getTreeTypeFromCommand(process.command);
86+
87+
process.displayName = process.command;
88+
process.icon = '/assets/img/app/apps/' + iconName + '.svg';
89+
process.iconFont = iconName === 'process';
8590
});
8691
}
8792

@@ -97,7 +102,11 @@
97102
});
98103

99104
angular.forEach(vm.topMemoryProcesses, function(process) {
100-
process.displayName = process.command.length <= 50 ? process.command : process.command.substring(0, 50) + '...'
105+
var iconName = getTreeTypeFromCommand(process.command);
106+
107+
process.displayName = process.command;
108+
process.icon = '/assets/img/app/apps/' + iconName + '.svg';
109+
process.iconFont = iconName === 'process';
101110
});
102111
}
103112

src/app/pages/processes/processes.html

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
<div class="row">
22
<div class="col-md-6">
33
<div ng-if="vm.topCpuProcesses.length > 0" ba-panel ba-panel-title="Top Processor Intensive Tasks" ba-panel-class="with-scroll">
4-
<ol class="half-height">
4+
<ol class="ordered-process-list half-height">
55
<li ng-repeat="process in vm.topCpuProcesses" title="{{process.command}}">
6-
<i class="ion-gear-a"></i>
7-
{{process.displayName}}
8-
({{process.processorUtilization}}%)
6+
<i ng-if="process.iconFont" class="list-icon ion-gear-a"></i>
7+
<i ng-if="!process.iconFont" class="list-icon" style="background-image: url({{process.icon}});"></i>
8+
<span class="process-name">{{process.displayName}}</span>
9+
<span class="process-util">({{process.processorUtilization}}%)</span>
910
</li>
1011
</ol>
1112
</div>
1213
</div>
1314

1415
<div class="col-md-6">
1516
<div ng-if="vm.topMemoryProcesses.length > 0" ba-panel ba-panel-title="Top Memory Intensive Tasks" ba-panel-class="with-scroll">
16-
<ol class="half-height">
17+
<ol class="ordered-process-list half-height">
1718
<li ng-repeat="process in vm.topMemoryProcesses" title="{{process.command}}">
18-
<i class="ion-gear-a"></i>
19-
{{process.displayName}}
20-
({{process.memoryUtilization}})%
19+
<i ng-if="process.iconFont" class="list-icon ion-gear-a"></i>
20+
<i ng-if="!process.iconFont" class="list-icon" style="background-image: url({{process.icon}});"></i>
21+
<span class="process-name">{{process.displayName}}</span>
22+
<span class="process-util">({{process.memoryUtilization}})%</span>
2123
</li>
2224
</ol>
2325
</div>
@@ -26,12 +28,11 @@
2628

2729
<div class="row">
2830
<div class="col-md-12">
29-
<div ba-panel ba-panel-title="Process Tree" ba-panel-class="with-scroll tree-panel">
31+
<div ng-if="vm.treeProcesses.length > 0" ba-panel ba-panel-title="Process Tree" ba-panel-class="with-scroll tree-panel">
3032
<div class="button-wrapper">
3133
<button type="button" class="btn btn-primary btn-raised btn-with-icon" ng-click="vm.getProcesses(true)">
3234
<i class="ion-loop"></i>
33-
<span ng-if="vm.treeProcesses.length === 0">Load Full Process Tree</span>
34-
<span ng-if="vm.treeProcesses.length > 0">Refresh Tree</span>
35+
Refresh Tree
3536
</button>
3637
</div>
3738
<div js-tree="vm.treeConfig" ng-model="vm.treeProcesses"></div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
plex.svg
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
plex.svg

src/assets/img/app/apps/Plex.svg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
plex.svg

src/assets/img/app/apps/SCREEN.svg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./utilities-terminal.svg

src/assets/img/app/apps/chrome.svg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
google-chrome.svg

src/assets/img/app/apps/gulp.svg

Lines changed: 81 additions & 0 deletions
Loading

src/assets/img/app/apps/node.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/img/app/apps/nodejs.svg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node.svg

src/assets/img/app/apps/plex.svg

Lines changed: 10 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)