feat: use a new ws implementation thats encapsulated
This commit is contained in:
parent
45537620a6
commit
5dd4c41291
13 changed files with 370 additions and 101 deletions
|
|
@ -1,12 +1,19 @@
|
|||
import type { HostInfo } from '~/types';
|
||||
import { TimedCache } from '~server/ws/cache';
|
||||
import { hp_agentRequest, hp_getAgentCache } from '~server/ws/data';
|
||||
import { hp_getConfig } from './loader';
|
||||
import { HeadplaneConfig } from './parser';
|
||||
import type { HeadplaneConfig } from './parser';
|
||||
|
||||
export interface AppContext {
|
||||
context: HeadplaneConfig;
|
||||
agentData?: TimedCache<HostInfo>;
|
||||
hp_agentRequest: typeof hp_agentRequest;
|
||||
}
|
||||
|
||||
export default function appContext() {
|
||||
return {
|
||||
context: hp_getConfig(),
|
||||
agentData: hp_getAgentCache(),
|
||||
hp_agentRequest,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue