(connectionId)
| 540 | } |
| 541 | |
| 542 | function setupAddKeyButton (connectionId) { |
| 543 | var newKeyModal = $('#addKeyModal'); |
| 544 | newKeyModal.find('#newStringValue').val(''); |
| 545 | newKeyModal.find('#newFieldName').val(''); |
| 546 | newKeyModal.find('#keyScore').val(''); |
| 547 | newKeyModal.find('#addKeyConnectionId').val(connectionId); |
| 548 | newKeyModal.find('#addKeyValueIsJson').prop('checked', false); |
| 549 | newKeyModal.find('#addKeyFieldIsJson').prop('checked', false); |
| 550 | newKeyModal.find('#keyType').on('change', function () { |
| 551 | var score = newKeyModal.find('#scoreWrap'); |
| 552 | if ($(this).val() === 'zset') { |
| 553 | score.show(); |
| 554 | } else { |
| 555 | score.hide(); |
| 556 | } |
| 557 | var field = newKeyModal.find('#fieldWrap'); |
| 558 | if ($(this).val() === 'hash') { |
| 559 | field.show(); |
| 560 | } else { |
| 561 | field.hide(); |
| 562 | } |
| 563 | var fieldValue = newKeyModal.find('#fieldValueWrap'); |
| 564 | var timestamp = newKeyModal.find('#timestampWrap'); |
| 565 | if ($(this).val() === 'stream') { |
| 566 | fieldValue.show(); |
| 567 | timestamp.show(); |
| 568 | } else { |
| 569 | fieldValue.hide(); |
| 570 | timestamp.hide(); |
| 571 | } |
| 572 | }); |
| 573 | } |
| 574 | |
| 575 | function addNewKey() { |
| 576 | var newKeyModal = $('#addKeyModal'); |
no test coverage detected