mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 23:38:46 +00:00
Improved kubernetes error handling
This commit is contained in:
parent
8887fcc3ee
commit
4fc6db49ca
8 changed files with 205 additions and 124 deletions
|
@ -2,7 +2,6 @@ export function parseCpu(cpuStr) {
|
|||
const unitLength = 1;
|
||||
const base = Number.parseInt(cpuStr, 10);
|
||||
const units = cpuStr.substring(cpuStr.length - unitLength);
|
||||
// console.log(Number.isNaN(Number(units)), cpuStr, base, units);
|
||||
if (Number.isNaN(Number(units))) {
|
||||
switch (units) {
|
||||
case 'n':
|
||||
|
@ -23,7 +22,6 @@ export function parseMemory(memStr) {
|
|||
const unitLength = (memStr.substring(memStr.length - 1) === 'i' ? 2 : 1);
|
||||
const base = Number.parseInt(memStr, 10);
|
||||
const units = memStr.substring(memStr.length - unitLength);
|
||||
// console.log(Number.isNaN(Number(units)), memStr, base, units);
|
||||
if (Number.isNaN(Number(units))) {
|
||||
switch (units) {
|
||||
case 'Ki':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue