(connectionId, key)
| 883 | } |
| 884 | |
| 885 | function decodeKey (connectionId, key) { |
| 886 | if (typeof(connectionId) === 'object') { |
| 887 | // context menu click |
| 888 | var node = getKeyTree().get_node(connectionId.reference[0]); |
| 889 | key = getFullKeyPath(node); |
| 890 | connectionId = getRootConnection(node); |
| 891 | } |
| 892 | |
| 893 | $.post('apiv2/key/' + encodeURIComponent(connectionId) + '/' + encodeURIComponent(key) + '?action=decode', function (data, status) { |
| 894 | if (status !== 'success') { |
| 895 | return alert('Could not decode key'); |
| 896 | } |
| 897 | |
| 898 | $('#base64Button').html('Encode <small>base64</small>') |
| 899 | .off('click') |
| 900 | .on('click', function() { |
| 901 | encodeString(connectionId, key) |
| 902 | }); |
| 903 | $('#stringValue').val(data); |
| 904 | }); |
| 905 | } |
| 906 | |
| 907 | function clusterNodes (connectionId) { |
| 908 | if (typeof(connectionId) === 'object') { |
no test coverage detected