MCPcopy
hub / github.com/joeferner/redis-commander / removeServer

Function removeServer

web/static/scripts/redisCommander.js:1519–1539  ·  view source on GitHub ↗
(connectionId)

Source from the content-addressed store, hash-verified

1517}
1518
1519function removeServer (connectionId) {
1520 var node;
1521 if (typeof(connectionId) === 'object') {
1522 // context menu click
1523 node = getKeyTree().get_node(connectionId.reference[0]);
1524 connectionId = getRootConnection(node);
1525 }
1526 else {
1527 node = getKeyTree().get_node(connectionId);
1528 }
1529 var result = confirm('Are you sure you want to disconnect from "' + node.text + '"?');
1530 if (result) {
1531 $.post('logout/' + encodeURIComponent(connectionId), function (err, status) {
1532 if (status !== 'success') {
1533 return alert('Could not remove instance');
1534 }
1535 $(window).off('beforeunload', 'clearStorage');
1536 location.reload();
1537 });
1538 }
1539}
1540
1541function addServer () {
1542 $('#addServerForm').trigger('submit');

Callers

nothing calls this directly

Calls 3

getKeyTreeFunction · 0.85
getRootConnectionFunction · 0.85
$Function · 0.85

Tested by

no test coverage detected