mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +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>
 | 
					<script lang="ts" setup>
 | 
				
			||||||
import { defineAsyncComponent, h, onBeforeUnmount, onMounted, reactive, ref, toRefs } from 'vue';
 | 
					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 { formatByteSize } from '@/common/utils/format';
 | 
				
			||||||
import { DbInst, registerDbCompletionItemProvider, TabInfo, TabType } from './db';
 | 
					import { DbInst, registerDbCompletionItemProvider, TabInfo, TabType } from './db';
 | 
				
			||||||
import { NodeType, TagTreeNode } from '../component/tag';
 | 
					import { NodeType, TagTreeNode } from '../component/tag';
 | 
				
			||||||
@@ -706,22 +706,20 @@ const onRenameTable = async (data: any) => {
 | 
				
			|||||||
    let tableData = { db, oldTableName: tableName, tableName };
 | 
					    let tableData = { db, oldTableName: tableName, tableName };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let value = ref(tableName);
 | 
					    let value = ref(tableName);
 | 
				
			||||||
    // 弹出确认框,并选择是否复制数据
 | 
					    // 弹出确认框
 | 
				
			||||||
    await ElMessageBox({
 | 
					    const promptValue = await ElMessageBox.prompt('', `重命名表【${db}.${tableName}】`, {
 | 
				
			||||||
        title: `重命名表【${db}.${tableName}】`,
 | 
					        inputValue: value.value,
 | 
				
			||||||
        type: 'warning',
 | 
					        confirmButtonText: '确定',
 | 
				
			||||||
        message: () =>
 | 
					        cancelButtonText: '取消',
 | 
				
			||||||
            h(ElInput, {
 | 
					    });
 | 
				
			||||||
                modelValue: value.value,
 | 
					
 | 
				
			||||||
                'onUpdate:modelValue': (val: string) => {
 | 
					    tableData.tableName = promptValue.value;
 | 
				
			||||||
                    value.value = val;
 | 
					 | 
				
			||||||
                },
 | 
					 | 
				
			||||||
            }),
 | 
					 | 
				
			||||||
        callback: (action: string) => {
 | 
					 | 
				
			||||||
            if (action === 'confirm') {
 | 
					 | 
				
			||||||
                tableData.tableName = value.value;
 | 
					 | 
				
			||||||
    let sql = nowDbInst.value.getDialect().getModifyTableInfoSql(tableData);
 | 
					    let sql = nowDbInst.value.getDialect().getModifyTableInfoSql(tableData);
 | 
				
			||||||
                if (sql) {
 | 
					    if (!sql) {
 | 
				
			||||||
 | 
					        ElMessage.warning('无更改');
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    SqlExecBox({
 | 
					    SqlExecBox({
 | 
				
			||||||
        sql: sql,
 | 
					        sql: sql,
 | 
				
			||||||
        dbId: id as any,
 | 
					        dbId: id as any,
 | 
				
			||||||
@@ -734,13 +732,6 @@ const onRenameTable = async (data: any) => {
 | 
				
			|||||||
            }, 1000);
 | 
					            }, 1000);
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
                } else {
 | 
					 | 
				
			||||||
                    ElMessage.error('无更改');
 | 
					 | 
				
			||||||
                    return;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const onCopyTable = async (data: any) => {
 | 
					const onCopyTable = async (data: any) => {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,15 +5,18 @@ import (
 | 
				
			|||||||
	"mayfly-go/internal/redis/application"
 | 
						"mayfly-go/internal/redis/application"
 | 
				
			||||||
	"mayfly-go/pkg/biz"
 | 
						"mayfly-go/pkg/biz"
 | 
				
			||||||
	"mayfly-go/pkg/req"
 | 
						"mayfly-go/pkg/req"
 | 
				
			||||||
 | 
						"mayfly-go/pkg/utils/collx"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (r *Redis) RunCmd(rc *req.Ctx) {
 | 
					func (r *Redis) RunCmd(rc *req.Ctx) {
 | 
				
			||||||
	var cmdReq form.RunCmdForm
 | 
						var cmdReq form.RunCmdForm
 | 
				
			||||||
	runCmdParam := req.BindJsonAndCopyTo(rc, &cmdReq, new(application.RunCmdParam))
 | 
						runCmdParam := req.BindJsonAndCopyTo(rc, &cmdReq, new(application.RunCmdParam))
 | 
				
			||||||
	biz.IsTrue(len(cmdReq.Cmd) > 0, "redis命令不能为空")
 | 
						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)
 | 
						biz.ErrIsNil(err)
 | 
				
			||||||
	rc.ResData = res
 | 
						rc.ResData = res
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,7 +27,7 @@ type RedisInfo struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	Host     string    `json:"host"`
 | 
						Host     string    `json:"host"`
 | 
				
			||||||
	Db       int       `json:"db"` // 库号
 | 
						Db       int       `json:"db"` // 库号
 | 
				
			||||||
	Mode     RedisMode `json:"-"`
 | 
						Mode     RedisMode `json:"mode"`
 | 
				
			||||||
	Username string    `json:"-"`
 | 
						Username string    `json:"-"`
 | 
				
			||||||
	Password string    `json:"-"`
 | 
						Password string    `json:"-"`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -35,7 +35,7 @@ type RedisInfo struct {
 | 
				
			|||||||
	TagPath            []string `json:"tagPath"`
 | 
						TagPath            []string `json:"tagPath"`
 | 
				
			||||||
	SshTunnelMachineId int      `json:"-"`
 | 
						SshTunnelMachineId int      `json:"-"`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	FlowProcdefKey string // 工单流程定义key
 | 
						FlowProcdefKey string `json:"flowProcdefKey"` // 工单流程定义key
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (r *RedisInfo) Conn() (*RedisConn, error) {
 | 
					func (r *RedisInfo) Conn() (*RedisConn, error) {
 | 
				
			||||||
 
 | 
				
			|||||||
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user