diff --git a/angular.json b/angular.json index 74007d0..40ffb74 100644 --- a/angular.json +++ b/angular.json @@ -43,9 +43,9 @@ "node_modules/bootstrap-table/dist/bootstrap-table.min.js" ], "styles": [ - "src/styles.scss", "node_modules/bootstrap-icons/font/bootstrap-icons.css", - "node_modules/bootstrap-table/dist/bootstrap-table.min.css" + "node_modules/bootstrap-table/dist/bootstrap-table.min.css", + "src/styles.scss" ], "customWebpackConfig": { "path": "./angular.webpack.js", diff --git a/app/main.ts b/app/main.ts index 7346507..4304562 100644 --- a/app/main.ts +++ b/app/main.ts @@ -1,5 +1,5 @@ import { app, BrowserWindow, ipcMain, screen, dialog, Tray, Menu, MenuItemConstructorOptions, - IpcMainInvokeEvent, Notification, NotificationConstructorOptions + IpcMainInvokeEvent, Notification, NotificationConstructorOptions, clipboard, } from 'electron'; import { ChildProcessWithoutNullStreams, exec, ExecException, spawn } from 'child_process'; import * as path from 'path'; @@ -254,7 +254,11 @@ function createWindow(): BrowserWindow { return win; } -const createSplashWindow = async (): Promise => { +const createSplashWindow = async (): Promise => { + + if (os.platform() == 'win32') { + return undefined; + } const window = new BrowserWindow({ width: 480, @@ -713,8 +717,11 @@ try { await new Promise((resolve, reject) => { try { setTimeout(() => { - splash.close(); - if (!minimized) win?.show(); + if (splash) splash.close(); + if (!minimized) { + win?.show(); + win?.maximize(); + } resolve(); }, 2600); } @@ -1030,6 +1037,10 @@ try { win?.webContents.send('on-is-app-image', isAppImage ? true : false); }); + ipcMain.handle('copy-to-clipboard', (event: IpcMainInvokeEvent, content: string) => { + clipboard.writeText(content, "selection"); + }); + } catch (e) { // Catch Error console.error(e); diff --git a/app/preload.js b/app/preload.js index a470ca5..aa7bd48 100644 --- a/app/preload.js +++ b/app/preload.js @@ -2,6 +2,9 @@ const { contextBridge, ipcRenderer } = require('electron'); contextBridge.exposeInMainWorld('electronAPI', { + copyToClipboard: (content) => { + ipcRenderer.invoke('copy-to-clipboard', content); + }, onTrayStartDaemon: (callback) => { ipcRenderer.on('on-tray-start-daemon', callback); }, diff --git a/package-lock.json b/package-lock.json index 68a4df7..aea4585 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "monerod-gui", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "monerod-gui", - "version": "0.1.1", + "version": "0.1.2", "hasInstallScript": true, "dependencies": { "@angular/common": "17.3.12", diff --git a/src/app/core/services/daemon/daemon-data.service.ts b/src/app/core/services/daemon/daemon-data.service.ts index f1d2ec0..cee4732 100644 --- a/src/app/core/services/daemon/daemon-data.service.ts +++ b/src/app/core/services/daemon/daemon-data.service.ts @@ -1,6 +1,6 @@ import { EventEmitter, Injectable, NgZone } from '@angular/core'; import { DaemonService } from './daemon.service'; -import { BlockCount, BlockHeader, Chain, Connection, CoreIsBusyError, DaemonInfo, MinerData, MiningStatus, NetStats, NetStatsHistory, PeerInfo, ProcessStats, PublicNode, SyncInfo, TimeUtils, TxBacklogEntry, TxPool, TxPoolStats } from '../../../../common'; +import { BlockCount, BlockHeader, Chain, Connection, CoreIsBusyError, DaemonInfo, MinerData, MiningStatus, NetHashRateHistory, NetStats, NetStatsHistory, PeerInfo, ProcessStats, PublicNode, SyncInfo, TimeUtils, TxBacklogEntry, TxPool, TxPoolStats } from '../../../../common'; import { ElectronService } from '../electron/electron.service'; @Injectable({ @@ -42,6 +42,8 @@ export class DaemonDataService { private _netStatsHistory: NetStatsHistory = new NetStatsHistory(); private _gettingNetStats: boolean = false; + private _hashRateHistory: NetHashRateHistory = new NetHashRateHistory(); + private _miningStatus?: MiningStatus; private _gettingMiningStatus: boolean = false; @@ -81,6 +83,7 @@ export class DaemonDataService { this.daemonService.onDaemonStatusChanged.subscribe((running: boolean) => { this.ngZone.run(() => { + this._hashRateHistory = new NetHashRateHistory(); if (running) { this._daemonRunning = true; this.startLoop(); @@ -253,6 +256,10 @@ export class DaemonDataService { return this._gettingTxPoolStats; } + public get netHashRateHistory(): NetHashRateHistory { + return this._hashRateHistory; + } + public setRefreshTimeout(ms: number = 5000): void { this.refreshTimeoutMs = ms; } @@ -356,14 +363,7 @@ export class DaemonDataService { try { const settings = await this.daemonService.getSettings(); - - const updateInfo = await this.daemonService.checkUpdate() - - if (updateInfo.update && settings.upgradeAutomatically) { - await this.daemonService.upgrade(); - return; - } - + const syncAlreadyDisabled = this.daemonService.settings.noSync; if (!settings.noSync && !syncAlreadyDisabled && !settings.syncOnWifi) { @@ -440,9 +440,17 @@ export class DaemonDataService { this._daemonInfo = await this.daemonService.getInfo(); this._gettingDaemonInfo = false; + if (this._daemonInfo.synchronized) { + this._hashRateHistory.add(this._daemonInfo.gigaHashRate); + } + if (this.daemonService.settings.upgradeAutomatically && this._daemonInfo.updateAvailable) { - await this.daemonService.upgrade(); - return; + const updateInfo = await this.daemonService.checkUpdate() + + if (updateInfo.update) { + await this.daemonService.upgrade(); + return; + } } this._gettingSyncInfo = true; diff --git a/src/app/pages/about/about.component.html b/src/app/pages/about/about.component.html index 488ff83..5382e86 100644 --- a/src/app/pages/about/about.component.html +++ b/src/app/pages/about/about.component.html @@ -15,9 +15,11 @@
+

Monerod GUI

+
Version: {{ guiVersion }}

@@ -32,37 +34,24 @@
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-
-
-
Donations
-
-
-
    -
  • -

    XMR

    -
    -

    -
    -
    - 84Q1SdQgFWaEWRn5KcvSPCQUa3NF39EJ3HPCTaiM86RHLLftqgTZpkP24jXrK5YpeedWbQAjHcFcDLpFJfr9TypfAU7pPjA -

    -
  • -
  • -

    BTC

    -
    -

    -
    -
    - bc1qndc2lesy0sse9vj33a35pnfrqz4znlhhs58vfp -

    - -
  • -
-
-
-
+ +
+
+
+ +
+
+
+
+ +
+

Contact

+
+ +
  • GitHub: https://github.com/everoddandeven/monerod-gui
  • Matrix: @everoddandeven:monero.social
  • @@ -70,13 +59,51 @@
  • Signal: @everoddandeven.01
- +
+ +
+
+
+ +
+

Donate

+
+ +
+
    +
  • + +
    + +
    + +
    +

    +
    +
    + {{XMRAddress}} +

    +

    +
    +
    + {{BTCAddress}} +

    + + +
  • +
+
+ +
+
+ +
+
diff --git a/src/app/pages/about/about.component.ts b/src/app/pages/about/about.component.ts index c6ada38..b24c7e2 100644 --- a/src/app/pages/about/about.component.ts +++ b/src/app/pages/about/about.component.ts @@ -9,9 +9,16 @@ import { DaemonService } from '../../core/services'; }) export class AboutComponent { public readonly links: NavbarLink[] = [ - new NavbarLink('pills-overview-tab', '#pills-overview', 'pills-overview', true, 'Overview') + new NavbarLink('pills-overview-tab', '#pills-overview', 'pills-overview', true, 'License', false), + new NavbarLink('pills-contact-tab', '#pills-contact', 'pills-contact', false, 'Contact', false), + new NavbarLink('pills-donate-tab', '#pills-donate', 'pills-donate', false, 'Donate', false) ]; + public donateCrypto: 'XMR' | 'BTC' = 'XMR'; + public readonly XMRAddress: string = '84Q1SdQgFWaEWRn5KcvSPCQUa3NF39EJ3HPCTaiM86RHLLftqgTZpkP24jXrK5YpeedWbQAjHcFcDLpFJfr9TypfAU7pPjA'; + public readonly BTCAddress: string = 'bc1qndc2lesy0sse9vj33a35pnfrqz4znlhhs58vfp'; + public addressCopied: boolean = false; + public get guiVersion(): string { return this.daemonService.getGuiVersion(); } @@ -20,5 +27,14 @@ export class AboutComponent { } + public copyAddressToClipboard(): void { + window.electronAPI.copyToClipboard(this.donateCrypto == 'XMR' ? this.XMRAddress : this.BTCAddress); + this.addressCopied = true; + + setTimeout(() => { + this.addressCopied = false; + }, 1500); + } + } diff --git a/src/app/pages/logs/logs.component.scss b/src/app/pages/logs/logs.component.scss index fa5c794..9730174 100644 --- a/src/app/pages/logs/logs.component.scss +++ b/src/app/pages/logs/logs.component.scss @@ -1,11 +1,12 @@ .terminal { - max-height: 700px; - overflow-y: auto; - font-family: monospace; - border: 1px solid #333; - border-radius: 5px; - } + max-height: 600px; + overflow-y: auto; + font-family: monospace; + border: 1px solid #333; + border-radius: 5px; +} .terminal-output { -white-space: pre-wrap; + white-space: pre-wrap; + font-size: small; } diff --git a/src/app/pages/mining/mining.component.html b/src/app/pages/mining/mining.component.html index 6440f51..468d6d3 100644 --- a/src/app/pages/mining/mining.component.html +++ b/src/app/pages/mining/mining.component.html @@ -16,7 +16,7 @@ @@ -119,18 +119,18 @@ -
+
- - + + - - + +
-

Necessary data to create a custom block template, used by p2pool

+

Necessary data to create a custom block template, used by p2pool