mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fixes vite dev
with arbitrary socketio port
This commit is contained in:
parent
1a0cf1320b
commit
fb6beaa347
2
frontend/.env.testing
Normal file
2
frontend/.env.testing
Normal file
@ -0,0 +1,2 @@
|
||||
NODE_ENV=development
|
||||
VITE_SOCKETIO_PORT=9090
|
File diff suppressed because one or more lines are too long
2
frontend/dist/index.html
vendored
2
frontend/dist/index.html
vendored
@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>InvokeAI Stable Diffusion Dream Server</title>
|
||||
<script type="module" crossorigin src="/assets/index.66192cce.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index.dec9161e.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index.447eb2a9.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -4,7 +4,7 @@
|
||||
"version": "0.0.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"dev": "vite dev -m testing",
|
||||
"build": "tsc && vite build",
|
||||
"build-dev": "tsc && vite build -m development",
|
||||
"preview": "vite preview"
|
||||
|
@ -24,9 +24,20 @@ import * as InvokeAI from '../invokeai';
|
||||
export const socketioMiddleware = () => {
|
||||
const { hostname, port } = new URL(window.location.href);
|
||||
|
||||
const socketio = io(`http://${hostname}:9090`, {
|
||||
timeout: 60000,
|
||||
});
|
||||
if (import.meta.env.VITE_SOCKETIO_PORT !== undefined) {
|
||||
console.log(
|
||||
`Running in Vite dev mode, using socketio port ${
|
||||
import.meta.env.VITE_SOCKETIO_PORT
|
||||
}`
|
||||
);
|
||||
}
|
||||
|
||||
const socketio = io(
|
||||
`http://${hostname}:${import.meta.env.VITE_SOCKETIO_PORT || port}`,
|
||||
{
|
||||
timeout: 60000,
|
||||
}
|
||||
);
|
||||
|
||||
let areListenersSet = false;
|
||||
|
||||
@ -153,7 +164,6 @@ export const socketioMiddleware = () => {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 'socketio/cancelProcessing': {
|
||||
emitCancelProcessing();
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user