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.js
CHANGED
|
@@ -56,14 +56,15 @@ const UsageItem = /*#__PURE__*/react.memo(_ref => {
|
|
|
56
56
|
iconClass,
|
|
57
57
|
text,
|
|
58
58
|
children,
|
|
59
|
-
|
|
59
|
+
showRam,
|
|
60
|
+
ramValue
|
|
60
61
|
} = _ref;
|
|
61
62
|
const tooltipContent = react.useMemo(() => /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
62
63
|
title: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
63
64
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
64
65
|
children: text
|
|
65
|
-
}),
|
|
66
|
-
children: ["Total Memory: ",
|
|
66
|
+
}), showRam && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
67
|
+
children: ["Total Memory: ", ramValue, "GB"]
|
|
67
68
|
})]
|
|
68
69
|
}),
|
|
69
70
|
destroyOnHidden: false,
|
|
@@ -88,7 +89,8 @@ const UsageItem = /*#__PURE__*/react.memo(_ref => {
|
|
|
88
89
|
const getTemperature = (supermicro, sensors) => {
|
|
89
90
|
return supermicro?.cpu_temperature ?? sensors?.temperatures?.coretemp?.[0]?.current;
|
|
90
91
|
};
|
|
91
|
-
const useHardwareUsage = ps_status
|
|
92
|
+
const useHardwareUsage = function (ps_status) {
|
|
93
|
+
let showRam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
92
94
|
return react.useMemo(() => {
|
|
93
95
|
if (!ps_status || typeof ps_status !== 'object') return null;
|
|
94
96
|
const {
|
|
@@ -111,7 +113,8 @@ const useHardwareUsage = ps_status => {
|
|
|
111
113
|
}), mem && /*#__PURE__*/jsxRuntime.jsxs(UsageItem, {
|
|
112
114
|
text: "Memory Usage",
|
|
113
115
|
iconClass: "icon-shiyongshuai",
|
|
114
|
-
|
|
116
|
+
showRam: showRam,
|
|
117
|
+
ramValue: (mem.total / (1024 * 1024 * 1024)).toFixed(1),
|
|
115
118
|
children: [mem.percent, "%"]
|
|
116
119
|
}), supermicro?.nic_temperature && /*#__PURE__*/jsxRuntime.jsxs(UsageItem, {
|
|
117
120
|
text: "NIC Temperature",
|