From a84a49918b60a1b34645deeadcda098ec2bd5385 Mon Sep 17 00:00:00 2001 From: "Joshua F. Rountree" Date: Fri, 9 Nov 2018 14:51:38 -0500 Subject: [PATCH] Restructuring the messy Main process a bit... attempts to improve Win32 --- app/app.global.scss | 1 - app/app.html | 8 +- app/background/updater.js | 27 -- app/containers/App.js | 9 +- app/contextmenu.js | 2 +- app/main.dev.js | 233 +++++------------- app/{utils => main}/default-shell.js | 0 app/main/log.js | 8 + app/main/notify.js | 29 +++ app/{ => main}/rpc.js | 0 .../services}/network-scanner.js | 4 +- app/main/services/rpc.js | 97 ++++++++ app/{background => main/services}/server.js | 2 +- app/{background => main/services}/streamer.js | 0 app/main/services/updater.js | 27 ++ app/{background => main/services}/zmq.js | 4 +- app/notify.js | 44 ---- app/sagas/eon_sagas.js | 4 +- app/sagas/network_scanner_sagas.js | 2 +- app/splash.html | 117 +++++++++ app/utils/notify.js | 15 -- package.json | 3 + yarn.lock | 111 ++++++++- 23 files changed, 476 insertions(+), 271 deletions(-) delete mode 100644 app/background/updater.js rename app/{utils => main}/default-shell.js (100%) create mode 100644 app/main/log.js create mode 100644 app/main/notify.js rename app/{ => main}/rpc.js (100%) rename app/{background => main/services}/network-scanner.js (92%) create mode 100644 app/main/services/rpc.js rename app/{background => main/services}/server.js (98%) rename app/{background => main/services}/streamer.js (100%) create mode 100644 app/main/services/updater.js rename app/{background => main/services}/zmq.js (96%) delete mode 100644 app/notify.js create mode 100644 app/splash.html delete mode 100644 app/utils/notify.js diff --git a/app/app.global.scss b/app/app.global.scss index cf2d620..5f97b75 100644 --- a/app/app.global.scss +++ b/app/app.global.scss @@ -43,7 +43,6 @@ body { flex-flow: wrap; position:fixed; background-color: #000; - z-index:1; // background: radial-gradient(619.87px at 50% 6.62%, #072339 0%, #051B2C 100%)!important; @import "styles/windows-top-bar"; @import "styles/top-bar"; diff --git a/app/app.html b/app/app.html index 00f047a..14b982f 100644 --- a/app/app.html +++ b/app/app.html @@ -25,7 +25,7 @@ /> - + -->
-
+ + + + + + + + + +
+ + +
+ Loading Workbench +
+
\ No newline at end of file diff --git a/app/utils/notify.js b/app/utils/notify.js deleted file mode 100644 index 478d920..0000000 --- a/app/utils/notify.js +++ /dev/null @@ -1,15 +0,0 @@ - -import { Notification } from 'electron'; -/* global Notification */ -/* eslint no-new:0 */ -export default function notify(title, body) { - //eslint-disable-next-line no-console - console.log(`[Notification] ${title}: ${body}`); - - const notify = new Notification({ - title, - body - }); - - notify.show(); -} diff --git a/package.json b/package.json index 51f8155..c22b191 100644 --- a/package.json +++ b/package.json @@ -211,6 +211,7 @@ "@fortawesome/free-brands-svg-icons": "^5.4.1", "@fortawesome/free-solid-svg-icons": "^5.4.1", "@fortawesome/react-fontawesome": "^0.1.3", + "@trodi/electron-splashscreen": "^0.3.4", "JSONStream": "^1.3.2", "ap": "^0.2.0", "arpping": "^0.1.5", @@ -233,11 +234,13 @@ "electron-fetch": "^1.2.1", "electron-is-dev": "^1.0.1", "electron-log": "^2.2.17", + "electron-notification-state": "^1.0.4", "electron-prompt": "^1.2.0", "electron-react-titlebar": "^0.8.1", "electron-settings": "^3.2.0", "electron-squirrel-startup": "^1.0.0", "electron-updater": "^3.1.2", + "electron-windows-notifications": "^3.0.1", "evilscan": "^1.7.1", "express-ws": "^4.0.0", "geval": "^2.2.0", diff --git a/yarn.lock b/yarn.lock index dc823ae..d88c339 100644 --- a/yarn.lock +++ b/yarn.lock @@ -857,6 +857,41 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== +"@nodert-win10-cu/windows.applicationmodel@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nodert-win10-cu/windows.applicationmodel/-/windows.applicationmodel-0.3.2.tgz#3b9df6413203f99a03170a0246cf91112dbdaa17" + integrity sha512-9ijHgslIwHF9ws8qx5LSGdpqVaJgbZ13WxoU8gxMW+iZBgIvRMfkAPd8wV+W+6DM1ycIGOjUtXnihW1sdtGQSw== + dependencies: + nan latest + +"@nodert-win10-cu/windows.data.xml.dom@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nodert-win10-cu/windows.data.xml.dom/-/windows.data.xml.dom-0.3.2.tgz#a6a12b92da0a564c767ded152244d89e9313344b" + integrity sha512-AVTGvh7ckD7kzsMgzD4l4eewKnQeGey4x9Tcn0KMgzz6zxcFoj+vxmELLWr5kUoaQFzbWFRHORrPDVIi7DA3KQ== + dependencies: + nan latest + +"@nodert-win10-cu/windows.foundation@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nodert-win10-cu/windows.foundation/-/windows.foundation-0.3.2.tgz#456f23e620350227ec73a646d00db77e9424482a" + integrity sha512-mDl8EEGPkdoLu2qrwsc0713yPYPB3RWVfGaoTyQo/F0G+qUjC6yCIdHgvbF8sRKzy+uGrUgGyvmi/JN1iXqNLQ== + dependencies: + nan latest + +"@nodert-win10-cu/windows.ui.notifications@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nodert-win10-cu/windows.ui.notifications/-/windows.ui.notifications-0.3.2.tgz#ddc2563e9ccc6e1e99d8cc7b0c1dcae333b086af" + integrity sha512-MNB8OfMiA0DQ0NkhufZbfTBIQuP7QD4+X/UG9YSwDAiV76YUnl80KLLzHbrJYMkGaSq20IpJT5u1FYDovU5EBw== + dependencies: + nan latest + +"@nodert-win10-cu/windows.ui.startscreen@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@nodert-win10-cu/windows.ui.startscreen/-/windows.ui.startscreen-0.3.2.tgz#e33dca79fe6df92f75cc45d9d92cf3ac55b8cd6e" + integrity sha512-gmXCdWZ6wrPSNeAcqvPaKgPdns+8Soy2P/5h0JntWFmshClayvw7z2FEDvnMNgukenPPgUeHTchPQFD2KMdX1A== + dependencies: + nan latest + "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" @@ -890,6 +925,11 @@ resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-2.1.2.tgz#16947fce5f57258d01f1688fdc32723093c55d3f" integrity sha512-ZwTHAlC9akprWDinwEPD4kOuwaYZlyMwVJIANsKNC3QVp0AHB04m7RnB4eqeWfgmxw8MGTzS9uMaw93Z3QcZbw== +"@trodi/electron-splashscreen@^0.3.4": + version "0.3.4" + resolved "https://registry.yarnpkg.com/@trodi/electron-splashscreen/-/electron-splashscreen-0.3.4.tgz#9ca5a6ad1b8cfb5b4846c634da3dc1e9fa3f9373" + integrity sha512-nYF+sfNIEUhZPyzYUOpcqyCZoDYmMfZq8jLhEolvQFSVwrJ7gAlPhhMxpuw/qpCzPErUkFLEtdGGvK1tGtLuvQ== + "@types/node@*": version "10.12.3" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.3.tgz#3918b73ceed484e58367be5acb79d1775239e393" @@ -2725,6 +2765,11 @@ binary-extensions@^1.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== +bindings@^1.2.1, bindings@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7" + integrity sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw== + bl@^1.0.0: version "1.2.2" resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" @@ -4981,6 +5026,15 @@ electron-log@^2.2.17: resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-2.2.17.tgz#e71e2ebb949fc96ded7cdb99eeee7202e48981d2" integrity sha512-v+Af5W5z99ehhaLOfE9eTSXUwjzh2wFlQjz51dvkZ6ZIrET6OB/zAZPvsuwT6tm3t5x+M1r+Ed3U3xtPZYAyuQ== +electron-notification-state@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/electron-notification-state/-/electron-notification-state-1.0.4.tgz#998610eff6f3870c81beec4769a0d9c7ad659aa1" + integrity sha512-MUTLCx+u8yha0cH//B1H0p1itT1RHVZvwV71s3HP9l0Kxbhwq/WQMtikmgwptFBqF0xJ6QyzmKXO3W/n+kboqQ== + dependencies: + macos-notification-state "^1.1.0" + windows-notification-state "^1.3.0" + windows-quiet-hours "^1.2.2" + electron-osx-sign@0.4.11: version "0.4.11" resolved "https://registry.yarnpkg.com/electron-osx-sign/-/electron-osx-sign-0.4.11.tgz#8377732fe7b207969f264b67582ee47029ce092f" @@ -5072,6 +5126,22 @@ electron-updater@^3.1.2: semver "^5.6.0" source-map-support "^0.5.9" +electron-windows-notifications@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/electron-windows-notifications/-/electron-windows-notifications-3.0.1.tgz#33b0b7caef3adbe8bbea1ac2bd3ac2d434af4b3b" + integrity sha512-9AWlNSL+OARz7UT4SV6isIwGMpW9MvQAcYJ/L5Vxw5WuLWHsGSAbIDF2bwPcZijpXHt4FRB8BwfvRlkSJtBBhA== + dependencies: + "@nodert-win10-cu/windows.applicationmodel" "^0.3.2" + "@nodert-win10-cu/windows.data.xml.dom" "^0.3.2" + "@nodert-win10-cu/windows.foundation" "^0.3.2" + "@nodert-win10-cu/windows.ui.notifications" "^0.3.2" + "@nodert-win10-cu/windows.ui.startscreen" "^0.3.2" + debug "^4.0.1" + is-electron-renderer "^2.0.1" + sanitize-xml-string "^1.1.0" + uuid "^3.3.2" + xml-escape "^1.1.0" + electron@^2.0.6: version "2.0.13" resolved "https://registry.yarnpkg.com/electron/-/electron-2.0.13.tgz#db3949cf4d9d4569be0cec010624746793a406c9" @@ -7572,6 +7642,11 @@ is-dotfile@^1.0.0: resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= +is-electron-renderer@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-electron-renderer/-/is-electron-renderer-2.0.1.tgz#a469d056f975697c58c98c6023eb0aa79af895a2" + integrity sha1-pGnQVvl1aXxYyYxgI+sKp5r4laI= + is-equal-shallow@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" @@ -9096,6 +9171,14 @@ lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.2, lru-cache@^4.1.3: pseudomap "^1.0.2" yallist "^2.1.2" +macos-notification-state@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/macos-notification-state/-/macos-notification-state-1.1.0.tgz#ee59671e05c1ec388c0b09101ef611c85b4b4e0e" + integrity sha1-7llnHgXB7DiMCwkQHvYRyFtLTg4= + dependencies: + bindings "^1.2.1" + nan "^2.4.0" + magic-string@^0.22.4: version "0.22.5" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.5.tgz#8e9cf5afddf44385c1da5bc2a6a0dbd10b03657e" @@ -9667,7 +9750,7 @@ nan@2.10.*: resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" integrity sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA== -nan@^2.10.0, nan@^2.9.2: +nan@^2.10.0, nan@^2.4.0, nan@^2.7.0, nan@^2.9.2, nan@latest: version "2.11.1" resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.1.tgz#90e22bccb8ca57ea4cd37cc83d3819b52eea6766" integrity sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA== @@ -12821,6 +12904,11 @@ sanitize-filename@^1.6.1: dependencies: truncate-utf8-bytes "^1.0.0" +sanitize-xml-string@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/sanitize-xml-string/-/sanitize-xml-string-1.1.0.tgz#dd86686069ce102b4954912d9c7982037b928768" + integrity sha512-RzX25K64YtZm9FvdZr/Ac7Eeq0va1YX0xmpOkjWoREhgKXXldrJRVJhBel83nS8omIcaKcNTdLY8XzOIK920HA== + sass-graph@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/sass-graph/-/sass-graph-2.2.4.tgz#13fbd63cd1caf0908b9fd93476ad43a51d1e0b49" @@ -15149,6 +15237,22 @@ widest-line@^2.0.0: dependencies: string-width "^2.1.1" +windows-notification-state@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/windows-notification-state/-/windows-notification-state-1.3.0.tgz#9f727782ecac8d920a408f1026be6f8e08fd902e" + integrity sha1-n3J3guysjZIKQI8QJr5vjgj9kC4= + dependencies: + bindings "^1.2.1" + nan "^2.4.0" + +windows-quiet-hours@^1.2.2: + version "1.2.5" + resolved "https://registry.yarnpkg.com/windows-quiet-hours/-/windows-quiet-hours-1.2.5.tgz#a168c82cb28b449204ca0c11d16fe25f252fdf0e" + integrity sha512-0JbfFw91Ys+A0vSR0pratoJgfTwWNFLHniu59dpOg1FC5IvpPSYQIATcQqhdy41HYSCijmT7Pyv9w0I2zC0+5w== + dependencies: + bindings "^1.3.0" + nan "^2.7.0" + winreg@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.4.tgz#ba065629b7a925130e15779108cf540990e98d1b" @@ -15255,6 +15359,11 @@ xdg-basedir@^3.0.0: resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" integrity sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ= +xml-escape@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/xml-escape/-/xml-escape-1.1.0.tgz#3904c143fa8eb3a0030ec646d2902a2f1b706c44" + integrity sha1-OQTBQ/qOs6ADDsZG0pAqLxtwbEQ= + xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"