es功能开发
This commit is contained in:
@@ -15,6 +15,13 @@
|
||||
</template>
|
||||
<el-menu-item index="/data/datasourceManage"><i class="el-icon-coin"></i>数据源管理</el-menu-item>
|
||||
</el-submenu>
|
||||
<el-submenu index="2">
|
||||
<template slot="title">
|
||||
<img src="./assets/img/elasticsearch.png" style="width: 18px;height: 18px;padding: 0 4px;">
|
||||
<span slot="title">ES功能列表</span>
|
||||
</template>
|
||||
<el-menu-item index="/index/executer"><i class="el-icon-coin"></i>数据查询</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
<el-tree :props="defaultProps" :data="esIndexList" @node-click="handleNodeClick"
|
||||
ref="databaseTree" highlight-current draggable
|
||||
|
||||
BIN
zyplayer-doc-ui/es-ui/src/assets/img/elasticsearch.png
Normal file
BIN
zyplayer-doc-ui/es-ui/src/assets/img/elasticsearch.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
@@ -11,8 +11,8 @@ var URL = {
|
||||
updateTableDesc: '/zyplayer-doc-db/doc-db/updateTableDesc',
|
||||
updateTableColumnDesc: '/zyplayer-doc-db/doc-db/updateTableColumnDesc',
|
||||
|
||||
manageDatasourceList: '/zyplayer-doc-db/datasource/list',
|
||||
manageUpdateDatasource: '/zyplayer-doc-db/datasource/update',
|
||||
manageDatasourceList: '/zyplayer-doc-es/datasource/list',
|
||||
manageUpdateDatasource: '/zyplayer-doc-es/datasource/update',
|
||||
|
||||
esMappings: '/zyplayer-doc-es/es-mapping/mappings',
|
||||
esExecuter: '/zyplayer-doc-es/es-mapping/execute',
|
||||
|
||||
@@ -8,10 +8,9 @@
|
||||
<el-button style="float: right;" v-on:click="addDatasource" type="primary" icon="el-icon-circle-plus-outline" size="small">新增</el-button>
|
||||
</div>
|
||||
<el-table :data="datasourceList" stripe border style="width: 100%; margin-bottom: 5px;">
|
||||
<el-table-column prop="driverClassName" label="驱动类" width="200"></el-table-column>
|
||||
<el-table-column prop="sourceUrl" label="数据源URL"></el-table-column>
|
||||
<el-table-column prop="sourceName" label="账号"></el-table-column>
|
||||
<el-table-column prop="sourcePassword" label="密码"></el-table-column>
|
||||
<el-table-column prop="name" label="名字" width="200"></el-table-column>
|
||||
<el-table-column prop="hostPort" label="地址和端口"></el-table-column>
|
||||
<el-table-column prop="scheme" label="scheme"></el-table-column>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-on:click="editDatasource(scope.row)" type="primary" size="small">修改</el-button>
|
||||
@@ -23,27 +22,17 @@
|
||||
</div>
|
||||
<!--增加数据源弹窗-->
|
||||
<el-dialog :inline="true" :title="newDatasource.id>0?'编辑数据源':'新增数据源'" :visible.sync="datasourceDialogVisible" width="600px">
|
||||
<el-alert
|
||||
title="重要提醒"
|
||||
description="请录入正确可用的数据库连接、账号、密码信息,否则初始化数据源失败将影响整个系统,有可能需要重启服务才能解决"
|
||||
type="warning" :closable="false"
|
||||
show-icon style="margin-bottom: 10px;">
|
||||
</el-alert>
|
||||
<el-form label-width="120px">
|
||||
<el-form-item label="驱动类:">
|
||||
<el-select v-model="newDatasource.driverClassName" placeholder="驱动类" style="width: 100%">
|
||||
<el-option label="com.mysql.jdbc.Driver" value="com.mysql.jdbc.Driver"></el-option>
|
||||
<el-option label="net.sourceforge.jtds.jdbc.Driver" value="net.sourceforge.jtds.jdbc.Driver"></el-option>
|
||||
</el-select>
|
||||
<el-form-item label="名字:">
|
||||
<el-input v-model="newDatasource.name" placeholder="中文名字"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据源URL:">
|
||||
<el-input v-model="newDatasource.sourceUrl" placeholder="数据源URL"></el-input>
|
||||
<el-input v-model="newDatasource.hostPort" placeholder="地址和端口"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="账号:">
|
||||
<el-input v-model="newDatasource.sourceName" placeholder="账号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码:">
|
||||
<el-input v-model="newDatasource.sourcePassword" placeholder="密码"></el-input>
|
||||
<el-form-item label="scheme:">
|
||||
<el-select v-model="newDatasource.scheme" placeholder="scheme" style="width: 100%">
|
||||
<el-option label="http" value="http"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" style="text-align: center;">
|
||||
@@ -76,7 +65,7 @@
|
||||
methods: {
|
||||
addDatasource() {
|
||||
this.datasourceDialogVisible = true;
|
||||
this.newDatasource = {driverClassName: "", sourceUrl: "", sourceName: "", sourcePassword: ""};
|
||||
this.newDatasource = {name: "", hostPort: "", scheme: "http"};
|
||||
},
|
||||
editDatasource(row) {
|
||||
this.newDatasource = row;
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
</div>
|
||||
<el-input type="textarea" v-model="executeParam.sql" :rows="10" placeholder="请输入"></el-input>
|
||||
<div style="text-align: center;margin: 10px 0;">
|
||||
<el-button type="primary" v-on:click="submitExecute">执行</el-button>
|
||||
<el-button type="primary" icon="el-icon-video-play" v-on:click="submitExecute">执行</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="margin: 10px;">
|
||||
<el-card style="margin: 10px;" v-loading="executeLoading">
|
||||
<div style="margin: 10px 0;">
|
||||
<span>执行结果:{{executeResult.errCode == 200 ? '成功' : '失败'}}</span>
|
||||
<span>执行状态:{{executeResult.errCode == 200 ? '成功' : '失败'}}</span>
|
||||
</div>
|
||||
<div style="margin: 10px 0;" v-if="executeResult.errCode == 200">
|
||||
<div style="margin: 10px 0;">返回结果:</div>
|
||||
@@ -36,7 +36,6 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
indexMappingListLoading: false,
|
||||
vueQueryParam: {},
|
||||
indexMappingList: [],
|
||||
executeParam: {
|
||||
@@ -44,6 +43,7 @@
|
||||
index: '',
|
||||
},
|
||||
executeResult: {},
|
||||
executeLoading: false,
|
||||
};
|
||||
},
|
||||
beforeRouteUpdate(to, from, next) {
|
||||
@@ -60,7 +60,7 @@
|
||||
},
|
||||
methods: {
|
||||
submitExecute() {
|
||||
this.indexMappingListLoading = true;
|
||||
this.executeLoading = true;
|
||||
this.executeResult = {};
|
||||
this.common.postNonCheck(this.apilist1.esExecuter, this.executeParam, function (json) {
|
||||
var executeResult = json;
|
||||
@@ -70,7 +70,8 @@
|
||||
executeResult.data = "结果解析失败";
|
||||
}
|
||||
app.executeResult = executeResult;
|
||||
app.indexMappingListLoading = false;
|
||||
// 防止遮罩消失太快~
|
||||
setTimeout(()=>{app.executeLoading = false;}, 500);
|
||||
});
|
||||
},
|
||||
executeResultClick(e) {
|
||||
|
||||
Reference in New Issue
Block a user