@axium/sysadmin 0.2.1 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/sysadmin",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "System administration for Axium",
6
6
  "funding": {
@@ -35,12 +35,6 @@
35
35
  return text('sysadmin.system.usage', { used: formatBytes(used), total: formatBytes(total) });
36
36
  }
37
37
 
38
- function speedText(speed: number): string {
39
- if (speed < 1000) return `${speed} MBit/s`;
40
- const gb = speed / 1000;
41
- return `${gb % 1 === 0 ? gb : gb.toFixed(1)} GBit/s`;
42
- }
43
-
44
38
  const socket = await connect();
45
39
 
46
40
  async function loadInfo() {
@@ -183,7 +177,11 @@
183
177
  {/if}
184
178
  </span>
185
179
  {#if iface.speed}
186
- <span class="subtle">{speedText(iface.speed)}</span>
180
+ <span class="subtle"
181
+ >{iface.speed < 1000
182
+ ? `${iface.speed} MBit/s`
183
+ : `${(iface.speed / 1000).toFixed(2).replace(/\.?0+$/, '')} GBit/s`}</span
184
+ >
187
185
  {/if}
188
186
  </span>
189
187
  </div>