1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 15:41:17 -04:00

fix double-booting windows VMs

This commit is contained in:
2022-06-15 09:50:51 -04:00
parent 293441bb1f
commit a60bee8340
3 changed files with 35 additions and 34 deletions

View File

@@ -79,17 +79,20 @@ const VNC = ({ server }: VNCProps) => {
if (loaded) { if (loaded) {
// don't do any of this more than once, the backend is pretty fragile // don't do any of this more than once, the backend is pretty fragile
return; return;
} else {
// show loading indicator and continue
setMessage({ message: "Spinning up your very own personal computer, please wait!", anyKey: false });
} }
if (!window.WebSocket) { if (!("WebSocket" in window)) {
// browser doesn't support websockets // browser doesn't support websockets
setMessage({ message: "WebSockets must be enabled to begin!", anyKey: true }); setMessage({ message: "WebSockets must be enabled to begin!", anyKey: true });
return; return;
} }
// show loading indicator and continue
setMessage({ message: "Spinning up your very own personal computer, please wait!", anyKey: false });
// this is the one and only time we're spinning up a VM (hopefully)
setLoaded(true);
// https://github.com/novnc/noVNC/blob/master/docs/API.md // https://github.com/novnc/noVNC/blob/master/docs/API.md
rfbRef.current = new RFB(screenRef.current as Element, server, { rfbRef.current = new RFB(screenRef.current as Element, server, {
wsProtocols: ["binary", "base64"], wsProtocols: ["binary", "base64"],
@@ -104,8 +107,6 @@ const VNC = ({ server }: VNCProps) => {
// finally hide the terminal and show the VNC canvas // finally hide the terminal and show the VNC canvas
setConnected(true); setConnected(true);
// this is the one and only time we're spinning up a VM (hopefully)
setLoaded(true);
}); });
// VM disconnected (on either end) // VM disconnected (on either end)

View File

@@ -57,7 +57,7 @@
"react-fast-marquee": "^1.3.2", "react-fast-marquee": "^1.3.2",
"react-gist": "^1.2.4", "react-gist": "^1.2.4",
"react-innertext": "^1.1.5", "react-innertext": "^1.1.5",
"react-intersection-observer": "^9.3.0", "react-intersection-observer": "^9.3.3",
"react-is": "18.2.0", "react-is": "18.2.0",
"react-player": "^2.10.1", "react-player": "^2.10.1",
"react-textarea-autosize": "^8.3.4", "react-textarea-autosize": "^8.3.4",

View File

@@ -1302,10 +1302,10 @@
"@octokit/types" "^6.0.3" "@octokit/types" "^6.0.3"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/openapi-types@^11.2.0": "@octokit/openapi-types@^12.1.0":
version "11.2.0" version "12.1.0"
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-11.2.0.tgz#b38d7fc3736d52a1e96b230c1ccd4a58a2f400a6" resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.1.0.tgz#a68b60e969f26dee0eb7d127c65a84967f2d3a6e"
integrity sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA== integrity sha512-kQzJh3ZUv3lDpi6M+uekMRHULvf9DlWoI1XgKN6nPeGDzkSgtkhVq1MMz3bFKQ6H6GbdC3ZqG/a6VzKhIx0VeA==
"@octokit/request-error@^2.1.0": "@octokit/request-error@^2.1.0":
version "2.1.0" version "2.1.0"
@@ -1329,11 +1329,11 @@
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/types@^6.0.3", "@octokit/types@^6.16.1": "@octokit/types@^6.0.3", "@octokit/types@^6.16.1":
version "6.34.0" version "6.35.0"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218" resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.35.0.tgz#11cd9a679c32b4a6c36459ae2ec3ac4de0104f71"
integrity sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw== integrity sha512-DhLfdUuv3H37u6jBDfkwamypx3HflHg29b26nbA6iVFYkAlZ5cMEtu/9pQoihGnQE5M7jJFnNo25Rr1UwQNF8Q==
dependencies: dependencies:
"@octokit/openapi-types" "^11.2.0" "@octokit/openapi-types" "^12.1.0"
"@polka/url@^1.0.0-next.20": "@polka/url@^1.0.0-next.20":
version "1.0.0-next.21" version "1.0.0-next.21"
@@ -1668,9 +1668,9 @@
"@types/unist" "*" "@types/unist" "*"
"@types/node@*", "@types/node@^17.0.5": "@types/node@*", "@types/node@^17.0.5":
version "17.0.42" version "17.0.43"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.42.tgz#d7e8f22700efc94d125103075c074396b5f41f9b" resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.43.tgz#7f16898cdd791c9d64069000ad448b47b3ca8353"
integrity sha512-Q5BPGyGKcvQgAMbsr7qEGN/kIPN6zZecYYABeTDBizOsau+2NMdSVTar9UQw21A2+JyA2KRNDYaYrPB0Rpk2oQ== integrity sha512-jnUpgw8fL9kP2iszfIDyBQtw5Mf4/XSqy0Loc1J9pI14ejL83XcCEvSf50Gs/4ET0I9VCCDoOfufQysj0S66xA==
"@types/novnc__novnc@github:jakejarvis/novnc-types#v0.0.0": "@types/novnc__novnc@github:jakejarvis/novnc-types#v0.0.0":
version "0.0.0" version "0.0.0"
@@ -2145,9 +2145,9 @@ camelcase@^6.2.0:
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001349: caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001349:
version "1.0.30001352" version "1.0.30001354"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001352.tgz#cc6f5da3f983979ad1e2cdbae0505dccaa7c6a12" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001354.tgz#95c5efdb64148bb4870771749b9a619304755ce5"
integrity sha512-GUgH8w6YergqPQDGWhJGt8GDRnY0L/iJVQcU3eJ46GYf52R8tk0Wxp0PymuFVZboJYXGiCqwozAYZNRjVj6IcA== integrity sha512-mImKeCkyGDAHNywYFA4bqnLAzTUvVkqPvhY4DV47X+Gl2c5Z8c3KNETnXp14GQt11LvxE8AwjzGxJ+rsikiOzg==
ccount@^1.0.0: ccount@^1.0.0:
version "1.1.0" version "1.1.0"
@@ -2588,9 +2588,9 @@ eastasianwidth@^0.2.0:
integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==
electron-to-chromium@^1.4.147: electron-to-chromium@^1.4.147:
version "1.4.154" version "1.4.156"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.154.tgz#d69c60499fc467a6c59591d29183e520afbc78a1" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.156.tgz#fc398e1bfbe586135351ebfaf198473a82923af5"
integrity sha512-GbV9djOkrnj6xmW+YYVVEI3VCQnJ0pnSTu7TW2JyjKd5cakoiSaG5R4RbEtfaD92GsY10DzbU3GYRe+IOA9kqA== integrity sha512-/Wj5NC7E0wHaMCdqxWz9B0lv7CcycDTiHyXCtbbu3pXM9TV2AOp8BtMqkVuqvJNdEvltBG6LxT2Q+BxY4LUCIA==
emoji-regex@^8.0.0: emoji-regex@^8.0.0:
version "8.0.0" version "8.0.0"
@@ -3900,16 +3900,16 @@ lit-element@^3.2.0:
lit-html "^2.2.0" lit-html "^2.2.0"
lit-html@^2.2.0: lit-html@^2.2.0:
version "2.2.5" version "2.2.6"
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.2.5.tgz#e2b4fbdb3b57e38a3bce23c8473d72ba0e652ed8" resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.2.6.tgz#e70679605420a34c4f3cbd0c483b2fb1fff781df"
integrity sha512-e56Y9V+RNA+SGYsWP2DGb/wad5Ccd3xUZYjmcmbeZcnc0wP4zFQRXeXn7W3bbfBekmHDK2dOnuYNYkg0bQjh/w== integrity sha512-xOKsPmq/RAKJ6dUeOxhmOYFjcjf0Q7aSdfBJgdJkOfCUnkmmJPxNrlZpRBeVe1Gg50oYWMlgm6ccAE/SpJgSdw==
dependencies: dependencies:
"@types/trusted-types" "^2.0.2" "@types/trusted-types" "^2.0.2"
lit@^2.2.4: lit@^2.2.4:
version "2.2.5" version "2.2.6"
resolved "https://registry.yarnpkg.com/lit/-/lit-2.2.5.tgz#60e8dd5b751fe31f849c64f74f1784a88235d664" resolved "https://registry.yarnpkg.com/lit/-/lit-2.2.6.tgz#4ef223e88517c000b0c01baf2e3535e61a75a5b5"
integrity sha512-Ln463c0xJZfzVxBcHddNvFQQ8Z22NK7KgNmrzwFF1iESHUud412RRExzepj18wpTbusgwoTnOYuoTpo9uyNBaQ== integrity sha512-K2vkeGABfSJSfkhqHy86ujchJs3NR9nW1bEEiV+bXDkbiQ60Tv5GUausYN2mXigZn8lC1qXuc46ArQRKYmumZw==
dependencies: dependencies:
"@lit/reactive-element" "^1.3.0" "@lit/reactive-element" "^1.3.0"
lit-element "^3.2.0" lit-element "^3.2.0"
@@ -5144,10 +5144,10 @@ react-innertext@^1.1.5:
resolved "https://registry.yarnpkg.com/react-innertext/-/react-innertext-1.1.5.tgz#8147ac54db3f7067d95f49e2d2c05a720d27d8d0" resolved "https://registry.yarnpkg.com/react-innertext/-/react-innertext-1.1.5.tgz#8147ac54db3f7067d95f49e2d2c05a720d27d8d0"
integrity sha512-PWAqdqhxhHIv80dT9znP2KvS+hfkbRovFp4zFYHFFlOoQLRiawIic81gKb3U1wEyJZgMwgs3JoLtwryASRWP3Q== integrity sha512-PWAqdqhxhHIv80dT9znP2KvS+hfkbRovFp4zFYHFFlOoQLRiawIic81gKb3U1wEyJZgMwgs3JoLtwryASRWP3Q==
react-intersection-observer@^9.3.0: react-intersection-observer@^9.3.3:
version "9.3.0" version "9.3.3"
resolved "https://registry.yarnpkg.com/react-intersection-observer/-/react-intersection-observer-9.3.0.tgz#c753839d132e574de6c19da5d4a33cf504c02d2a" resolved "https://registry.yarnpkg.com/react-intersection-observer/-/react-intersection-observer-9.3.3.tgz#1266fad4c09d8380462548b71bbc73e0e1c0c089"
integrity sha512-E1UT9Mc8tiku9WZih56GqQyuQ+8dVC/yX9VOMNnbmG0vGjiRNb4RU7exgrbCtTRzfco0HwEs1jbbdKBX+QiYCA== integrity sha512-IEXX+Qd3/Bi2EzR2TYBLosHIaIMOTpgKRp5UH//eWOuteO/lpyTpQXt5ACy/ZugI6v0nwJBfiKLvWtCaKiRI7g==
react-is@18.2.0: react-is@18.2.0:
version "18.2.0" version "18.2.0"