Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f677e23d09 |
No files matched your search
@@ -4,14 +4,14 @@
|
|||||||
<h3>Homarr</h3>
|
<h3>Homarr</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
**Thank you for your contribution. Please ensure that your pull request meets the following requirements:**
|
**Thank you for your contribution. Please ensure that your pull request meets the following pull request:**
|
||||||
|
|
||||||
- [ ] Relevant checks pass without warnings or errors
|
- [ ] Builds without warnings or errors (`pnpm build`, autofix with `pnpm format:fix`)
|
||||||
- [ ] Pull request targets the intended base branch (`dev` by default; `release/v2` for v2 release work)
|
- [ ] Pull request targets `dev` branch
|
||||||
- [ ] Commits follow the [conventional commits guideline](https://www.conventionalcommits.org/en/v1.0.0/)
|
- [ ] Commits follow the [conventional commits guideline](https://www.conventionalcommits.org/en/v1.0.0/)
|
||||||
- [ ] No shorthand variable names are used (for example, `x`, `y`, `i`, or abbreviations)
|
- [ ] No shorthand variable names are used (eg. `x`, `y`, `i` or any abbrevation)
|
||||||
- [ ] User-facing changes include matching documentation updates under `apps/docs`
|
- [ ] Documentation is up to date. Create a pull request [here](https://github.com/homarr-labs/documentation/).
|
||||||
- [ ] When using AI, no temporary files are checked in and the code style follows the rest of the project
|
- [ ] When using AI; No temp files are checked in, the code style follows the rest of the project
|
||||||
|
|
||||||
**When contributing a new integration or widget:**
|
**When contributing a new integration or widget:**
|
||||||
|
|
||||||
|
|||||||
@@ -39,9 +39,8 @@ export class UnraidIntegration extends Integration implements ISystemHealthMonit
|
|||||||
const cpuUtilization = systemInfo.metrics.cpu.cpus.reduce((acc, val) => acc + val.percentTotal, 0);
|
const cpuUtilization = systemInfo.metrics.cpu.cpus.reduce((acc, val) => acc + val.percentTotal, 0);
|
||||||
const cpuCount = systemInfo.info.cpu.cores;
|
const cpuCount = systemInfo.info.cpu.cores;
|
||||||
|
|
||||||
// We use "info" object instead of the stats since this is the exact amount the kernel sees, which is what Unraid displays.
|
const totalMemory = systemInfo.metrics.memory.total;
|
||||||
const totalMemory = systemInfo.info.memory.layout.reduce((acc, layout) => layout.size + acc, 0);
|
const usedMemory = Math.max(totalMemory - systemInfo.metrics.memory.available, 0);
|
||||||
const usedMemory = totalMemory * (systemInfo.metrics.memory.percentTotal / 100);
|
|
||||||
const uptime = dayjs(systemInfo.info.os.uptime);
|
const uptime = dayjs(systemInfo.info.os.uptime);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -136,11 +135,6 @@ export class UnraidIntegration extends Integration implements ISystemHealthMonit
|
|||||||
brand,
|
brand,
|
||||||
cores,
|
cores,
|
||||||
threads
|
threads
|
||||||
},
|
|
||||||
memory {
|
|
||||||
layout {
|
|
||||||
size
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,13 +60,6 @@ export const unraidSystemInfoSchema = z.object({
|
|||||||
cores: z.number(),
|
cores: z.number(),
|
||||||
threads: z.number(),
|
threads: z.number(),
|
||||||
}),
|
}),
|
||||||
memory: z.object({
|
|
||||||
layout: z.array(
|
|
||||||
z.object({
|
|
||||||
size: z.number(),
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
}),
|
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user