2020-12-23 17:21:23 +00:00
|
|
|
// Copyright (C) 2020 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
/**
|
2021-01-04 18:17:00 +00:00
|
|
|
* NodeToAdd is a representation of storagenode, that SNO could add to the Multinode Dashboard.
|
2020-12-23 17:21:23 +00:00
|
|
|
*/
|
2021-01-04 18:17:00 +00:00
|
|
|
export class NodeToAdd {
|
2020-12-23 17:21:23 +00:00
|
|
|
public id: string; // TODO: create ts analog of storj.NodeID;
|
|
|
|
/**
|
|
|
|
* apiSecret is a secret issued by storagenode, that will be main auth mechanism in MND <-> SNO api.
|
|
|
|
*/
|
|
|
|
public apiSecret: string; // TODO: change to Uint8Array[];
|
|
|
|
public publicAddress: string;
|
|
|
|
public name: string;
|
|
|
|
}
|
2021-01-04 18:17:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes node online statuses.
|
|
|
|
*/
|
|
|
|
export enum NodeStatus {
|
|
|
|
Online = 'online',
|
|
|
|
Offline = 'offline',
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: refactor this
|
|
|
|
/**
|
|
|
|
* Node holds all information of node for the Multinode Dashboard.
|
|
|
|
*/
|
|
|
|
export class Node {
|
|
|
|
public constructor(
|
|
|
|
public id: string = '',
|
|
|
|
public name: string = '',
|
|
|
|
public diskSpaceUsed: number = 0,
|
|
|
|
public diskSpaceLeft: number = 0,
|
|
|
|
public bandwidthUsed: number = 0,
|
|
|
|
public earned: number = 0,
|
|
|
|
public version: string = '',
|
|
|
|
public status: NodeStatus = NodeStatus.Offline,
|
|
|
|
) {}
|
|
|
|
}
|