web/storagenode: node version bug fixed (#3339)
This commit is contained in:
parent
97018d6d64
commit
4489c86539
@ -106,7 +106,7 @@ export default class SNOContentTitle extends Vue {
|
|||||||
public get version(): string {
|
public get version(): string {
|
||||||
const version = this.$store.state.node.info.version;
|
const version = this.$store.state.node.info.version;
|
||||||
|
|
||||||
return `v${version.major}.${version.minor}.${version.patch}`;
|
return `v${version}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get online(): boolean {
|
public get online(): boolean {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright (C) 2019 Storj Labs, Inc.
|
// Copyright (C) 2019 Storj Labs, Inc.
|
||||||
// See LICENSE for copying information.
|
// See LICENSE for copying information.
|
||||||
|
|
||||||
import { BandwidthInfo, Dashboard, DiskSpaceInfo, SatelliteInfo, Version } from '@/storagenode/dashboard';
|
import { BandwidthInfo, Dashboard, DiskSpaceInfo, SatelliteInfo } from '@/storagenode/dashboard';
|
||||||
import { BandwidthUsed, Egress, Ingress, Metric, Satellite, Satellites, Stamp } from '@/storagenode/satellite';
|
import { BandwidthUsed, Egress, Ingress, Metric, Satellite, Satellites, Stamp } from '@/storagenode/satellite';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,14 +38,12 @@ export class SNOApi {
|
|||||||
return new SatelliteInfo(satellite.id, disqualified);
|
return new SatelliteInfo(satellite.id, disqualified);
|
||||||
});
|
});
|
||||||
|
|
||||||
const version: Version = new Version(json.version.major, json.version.minor, json.version.patch);
|
|
||||||
|
|
||||||
const diskSpace: DiskSpaceInfo = new DiskSpaceInfo(json.diskSpace.used, json.diskSpace.available);
|
const diskSpace: DiskSpaceInfo = new DiskSpaceInfo(json.diskSpace.used, json.diskSpace.available);
|
||||||
|
|
||||||
const bandwidth: BandwidthInfo = new BandwidthInfo(json.bandwidth.used, json.bandwidth.available);
|
const bandwidth: BandwidthInfo = new BandwidthInfo(json.bandwidth.used, json.bandwidth.available);
|
||||||
|
|
||||||
return new Dashboard(json.nodeID, json.wallet, satellites, diskSpace, bandwidth,
|
return new Dashboard(json.nodeID, json.wallet, satellites, diskSpace, bandwidth,
|
||||||
new Date(json.lastPinged), new Date(json.startedAt), version, json.upToDate);
|
new Date(json.lastPinged), new Date(json.startedAt), json.version, json.upToDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,28 +13,10 @@ export class Dashboard {
|
|||||||
public bandwidth: BandwidthInfo,
|
public bandwidth: BandwidthInfo,
|
||||||
public lastPinged: Date,
|
public lastPinged: Date,
|
||||||
public startedAt: Date,
|
public startedAt: Date,
|
||||||
public version: Version,
|
public version: string,
|
||||||
public isUpToDate: boolean) {}
|
public isUpToDate: boolean) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Version represents a semantic version
|
|
||||||
*/
|
|
||||||
export class Version {
|
|
||||||
public constructor(
|
|
||||||
public major: number,
|
|
||||||
public minor: number,
|
|
||||||
public patch: number) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts version numbers to string type
|
|
||||||
* @returns version - string of version value
|
|
||||||
*/
|
|
||||||
public toString(): string {
|
|
||||||
return `v${this.major}.${this.minor}.${this.patch}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SatelliteInfo encapsulates satellite ID and disqualification
|
* SatelliteInfo encapsulates satellite ID and disqualification
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user