MCPcopy Create free account
hub / github.com/Roy3838/Observer / toggleCustomServer

Method toggleCustomServer

app/src/utils/ModelManager.ts:409–423  ·  view source on GitHub ↗
(address: string)

Source from the content-addressed store, hash-verified

407 }
408
409 public toggleCustomServer(address: string): CustomServer[] {
410 const server = this.customServers.find(s => s.address === address);
411 if (server) {
412 server.enabled = !server.enabled;
413 this.saveCustomServersToStorage();
414
415 if (server.enabled && server.status === 'online') {
416 this.addServer(address);
417 } else {
418 this.removeServer(address);
419 }
420 }
421
422 return [...this.customServers];
423 }
424
425 public updateCustomServerStatus(address: string, status: 'online' | 'offline'): CustomServer[] {
426 const server = this.customServers.find(s => s.address === address);

Callers 1

toggleCustomServerFunction · 0.80

Calls 3

addServerMethod · 0.95
removeServerMethod · 0.95

Tested by

no test coverage detected