( params: Record<string, any> )
| 274 | } |
| 275 | |
| 276 | export 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 | |
| 291 | export async function getNodeStatus(params: Record<string, any>): Promise<INodeStatusProtocol> { |
| 292 | const nodeId = toText(params.node_id) ?? ""; |
no test coverage detected