mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-02 07:20:24 +08:00
feat: v1.7.4
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
### 介绍
|
||||
|
||||
web 版 **linux(终端[终端回放] 文件 脚本 进程 计划任务)、数据库(mysql postgres oracle sqlserver 达梦 高斯 sqlite)、redis(单机 哨兵 集群)、mongo 统一管理操作平台**
|
||||
web 版 **linux(终端[终端回放] 文件 脚本 进程 计划任务)、数据库(mysql postgres oracle sqlserver 达梦 高斯 sqlite)、redis(单机 哨兵 集群)、mongo 等集工单流程审批于一体的统一管理操作平台**
|
||||
|
||||
### 开发语言与主要框架
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { defineAsyncComponent, h, onBeforeUnmount, onMounted, reactive, ref, toRefs } from 'vue';
|
||||
import { ElCheckbox, ElInput, ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElCheckbox, ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { formatByteSize } from '@/common/utils/format';
|
||||
import { DbInst, registerDbCompletionItemProvider, TabInfo, TabType } from './db';
|
||||
import { NodeType, TagTreeNode } from '../component/tag';
|
||||
@@ -706,39 +706,30 @@ const onRenameTable = async (data: any) => {
|
||||
let tableData = { db, oldTableName: tableName, tableName };
|
||||
|
||||
let value = ref(tableName);
|
||||
// 弹出确认框,并选择是否复制数据
|
||||
await ElMessageBox({
|
||||
title: `重命名表【${db}.${tableName}】`,
|
||||
type: 'warning',
|
||||
message: () =>
|
||||
h(ElInput, {
|
||||
modelValue: value.value,
|
||||
'onUpdate:modelValue': (val: string) => {
|
||||
value.value = val;
|
||||
},
|
||||
}),
|
||||
callback: (action: string) => {
|
||||
if (action === 'confirm') {
|
||||
tableData.tableName = value.value;
|
||||
let sql = nowDbInst.value.getDialect().getModifyTableInfoSql(tableData);
|
||||
if (sql) {
|
||||
SqlExecBox({
|
||||
sql: sql,
|
||||
dbId: id as any,
|
||||
db: db as any,
|
||||
dbType: nowDbInst.value.getDialect().getInfo().formatSqlDialect,
|
||||
flowProcdefKey: flowProcdefKey,
|
||||
runSuccessCallback: () => {
|
||||
setTimeout(() => {
|
||||
parentKey && reloadNode(parentKey);
|
||||
}, 1000);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
ElMessage.error('无更改');
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 弹出确认框
|
||||
const promptValue = await ElMessageBox.prompt('', `重命名表【${db}.${tableName}】`, {
|
||||
inputValue: value.value,
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
});
|
||||
|
||||
tableData.tableName = promptValue.value;
|
||||
let sql = nowDbInst.value.getDialect().getModifyTableInfoSql(tableData);
|
||||
if (!sql) {
|
||||
ElMessage.warning('无更改');
|
||||
return;
|
||||
}
|
||||
|
||||
SqlExecBox({
|
||||
sql: sql,
|
||||
dbId: id as any,
|
||||
db: db as any,
|
||||
dbType: nowDbInst.value.getDialect().getInfo().formatSqlDialect,
|
||||
flowProcdefKey: flowProcdefKey,
|
||||
runSuccessCallback: () => {
|
||||
setTimeout(() => {
|
||||
parentKey && reloadNode(parentKey);
|
||||
}, 1000);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -5,15 +5,18 @@ import (
|
||||
"mayfly-go/internal/redis/application"
|
||||
"mayfly-go/pkg/biz"
|
||||
"mayfly-go/pkg/req"
|
||||
"mayfly-go/pkg/utils/collx"
|
||||
)
|
||||
|
||||
func (r *Redis) RunCmd(rc *req.Ctx) {
|
||||
var cmdReq form.RunCmdForm
|
||||
runCmdParam := req.BindJsonAndCopyTo(rc, &cmdReq, new(application.RunCmdParam))
|
||||
biz.IsTrue(len(cmdReq.Cmd) > 0, "redis命令不能为空")
|
||||
rc.ReqParam = cmdReq
|
||||
|
||||
res, err := r.RedisApp.RunCmd(rc.MetaCtx, r.getRedisConn(rc), runCmdParam)
|
||||
redisConn := r.getRedisConn(rc)
|
||||
rc.ReqParam = collx.Kvs("redis", redisConn.Info, "cmd", cmdReq.Cmd)
|
||||
|
||||
res, err := r.RedisApp.RunCmd(rc.MetaCtx, redisConn, runCmdParam)
|
||||
biz.ErrIsNil(err)
|
||||
rc.ResData = res
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ type RedisInfo struct {
|
||||
|
||||
Host string `json:"host"`
|
||||
Db int `json:"db"` // 库号
|
||||
Mode RedisMode `json:"-"`
|
||||
Mode RedisMode `json:"mode"`
|
||||
Username string `json:"-"`
|
||||
Password string `json:"-"`
|
||||
|
||||
@@ -35,7 +35,7 @@ type RedisInfo struct {
|
||||
TagPath []string `json:"tagPath"`
|
||||
SshTunnelMachineId int `json:"-"`
|
||||
|
||||
FlowProcdefKey string // 工单流程定义key
|
||||
FlowProcdefKey string `json:"flowProcdefKey"` // 工单流程定义key
|
||||
}
|
||||
|
||||
func (r *RedisInfo) Conn() (*RedisConn, error) {
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user