MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / queryInstanceByUserId

Function queryInstanceByUserId

panel/src/app/service/exchange_service.ts:276–289  ·  view source on GitHub ↗
(
  params: Record<string, any>
)

Source from the content-addressed store, hash-verified

274}
275
276export async function queryInstanceByUserId(
277 params: Record<string, any>
278): Promise<IInstanceInfoProtocol[]> {
279 const name = parseUserName(params.username) || "";
280 const targetDaemonId = toText(params.node_id) ?? undefined;
281 const user = user_service.getUserByUserName(name);
282 if (!user) throw new Error(t("TXT_CODE_903b6c50"));
283
284 const { instances = [] } = await getInstancesByUuid(user.uuid, targetDaemonId, true);
285 const newInstancesInfo = instances.map((v) => {
286 return formatInstanceData(v);
287 });
288 return newInstancesInfo;
289}
290
291export async function getNodeStatus(params: Record<string, any>): Promise<INodeStatusProtocol> {
292 const nodeId = toText(params.node_id) ?? "";

Callers 1

Calls 5

getInstancesByUuidFunction · 0.90
parseUserNameFunction · 0.85
toTextFunction · 0.85
formatInstanceDataFunction · 0.85
getUserByUserNameMethod · 0.80

Tested by

no test coverage detected