mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-25 02:20:30 +08:00
feat: 版本升级&小问题修复
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
package starter
|
package starter
|
||||||
|
|
||||||
import "fmt"
|
import (
|
||||||
|
"mayfly-go/base/global"
|
||||||
|
)
|
||||||
|
|
||||||
func PrintBanner() {
|
func PrintBanner() {
|
||||||
fmt.Print(`
|
global.Log.Print(`
|
||||||
__ _
|
__ _
|
||||||
_ __ ___ __ _ _ _ / _| |_ _ __ _ ___
|
_ __ ___ __ _ _ _ / _| |_ _ __ _ ___
|
||||||
| '_ ' _ \ / _' | | | | |_| | | | |_____ / _' |/ _ \
|
| '_ ' _ \ / _' | | | | |_| | | | |_____ / _' |/ _ \
|
||||||
|
|||||||
52
go.mod
52
go.mod
@@ -5,53 +5,49 @@ go 1.17
|
|||||||
require (
|
require (
|
||||||
// jwt
|
// jwt
|
||||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible
|
github.com/dgrijalva/jwt-go v3.2.0+incompatible
|
||||||
github.com/gin-gonic/gin v1.7.2
|
github.com/gin-gonic/gin v1.7.7
|
||||||
github.com/go-redis/redis v6.15.9+incompatible
|
github.com/go-redis/redis v6.15.9+incompatible
|
||||||
github.com/gorilla/websocket v1.4.2
|
github.com/gorilla/websocket v1.5.0
|
||||||
// 验证码
|
// 验证码
|
||||||
github.com/mojocn/base64Captcha v1.3.4
|
github.com/mojocn/base64Captcha v1.3.5
|
||||||
github.com/pkg/sftp v1.13.1
|
github.com/pkg/sftp v1.13.4
|
||||||
// 定时任务
|
// 定时任务
|
||||||
github.com/robfig/cron/v3 v3.0.1
|
github.com/robfig/cron/v3 v3.0.1
|
||||||
github.com/sirupsen/logrus v1.8.1
|
github.com/sirupsen/logrus v1.8.1
|
||||||
// jsonschemal校验
|
// jsonschemal校验
|
||||||
github.com/xeipuuv/gojsonschema v1.2.0
|
github.com/xeipuuv/gojsonschema v1.2.0
|
||||||
// ssh
|
// ssh
|
||||||
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
|
golang.org/x/crypto v0.0.0-20220314234724-5d542ad81a58
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||||
// gorm
|
// gorm
|
||||||
gorm.io/driver/mysql v1.0.5
|
gorm.io/driver/mysql v1.3.2
|
||||||
gorm.io/gorm v1.21.11
|
gorm.io/gorm v1.23.2
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||||
github.com/go-playground/locales v0.13.0 // indirect
|
github.com/go-playground/locales v0.14.0 // indirect
|
||||||
github.com/go-playground/universal-translator v0.17.0 // indirect
|
github.com/go-playground/universal-translator v0.18.0 // indirect
|
||||||
github.com/go-playground/validator/v10 v10.4.1 // indirect
|
github.com/go-playground/validator/v10 v10.10.1 // indirect
|
||||||
github.com/go-sql-driver/mysql v1.5.0 // indirect
|
github.com/go-sql-driver/mysql v1.6.0 // indirect
|
||||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||||
github.com/golang/protobuf v1.5.2 // indirect
|
github.com/golang/protobuf v1.5.2 // indirect
|
||||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||||
github.com/jinzhu/now v1.1.2 // indirect
|
github.com/jinzhu/now v1.1.4 // indirect
|
||||||
github.com/json-iterator/go v1.1.11 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/kr/fs v0.1.0 // indirect
|
github.com/kr/fs v0.1.0 // indirect
|
||||||
github.com/kr/pretty v0.1.0 // indirect
|
github.com/leodido/go-urn v1.2.1 // indirect
|
||||||
github.com/leodido/go-urn v1.2.0 // indirect
|
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.13 // indirect
|
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.1 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/onsi/ginkgo v1.16.4 // indirect
|
github.com/onsi/ginkgo v1.16.5 // indirect
|
||||||
github.com/onsi/gomega v1.10.1 // indirect
|
github.com/onsi/gomega v1.18.1 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/ugorji/go/codec v1.2.7 // indirect
|
||||||
github.com/ugorji/go/codec v1.1.7 // indirect
|
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||||
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
|
|
||||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b // indirect
|
golang.org/x/image v0.0.0-20220302094943-723b81ca9867 // indirect
|
||||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
|
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
|
golang.org/x/text v0.3.7 // indirect
|
||||||
golang.org/x/text v0.3.5 // indirect
|
google.golang.org/protobuf v1.27.1 // indirect
|
||||||
google.golang.org/protobuf v1.26.0 // indirect
|
|
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
|
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
"lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue src/"
|
"lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue src/"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.26.1",
|
||||||
"codemirror": "^5.61.0",
|
"codemirror": "^5.65.2",
|
||||||
"countup.js": "^2.0.7",
|
"countup.js": "^2.0.7",
|
||||||
"cropperjs": "^1.5.11",
|
"cropperjs": "^1.5.11",
|
||||||
"echarts": "^5.1.1",
|
"echarts": "^5.1.1",
|
||||||
"element-plus": "^2.0.4",
|
"element-plus": "^2.1.3",
|
||||||
"@element-plus/icons-vue": "^0.2.4",
|
"@element-plus/icons-vue": "^1.1.1",
|
||||||
"jsonlint": "^1.6.3",
|
"jsonlint": "^1.6.3",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mitt": "^3.0.0",
|
"mitt": "^3.0.0",
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"vue": "^3.2.30",
|
"vue": "^3.2.30",
|
||||||
"vue-router": "^4.0.12",
|
"vue-router": "^4.0.12",
|
||||||
"vuex": "^4.0.2",
|
"vuex": "^4.0.2",
|
||||||
"xterm": "^4.16.0",
|
"xterm": "^4.18.0",
|
||||||
"xterm-addon-fit": "^0.5.0"
|
"xterm-addon-fit": "^0.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"sass": "^1.45.1",
|
"sass": "^1.45.1",
|
||||||
"sass-loader": "^12.4.0",
|
"sass-loader": "^12.4.0",
|
||||||
"typescript": "^4.2.4",
|
"typescript": "^4.2.4",
|
||||||
"vite": "^2.7.4",
|
"vite": "^2.8.6",
|
||||||
"vue-eslint-parser": "^8.0.1"
|
"vue-eslint-parser": "^8.0.1"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import { dateStrFormat } from '@/common/utils/date.ts'
|
|||||||
|
|
||||||
import ElementPlus from 'element-plus';
|
import ElementPlus from 'element-plus';
|
||||||
import 'element-plus/dist/index.css';
|
import 'element-plus/dist/index.css';
|
||||||
|
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
||||||
import '@/theme/index.scss';
|
import '@/theme/index.scss';
|
||||||
import mitt from 'mitt';
|
import mitt from 'mitt';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import locale from 'element-plus/lib/locale/lang/zh-cn'
|
|
||||||
|
|
||||||
import * as svg from '@element-plus/icons-vue';
|
import * as svg from '@element-plus/icons-vue';
|
||||||
import SvgIcon from '@/components/svgIcon/index.vue';
|
import SvgIcon from '@/components/svgIcon/index.vue';
|
||||||
@@ -37,7 +37,7 @@ directive(app);
|
|||||||
|
|
||||||
app.use(router)
|
app.use(router)
|
||||||
.use(store, key)
|
.use(store, key)
|
||||||
.use(ElementPlus, { size: globalComponentSize, locale: locale })
|
.use(ElementPlus, { size: globalComponentSize, locale: zhCn})
|
||||||
.mount('#app');
|
.mount('#app');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,14 +34,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-container id="data-exec" style="border: 1px solid #eee; margin-top: 1px">
|
<el-container id="data-exec" style="border: 1px solid #eee; margin-top: 1px">
|
||||||
<el-tabs @tab-remove="removeDataTab" @tab-click="onDataTabClick" style="width: 100%; margin-left: 10px" v-model="activeName">
|
<el-tabs @tab-remove="removeDataTab" @tab-click="onDataTabClick" style="width: 100%" v-model="activeName">
|
||||||
<el-tab-pane :label="queryTab.label" :name="queryTab.name">
|
<el-tab-pane :label="queryTab.label" :name="queryTab.name">
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<div class="fl">
|
<div class="fl">
|
||||||
<el-upload
|
<el-upload
|
||||||
style="display: inline-block; margin-left: 10px"
|
style="display: inline-block"
|
||||||
:before-upload="beforeUpload"
|
:before-upload="beforeUpload"
|
||||||
:on-success="execSqlFileSuccess"
|
:on-success="execSqlFileSuccess"
|
||||||
:headers="{ Authorization: token }"
|
:headers="{ Authorization: token }"
|
||||||
@@ -56,7 +56,9 @@
|
|||||||
>
|
>
|
||||||
<el-button type="success" icon="video-play" plain size="small">sql脚本执行</el-button>
|
<el-button type="success" icon="video-play" plain size="small">sql脚本执行</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-button @click="onCommit" class="ml5" type="success" icon="CircleCheck" plain size="small">commit</el-button>
|
<el-button @click="onCommit" class="ml5 mb5" type="success" icon="CircleCheck" plain size="small"
|
||||||
|
>commit</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="float: right" class="fl">
|
<div style="float: right" class="fl">
|
||||||
@@ -80,8 +82,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt10">
|
<div class="mt5">
|
||||||
<codemirror
|
<codemirror
|
||||||
|
style="border: 1px solid #ccc"
|
||||||
@mousemove="listenMouse"
|
@mousemove="listenMouse"
|
||||||
@beforeChange="onBeforeChange"
|
@beforeChange="onBeforeChange"
|
||||||
height="300px"
|
height="300px"
|
||||||
@@ -97,14 +100,13 @@
|
|||||||
</el-button-group>
|
</el-button-group>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt10">
|
<div class="mt5">
|
||||||
<el-row v-if="queryTab.nowTableName">
|
<el-row v-if="queryTab.nowTableName">
|
||||||
<el-link @click="onDeleteData" class="ml5" type="danger" icon="delete" :underline="false"></el-link>
|
<el-link @click="onDeleteData" class="ml5" type="danger" icon="delete" :underline="false"></el-link>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table
|
<el-table
|
||||||
@cell-dblclick="cellClick"
|
@cell-dblclick="cellClick"
|
||||||
@selection-change="onDataSelectionChange"
|
@selection-change="onDataSelectionChange"
|
||||||
style="margin-top: 1px"
|
|
||||||
:data="queryTab.execRes.data"
|
:data="queryTab.execRes.data"
|
||||||
v-loading="queryTab.loading"
|
v-loading="queryTab.loading"
|
||||||
element-loading-text="查询中..."
|
element-loading-text="查询中..."
|
||||||
@@ -113,6 +115,7 @@
|
|||||||
empty-text="tips: select *开头的单表查询或点击表名默认查询的数据,可双击数据在线修改"
|
empty-text="tips: select *开头的单表查询或点击表名默认查询的数据,可双击数据在线修改"
|
||||||
stripe
|
stripe
|
||||||
border
|
border
|
||||||
|
class="mt5"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="queryTab.execRes.tableColumn.length > 0 && queryTab.nowTableName"
|
v-if="queryTab.execRes.tableColumn.length > 0 && queryTab.nowTableName"
|
||||||
@@ -137,7 +140,7 @@
|
|||||||
|
|
||||||
<el-tab-pane closable v-for="dt in dataTabs" :key="dt.name" :label="dt.label" :name="dt.name">
|
<el-tab-pane closable v-for="dt in dataTabs" :key="dt.name" :label="dt.label" :name="dt.name">
|
||||||
<el-row v-if="dbId">
|
<el-row v-if="dbId">
|
||||||
<el-link @click="onRefresh(dt.name)" icon="refresh" :underline="false"></el-link>
|
<el-link @click="onRefresh(dt.name)" icon="refresh" :underline="false" class="ml5"></el-link>
|
||||||
<el-link @click="addRow" class="ml5" type="primary" icon="plus" :underline="false"></el-link>
|
<el-link @click="addRow" class="ml5" type="primary" icon="plus" :underline="false"></el-link>
|
||||||
<el-link @click="onDeleteData" class="ml5" type="danger" icon="delete" :underline="false"></el-link>
|
<el-link @click="onDeleteData" class="ml5" type="danger" icon="delete" :underline="false"></el-link>
|
||||||
|
|
||||||
@@ -145,7 +148,7 @@
|
|||||||
<el-link @click="onCommit" class="ml5" type="success" icon="check" :underline="false"></el-link>
|
<el-link @click="onCommit" class="ml5" type="success" icon="check" :underline="false"></el-link>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row class="mt5">
|
||||||
<el-input v-model="dt.condition" placeholder="若需条件过滤,输入WHERE之后查询条件点击查询按钮即可" clearable size="small">
|
<el-input v-model="dt.condition" placeholder="若需条件过滤,输入WHERE之后查询条件点击查询按钮即可" clearable size="small">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<el-button @click="selectByCondition(dt.name, dt.condition)" icon="search" size="small"></el-button>
|
<el-button @click="selectByCondition(dt.name, dt.condition)" icon="search" size="small"></el-button>
|
||||||
@@ -156,14 +159,15 @@
|
|||||||
@cell-dblclick="cellClick"
|
@cell-dblclick="cellClick"
|
||||||
@sort-change="onTableSortChange"
|
@sort-change="onTableSortChange"
|
||||||
@selection-change="onDataSelectionChange"
|
@selection-change="onDataSelectionChange"
|
||||||
style="margin-top: 1px"
|
|
||||||
:data="dt.execRes.data"
|
:data="dt.execRes.data"
|
||||||
size="small"
|
size="small"
|
||||||
max-height="600"
|
max-height="600"
|
||||||
v-loading="dt.loading"
|
v-loading="dt.loading"
|
||||||
element-loading-text="查询中..."
|
element-loading-text="查询中..."
|
||||||
|
empty-text="暂无数据"
|
||||||
stripe
|
stripe
|
||||||
border
|
border
|
||||||
|
class="mt5"
|
||||||
>
|
>
|
||||||
<el-table-column v-if="dt.execRes.tableColumn.length > 0" type="selection" width="35" />
|
<el-table-column v-if="dt.execRes.tableColumn.length > 0" type="selection" width="35" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -934,7 +938,7 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style lang="scss">
|
||||||
.codesql {
|
.codesql {
|
||||||
font-size: 9pt;
|
font-size: 9pt;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -946,5 +950,10 @@ export default defineComponent({
|
|||||||
|
|
||||||
#data-exec {
|
#data-exec {
|
||||||
min-height: calc(100vh - 155px);
|
min-height: calc(100vh - 155px);
|
||||||
|
|
||||||
|
.el-table__empty-text {
|
||||||
|
width: 100%;
|
||||||
|
margin-left: 50px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -488,6 +488,7 @@ export default defineComponent({
|
|||||||
headers: { 'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryF1uyUD0tWdqmJqpl' },
|
headers: { 'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryF1uyUD0tWdqmJqpl' },
|
||||||
onUploadProgress: onUploadProgress,
|
onUploadProgress: onUploadProgress,
|
||||||
baseURL: '',
|
baseURL: '',
|
||||||
|
timeout: 60*60*1000,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
ElMessage.success('上传成功');
|
ElMessage.success('上传成功');
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<el-input v-model.trim="form.ip" placeholder="请输入主机ip" auto-complete="off"></el-input>
|
<el-input v-model.trim="form.ip" placeholder="请输入主机ip" auto-complete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="port" label="port:" required>
|
<el-form-item prop="port" label="port:" required>
|
||||||
<el-input type="number" v-model.trim="form.port" placeholder="请输入端口"></el-input>
|
<el-input type="number" v-model.number="form.port" placeholder="请输入端口"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="username" label="用户名:" required>
|
<el-form-item prop="username" label="用户名:" required>
|
||||||
<el-input v-model.trim="form.username" placeholder="请输入用户名"></el-input>
|
<el-input v-model.trim="form.username" placeholder="请输入用户名"></el-input>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="db" label="库号:" required>
|
<el-form-item prop="db" label="库号:" required>
|
||||||
<el-input v-model.trim="form.db" placeholder="请输入库号"></el-input>
|
<el-input v-model.number="form.db" placeholder="请输入库号"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const viteConfig: UserConfig = {
|
|||||||
resolve: { alias },
|
resolve: { alias },
|
||||||
base: process.env.NODE_ENV === 'production' ? VITE_PUBLIC_PATH : './',
|
base: process.env.NODE_ENV === 'production' ? VITE_PUBLIC_PATH : './',
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
include: ['element-plus/lib/locale/lang/zh-cn'],
|
include: ['element-plus/es/locale/lang/zh-cn'],
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
|
|||||||
Reference in New Issue
Block a user