Commit 5055778e authored by Q-Max's avatar Q-Max

add CPU-TEMP chart with cpu_temp.sh cpu-temp.html modules.js system-status.html

add charset UTF8 to index.html to support °
now support parsing k10 from prog. sensors
parent 53d889ae
<!DOCTYPE html>
<html lang="en" ng-app="linuxDash">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>linux-dash : Server Monitoring Web Dashboard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Monitor your Linux server through a simple web dashboard. Open source and free!">
......
......@@ -120,6 +120,29 @@
}
};
}]);
angular.module('linuxDash').directive('cpuTemp', ['server', function(server) {
return {
restrict: 'E',
scope: {},
templateUrl: 'templates/modules/cpu-temp.html',
link: function(scope) {
scope.min = 0;
scope.max = 100;
scope.displayValue = function(serverResponseData) {
return serverResponseData;
};
scope.utilMetrics = [{
name: 'Temprature',
generate: function(serverResponseData) {
return serverResponseData + ' °C';
}
}];
}
};
}]);
angular.module('linuxDash').directive('cpuUtilizationChart', ['server', function(server) {
return {
......@@ -229,6 +252,10 @@
name: 'swapUsage',
template: '<table-data heading="Swap Usage" module-name="swap"></table-data>'
},
/*{
name: 'cpuTemp',
template: '<table-data heading="CPU Temp" module-name="cputemp"></table-data>'
},*/
{
name: 'internetSpeed',
template: '<key-value-list heading="Internet Speed" module-name="internet_speed" info="Internet connection speed of server."></key-value-list>'
......
#!/bin/bash
if [ `which sensors` ]; then
returnString=`sensors`
if [[ "${returnString/"k10"}" != "${returnString}" ]] ; then
echo ${returnString##*k10} | cut -d ' ' -f 6 | cut -c 2- | cut -c 1-4
elif [[ "${returnString/"ore"}" != "${returnString}" ]] ; then
echo 90
fi
fi
<line-chart-plugin
heading="CPU temp"
module-name="cpu_temp"
color="0,255,0"
max-value="max"
min-value="min"
refresh-rate="1500"
get-display-value="displayValue"
metrics="utilMetrics">
</line-chart-plugin>
......@@ -6,3 +6,4 @@
<docker-processes></docker-processes>
<swap-usage></swap-usage>
<disk-space></disk-space>
<cpu-temp></cpu-temp>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment