mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-16 12:46:35 +08:00
feat: redis支持flushdb、菜单资源支持拖拽排序、禁用等
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
<el-button @click="scan()" icon="bottom" plain>scan</el-button>
|
||||
<el-button @click="showNewKeyDialog" type="primary" icon="plus" plain
|
||||
v-auth="'redis:data:save'"></el-button>
|
||||
<el-button @click="flushDb" type="danger" plain v-auth="'redis:data:save'">flush</el-button>
|
||||
</el-form-item>
|
||||
<div style="float: right">
|
||||
<span>keys: {{ state.dbsize }}</span>
|
||||
@@ -338,11 +339,6 @@ const showKeyDetail = async (row: any) => {
|
||||
state.keyDetailDialog.visible = true;
|
||||
};
|
||||
|
||||
const closeKeyDetail = () => {
|
||||
|
||||
// state.keyDetailDialog.visible = false;
|
||||
}
|
||||
|
||||
const showNewKeyDialog = () => {
|
||||
notNull(state.scanParam.id, '请先选择redis');
|
||||
notNull(state.scanParam.db, "请选择要操作的库")
|
||||
@@ -350,6 +346,24 @@ const showNewKeyDialog = () => {
|
||||
state.newKeyDialog.visible = true;
|
||||
}
|
||||
|
||||
const flushDb = () => {
|
||||
ElMessageBox.confirm(`确定清空[${state.scanParam.db}]库的所有key?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
redisApi.flushDb
|
||||
.request({
|
||||
id: state.scanParam.id,
|
||||
db: state.scanParam.db,
|
||||
})
|
||||
.then(() => {
|
||||
ElMessage.success('清除成功!');
|
||||
searchKey();
|
||||
});
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
||||
const cancelNewKey = () => {
|
||||
resetKeyDetailInfo();
|
||||
state.newKeyDialog.visible = false;
|
||||
|
||||
Reference in New Issue
Block a user