Refactory and upgrade dependencies

This commit is contained in:
everoddandeven 2024-10-31 12:37:41 +01:00
parent 440a13854d
commit dc8b35e250
6 changed files with 134 additions and 74 deletions

View file

@ -83,6 +83,8 @@ const wdwIcon = `${dirname}/${iconRelPath}`;
const args = process.argv.slice(1),
serve = args.some(val => val === '--serve');
// #region Window
function createWindow(): BrowserWindow {
const size = screen.getPrimaryDisplay().workAreaSize;
@ -229,9 +231,6 @@ const createSplashWindow = async (): Promise<BrowserWindow> => {
return window;
}
// #region Auto Launch
// #endregion
// #region WiFi

88
package-lock.json generated
View file

@ -17,11 +17,10 @@
"@angular/platform-browser": "17.3.12",
"@angular/platform-browser-dynamic": "17.3.12",
"@angular/router": "17.3.12",
"appdmg": "*",
"bootstrap": "5.3.3",
"bootstrap-icons": "1.11.3",
"bootstrap-table": "1.23.5",
"chart.js": "4.4.5",
"chart.js": "4.4.6",
"crypto": "1.0.1",
"idb": "8.0.0",
"jquery": "3.7.1",
@ -45,7 +44,7 @@
"@electron/packager": "18.3.5",
"@ngx-translate/core": "15.0.0",
"@ngx-translate/http-loader": "8.0.0",
"@playwright/test": "1.48.1",
"@playwright/test": "1.48.2",
"@types/auto-launch": "5.0.5",
"@types/bootstrap": "5.2.10",
"@types/chart.js": "2.9.41",
@ -69,7 +68,7 @@
"jest": "29.7.0",
"node-polyfill-webpack-plugin": "2.0.1",
"npm-run-all": "4.1.5",
"playwright": "1.48.1",
"playwright": "1.48.2",
"ts-node": "10.9.2",
"typescript": "5.4.5",
"wait-on": "7.2.0",
@ -79,7 +78,6 @@
"node": ">= 16.14.0 || >= 18.10.0"
},
"optionalDependencies": {
"appdmg": "0.6.6",
"electron-installer-debian": "3.2.0",
"electron-installer-dmg": "5.0.1",
"electron-installer-windows": "3.0.0"
@ -5520,12 +5518,12 @@
}
},
"node_modules/@playwright/test": {
"version": "1.48.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.1.tgz",
"integrity": "sha512-s9RtWoxkOLmRJdw3oFvhFbs9OJS0BzrLUc8Hf6l2UdCNd1rqeEyD4BhCJkvzeEoD1FsK4mirsWwGerhVmYKtZg==",
"version": "1.48.2",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.2.tgz",
"integrity": "sha512-54w1xCWfXuax7dz4W2M9uw0gDyh+ti/0K/MxcCUxChFh37kkdxPdfZDw5QBbuPUJHr1CiHJ1hXgSs+GgeQc5Zw==",
"dev": true,
"dependencies": {
"playwright": "1.48.1"
"playwright": "1.48.2"
},
"bin": {
"playwright": "cli.js"
@ -7947,6 +7945,7 @@
"version": "0.6.6",
"resolved": "https://registry.npmjs.org/appdmg/-/appdmg-0.6.6.tgz",
"integrity": "sha512-GRmFKlCG+PWbcYF4LUNonTYmy0GjguDy6Jh9WP8mpd0T6j80XIJyXBiWlD0U+MLNhqV9Nhx49Gl9GpVToulpLg==",
"dev": true,
"optional": true,
"os": [
"darwin"
@ -7975,12 +7974,14 @@
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
"integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==",
"dev": true,
"optional": true
},
"node_modules/appdmg/node_modules/cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"optional": true,
"dependencies": {
"nice-try": "^1.0.4",
@ -7997,6 +7998,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
"dev": true,
"optional": true,
"dependencies": {
"cross-spawn": "^6.0.0",
@ -8015,6 +8017,7 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
"dev": true,
"optional": true,
"dependencies": {
"pump": "^3.0.0"
@ -8027,6 +8030,7 @@
"version": "0.7.5",
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.7.5.tgz",
"integrity": "sha512-Hiyv+mXHfFEP7LzUL/llg9RwFxxY+o9N3JVLIeG5E7iFIFAalxvRU9UZthBdYDEVnzHMgjnKJPPpay5BWf1g9g==",
"dev": true,
"optional": true,
"bin": {
"image-size": "bin/image-size.js"
@ -8039,6 +8043,7 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==",
"dev": true,
"optional": true,
"engines": {
"node": ">=0.10.0"
@ -8048,6 +8053,7 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
"integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==",
"dev": true,
"optional": true,
"dependencies": {
"path-key": "^2.0.0"
@ -8060,6 +8066,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
"dev": true,
"optional": true,
"engines": {
"node": ">=4"
@ -8069,6 +8076,7 @@
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
"dev": true,
"optional": true,
"bin": {
"semver": "bin/semver"
@ -8078,6 +8086,7 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
"dev": true,
"optional": true,
"dependencies": {
"shebang-regex": "^1.0.0"
@ -8090,6 +8099,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
"dev": true,
"optional": true,
"engines": {
"node": ">=0.10.0"
@ -8099,6 +8109,7 @@
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"optional": true,
"dependencies": {
"isexe": "^2.0.0"
@ -8871,6 +8882,7 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/base32-encode/-/base32-encode-1.2.0.tgz",
"integrity": "sha512-cHFU8XeRyx0GgmoWi5qHMCVRiqU6J3MHWxVgun7jggCBUpVzm1Ir7M9dYr2whjSNc3tFeXfQ/oZjQu/4u55h9A==",
"dev": true,
"optional": true,
"dependencies": {
"to-data-view": "^1.1.0"
@ -9092,6 +9104,7 @@
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.8.tgz",
"integrity": "sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==",
"dev": true,
"optional": true,
"dependencies": {
"stream-buffers": "~2.2.0"
@ -9742,9 +9755,9 @@
"dev": true
},
"node_modules/chart.js": {
"version": "4.4.5",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.5.tgz",
"integrity": "sha512-CVVjg1RYTJV9OCC8WeJPMx8gsV8K6WIyIEQUE3ui4AR9Hfgls9URri6Ja3hyMVBbTF8Q2KFa19PE815gWcWhng==",
"version": "4.4.6",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.6.tgz",
"integrity": "sha512-8Y406zevUPbbIBA/HRk33khEmQPk5+cxeflWE/2rx1NJsjVWMPw/9mSP9rxHP5eqi6LNoPBVMfZHxbwLSgldYA==",
"dependencies": {
"@kurkle/color": "^0.3.0"
},
@ -11746,6 +11759,7 @@
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/ds-store/-/ds-store-0.1.6.tgz",
"integrity": "sha512-kY21M6Lz+76OS3bnCzjdsJSF7LBpLYGCVfavW8TgQD2XkcqIZ86W0y9qUDZu6fp7SIZzqosMDW2zi7zVFfv4hw==",
"dev": true,
"optional": true,
"dependencies": {
"bplist-creator": "~0.0.3",
@ -12699,6 +12713,7 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz",
"integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==",
"dev": true,
"optional": true
},
"node_modules/encodeurl": {
@ -12724,7 +12739,7 @@
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"devOptional": true,
"dev": true,
"dependencies": {
"once": "^1.4.0"
}
@ -14169,6 +14184,7 @@
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/fmix/-/fmix-0.1.0.tgz",
"integrity": "sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w==",
"dev": true,
"optional": true,
"dependencies": {
"imul": "^1.0.0"
@ -14327,6 +14343,7 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/fs-temp/-/fs-temp-1.2.1.tgz",
"integrity": "sha512-okTwLB7/Qsq82G6iN5zZJFsOfZtx2/pqrA7Hk/9fvy+c+eJS9CvgGXT2uNxwnI14BDY9L/jQPkaBgSvlKfSW9w==",
"dev": true,
"optional": true,
"dependencies": {
"random-path": "^0.1.0"
@ -14336,6 +14353,7 @@
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/fs-xattr/-/fs-xattr-0.3.1.tgz",
"integrity": "sha512-UVqkrEW0GfDabw4C3HOrFlxKfx0eeigfRne69FxSBdHIP8Qt5Sq6Pu3RM9KmMlkygtC4pPKkj5CiPO5USnj2GA==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"os": [
@ -14460,6 +14478,7 @@
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
"dev": true,
"optional": true,
"dependencies": {
"is-property": "^1.0.2"
@ -14469,6 +14488,7 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
"integrity": "sha512-TuOwZWgJ2VAMEGJvAyPWvpqxSANF0LDpmyHauMjFYzaACvn+QTT/AZomvPCzVBV7yDN3OmwHQ5OvHaeLKre3JQ==",
"dev": true,
"optional": true,
"dependencies": {
"is-property": "^1.0.0"
@ -15592,6 +15612,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/imul/-/imul-1.0.1.tgz",
"integrity": "sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA==",
"dev": true,
"optional": true,
"engines": {
"node": ">=0.10.0"
@ -15989,12 +16010,14 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.1.tgz",
"integrity": "sha512-jxc8cBcOWbNK2i2aTkCZP6i7wkHF1bqKFrwEHuN5Jtg5BSaZHUZQ/JTOJwoV41YvHnOaRyWWh72T/KvfNz9DJg==",
"dev": true,
"optional": true
},
"node_modules/is-my-json-valid": {
"version": "2.20.6",
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.6.tgz",
"integrity": "sha512-1JQwulVNjx8UqkPE/bqDaxtH4PXCe/2VRh/y3p99heOV87HG4Id5/VfDswd+YiAfHcRTfDlWgISycnHuhZq1aw==",
"dev": true,
"optional": true,
"dependencies": {
"generate-function": "^2.0.0",
@ -16141,6 +16164,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==",
"dev": true,
"optional": true
},
"node_modules/is-regex": {
@ -18401,6 +18425,7 @@
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz",
"integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==",
"dev": true,
"optional": true,
"engines": {
"node": ">=0.10.0"
@ -18969,6 +18994,7 @@
"version": "0.2.11",
"resolved": "https://registry.npmjs.org/macos-alias/-/macos-alias-0.2.11.tgz",
"integrity": "sha512-zIUs3+qpml+w3wiRuADutd7XIO8UABqksot10Utl/tji4UxZzLG4fWDC+yJZoO8/Ehg5RqsvSRE/6TS5AEOeWw==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"os": [
@ -19350,7 +19376,7 @@
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"devOptional": true,
"dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@ -19520,6 +19546,7 @@
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/murmur-32/-/murmur-32-0.2.0.tgz",
"integrity": "sha512-ZkcWZudylwF+ir3Ld1n7gL6bI2mQAzXvSobPwVtu8aYi2sbXeipeSkdcanRLzIofLcM5F53lGaKm2dk7orBi7Q==",
"dev": true,
"optional": true,
"dependencies": {
"encode-utf8": "^1.0.3",
@ -19540,6 +19567,7 @@
"version": "2.22.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.22.0.tgz",
"integrity": "sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw==",
"dev": true,
"optional": true
},
"node_modules/nanoid": {
@ -19624,7 +19652,7 @@
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"devOptional": true
"dev": true
},
"node_modules/node-abi": {
"version": "3.71.0",
@ -21046,6 +21074,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
"integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==",
"dev": true,
"optional": true,
"engines": {
"node": ">=4"
@ -21447,6 +21476,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/parse-color/-/parse-color-1.0.0.tgz",
"integrity": "sha512-fuDHYgFHJGbpGMgw9skY/bj3HL/Jrn4l/5rSspy00DoT4RyLnDcRvPxdZ+r6OFwIsgAuhDh4I09tAId4mI12bw==",
"dev": true,
"optional": true,
"dependencies": {
"color-convert": "~0.5.0"
@ -21456,6 +21486,7 @@
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz",
"integrity": "sha512-RwBeO/B/vZR3dfKL1ye/vx8MHZ40ugzpyfeVG5GsiuGnrlMWe2o8wxBbLCpw9CsxV+wHuzYlCiWnybrIA0ling==",
"dev": true,
"optional": true
},
"node_modules/parse-json": {
@ -21853,12 +21884,12 @@
}
},
"node_modules/playwright": {
"version": "1.48.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.1.tgz",
"integrity": "sha512-j8CiHW/V6HxmbntOfyB4+T/uk08tBy6ph0MpBXwuoofkSnLmlfdYNNkFTYD6ofzzlSqLA1fwH4vwvVFvJgLN0w==",
"version": "1.48.2",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.2.tgz",
"integrity": "sha512-NjYvYgp4BPmiwfe31j4gHLa3J7bD2WiBz8Lk2RoSsmX38SVIARZ18VYjxLjAcDsAhA+F4iSEXTSGgjua0rrlgQ==",
"dev": true,
"dependencies": {
"playwright-core": "1.48.1"
"playwright-core": "1.48.2"
},
"bin": {
"playwright": "cli.js"
@ -21871,9 +21902,9 @@
}
},
"node_modules/playwright-core": {
"version": "1.48.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.1.tgz",
"integrity": "sha512-Yw/t4VAFX/bBr1OzwCuOMZkY1Cnb4z/doAFSwf4huqAGWmf9eMNjmK7NiOljCdLmxeRYcGPPmcDgU0zOlzP0YA==",
"version": "1.48.2",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.2.tgz",
"integrity": "sha512-sjjw+qrLFlriJo64du+EK0kJgZzoQPsabGF4lBvsid+3CNIZIYLgnMj9V6JY5VhM2Peh20DJWIVpVljLLnlawA==",
"dev": true,
"bin": {
"playwright-core": "cli.js"
@ -22251,7 +22282,7 @@
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz",
"integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==",
"devOptional": true,
"dev": true,
"dependencies": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
@ -22359,6 +22390,7 @@
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/random-path/-/random-path-0.1.2.tgz",
"integrity": "sha512-4jY0yoEaQ5v9StCl5kZbNIQlg1QheIDBrdkDn53EynpPb9FgO6//p3X/tgMnrC45XN6QZCzU1Xz/+pSSsJBpRw==",
"dev": true,
"optional": true,
"dependencies": {
"base32-encode": "^0.1.0 || ^1.0.0",
@ -22791,6 +22823,7 @@
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
"integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==",
"dev": true,
"optional": true,
"engines": {
"node": ">=0.10"
@ -23714,7 +23747,7 @@
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
"devOptional": true
"dev": true
},
"node_modules/sigstore": {
"version": "2.3.1",
@ -24112,6 +24145,7 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz",
"integrity": "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==",
"dev": true,
"optional": true,
"engines": {
"node": ">= 0.10.0"
@ -24285,6 +24319,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==",
"dev": true,
"optional": true,
"engines": {
"node": ">=0.10.0"
@ -24695,6 +24730,7 @@
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/tn1150/-/tn1150-0.1.0.tgz",
"integrity": "sha512-DbplOfQFkqG5IHcDyyrs/lkvSr3mPUVsFf/RbDppOshs22yTPnSJWEe6FkYd1txAwU/zcnR905ar2fi4kwF29w==",
"dev": true,
"optional": true,
"dependencies": {
"unorm": "^1.4.1"
@ -24707,6 +24743,7 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/to-data-view/-/to-data-view-1.1.0.tgz",
"integrity": "sha512-1eAdufMg6mwgmlojAx3QeMnzB/BTVp7Tbndi3U7ftcT2zCZadjxkkmLmd97zmaxWi+sgGcgWrokmpEoy0Dn0vQ==",
"dev": true,
"optional": true
},
"node_modules/to-regex-range": {
@ -25515,6 +25552,7 @@
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==",
"dev": true,
"optional": true,
"engines": {
"node": ">= 0.4.0"
@ -27005,7 +27043,7 @@
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
"devOptional": true,
"dev": true,
"engines": {
"node": ">=0.4"
}

View file

@ -72,7 +72,7 @@
"bootstrap": "5.3.3",
"bootstrap-icons": "1.11.3",
"bootstrap-table": "1.23.5",
"chart.js": "4.4.5",
"chart.js": "4.4.6",
"crypto": "1.0.1",
"idb": "8.0.0",
"jquery": "3.7.1",
@ -96,7 +96,7 @@
"@electron/packager": "18.3.5",
"@ngx-translate/core": "15.0.0",
"@ngx-translate/http-loader": "8.0.0",
"@playwright/test": "1.48.1",
"@playwright/test": "1.48.2",
"@types/auto-launch": "5.0.5",
"@types/bootstrap": "5.2.10",
"@types/chart.js": "2.9.41",
@ -120,14 +120,13 @@
"jest": "29.7.0",
"node-polyfill-webpack-plugin": "2.0.1",
"npm-run-all": "4.1.5",
"playwright": "1.48.1",
"playwright": "1.48.2",
"ts-node": "10.9.2",
"typescript": "5.4.5",
"wait-on": "7.2.0",
"webdriver-manager": "12.1.9"
},
"optionalDependencies": {
"appdmg": "0.6.6",
"electron-installer-debian": "3.2.0",
"electron-installer-dmg": "5.0.1",
"electron-installer-windows": "3.0.0"

View file

@ -240,4 +240,18 @@ export class ElectronService {
return await selectPromise;
}
public async getOsType(): Promise<{ platform: string, arch: string }> {
const promise = new Promise<{ platform: string, arch: string }>((resolve) => {
window.electronAPI.gotOsType((event: any, osType: { platform: string; arch: string; }) => {
window.electronAPI.unregisterGotOsType();
resolve(osType);
});
});
window.electronAPI.getOsType();
return await promise;
}
}

View file

@ -1,4 +1,5 @@
import { Injectable, NgZone } from '@angular/core';
import { ElectronService } from '../electron/electron.service';
@Injectable({
providedIn: 'root'
@ -34,7 +35,7 @@ export class MoneroInstallerService {
return this._progress;
}
constructor(private ngZone: NgZone) {}
constructor(private electronService: ElectronService, private ngZone: NgZone) {}
public async downloadMonero(destination: string, alreadyConfigured: boolean): Promise<string> {
this.alreadyConfigured = alreadyConfigured;
@ -75,49 +76,41 @@ export class MoneroInstallerService {
}
private async getMoneroDownloadLink(): Promise<string> {
const promise = new Promise<string>((resolve, reject) => {
window.electronAPI.gotOsType((event: any, osType: { platform: string, arch: string }) => {
const platform = osType.platform;
const arch = osType.arch;
let resource: string = '';
const osType = await this.electronService.getOsType();
// Mappatura tra sistema operativo e architettura
if (platform === 'win32') {
resource = arch === 'x64' ? this.resources.win64 : this.resources.win32;
} else if (platform === 'darwin') {
resource = arch === 'arm64' ? this.resources.macarm8 : this.resources.mac64;
}
else if (platform === 'linux') {
if (arch === 'x64') {
resource = this.resources.linux64;
}
else if (arch === 'ia32') {
resource = this.resources.linux32;
}
else if (arch === 'arm') {
resource = this.resources.linuxarm7;
}
else if (arch === 'arm64') {
resource = this.resources.linuxarm8;
}
else if (arch === 'riscv64') {
resource = this.resources.linuxriscv64;
}
}
const platform = osType.platform;
const arch = osType.arch;
let resource: string = '';
window.electronAPI.unregisterGotOsType();
// Mappatura tra sistema operativo e architettura
if (platform === 'win32') {
resource = arch === 'x64' ? this.resources.win64 : this.resources.win32;
} else if (platform === 'darwin') {
resource = arch === 'arm64' ? this.resources.macarm8 : this.resources.mac64;
}
else if (platform === 'linux') {
if (arch === 'x64') {
resource = this.resources.linux64;
}
else if (arch === 'ia32') {
resource = this.resources.linux32;
}
else if (arch === 'arm') {
resource = this.resources.linuxarm7;
}
else if (arch === 'arm64') {
resource = this.resources.linuxarm8;
}
else if (arch === 'riscv64') {
resource = this.resources.linuxriscv64;
}
}
if (resource != '')
{
resolve(resource);
}
reject('Unsopported platform ' + platform);
});
});
window.electronAPI.getOsType();
if (resource == '')
{
throw new Error('Unsopported platform ' + platform);
}
return await promise;
return resource;
}
}

View file

@ -200,8 +200,25 @@ export class SettingsComponent {
this.savingChanges = false;
}
private async getMonerodFileSpec(): Promise<{ extensions?: string[]; mimeType: string; }> {
const { platform } = await this.electronService.getOsType();
if (platform == 'win32') {
return { mimeType: 'application/vnd.microsoft.portable-executable', extensions: ['exe']};
}
else if (platform == 'darwin') {
return { mimeType: 'application/octet-stream' };
}
else if (platform == 'linux') {
return { mimeType: 'application/x-executable'};
}
throw new Error("Could not get monerod mime type");
}
public async chooseMonerodFile(): Promise<void> {
const file = await this.electronService.selectFile();
const spec = await this.getMonerodFileSpec();
const file = await this.electronService.selectFile(spec.extensions);
if (file == '') {
return;