@axium/sysadmin 0.0.1 → 0.1.1

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.
@@ -136,7 +136,7 @@ function memory() {
136
136
  function networkInterfaces() {
137
137
  const result = [];
138
138
  for (const name of list('/sys/class/net')) {
139
- if (name === 'lo')
139
+ if (name === 'lo' || name.startsWith('veth') || name.startsWith('docker') || name.startsWith('br-'))
140
140
  continue;
141
141
  const operstate = read(`/sys/class/net/${name}/operstate`);
142
142
  const connected = operstate === 'up' || read(`/sys/class/net/${name}/carrier`) === '1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/sysadmin",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "System administration for Axium",
6
6
  "funding": {
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@axium/client": ">=0.27.0",
40
- "@axium/core": ">=0.23.0",
40
+ "@axium/core": ">=0.33.0",
41
41
  "@axium/server": ">=0.47.0",
42
42
  "@sveltejs/kit": "^2.27.3",
43
43
  "kysely": "^0.29.0",
package/dist/_probe.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/_probe.js DELETED
@@ -1,4 +0,0 @@
1
- import { SystemType } from './common.js';
2
- const v = SystemType.def.values;
3
- const _check = v;
4
- console.log(v);
@@ -1,38 +0,0 @@
1
- import { systemInfo } from './info.js';
2
- import { formatBytes } from '@axium/core';
3
- import { styleText } from 'node:util';
4
-
5
- const t = ' ',
6
- t2 = ' ';
7
-
8
- const { cpus, gpus, memory, storage, networkInterfaces, uptime, ...rest } = systemInfo();
9
-
10
- function usage(info) {
11
- return styleText('blueBright', formatBytes(info.used)) + '/' + styleText('blueBright', formatBytes(info.total));
12
- }
13
-
14
- const num = value => styleText('blueBright', value.toString());
15
-
16
- console.log('CPUs:');
17
- for (const cpu of cpus) console.log(t, num(cpu.cores) + 'x', styleText('yellow', cpu.model));
18
-
19
- console.log('GPUs:');
20
- for (const gpu of gpus) {
21
- console.log(t, styleText('yellow', gpu.model));
22
- if (gpu.vram) console.log(t2, 'VRAM:', usage(gpu.vram));
23
- }
24
-
25
- console.log('Memory:', usage(memory));
26
- if (memory.swap) console.log(t, 'Swap:', usage(memory.swap));
27
-
28
- console.log('Storage:');
29
- for (const drive of storage) console.log(t, styleText('yellow', drive.model), usage(drive));
30
-
31
- console.log('Network:');
32
- for (const iface of networkInterfaces) {
33
- console.log(t, styleText('cyanBright', iface.name), styleText('yellow', iface.model), iface.wireless ? '(wireless)' : '(wired)');
34
- if (iface.connected)
35
- console.log(t2, iface.connection ? 'Connected to ' + iface.connection : 'Connected', 'at', num(iface.speed), 'MBit/s');
36
- }
37
-
38
- console.log(rest);