mirror of
https://github.com/tale/headplane.git
synced 2026-08-09 13:39:23 +00:00
feat: keep track of agent ids
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
import type { HostInfo } from '~/types';
|
||||
import { TimedCache } from '~server/ws/cache';
|
||||
import { hp_agentRequest, hp_getAgentCache } from '~server/ws/data';
|
||||
import { hp_getAgents } from '~server/ws/socket';
|
||||
import { hp_getConfig } from './loader';
|
||||
import type { HeadplaneConfig } from './parser';
|
||||
|
||||
export interface AppContext {
|
||||
context: HeadplaneConfig;
|
||||
agentData?: TimedCache<HostInfo>;
|
||||
hp_agentRequest: typeof hp_agentRequest;
|
||||
agents: string[];
|
||||
agentData?: TimedCache<HostInfo>;
|
||||
}
|
||||
|
||||
export default function appContext() {
|
||||
export default function appContext(): AppContext {
|
||||
return {
|
||||
context: hp_getConfig(),
|
||||
agentData: hp_getAgentCache(),
|
||||
hp_agentRequest,
|
||||
agents: [...hp_getAgents().keys()],
|
||||
agentData: hp_getAgentCache(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user