various additions
parent
789c97f3ff
commit
8c7bf288c4
|
@ -4,6 +4,7 @@ import net from 'net';
|
|||
import crypto from 'crypto';
|
||||
import { promises as fs } from 'fs';
|
||||
import Client from '../Client';
|
||||
import { dataConversion } from '../functions';
|
||||
|
||||
export default class CSCLI {
|
||||
public client: Client;
|
||||
|
@ -42,13 +43,12 @@ export default class CSCLI {
|
|||
await this.client.util.accounts.lock(parsed.Username, this.client.user.id, { reason: 'Failed to accept Terms of Service.' });
|
||||
break;
|
||||
case 'ram':
|
||||
const mem = Number(await this.client.util.exec(`memory ${parsed.Username}`)) * 1000;
|
||||
const memoryConversion = mem / 1024 / 1024;
|
||||
const memoryConversion = dataConversion(Number(await this.client.util.exec(`memory ${parsed.Username}`)) * 1000);
|
||||
socket.write(`${memoryConversion}\n`);
|
||||
socket.destroy();
|
||||
break;
|
||||
case 'storage':
|
||||
const res = await this.client.redis.get(`storage-${parsed.Username}`) ? Number(await this.client.redis.get(`storage-${parsed.Username}`)) : '0';
|
||||
const res = await this.client.redis.get(`storage-${parsed.Username}`) ? dataConversion(Number(await this.client.redis.get(`storage-${parsed.Username}`))) : 'N/A';
|
||||
socket.write(`${res}\n`);
|
||||
socket.destroy();
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue