mirror of
https://github.com/everoddandeven/monerod-gui.git
synced 2024-12-22 19:49:27 +00:00
Minor fixes
This commit is contained in:
parent
eb37929c14
commit
09782e68f7
4 changed files with 75 additions and 78 deletions
|
@ -69,7 +69,7 @@ export class DaemonDataService {
|
|||
|
||||
public readonly syncStart: EventEmitter<{ first: boolean }> = new EventEmitter<{ first: boolean }>();
|
||||
public readonly syncEnd: EventEmitter<void> = new EventEmitter<void>();
|
||||
public readonly syncError: EventEmitter<Error> = new EventEmitter<Error>();
|
||||
public readonly syncError: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
public readonly syncInfoRefreshStart: EventEmitter<void> = new EventEmitter<void>();
|
||||
public readonly syncInfoRefreshEnd: EventEmitter<void> = new EventEmitter<void>();
|
||||
|
@ -354,58 +354,64 @@ export class DaemonDataService {
|
|||
|
||||
this._refreshing = true;
|
||||
|
||||
const settings = await this.daemonService.getSettings();
|
||||
try {
|
||||
const settings = await this.daemonService.getSettings();
|
||||
|
||||
const updateInfo = await this.daemonService.checkUpdate()
|
||||
|
||||
if (updateInfo.update) {
|
||||
await this.daemonService.upgrade();
|
||||
return;
|
||||
}
|
||||
|
||||
const syncAlreadyDisabled = this.daemonService.settings.noSync;
|
||||
|
||||
if (!settings.noSync && !syncAlreadyDisabled && !settings.syncOnWifi) {
|
||||
const wifiConnected = await this.electronService.isWifiConnected();
|
||||
|
||||
if (wifiConnected) {
|
||||
console.log("Disabling sync ...");
|
||||
await this.daemonService.disableSync();
|
||||
this.syncDisabledByWifiPolicy = true;
|
||||
const updateInfo = await this.daemonService.checkUpdate()
|
||||
|
||||
if (updateInfo.update && settings.upgradeAutomatically) {
|
||||
await this.daemonService.upgrade();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!settings.noSync && syncAlreadyDisabled && !settings.syncOnWifi) {
|
||||
const wifiConnected = await this.electronService.isWifiConnected();
|
||||
|
||||
if (!wifiConnected) {
|
||||
console.log("Enabling sync ...");
|
||||
|
||||
await this.daemonService.enableSync();
|
||||
this.syncDisabledByWifiPolicy = false;
|
||||
|
||||
const syncAlreadyDisabled = this.daemonService.settings.noSync;
|
||||
|
||||
if (!settings.noSync && !syncAlreadyDisabled && !settings.syncOnWifi) {
|
||||
const wifiConnected = await this.electronService.isWifiConnected();
|
||||
|
||||
if (wifiConnected) {
|
||||
console.log("Disabling sync ...");
|
||||
await this.daemonService.disableSync();
|
||||
this.syncDisabledByWifiPolicy = true;
|
||||
}
|
||||
}
|
||||
else if (!settings.noSync && syncAlreadyDisabled && !settings.syncOnWifi) {
|
||||
const wifiConnected = await this.electronService.isWifiConnected();
|
||||
|
||||
if (!wifiConnected) {
|
||||
console.log("Enabling sync ...");
|
||||
|
||||
await this.daemonService.enableSync();
|
||||
this.syncDisabledByWifiPolicy = false;
|
||||
}
|
||||
else {
|
||||
this.syncDisabledByWifiPolicy = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.syncDisabledByWifiPolicy = true;
|
||||
this.syncDisabledByWifiPolicy = false;
|
||||
}
|
||||
|
||||
if (!syncAlreadyDisabled && !this.syncDisabledByWifiPolicy && !this.syncDisabledByPeriodPolicy && settings.syncPeriodEnabled && !TimeUtils.isInTimeRange(settings.syncPeriodFrom, settings.syncPeriodTo)) {
|
||||
await this.daemonService.disableSync();
|
||||
this.syncDisabledByPeriodPolicy = true;
|
||||
}
|
||||
else if (syncAlreadyDisabled && !this.syncDisabledByWifiPolicy && this.syncDisabledByPeriodPolicy && settings.syncPeriodEnabled && TimeUtils.isInTimeRange(settings.syncPeriodFrom, settings.syncPeriodTo)) {
|
||||
await this.daemonService.enableSync();
|
||||
this.syncDisabledByPeriodPolicy = false;
|
||||
}
|
||||
else if (syncAlreadyDisabled && !this.syncDisabledByWifiPolicy && settings.syncPeriodEnabled && !TimeUtils.isInTimeRange(settings.syncPeriodFrom, settings.syncPeriodTo)) {
|
||||
this.syncDisabledByPeriodPolicy = true;
|
||||
}
|
||||
else {
|
||||
this.syncDisabledByPeriodPolicy = false;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
this.syncDisabledByWifiPolicy = false;
|
||||
catch(error: any) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
if (!syncAlreadyDisabled && !this.syncDisabledByWifiPolicy && !this.syncDisabledByPeriodPolicy && settings.syncPeriodEnabled && !TimeUtils.isInTimeRange(settings.syncPeriodFrom, settings.syncPeriodTo)) {
|
||||
await this.daemonService.disableSync();
|
||||
this.syncDisabledByPeriodPolicy = true;
|
||||
}
|
||||
else if (syncAlreadyDisabled && !this.syncDisabledByWifiPolicy && this.syncDisabledByPeriodPolicy && settings.syncPeriodEnabled && TimeUtils.isInTimeRange(settings.syncPeriodFrom, settings.syncPeriodTo)) {
|
||||
await this.daemonService.enableSync();
|
||||
this.syncDisabledByPeriodPolicy = false;
|
||||
}
|
||||
else if (syncAlreadyDisabled && !this.syncDisabledByWifiPolicy && settings.syncPeriodEnabled && !TimeUtils.isInTimeRange(settings.syncPeriodFrom, settings.syncPeriodTo)) {
|
||||
this.syncDisabledByPeriodPolicy = true;
|
||||
}
|
||||
else {
|
||||
this.syncDisabledByPeriodPolicy = false;
|
||||
}
|
||||
|
||||
|
||||
this.syncStart.emit({ first: this._firstRefresh });
|
||||
|
||||
try {
|
||||
|
@ -507,7 +513,7 @@ export class DaemonDataService {
|
|||
|
||||
this._lastRefreshHeight = this._daemonInfo.heightWithoutBootstrap;
|
||||
this._lastRefresh = Date.now();
|
||||
} catch(error) {
|
||||
} catch(error: any) {
|
||||
console.error(error);
|
||||
this._gettingDaemonInfo = false;
|
||||
this._gettingSyncInfo = false;
|
||||
|
@ -522,7 +528,7 @@ export class DaemonDataService {
|
|||
this._gettingPeerList = false;
|
||||
this._gettingTxPoolStats = false;
|
||||
|
||||
this.syncError.emit(<Error>error);
|
||||
this.syncError.emit(error);
|
||||
|
||||
if (!await this.daemonService.isRunning()) {
|
||||
this.stopLoop();
|
||||
|
|
|
@ -348,16 +348,7 @@ export class DaemonService {
|
|||
}
|
||||
catch (error: any) {
|
||||
if (error instanceof HttpErrorResponse) {
|
||||
if (error.status == 0) {
|
||||
const wasRunning = this.daemonRunning;
|
||||
this.daemonRunning = false;
|
||||
|
||||
if (wasRunning) {
|
||||
this.onDaemonStatusChanged.emit(false);
|
||||
}
|
||||
}
|
||||
|
||||
const errorMessage: string = `${error.message}`;
|
||||
const errorMessage: string = error.status == 0 ? `No connection` : `${error.message}`;
|
||||
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
|
|
|
@ -36,25 +36,25 @@
|
|||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="connectionId">ID</th>
|
||||
<th data-field="peerId">Peer ID</th>
|
||||
<th data-field="connectionId" data-visible="false">ID</th>
|
||||
<th data-field="peerId" data-visible="false">Peer ID</th>
|
||||
<th data-field="address">Address</th>
|
||||
<th data-field="host">Host</th>
|
||||
<th data-field="ip">IP</th>
|
||||
<th data-field="port">Port</th>
|
||||
<th data-field="host" data-visible="false">Host</th>
|
||||
<th data-field="ip" data-visible="false">IP</th>
|
||||
<th data-field="port" data-visible="false">Port</th>
|
||||
<th data-field="state">State</th>
|
||||
<th data-field="avgDownload">Avg Download</th>
|
||||
<th data-field="avgUpload">Avg Upload</th>
|
||||
<th data-field="avgDownload" data-visible="false">Avg Download</th>
|
||||
<th data-field="avgUpload" data-visible="false">Avg Upload</th>
|
||||
<th data-field="currentDownload">Current Download</th>
|
||||
<th data-field="currentUpload">Current Upload</th>
|
||||
<th data-field="height">Height</th>
|
||||
<th data-field="height" data-visible="false">Height</th>
|
||||
<th data-field="incoming">Incoming</th>
|
||||
<th data-field="liveTime">Live Time</th>
|
||||
<th data-field="recvCount">Recv Count</th>
|
||||
<th data-field="recvIdleTime">Recv Idle Time</th>
|
||||
<th data-field="sendCount">Send Count</th>
|
||||
<th data-field="sendIdleTime">Send Idle Time</th>
|
||||
<th data-field="supportFlags">Support Flags</th>
|
||||
<th data-field="recvCount" data-visible="false">Recv Count</th>
|
||||
<th data-field="recvIdleTime" data-visible="false">Recv Idle Time</th>
|
||||
<th data-field="sendCount" data-visible="false">Send Count</th>
|
||||
<th data-field="sendIdleTime" data-visible="false">Send Idle Time</th>
|
||||
<th data-field="supportFlags" data-visible="false">Support Flags</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
|
|
@ -76,17 +76,17 @@
|
|||
<th data-field="idHash">ID Hash</th>
|
||||
<th data-field="relayed">Relayed</th>
|
||||
<th data-field="blobSize">Blob Size</th>
|
||||
<th data-field="doNotRelay">Do Not Relay</th>
|
||||
<th data-field="doNotRelay" data-visible="false">Do Not Relay</th>
|
||||
<th data-field="doubleSpendSeen">Double Spend Seen</th>
|
||||
<th data-field="fee">Fee</th>
|
||||
<th data-field="keptByBlock">Kept By Block</th>
|
||||
<th data-field="lastFailedHeight">Last Failed Height</th>
|
||||
<th data-field="lastFailedIdHash">Last Failed Id Hash</th>
|
||||
<th data-field="keptByBlock" data-visible="false">Kept By Block</th>
|
||||
<th data-field="lastFailedHeight" data-visible="false">Last Failed Height</th>
|
||||
<th data-field="lastFailedIdHash" data-visible="false">Last Failed Id Hash</th>
|
||||
<th data-field="lastRelayedTime">Last Relayed Time</th>
|
||||
<th data-field="maxUsedBlockHeight">Max Used Block Height</th>
|
||||
<th data-field="maxUsedBlockIdHash">Max Used Block Id Hash</th>
|
||||
<th data-field="maxUsedBlockHeight" data-visible="false">Max Used Block Height</th>
|
||||
<th data-field="maxUsedBlockIdHash" data-visible="false">Max Used Block Id Hash</th>
|
||||
<th data-field="receiveTime">Receive Time</th>
|
||||
<th data-field="txBlob">Tx Blob</th>
|
||||
<th data-field="txBlob" data-visible="false">Tx Blob</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
|
Loading…
Reference in a new issue