mirror of
https://github.com/everoddandeven/monerod-gui.git
synced 2025-01-05 10:29:27 +00:00
Windows standalone app, msi installer and minor fixes
This commit is contained in:
parent
6bc64a369b
commit
02bfd5ff9f
8 changed files with 107 additions and 158 deletions
|
@ -1,5 +1,5 @@
|
||||||
# This is a basic workflow to help you get started with Actions
|
# This is a basic workflow to help you get started with Actions
|
||||||
name: 'Windows Portable Build'
|
name: 'Windows Build'
|
||||||
|
|
||||||
# Controls when the action will run.
|
# Controls when the action will run.
|
||||||
on:
|
on:
|
58
.github/workflows/windows_installer.yml
vendored
58
.github/workflows/windows_installer.yml
vendored
|
@ -1,58 +0,0 @@
|
||||||
# This is a basic workflow to help you get started with Actions
|
|
||||||
name: 'Windows Installer Build'
|
|
||||||
|
|
||||||
# Controls when the action will run.
|
|
||||||
on:
|
|
||||||
# Triggers the workflow on push or pull request events but only for the main branch
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [20]
|
|
||||||
|
|
||||||
# The type of runner that the job will run on
|
|
||||||
runs-on: windows-2022
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Cache node modules
|
|
||||||
uses: actions/cache@v4
|
|
||||||
env:
|
|
||||||
cache-name: cache-node-modules
|
|
||||||
with:
|
|
||||||
# npm cache files are stored in `~/.npm`
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
||||||
${{ runner.os }}-build-
|
|
||||||
${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: npm i
|
|
||||||
|
|
||||||
- name: Check lint
|
|
||||||
run: npm run lint
|
|
||||||
|
|
||||||
- name: Build the app
|
|
||||||
run: npm run electron:build:win
|
|
|
@ -254,10 +254,7 @@ function createWindow(): BrowserWindow {
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
const createSplashWindow = async (): Promise<BrowserWindow | undefined> => {
|
const createSplashWindow = async (): Promise<BrowserWindow> => {
|
||||||
if (os.platform() == 'win32') {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const window = new BrowserWindow({
|
const window = new BrowserWindow({
|
||||||
width: 480,
|
width: 480,
|
||||||
|
@ -716,7 +713,7 @@ try {
|
||||||
await new Promise<void>((resolve, reject) => {
|
await new Promise<void>((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (splash) splash.close();
|
splash.close();
|
||||||
if (!minimized) win?.show();
|
if (!minimized) win?.show();
|
||||||
resolve();
|
resolve();
|
||||||
}, 2600);
|
}, 2600);
|
||||||
|
@ -1028,7 +1025,7 @@ try {
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.handle('is-app-image', (event: IpcMainInvokeEvent) => {
|
ipcMain.handle('is-app-image', (event: IpcMainInvokeEvent) => {
|
||||||
const isAppImage: boolean = !!process.env.APPIMAGE;
|
const isAppImage: boolean = (!!process.env.APPIMAGE) || (!!process.env.PORTABLE_EXECUTABLE_DIR);
|
||||||
|
|
||||||
win?.webContents.send('on-is-app-image', isAppImage ? true : false);
|
win?.webContents.send('on-is-app-image', isAppImage ? true : false);
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,11 +17,16 @@
|
||||||
"win": {
|
"win": {
|
||||||
"icon": "dist/assets/icons",
|
"icon": "dist/assets/icons",
|
||||||
"target": [
|
"target": [
|
||||||
|
"msi",
|
||||||
"portable"
|
"portable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"msi": {
|
||||||
|
"artifactName": "${productName}-${version}-setup.${ext}",
|
||||||
|
"createDesktopShortcut": "always"
|
||||||
|
},
|
||||||
"portable": {
|
"portable": {
|
||||||
"splashImage": "dist/assets/icons/electron.bmp"
|
"artifactName": "${productName}-${version}-portable.${ext}"
|
||||||
},
|
},
|
||||||
"mac": {
|
"mac": {
|
||||||
"icon": "dist/assets/icons",
|
"icon": "dist/assets/icons",
|
||||||
|
|
|
@ -416,6 +416,7 @@ export class DaemonDataService {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this._daemonRunning = await this.daemonService.isRunning();
|
this._daemonRunning = await this.daemonService.isRunning();
|
||||||
|
const firstRefresh = this._firstRefresh;
|
||||||
this._firstRefresh = false;
|
this._firstRefresh = false;
|
||||||
|
|
||||||
if (!this._daemonRunning) {
|
if (!this._daemonRunning) {
|
||||||
|
@ -426,6 +427,15 @@ export class DaemonDataService {
|
||||||
|
|
||||||
await this.refreshProcessStats();
|
await this.refreshProcessStats();
|
||||||
|
|
||||||
|
if (firstRefresh) {
|
||||||
|
this._gettingIsBlockchainPruned = true;
|
||||||
|
|
||||||
|
const settings = await this.daemonService.getSettings();
|
||||||
|
this._isBlockchainPruned = settings.pruneBlockchain;
|
||||||
|
|
||||||
|
this._gettingIsBlockchainPruned = false;
|
||||||
|
}
|
||||||
|
|
||||||
this._gettingDaemonInfo = true;
|
this._gettingDaemonInfo = true;
|
||||||
this._daemonInfo = await this.daemonService.getInfo();
|
this._daemonInfo = await this.daemonService.getInfo();
|
||||||
this._gettingDaemonInfo = false;
|
this._gettingDaemonInfo = false;
|
||||||
|
@ -451,24 +461,7 @@ export class DaemonDataService {
|
||||||
this._gettingLastBlockHeader = false;
|
this._gettingLastBlockHeader = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this._daemonInfo.synchronized && this._daemonInfo.altBlocksCount > 0) await this.refreshAltChains();
|
||||||
this._gettingIsBlockchainPruned = true;
|
|
||||||
|
|
||||||
const settings = await this.daemonService.getSettings();
|
|
||||||
this._isBlockchainPruned = settings.pruneBlockchain;
|
|
||||||
/*
|
|
||||||
if (firstRefresh) {
|
|
||||||
this.daemonService.pruneBlockchain(true).then((info) => {
|
|
||||||
this._isBlockchainPruned = info.pruned;
|
|
||||||
}).catch((error) => {
|
|
||||||
console.error(error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
this._gettingIsBlockchainPruned = false;
|
|
||||||
|
|
||||||
if (this._daemonInfo.synchronized) await this.refreshAltChains();
|
|
||||||
|
|
||||||
this._gettingNetStats = true;
|
this._gettingNetStats = true;
|
||||||
this.netStatsRefreshStart.emit();
|
this.netStatsRefreshStart.emit();
|
||||||
|
@ -477,9 +470,10 @@ export class DaemonDataService {
|
||||||
this.netStatsRefreshEnd.emit();
|
this.netStatsRefreshEnd.emit();
|
||||||
this._gettingNetStats = false;
|
this._gettingNetStats = false;
|
||||||
|
|
||||||
if (this._daemonInfo.synchronized) await this.refreshMiningStatus();
|
if (this._daemonInfo.coreSynchronized) {
|
||||||
|
await this.refreshMiningStatus();
|
||||||
if (this._daemonInfo.synchronized) await this.refreshMinerData();
|
await this.refreshMinerData();
|
||||||
|
}
|
||||||
|
|
||||||
this._gettingPeerList = true;
|
this._gettingPeerList = true;
|
||||||
this._peerList = await this.daemonService.getPeerList();
|
this._peerList = await this.daemonService.getPeerList();
|
||||||
|
|
|
@ -58,27 +58,26 @@ export class LogsComponent extends BasePageComponent implements AfterViewInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public get logs(): string {
|
public get logs(): string {
|
||||||
return this.lines.join("\n");
|
return this.initing ? '' : this.lines.join("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
private scrollToBottom(): void {
|
private scrollToBottom(): void {
|
||||||
this.ngZone.run(() => {
|
this.ngZone.run(() => {
|
||||||
this.lines;
|
setTimeout(() => {
|
||||||
const terminalOutput = <HTMLDivElement | null>document.getElementById('terminalOutput');
|
const terminalOutput = <HTMLDivElement | null>document.getElementById('terminalOutput');
|
||||||
if (terminalOutput) {
|
if (terminalOutput) {
|
||||||
terminalOutput.style.width = `${window.innerWidth}`;
|
terminalOutput.style.width = `${window.innerWidth}`;
|
||||||
console.log(`scrolling from ${terminalOutput.offsetTop} to ${terminalOutput.scrollHeight}`)
|
//console.log(`scrolling from ${terminalOutput.offsetTop} to ${terminalOutput.scrollHeight}`)
|
||||||
terminalOutput.scrollBy(0, terminalOutput.scrollHeight)
|
terminalOutput.scrollBy(0, terminalOutput.scrollHeight)
|
||||||
}
|
}
|
||||||
|
}, 100);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private onLog(): void {
|
private onLog(): void {
|
||||||
if (this.logTerminal) this.logTerminal.nativeElement.scrollTop = this.logTerminal.nativeElement.scrollHeight;
|
if (this.logTerminal) this.logTerminal.nativeElement.scrollTop = this.logTerminal.nativeElement.scrollHeight;
|
||||||
// Scorri automaticamente in basso
|
// Scorri automaticamente in basso
|
||||||
setTimeout(() => {
|
|
||||||
this.scrollToBottom();
|
this.scrollToBottom();
|
||||||
}, 100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public trackByFn(index: number, item: string): number {
|
public trackByFn(index: number, item: string): number {
|
||||||
|
@ -86,9 +85,17 @@ export class LogsComponent extends BasePageComponent implements AfterViewInit {
|
||||||
return index; // usa l'indice per tracciare gli elementi
|
return index; // usa l'indice per tracciare gli elementi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private initing: boolean = false;
|
||||||
|
|
||||||
public ngAfterViewInit(): void {
|
public ngAfterViewInit(): void {
|
||||||
|
this.initing = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.scrollToBottom();
|
this.scrollToBottom();
|
||||||
|
this.initing = false;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scrollToBottom();
|
||||||
|
}, 500);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { SimpleBootstrapCard } from '../../shared/utils';
|
||||||
export class MiningComponent extends BasePageComponent implements AfterViewInit, AfterContentInit {
|
export class MiningComponent extends BasePageComponent implements AfterViewInit, AfterContentInit {
|
||||||
|
|
||||||
public get coreBusy(): boolean {
|
public get coreBusy(): boolean {
|
||||||
return this.daemonData.info? !this.daemonData.info.synchronized : true;
|
return this.daemonData.info? !this.daemonData.info.coreSynchronized : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get miningStatus(): MiningStatus | undefined {
|
public get miningStatus(): MiningStatus | undefined {
|
||||||
|
|
|
@ -63,6 +63,10 @@ export class DaemonInfo {
|
||||||
return this.hashRate / 1000;
|
return this.hashRate / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get coreSynchronized(): boolean {
|
||||||
|
return this.wasBoostrapEverUsed ? this.heightWithoutBootstrap == this.targetHeight : this.synchronized;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
adjustedTime: number,
|
adjustedTime: number,
|
||||||
altBlocksCount: number,
|
altBlocksCount: number,
|
||||||
|
@ -184,7 +188,7 @@ export class DaemonInfo {
|
||||||
const untrusted: boolean = info.untrusted;
|
const untrusted: boolean = info.untrusted;
|
||||||
const updateAvailable: boolean = info.update_available;
|
const updateAvailable: boolean = info.update_available;
|
||||||
const version: string = info.version;
|
const version: string = info.version;
|
||||||
const wasBoostrapEverUsed: boolean = info.was_boostrap_ever_used === true ? true : false;
|
const wasBoostrapEverUsed: boolean = info.was_bootstrap_ever_used === true ? true : false;
|
||||||
const whitePeerlistSize: number = info.white_peerlist_size;
|
const whitePeerlistSize: number = info.white_peerlist_size;
|
||||||
const wideCumulativeDifficulty: string = info.wide_cumulative_difficulty;
|
const wideCumulativeDifficulty: string = info.wide_cumulative_difficulty;
|
||||||
const wideDifficulty: string = info.wide_difficulty;
|
const wideDifficulty: string = info.wide_difficulty;
|
||||||
|
|
Loading…
Reference in a new issue