2
0
mirror of https://github.com/ad1217/PrinterStatus synced 2024-11-10 18:45:08 -05:00

Compare commits

..

No commits in common. "f39366cd8238f11a92db2d61c65224c14f2f4439" and "d6a3fb766f28e779731f9ec1e9a82a682955031a" have entirely different histories.

7 changed files with 877 additions and 878 deletions

View File

@ -2,21 +2,21 @@
"name": "printer_status",
"version": "0.0.0",
"devDependencies": {
"@vitejs/plugin-vue": "^3.0.3",
"sass": "^1.54.5",
"typescript": "^4.7.4",
"vite": "^3.0.9",
"vue-tsc": "^0.40.1"
"@vitejs/plugin-vue": "^2.0.1",
"sass": "^1.45.2",
"typescript": "^4.5.4",
"vite": "^2.7.10",
"vue-tsc": "^0.30.2"
},
"dependencies": {
"@popperjs/core": "^2.11.6",
"bootstrap": "^5.2.0",
"hls.js": "^1.2.1",
"@popperjs/core": "^2.11.2",
"bootstrap": "^5.1.3",
"hls.js": "^1.1.2",
"pretty-ms": "^7.0.1",
"vue": "^3.2.37"
"vue": "^3.2.26"
},
"scripts": {
"start": "pnpm run -r --include-workspace-root --parallel dev",
"start": "pnpm run -r --parallel dev",
"server": "cd server && npm start",
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",

File diff suppressed because it is too large Load Diff

1
server/.gitignore vendored
View File

@ -1 +0,0 @@
dist/

View File

@ -4,25 +4,23 @@
"@types/express-ws": "^3.0.1",
"@types/fluent-ffmpeg": "^2.1.20",
"@types/js-yaml": "^4.0.5",
"@types/node": "^18.7.11",
"@types/node-fetch": "^2.6.2",
"@types/ws": "^8.5.3",
"ts-node-dev": "^2.0.0",
"typescript": "^4.7.4"
"@types/node": "^17.0.8",
"@types/node-fetch": "^2.5.12",
"@types/ws": "^8.2.2",
"ts-node": "^10.4.0",
"typescript": "^4.5.4"
},
"dependencies": {
"express": "^4.18.1",
"express": "^4.17.2",
"express-ws": "^5.0.2",
"fluent-ffmpeg": "^2.1.2",
"js-yaml": "^4.1.0",
"mp4frag": "^0.6.0",
"node-fetch": "^2.6.7",
"ws": "^8.8.1"
"mp4frag": "^0.5.4",
"node-fetch": "^2.6.6",
"ws": "^8.4.0"
},
"scripts": {
"start": "npm run dev",
"dev": "ts-node-dev --files ./src/server.ts",
"build": "tsc",
"serve": "node dist/server.js"
"dev": "ts-node --files ./src/server.ts"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,6 @@ import { Message, StatusMessage, SettingsMessage } from '../../types/messages';
import * as octoprint from '../../types/octoprint';
const PING_TIME = 10000;
const STATUS_TIMEOUT = 30000;
type Timeout = ReturnType<typeof setTimeout>;
@ -59,7 +58,6 @@ export default class OctoprintConnection {
let pingSender: ReturnType<typeof setInterval>;
let pongTimeout: Timeout;
let statusTimeout: Timeout;
const url = new URL('/sockjs/websocket', this.address);
url.protocol = 'ws';
@ -68,14 +66,6 @@ export default class OctoprintConnection {
.on('open', () => {
pingSender = setInterval(() => websocket.ping(), PING_TIME);
pongTimeout = this.heartbeat(websocket, pongTimeout);
statusTimeout = setTimeout(() => {
console.log(
`No status recieved in ${STATUS_TIMEOUT / 1000}s for "${
this.slug
}", disconnecting`
);
websocket.terminate();
}, STATUS_TIMEOUT);
console.log(`Connected to "${this.slug}"`);
websocket.send(JSON.stringify({ auth: session_key }));
@ -91,7 +81,6 @@ export default class OctoprintConnection {
this.broadcast(ext_event);
if ('current' in event || 'history' in event) {
clearTimeout(statusTimeout);
this.lastStatus = ext_event;
}
})
@ -101,7 +90,6 @@ export default class OctoprintConnection {
.on('close', () => {
clearInterval(pingSender);
clearTimeout(pongTimeout);
clearTimeout(statusTimeout);
console.log(
`Lost connection to "${this.slug}", attempting reconnection in 5 seconds`

View File

@ -1,11 +1,9 @@
{
"include": ["src/**/*"],
"compilerOptions": {
"target": "es5",
"strict": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist",
"experimentalDecorators": true
}
}