seeder-st2110-components 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +8 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -54,14 +54,15 @@ const UsageItem = /*#__PURE__*/memo(_ref => {
|
|
|
54
54
|
iconClass,
|
|
55
55
|
text,
|
|
56
56
|
children,
|
|
57
|
-
|
|
57
|
+
showRam,
|
|
58
|
+
ramValue
|
|
58
59
|
} = _ref;
|
|
59
60
|
const tooltipContent = useMemo(() => /*#__PURE__*/jsx(Tooltip, {
|
|
60
61
|
title: /*#__PURE__*/jsxs(Fragment, {
|
|
61
62
|
children: [/*#__PURE__*/jsx("div", {
|
|
62
63
|
children: text
|
|
63
|
-
}),
|
|
64
|
-
children: ["Total Memory: ",
|
|
64
|
+
}), showRam && /*#__PURE__*/jsxs("div", {
|
|
65
|
+
children: ["Total Memory: ", ramValue, "GB"]
|
|
65
66
|
})]
|
|
66
67
|
}),
|
|
67
68
|
destroyOnHidden: false,
|
|
@@ -86,7 +87,8 @@ const UsageItem = /*#__PURE__*/memo(_ref => {
|
|
|
86
87
|
const getTemperature = (supermicro, sensors) => {
|
|
87
88
|
return supermicro?.cpu_temperature ?? sensors?.temperatures?.coretemp?.[0]?.current;
|
|
88
89
|
};
|
|
89
|
-
const useHardwareUsage = ps_status
|
|
90
|
+
const useHardwareUsage = function (ps_status) {
|
|
91
|
+
let showRam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
90
92
|
return useMemo(() => {
|
|
91
93
|
if (!ps_status || typeof ps_status !== 'object') return null;
|
|
92
94
|
const {
|
|
@@ -109,7 +111,8 @@ const useHardwareUsage = ps_status => {
|
|
|
109
111
|
}), mem && /*#__PURE__*/jsxs(UsageItem, {
|
|
110
112
|
text: "Memory Usage",
|
|
111
113
|
iconClass: "icon-shiyongshuai",
|
|
112
|
-
|
|
114
|
+
showRam: showRam,
|
|
115
|
+
ramValue: (mem.total / (1024 * 1024 * 1024)).toFixed(1),
|
|
113
116
|
children: [mem.percent, "%"]
|
|
114
117
|
}), supermicro?.nic_temperature && /*#__PURE__*/jsxs(UsageItem, {
|
|
115
118
|
text: "NIC Temperature",
|