diff --git a/mayfly_go_web/src/assets/iconfont/iconfont.js b/mayfly_go_web/src/assets/iconfont/iconfont.js index b9b4f4d5..7e31d647 100644 --- a/mayfly_go_web/src/assets/iconfont/iconfont.js +++ b/mayfly_go_web/src/assets/iconfont/iconfont.js @@ -1,5 +1,5 @@ (window._iconfont_svg_string_3953964 = - ''), + ''), (function (c) { var t = (t = document.getElementsByTagName('script'))[t.length - 1], a = t.getAttribute('data-injectcss'), diff --git a/mayfly_go_web/src/assets/iconfont/iconfont.json b/mayfly_go_web/src/assets/iconfont/iconfont.json index baab9418..9cdae18d 100644 --- a/mayfly_go_web/src/assets/iconfont/iconfont.json +++ b/mayfly_go_web/src/assets/iconfont/iconfont.json @@ -26,6 +26,13 @@ "unicode": "e8b7", "unicode_decimal": 59575 }, + { + "icon_id": "12295203", + "name": "达梦数据库", + "font_class": "db-dm", + "unicode": "e6f0", + "unicode_decimal": 59120 + }, { "icon_id": "10055634", "name": "云数据库MongoDB", diff --git a/mayfly_go_web/src/views/ops/db/InstanceEdit.vue b/mayfly_go_web/src/views/ops/db/InstanceEdit.vue index 2ca210e9..d182fdd5 100644 --- a/mayfly_go_web/src/views/ops/db/InstanceEdit.vue +++ b/mayfly_go_web/src/views/ops/db/InstanceEdit.vue @@ -8,10 +8,11 @@ - - - - + + + + {{ dt.label }} + @@ -86,6 +87,8 @@ import { ElMessage } from 'element-plus'; import { notBlank } from '@/common/assert'; import { RsaEncrypt } from '@/common/rsa'; import SshTunnelSelect from '../component/SshTunnelSelect.vue'; +import { getDbDialect } from './dialect'; +import SvgIcon from '@/components/svgIcon/index.vue'; const props = defineProps({ visible: { @@ -121,7 +124,7 @@ const rules = { { required: true, message: '请输入主机ip和port', - trigger: ['change', 'blur'], + trigger: ['blur'], }, ], username: [ @@ -135,6 +138,21 @@ const rules = { const dbForm: any = ref(null); +const dbTypes = [ + { + type: 'mysql', + label: 'mysql', + }, + { + type: 'postgres', + label: 'postgres', + }, + { + type: 'dm', + label: '达梦(暂不支持ssh)', + }, +]; + const state = reactive({ dialogVisible: false, tabActiveName: 'basic', @@ -143,7 +161,7 @@ const state = reactive({ type: null, name: null, host: '', - port: 3306, + port: null, username: null, password: null, params: null, @@ -170,11 +188,17 @@ watch(props, (newValue: any) => { state.form = { ...newValue.data }; state.oldUserName = state.form.username; } else { - state.form = { port: 3306 } as any; + state.form = { port: null } as any; state.oldUserName = null; } }); +const changeDbType = (val: string) => { + if (!state.form.id) { + state.form.port = getDbDialect(val).getInfo().defaultPort as any; + } +}; + const getDbPwd = async () => { state.pwd = await dbApi.getInstancePwd.request({ id: state.form.id }); }; diff --git a/mayfly_go_web/src/views/ops/db/SqlExec.vue b/mayfly_go_web/src/views/ops/db/SqlExec.vue index 405cea22..3b738699 100644 --- a/mayfly_go_web/src/views/ops/db/SqlExec.vue +++ b/mayfly_go_web/src/views/ops/db/SqlExec.vue @@ -7,7 +7,7 @@