Merge pull request #31 from Meliox/integration-eremem
Make host summary view panel collapsible
This commit is contained in:
commit
d5f78e7b49
@ -204,7 +204,7 @@ function install_mod {
|
|||||||
# Expand space in StatusView
|
# Expand space in StatusView
|
||||||
sed -i "/Ext.define('PVE\.node\.StatusView'/,/\},/ {
|
sed -i "/Ext.define('PVE\.node\.StatusView'/,/\},/ {
|
||||||
s/\(bodyPadding:\) '[^']*'/\1 '20 15 20 15'/
|
s/\(bodyPadding:\) '[^']*'/\1 '20 15 20 15'/
|
||||||
s/height: [0-9]\+/minHeight: 360,\n\tflex: 1/
|
s/height: [0-9]\+/minHeight: 360,\n\tflex: 1,\n\tcollapsible: true,\n\ttitleCollapse: true/
|
||||||
s/\(tableAttrs:.*$\)/trAttrs: \{ valign: 'top' \},\n\t\1/
|
s/\(tableAttrs:.*$\)/trAttrs: \{ valign: 'top' \},\n\t\1/
|
||||||
}" "$pvemanagerlibjs"
|
}" "$pvemanagerlibjs"
|
||||||
msg "Expanded space in \"$pvemanagerlibjs\"."
|
msg "Expanded space in \"$pvemanagerlibjs\"."
|
||||||
@ -250,10 +250,10 @@ function install_mod {
|
|||||||
});\n\
|
});\n\
|
||||||
if (!isNaN(tempVal)) {\n\
|
if (!isNaN(tempVal)) {\n\
|
||||||
let tempStyle = '';\n\
|
let tempStyle = '';\n\
|
||||||
if (!isNaN(tempMax) && tempVal > tempMax) {\n\
|
if (!isNaN(tempMax) && tempVal >= tempMax) {\n\
|
||||||
tempStyle = 'color: #FFC300; font-weight: bold;';\n\
|
tempStyle = 'color: #FFC300; font-weight: bold;';\n\
|
||||||
}\n\
|
}\n\
|
||||||
if (!isNaN(tempCrit) && tempVal > tempCrit) {\n\
|
if (!isNaN(tempCrit) && tempVal >= tempCrit) {\n\
|
||||||
tempStyle = 'color: red; font-weight: bold;';\n\
|
tempStyle = 'color: red; font-weight: bold;';\n\
|
||||||
}\n\
|
}\n\
|
||||||
let tempStr = '';\n\
|
let tempStr = '';\n\
|
||||||
@ -318,10 +318,10 @@ function install_mod {
|
|||||||
});\n\
|
});\n\
|
||||||
if (!isNaN(tempVal)) {\n\
|
if (!isNaN(tempVal)) {\n\
|
||||||
let tempStyle = '';\n\
|
let tempStyle = '';\n\
|
||||||
if (!isNaN(tempMax) && tempVal > tempMax) {\n\
|
if (!isNaN(tempMax) && tempVal >= tempMax) {\n\
|
||||||
tempStyle = 'color: #FFC300; font-weight: bold;';\n\
|
tempStyle = 'color: #FFC300; font-weight: bold;';\n\
|
||||||
}\n\
|
}\n\
|
||||||
if (!isNaN(tempCrit) && tempVal > tempCrit) {\n\
|
if (!isNaN(tempCrit) && tempVal >= tempCrit) {\n\
|
||||||
tempStyle = 'color: red; font-weight: bold;';\n\
|
tempStyle = 'color: red; font-weight: bold;';\n\
|
||||||
}\n\
|
}\n\
|
||||||
const tempStr = \`Drive \${index + 1}: <span style=\"\${tempStyle}\">\${tempVal}°C</span>\`;\n\
|
const tempStr = \`Drive \${index + 1}: <span style=\"\${tempStyle}\">\${tempVal}°C</span>\`;\n\
|
||||||
@ -375,10 +375,10 @@ function install_mod {
|
|||||||
});\n\
|
});\n\
|
||||||
if (!isNaN(tempVal)) {\n\
|
if (!isNaN(tempVal)) {\n\
|
||||||
let tempStyle = '';\n\
|
let tempStyle = '';\n\
|
||||||
if (!isNaN(tempMax) && tempVal > tempMax) {\n\
|
if (!isNaN(tempMax) && tempVal >= tempMax) {\n\
|
||||||
tempStyle = 'color: #FFC300; font-weight: bold;';\n\
|
tempStyle = 'color: #FFC300; font-weight: bold;';\n\
|
||||||
}\n\
|
}\n\
|
||||||
if (!isNaN(tempCrit) && tempVal > tempCrit) {\n\
|
if (!isNaN(tempCrit) && tempVal >= tempCrit) {\n\
|
||||||
tempStyle = 'color: red; font-weight: bold;';\n\
|
tempStyle = 'color: red; font-weight: bold;';\n\
|
||||||
}\n\
|
}\n\
|
||||||
const tempStr = \`Drive \${index + 1}: <span style=\"\${tempStyle}\">\${tempVal}°C</span>\`;\n\
|
const tempStr = \`Drive \${index + 1}: <span style=\"\${tempStyle}\">\${tempVal}°C</span>\`;\n\
|
||||||
|
|||||||
@ -6,17 +6,17 @@ If you find this helpful, a small donation is appreciated, [
|
(Tested compatibility: 7.x - 8.2)
|
||||||
|
|
||||||
This bash script installs a modification to the Proxmox Virtual Environment (PVE) web user interface (UI) to display sensor readings in a flexible manner. Supported are CPU, NVMe/HDD/SSD temperatures and fan speeds.
|
This bash script installs a modification to the Proxmox Virtual Environment (PVE) web user interface (UI) to display sensor readings in a flexible and readable manner. Supported are CPU, NVMe/HDD/SSD temperatures and fan speeds.
|
||||||
|
|
||||||
The modification includes three main steps:
|
The modification includes three main steps:
|
||||||
|
|
||||||
1. Create backups of the original files located at `/usr/share/pve-manager/js/pvemanagerlib.js` and `/usr/share/perl5/PVE/API2/Nodes.pm` in the `backup` directory relative to the script location.
|
1. Create backups of the original files located at `/usr/share/pve-manager/js/pvemanagerlib.js` and `/usr/share/perl5/PVE/API2/Nodes.pm` in the `backup` directory relative to the script location.
|
||||||
2. Add a new line to the `Nodes.pm` file that enables host system sensor readings using the `sensors` command.
|
2. Add a new line to the `Nodes.pm` file that enables host system sensor readings using the `sensors` command.
|
||||||
3. Modify the `pvemanagerlib.js` file to expand the space in the host summary view and add new items that displays the temperature information in Celsius for CPU, NVME and HDDs/SSDs, and fan speeds, if available.
|
3. Modify the `pvemanagerlib.js` file to expand the space in the host summary view, add new items that displays the temperature information in Celsius for CPU, NVMe drives, HDDs/SSDs and fan speeds (actual view depend on the available sensor readings). The view layout is also adjusted to no longer match the column number settings and always expands to the full width of the browser window. It is also possible to collapse the panel vertically.
|
||||||
|
|
||||||
The script provides two options: `install` and `uninstall`. The `install` option installs the modification, while the `uninstall` option removes it by copying the backup files to their original location. The script also restarts the `pveproxy` service to apply the changes.
|
The script provides two options: `install` and `uninstall`. The `install` option installs the modification, while the `uninstall` option removes it by copying the backup files to their original location. The script also restarts the `pveproxy` service to apply the changes.
|
||||||
|
|
||||||
For HDDs/SSDs readings to work, the kernal module drivetemp must be installed.
|
For HDDs/SSDs readings to work, the kernel module *drivetemp* must be installed.
|
||||||
|
|
||||||
### Install
|
### Install
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user