diff --git a/mayfly_go_web/package.json b/mayfly_go_web/package.json index 59cb83e6..92fb832a 100644 --- a/mayfly_go_web/package.json +++ b/mayfly_go_web/package.json @@ -17,7 +17,7 @@ "countup.js": "^2.7.0", "cropperjs": "^1.5.11", "echarts": "^5.4.3", - "element-plus": "^2.4.4", + "element-plus": "^2.5.0", "js-base64": "^3.7.5", "jsencrypt": "^3.3.2", "lodash": "^4.17.21", @@ -33,7 +33,7 @@ "splitpanes": "^3.1.5", "sql-formatter": "^14.0.0", "uuid": "^9.0.1", - "vue": "^3.4.6", + "vue": "^3.4.7", "vue-router": "^4.2.5", "xterm": "^5.3.0", "xterm-addon-fit": "^0.8.0", @@ -48,7 +48,7 @@ "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "@vitejs/plugin-vue": "^5.0.2", - "@vue/compiler-sfc": "^3.4.6", + "@vue/compiler-sfc": "^3.4.7", "dotenv": "^16.3.1", "eslint": "^8.35.0", "eslint-plugin-vue": "^9.19.2", diff --git a/mayfly_go_web/src/common/echarts/theme.json b/mayfly_go_web/src/common/echarts/theme.json deleted file mode 100644 index a66adba7..00000000 --- a/mayfly_go_web/src/common/echarts/theme.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "seriesCnt": "4", - "backgroundColor": "rgba(0,0,0,0)", - "titleColor": "#008acd", - "subtitleColor": "#aaaaaa", - "textColorShow": false, - "textColor": "#333", - "markTextColor": "#eeeeee", - "color": [ - "#2ec7c9", - "#b6a2de", - "#5ab1ef", - "#ffb980", - "#d87a80", - "#8d98b3", - "#e5cf0d", - "#97b552", - "#95706d", - "#dc69aa", - "#07a2a4", - "#9a7fd1", - "#588dd5", - "#f5994e", - "#c05050", - "#59678c", - "#c9ab00", - "#7eb00a", - "#6f5553", - "#c14089" - ], - "borderColor": "#ccc", - "borderWidth": 0, - "visualMapColor": [ - "#5ab1ef", - "#e0ffff" - ], - "legendTextColor": "#333333", - "kColor": "#d87a80", - "kColor0": "#2ec7c9", - "kBorderColor": "#d87a80", - "kBorderColor0": "#2ec7c9", - "kBorderWidth": 1, - "lineWidth": 2, - "symbolSize": 3, - "symbol": "emptyCircle", - "symbolBorderWidth": 1, - "lineSmooth": true, - "graphLineWidth": 1, - "graphLineColor": "#aaaaaa", - "mapLabelColor": "#d87a80", - "mapLabelColorE": "rgb(100,0,0)", - "mapBorderColor": "#eeeeee", - "mapBorderColorE": "#444", - "mapBorderWidth": 0.5, - "mapBorderWidthE": 1, - "mapAreaColor": "#dddddd", - "mapAreaColorE": "rgba(254,153,78,1)", - "axes": [ - { - "type": "all", - "name": "通用坐标轴", - "axisLineShow": true, - "axisLineColor": "#eeeeee", - "axisTickShow": true, - "axisTickColor": "#eeeeee", - "axisLabelShow": true, - "axisLabelColor": "#eeeeee", - "splitLineShow": true, - "splitLineColor": [ - "#aaaaaa" - ], - "splitAreaShow": false, - "splitAreaColor": [ - "#eeeeee" - ] - }, - { - "type": "category", - "name": "类目坐标轴", - "axisLineShow": true, - "axisLineColor": "#008acd", - "axisTickShow": true, - "axisTickColor": "#333", - "axisLabelShow": true, - "axisLabelColor": "#333", - "splitLineShow": false, - "splitLineColor": [ - "#eee" - ], - "splitAreaShow": false, - "splitAreaColor": [ - "rgba(250,250,250,0.3)", - "rgba(200,200,200,0.3)" - ] - }, - { - "type": "value", - "name": "数值坐标轴", - "axisLineShow": true, - "axisLineColor": "#008acd", - "axisTickShow": true, - "axisTickColor": "#333", - "axisLabelShow": true, - "axisLabelColor": "#333", - "splitLineShow": true, - "splitLineColor": [ - "#eee" - ], - "splitAreaShow": true, - "splitAreaColor": [ - "rgba(250,250,250,0.3)", - "rgba(200,200,200,0.3)" - ] - }, - { - "type": "log", - "name": "对数坐标轴", - "axisLineShow": true, - "axisLineColor": "#008acd", - "axisTickShow": true, - "axisTickColor": "#333", - "axisLabelShow": true, - "axisLabelColor": "#333", - "splitLineShow": true, - "splitLineColor": [ - "#eee" - ], - "splitAreaShow": true, - "splitAreaColor": [ - "rgba(250,250,250,0.3)", - "rgba(200,200,200,0.3)" - ] - }, - { - "type": "time", - "name": "时间坐标轴", - "axisLineShow": true, - "axisLineColor": "#008acd", - "axisTickShow": true, - "axisTickColor": "#333", - "axisLabelShow": true, - "axisLabelColor": "#333", - "splitLineShow": true, - "splitLineColor": [ - "#eee" - ], - "splitAreaShow": false, - "splitAreaColor": [ - "rgba(250,250,250,0.3)", - "rgba(200,200,200,0.3)" - ] - } - ], - "axisSeperateSetting": true, - "toolboxColor": "#2ec7c9", - "toolboxEmphasisColor": "#18a4a6", - "tooltipAxisColor": "#008acd", - "tooltipAxisWidth": "1", - "timelineLineColor": "#008acd", - "timelineLineWidth": 1, - "timelineItemColor": "#008acd", - "timelineItemColorE": "#a9334c", - "timelineCheckColor": "#2ec7c9", - "timelineCheckBorderColor": "#2ec7c9", - "timelineItemBorderWidth": 1, - "timelineControlColor": "#008acd", - "timelineControlBorderColor": "#008acd", - "timelineControlBorderWidth": 0.5, - "timelineLabelColor": "#008acd", - "datazoomBackgroundColor": "rgba(47,69,84,0)", - "datazoomDataColor": "#efefff", - "datazoomFillColor": "rgba(182,162,222,0.2)", - "datazoomHandleColor": "#008acd", - "datazoomHandleWidth": "100", - "datazoomLabelColor": "#333333" -} \ No newline at end of file diff --git a/mayfly_go_web/src/common/echarts/useEcharts.ts b/mayfly_go_web/src/common/echarts/useEcharts.ts deleted file mode 100644 index a02fb0cd..00000000 --- a/mayfly_go_web/src/common/echarts/useEcharts.ts +++ /dev/null @@ -1,38 +0,0 @@ -// import * as echarts from 'echarts' - -// 引入 echarts 核心模块,核心模块提供了 echarts 使用必须要的接口。 -import * as echarts from 'echarts/core'; - -/** 图表后缀都为 Chart */ -import { PieChart } from 'echarts/charts'; - -// 引入提示框,标题,直角坐标系,数据集,内置数据转换器组件,组件后缀都为 Component -import { TitleComponent, TooltipComponent, GridComponent, DatasetComponent, TransformComponent, LegendComponent } from 'echarts/components'; - -// 标签自动布局,全局过渡动画等特性 -import { LabelLayout, UniversalTransition } from 'echarts/features'; - -// 引入 Canvas 渲染器,注意引入 CanvasRenderer 或者 SVGRenderer 是必须的一步 -import { CanvasRenderer } from 'echarts/renderers'; - -// 注册必须的组件 -echarts.use([ - TitleComponent, - TooltipComponent, - GridComponent, - DatasetComponent, - TransformComponent, - LegendComponent, - // BarChart, - LabelLayout, - UniversalTransition, - CanvasRenderer, - // LineChart, - PieChart, -]); - -export default function (dom: any, theme: any = null, option: any) { - let chart = echarts.init(dom, theme); - chart.setOption(option); - return chart; -} diff --git a/mayfly_go_web/src/components/echarts/ECharts.vue b/mayfly_go_web/src/components/echarts/ECharts.vue new file mode 100644 index 00000000..7083d420 --- /dev/null +++ b/mayfly_go_web/src/components/echarts/ECharts.vue @@ -0,0 +1,86 @@ + + + diff --git a/mayfly_go_web/src/components/echarts/config/index.ts b/mayfly_go_web/src/components/echarts/config/index.ts new file mode 100644 index 00000000..af146888 --- /dev/null +++ b/mayfly_go_web/src/components/echarts/config/index.ts @@ -0,0 +1,67 @@ +import * as echarts from 'echarts/core'; +import { BarChart, LineChart, LinesChart, PieChart, ScatterChart, RadarChart, GaugeChart } from 'echarts/charts'; +import { + TitleComponent, + TooltipComponent, + GridComponent, + DatasetComponent, + TransformComponent, + LegendComponent, + PolarComponent, + GeoComponent, + ToolboxComponent, + DataZoomComponent, +} from 'echarts/components'; +import { LabelLayout, UniversalTransition } from 'echarts/features'; +import { CanvasRenderer } from 'echarts/renderers'; +import type { + BarSeriesOption, + LineSeriesOption, + LinesSeriesOption, + PieSeriesOption, + ScatterSeriesOption, + RadarSeriesOption, + GaugeSeriesOption, +} from 'echarts/charts'; +import type { TitleComponentOption, TooltipComponentOption, GridComponentOption, DatasetComponentOption } from 'echarts/components'; +import type { ComposeOption } from 'echarts/core'; +// import 'echarts-liquidfill'; + +export type ECOption = ComposeOption< + | BarSeriesOption + | LineSeriesOption + | LinesSeriesOption + | PieSeriesOption + | RadarSeriesOption + | GaugeSeriesOption + | TitleComponentOption + | TooltipComponentOption + | GridComponentOption + | DatasetComponentOption + | ScatterSeriesOption +>; + +echarts.use([ + TitleComponent, + TooltipComponent, + GridComponent, + DatasetComponent, + TransformComponent, + LegendComponent, + PolarComponent, + GeoComponent, + ToolboxComponent, + DataZoomComponent, + BarChart, + LineChart, + LinesChart, + PieChart, + ScatterChart, + RadarChart, + GaugeChart, + LabelLayout, + UniversalTransition, + CanvasRenderer, +]); + +export default echarts; diff --git a/mayfly_go_web/src/components/echarts/config/theme.js b/mayfly_go_web/src/components/echarts/config/theme.js new file mode 100644 index 00000000..852b4216 --- /dev/null +++ b/mayfly_go_web/src/components/echarts/config/theme.js @@ -0,0 +1,151 @@ +const light = { + seriesCnt: '4', + backgroundColor: 'rgba(0,0,0,0)', + titleColor: '#008acd', + subtitleColor: '#aaaaaa', + textColorShow: false, + textColor: '#333', + markTextColor: '#eeeeee', + color: [ + '#2ec7c9', + '#b6a2de', + '#5ab1ef', + '#ffb980', + '#d87a80', + '#8d98b3', + '#e5cf0d', + '#97b552', + '#95706d', + '#dc69aa', + '#07a2a4', + '#9a7fd1', + '#588dd5', + '#f5994e', + '#c05050', + '#59678c', + '#c9ab00', + '#7eb00a', + '#6f5553', + '#c14089', + ], + borderColor: '#ccc', + borderWidth: 0, + visualMapColor: ['#5ab1ef', '#e0ffff'], + legendTextColor: '#333333', + kColor: '#d87a80', + kColor0: '#2ec7c9', + kBorderColor: '#d87a80', + kBorderColor0: '#2ec7c9', + kBorderWidth: 1, + lineWidth: 2, + symbolSize: 3, + symbol: 'emptyCircle', + symbolBorderWidth: 1, + lineSmooth: true, + graphLineWidth: 1, + graphLineColor: '#aaaaaa', + mapLabelColor: '#d87a80', + mapLabelColorE: 'rgb(100,0,0)', + mapBorderColor: '#eeeeee', + mapBorderColorE: '#444', + mapBorderWidth: 0.5, + mapBorderWidthE: 1, + mapAreaColor: '#dddddd', + mapAreaColorE: 'rgba(254,153,78,1)', + axes: [ + { + type: 'all', + name: '通用坐标轴', + axisLineShow: true, + axisLineColor: '#eeeeee', + axisTickShow: true, + axisTickColor: '#eeeeee', + axisLabelShow: true, + axisLabelColor: '#eeeeee', + splitLineShow: true, + splitLineColor: ['#aaaaaa'], + splitAreaShow: false, + splitAreaColor: ['#eeeeee'], + }, + { + type: 'category', + name: '类目坐标轴', + axisLineShow: true, + axisLineColor: '#008acd', + axisTickShow: true, + axisTickColor: '#333', + axisLabelShow: true, + axisLabelColor: '#333', + splitLineShow: false, + splitLineColor: ['#eee'], + splitAreaShow: false, + splitAreaColor: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'], + }, + { + type: 'value', + name: '数值坐标轴', + axisLineShow: true, + axisLineColor: '#008acd', + axisTickShow: true, + axisTickColor: '#333', + axisLabelShow: true, + axisLabelColor: '#333', + splitLineShow: true, + splitLineColor: ['#eee'], + splitAreaShow: true, + splitAreaColor: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'], + }, + { + type: 'log', + name: '对数坐标轴', + axisLineShow: true, + axisLineColor: '#008acd', + axisTickShow: true, + axisTickColor: '#333', + axisLabelShow: true, + axisLabelColor: '#333', + splitLineShow: true, + splitLineColor: ['#eee'], + splitAreaShow: true, + splitAreaColor: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'], + }, + { + type: 'time', + name: '时间坐标轴', + axisLineShow: true, + axisLineColor: '#008acd', + axisTickShow: true, + axisTickColor: '#333', + axisLabelShow: true, + axisLabelColor: '#333', + splitLineShow: true, + splitLineColor: ['#eee'], + splitAreaShow: false, + splitAreaColor: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'], + }, + ], + axisSeperateSetting: true, + toolboxColor: '#2ec7c9', + toolboxEmphasisColor: '#18a4a6', + tooltipAxisColor: '#008acd', + tooltipAxisWidth: '1', + timelineLineColor: '#008acd', + timelineLineWidth: 1, + timelineItemColor: '#008acd', + timelineItemColorE: '#a9334c', + timelineCheckColor: '#2ec7c9', + timelineCheckBorderColor: '#2ec7c9', + timelineItemBorderWidth: 1, + timelineControlColor: '#008acd', + timelineControlBorderColor: '#008acd', + timelineControlBorderWidth: 0.5, + timelineLabelColor: '#008acd', + datazoomBackgroundColor: 'rgba(47,69,84,0)', + datazoomDataColor: '#efefff', + datazoomFillColor: 'rgba(182,162,222,0.2)', + datazoomHandleColor: '#008acd', + datazoomHandleWidth: '100', + datazoomLabelColor: '#333333', +}; + +export { light }; diff --git a/mayfly_go_web/src/views/ops/component/TagTreeResourceSelect.vue b/mayfly_go_web/src/views/ops/component/TagTreeResourceSelect.vue new file mode 100644 index 00000000..bbb5b12e --- /dev/null +++ b/mayfly_go_web/src/views/ops/component/TagTreeResourceSelect.vue @@ -0,0 +1,135 @@ + + + + + diff --git a/mayfly_go_web/src/views/ops/db/SyncTaskEdit.vue b/mayfly_go_web/src/views/ops/db/SyncTaskEdit.vue index fa6de5ba..5f3e4018 100644 --- a/mayfly_go_web/src/views/ops/db/SyncTaskEdit.vue +++ b/mayfly_go_web/src/views/ops/db/SyncTaskEdit.vue @@ -7,47 +7,62 @@ :close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true" - width="700px" + width="850px" > - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -85,6 +127,7 @@ + @@ -226,48 +269,43 @@ watch(dialogVisible, async (newValue: boolean) => { } state.tabActiveName = 'basic'; const propsData = props.data as any; - if (propsData?.id) { - let data = await dbApi.getDatasyncTask.request({ taskId: propsData?.id }); - state.form = data; - try { - state.form.fieldMap = JSON.parse(data.fieldMap); - } catch (e) { - state.form.fieldMap = []; - } - let { srcDbId, srcTagPath, srcDbName, targetTagPath, targetDbId } = state.form; - - // 初始化src数据源 - if (srcTagPath && srcDbId) { - // 通过tagPath查询实例列表 - const dbInfoRes = await dbApi.dbs.request({ tagPath: srcTagPath }); - dbInfoRes.list.forEach((a: any) => { - if (a.id === srcDbId) { - // 初始化实例 - a.databases = a.database?.split(' ').sort() || []; - state.srcDbInst = DbInst.getOrNewInst(a); - } - }); - } - - // 初始化target数据源 - if (targetTagPath && targetDbId) { - // 通过tagPath查询实例列表 - const dbInfoRes = await dbApi.dbs.request({ tagPath: targetTagPath }); - dbInfoRes.list.forEach((a: any) => { - if (a.id === targetDbId) { - // 初始化实例 - a.databases = a.database?.split(' ').sort() || []; - state.targetDbInst = DbInst.getOrNewInst(a); - } - }); - } - - // 注册sql代码提示 - if (srcDbId && srcDbName) { - registerDbCompletionItemProvider(srcDbId, srcDbName, state.srcDbInst.databases, state.srcDbInst.type); - } - } else { + if (!propsData?.id) { state.form = basicFormData; + return; + } + + let data = await dbApi.getDatasyncTask.request({ taskId: propsData?.id }); + state.form = data; + try { + state.form.fieldMap = JSON.parse(data.fieldMap); + } catch (e) { + state.form.fieldMap = []; + } + let { srcDbId, srcDbName, targetDbId } = state.form; + + // 初始化src数据源 + if (srcDbId) { + // 通过tagPath查询实例列表 + const dbInfoRes = await dbApi.dbs.request({ id: srcDbId }); + const db = dbInfoRes.list[0]; + // 初始化实例 + db.databases = db.database?.split(' ').sort() || []; + state.srcDbInst = DbInst.getOrNewInst(db); + } + + // 初始化target数据源 + if (targetDbId) { + // 通过tagPath查询实例列表 + const dbInfoRes = await dbApi.dbs.request({ id: targetDbId }); + const db = dbInfoRes.list[0]; + // 初始化实例 + db.databases = db.database?.split(' ').sort() || []; + state.targetDbInst = DbInst.getOrNewInst(db); + } + + // 注册sql代码提示 + if (srcDbId && srcDbName) { + registerDbCompletionItemProvider(srcDbId, srcDbName, state.srcDbInst.databases, state.srcDbInst.type); } }); @@ -277,7 +315,7 @@ watch(tabActiveName, async (newValue: string) => { await handleGetSrcFields(); await handleGetTargetFields(); break; - case 'targetDb': + case 'dbConf': await handleGetTargetFields(); if (state.form.targetDbId && state.form.targetDbName) { await loadDbTables(state.form.targetDbId, state.form.targetDbName); @@ -418,8 +456,12 @@ const cancel = () => { + diff --git a/mayfly_go_web/src/views/ops/machine/MachineStats.vue b/mayfly_go_web/src/views/ops/machine/MachineStats.vue index 39270ce9..fbed4311 100644 --- a/mayfly_go_web/src/views/ops/machine/MachineStats.vue +++ b/mayfly_go_web/src/views/ops/machine/MachineStats.vue @@ -24,11 +24,11 @@ -
+
-
+
@@ -74,11 +74,11 @@ - + diff --git a/mayfly_go_web/src/views/ops/redis/Info.vue b/mayfly_go_web/src/views/ops/redis/Info.vue index 4d9b9bbb..85d59a19 100644 --- a/mayfly_go_web/src/views/ops/redis/Info.vue +++ b/mayfly_go_web/src/views/ops/redis/Info.vue @@ -15,7 +15,7 @@ -
+
@@ -72,10 +72,10 @@