feat: heartbeat check if connection offline
- WIP price message Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
parent
a0637c7d72
commit
4578a43197
4 changed files with 69 additions and 17 deletions
|
|
@ -60,6 +60,16 @@ async function handleAdbPayload(raw_payload: string) {
|
|||
addNotification('INFO:Machine Status Updated, ' + next);
|
||||
updateMachineStatus(next);
|
||||
}
|
||||
break;
|
||||
case 'brew-finish':
|
||||
if (payload.payload) {
|
||||
let plist = payload.payload.split('/');
|
||||
let pd = plist[0] ?? '';
|
||||
let total_time = plist[1] ?? '';
|
||||
|
||||
// update recipe data store
|
||||
}
|
||||
|
||||
break;
|
||||
case 'error':
|
||||
// show error to user from brew app
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import { buildOverviewFromServer } from '$lib/data/recipeService';
|
|||
import { auth } from '../client/firebase';
|
||||
import { type RecipeVersion } from '$lib/models/recipe_version.model';
|
||||
import { goto } from '$app/navigation';
|
||||
import { socketAlreadySendHeartbeat, socketConnectionOfflineCount } from '../stores/websocketStore';
|
||||
|
||||
export const messages = writable<string[]>([]);
|
||||
|
||||
|
|
@ -207,6 +208,18 @@ const handlers: Record<string, (payload: any) => void> = {
|
|||
|
||||
currentRecipeVersionsSelector.set(result);
|
||||
}
|
||||
},
|
||||
price: (p) => {
|
||||
let req_action = p.req_action;
|
||||
let status = p.status;
|
||||
let to = p.to;
|
||||
|
||||
let content = p.content ?? [];
|
||||
},
|
||||
heartbeat: (p) => {
|
||||
socketConnectionOfflineCount.set(0);
|
||||
socketAlreadySendHeartbeat.set(0);
|
||||
console.log('heartbeat reset offline count');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue