mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 07:50: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,39 +706,30 @@ 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;
|
let sql = nowDbInst.value.getDialect().getModifyTableInfoSql(tableData);
|
||||||
},
|
if (!sql) {
|
||||||
}),
|
ElMessage.warning('无更改');
|
||||||
callback: (action: string) => {
|
return;
|
||||||
if (action === 'confirm') {
|
}
|
||||||
tableData.tableName = value.value;
|
|
||||||
let sql = nowDbInst.value.getDialect().getModifyTableInfoSql(tableData);
|
SqlExecBox({
|
||||||
if (sql) {
|
sql: sql,
|
||||||
SqlExecBox({
|
dbId: id as any,
|
||||||
sql: sql,
|
db: db as any,
|
||||||
dbId: id as any,
|
dbType: nowDbInst.value.getDialect().getInfo().formatSqlDialect,
|
||||||
db: db as any,
|
flowProcdefKey: flowProcdefKey,
|
||||||
dbType: nowDbInst.value.getDialect().getInfo().formatSqlDialect,
|
runSuccessCallback: () => {
|
||||||
flowProcdefKey: flowProcdefKey,
|
setTimeout(() => {
|
||||||
runSuccessCallback: () => {
|
parentKey && reloadNode(parentKey);
|
||||||
setTimeout(() => {
|
}, 1000);
|
||||||
parentKey && reloadNode(parentKey);
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
ElMessage.error('无更改');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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