mirror of
https://github.com/logos-storage/logos-storage-installer.git
synced 2026-01-09 00:43:08 +00:00
debugs data features
This commit is contained in:
parent
54dfd5ee34
commit
51eb29ec5e
@ -44,12 +44,20 @@ export class DataService {
|
||||
|
||||
debugInfo = async () => {
|
||||
const debug = this.getCodexDebug();
|
||||
return await debug.info();
|
||||
const res = await debug.info();
|
||||
if (res.error) {
|
||||
throw new Error(res.data);
|
||||
}
|
||||
return res.data;
|
||||
};
|
||||
|
||||
localData = async () => {
|
||||
const data = this.getCodexData();
|
||||
return await data.cids();
|
||||
const res = await data.cids();
|
||||
if (res.error) {
|
||||
throw new Error(res.data);
|
||||
}
|
||||
return res.data;
|
||||
};
|
||||
|
||||
getCodex = () => {
|
||||
|
||||
@ -54,13 +54,13 @@ export class DataMenu {
|
||||
filesData.content.forEach((file, index) => {
|
||||
const { cid, manifest } = file;
|
||||
const {
|
||||
originalBytes,
|
||||
datasetSize,
|
||||
protected: isProtected,
|
||||
filename,
|
||||
mimetype,
|
||||
} = manifest;
|
||||
|
||||
const fileSize = (originalBytes / 1024).toFixed(2);
|
||||
const fileSize = (datasetSize / 1024).toFixed(2);
|
||||
|
||||
this.ui.showInfoMessage(
|
||||
`${chalk.cyan("File")} ${index + 1} of ${filesData.content.length}\n\n` +
|
||||
|
||||
@ -11,18 +11,18 @@ export class NodeStatusMenu {
|
||||
|
||||
showNodeStatus = async () => {
|
||||
this.debugInfo = await this.fetchDebugInfo();
|
||||
if (debugInfo == undefined) return;
|
||||
if (this.debugInfo == undefined) return;
|
||||
|
||||
const peerCount = this.debugInfo.table.nodes.length;
|
||||
const isOnline = peerCount > 2;
|
||||
|
||||
if (isOnline) {
|
||||
this.showSuccessMessage(
|
||||
this.ui.showSuccessMessage(
|
||||
"Node is ONLINE & DISCOVERABLE",
|
||||
"🔌 Node Status",
|
||||
);
|
||||
} else {
|
||||
this.showInfoMessage(
|
||||
this.ui.showInfoMessage(
|
||||
"Node is ONLINE but has few peers",
|
||||
"🔌 Node Status",
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user