Skip to content

Commit

Permalink
set ttl<=0 confirm delete
Browse files Browse the repository at this point in the history
  • Loading branch information
qishibo committed Feb 22, 2019
1 parent 3d18665 commit 664ee04
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/KeyHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions src/i18n/langs/cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const cn = {
confirm_to_delete_connection: '确认删除连接?',
connection_exists: '连接配置已存在',
close_to_edit_connection: '编辑前必须关闭连接,要继续么',
ttl_delete: '设置TTL<=0将删除该key,是否确认?',
}
};

Expand Down
1 change: 1 addition & 0 deletions src/i18n/langs/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
};

Expand Down

0 comments on commit 664ee04

Please sign in to comment.