@axium/sysadmin 0.3.1 → 0.3.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/client/cli.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { session } from '@axium/client/cli/config';
|
|
2
2
|
import { fetchAPI } from '@axium/client/requests';
|
|
3
3
|
import { connect } from '@axium/client/socket';
|
|
4
|
-
import
|
|
4
|
+
import * as format from 'utilium/format';
|
|
5
5
|
import { program } from 'commander';
|
|
6
6
|
import * as io from 'ioium/node';
|
|
7
7
|
import { styleText } from 'node:util';
|
|
8
8
|
import './socket.js';
|
|
9
9
|
function usage(info) {
|
|
10
|
-
return styleText('blueBright',
|
|
10
|
+
return styleText('blueBright', format.bytes(info.used)) + '/' + styleText('blueBright', format.bytes(info.total));
|
|
11
11
|
}
|
|
12
12
|
function drive(device) {
|
|
13
|
-
return styleText('blueBright',
|
|
13
|
+
return styleText('blueBright', format.bytes(device.size)) + (device.interface ? ' ' + styleText('dim', device.interface) : '');
|
|
14
14
|
}
|
|
15
15
|
const num = (value) => value === undefined ? styleText('red', '<unknown>') : styleText('blueBright', value.toString());
|
|
16
16
|
const tab = ' ', tab2 = ' ';
|
|
@@ -48,7 +48,7 @@ function dumpInfo(system, info) {
|
|
|
48
48
|
if (iface.connected)
|
|
49
49
|
console.log(tab2, iface.connection ? 'Connected to ' + iface.connection : 'Connected', 'at', num(iface.speed), 'MBit/s');
|
|
50
50
|
}
|
|
51
|
-
console.log('Uptime:',
|
|
51
|
+
console.log('Uptime:', format.duration(uptime));
|
|
52
52
|
for (const [key, value] of Object.entries(rest)) {
|
|
53
53
|
console.log(key + ':', value);
|
|
54
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axium/sysadmin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"author": "James Prevett <axium@jamespre.dev>",
|
|
5
5
|
"description": "System administration for Axium",
|
|
6
6
|
"funding": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@axium/server": ">=0.47.0",
|
|
42
42
|
"@sveltejs/kit": "^2.27.3",
|
|
43
43
|
"kysely": "^0.29.0",
|
|
44
|
-
"utilium": "^3.
|
|
44
|
+
"utilium": "^3.8.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"commander": "^15.0.0",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { Icon, NumberBar } from '@axium/client/components';
|
|
4
4
|
import { connect } from '@axium/client/socket';
|
|
5
5
|
import { toastStatus } from '@axium/client/toast';
|
|
6
|
-
import
|
|
6
|
+
import * as format from 'utilium/format';
|
|
7
7
|
import { systemTypeIcons, type SystemInfo } from '@axium/sysadmin';
|
|
8
8
|
import '@axium/sysadmin/common';
|
|
9
9
|
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function usageText(used: bigint, total: bigint): string {
|
|
39
|
-
if (used <= 0n) return
|
|
40
|
-
return text('sysadmin.system.usage', { used:
|
|
39
|
+
if (used <= 0n) return format.bytes(total);
|
|
40
|
+
return text('sysadmin.system.usage', { used: format.bytes(used), total: format.bytes(total) });
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const socket = await connect();
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
{disk.model}
|
|
185
185
|
</span>
|
|
186
186
|
<span class="subtle">
|
|
187
|
-
{
|
|
187
|
+
{format.bytes(disk.size)}
|
|
188
188
|
{#if disk.interface}<span class="dot">·</span>{disk.interface}{/if}
|
|
189
189
|
</span>
|
|
190
190
|
</div>
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
<span class="mount">{disk.model}</span>
|
|
198
198
|
<span class="tags">
|
|
199
199
|
<span class="subtle">
|
|
200
|
-
{
|
|
200
|
+
{format.bytes(disk.size)}
|
|
201
201
|
{#if disk.interface}<span class="dot">·</span>{disk.interface}{/if}
|
|
202
202
|
</span>
|
|
203
203
|
<span class="tag unused">{text('sysadmin.system.storage_unused')}</span>
|
|
@@ -248,7 +248,7 @@
|
|
|
248
248
|
<dt>{text('sysadmin.system.arch')}</dt>
|
|
249
249
|
<dd>{info.arch} <span class="subtle">({info.machine})</span></dd>
|
|
250
250
|
<dt>{text('sysadmin.system.uptime')}</dt>
|
|
251
|
-
<dd>{
|
|
251
|
+
<dd>{format.duration(info.uptime)}</dd>
|
|
252
252
|
</dl>
|
|
253
253
|
</section>
|
|
254
254
|
{/if}
|