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

Function setupAddKeyButton

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

Source from the content-addressed store, hash-verified

540}
541
542function 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
575function addNewKey() {
576 var newKeyModal = $('#addKeyModal');

Callers 2

treeNodeSelectedFunction · 0.85
addKeyFunction · 0.85

Calls 1

$Function · 0.85

Tested by

no test coverage detected