diff --git a/src/components/KeyHeader.vue b/src/components/KeyHeader.vue index bd7a3a5d9..370325b0d 100644 --- a/src/components/KeyHeader.vue +++ b/src/components/KeyHeader.vue @@ -123,6 +123,21 @@ }); }, ttlKey: function () { + // ttl <= 0 + if (this.keyTTL <= 0) { + this.$confirm( + this.$t('message.ttl_delete', {key: this.myRedisKey}), + {type: 'warning'} + ).then(() => { + this.setTTL(); + }).catch(() => {}); + } + + else { + this.setTTL(); + } + }, + setTTL() { console.log('ttl key ' + this.myRedisKey + ' ttl is ' + this.keyTTL); let client = this.$util.get('client'); diff --git a/src/i18n/langs/cn.js b/src/i18n/langs/cn.js index 53963be31..484fece94 100644 --- a/src/i18n/langs/cn.js +++ b/src/i18n/langs/cn.js @@ -40,6 +40,7 @@ const cn = { confirm_to_delete_connection: '确认删除连接?', connection_exists: '连接配置已存在', close_to_edit_connection: '编辑前必须关闭连接,要继续么', + ttl_delete: '设置TTL<=0将删除该key,是否确认?', } }; diff --git a/src/i18n/langs/en.js b/src/i18n/langs/en.js index e17a0d144..3d86b3028 100644 --- a/src/i18n/langs/en.js +++ b/src/i18n/langs/en.js @@ -40,6 +40,7 @@ const en = { confirm_to_delete_connection: 'Confirm To Delete Connection ?', connection_exists: 'Connection Config Already Exists', close_to_edit_connection: 'You Must Close The Connection Before Editing', + ttl_delete: 'Set TTL<=0 Will Delete The Key Directly', } };