mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-05 05:18:12 +08:00
Merge branch 'dev' of https://gitee.com/keepbx/Jpom into dev
This commit is contained in:
commit
f18a1fd4b5
@ -35,6 +35,34 @@ export function editDispatch(params) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑分发项目
|
||||
* @param {
|
||||
* id: 分发 ID
|
||||
* name: 分发名称
|
||||
* reqId: 请求 ID
|
||||
* type: 类型 add | edit
|
||||
* afterOpt: 发布后操作
|
||||
* runMode: 运行方式
|
||||
* mainClass: 启动类
|
||||
* javaExtDirsCp: 目录地址
|
||||
* whitelistDirectory: 白名单地址
|
||||
* lib: lib
|
||||
* add_xxx: xxx 表示添加的节点信息
|
||||
* xxx_token: xxx 节点的 webhook 地址
|
||||
* xxx_jvm: jvm 参数
|
||||
* xxx_args: args 参数
|
||||
* xxx_javaCopyIds: xxx 节点副本 ID (如果有副本,还需要加上 xxx_jvm_${副本ID} | xxx_args_${副本ID} 参数)
|
||||
* } params
|
||||
*/
|
||||
export function editDispatchProject(params) {
|
||||
return axios({
|
||||
url: '/outgiving/save_project',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分发
|
||||
* @param {*} id 分发 ID
|
||||
|
@ -20,7 +20,8 @@
|
||||
</template>
|
||||
<template slot="operation" slot-scope="text, record">
|
||||
<a-button type="primary" @click="handleDispatch(record)">分发文件</a-button>
|
||||
<a-button type="primary" @click="handleEdit(record)">编辑</a-button>
|
||||
<a-button type="primary" v-if="record.outGivingProject" @click="handleEditDispatchProject(record)">编辑</a-button>
|
||||
<a-button type="primary" v-else @click="handleEditDispatch(record)">编辑</a-button>
|
||||
<a-button type="danger" @click="handleDelete(record)">删除</a-button>
|
||||
</template>
|
||||
<!-- 嵌套表格 -->
|
||||
@ -36,6 +37,10 @@
|
||||
<a-tooltip slot="lastOutGivingTime" slot-scope="text" placement="topLeft" :title="text">
|
||||
<span>{{ text }}</span>
|
||||
</a-tooltip>
|
||||
<template slot="child-operation" slot-scope="text, record">
|
||||
<a-button type="primary" @click="handleFile(record)">文件</a-button>
|
||||
<a-button type="primary" @click="handleConsole(record)">控制台</a-button>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-table>
|
||||
<!-- 添加关联项目 -->
|
||||
@ -105,14 +110,31 @@
|
||||
<a-select-option :key="3">顺序重启(有重启失败将继续)</a-select-option>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
|
||||
</a-form-model>
|
||||
</a-modal>
|
||||
<!-- 项目文件组件 -->
|
||||
<a-drawer :title="drawerTitle" placement="right" width="85vw"
|
||||
:visible="drawerFileVisible" @close="onFileClose">
|
||||
<file v-if="drawerFileVisible" :nodeId="temp.nodeId" :projectId="temp.projectId" />
|
||||
</a-drawer>
|
||||
<!-- 项目控制台组件 -->
|
||||
<a-drawer :title="drawerTitle" placement="right" width="85vw"
|
||||
:visible="drawerConsoleVisible" @close="onConsoleClose">
|
||||
<console v-if="drawerConsoleVisible" :nodeId="temp.nodeId" :projectId="temp.projectId" />
|
||||
</a-drawer>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getDishPatchList, getReqId, editDispatch, getDispatchWhiteList, deleteDisPatch } from '../../api/dispatch';
|
||||
import File from '../node/node-layout/project/project-file';
|
||||
import Console from '../node/node-layout/project/project-console';
|
||||
import { getDishPatchList, getReqId, editDispatch, /*editDispatchProject,*/ getDispatchWhiteList, deleteDisPatch } from '../../api/dispatch';
|
||||
import { getNodeProjectList } from '../../api/node'
|
||||
export default {
|
||||
components: {
|
||||
File,
|
||||
Console
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
@ -134,6 +156,9 @@ export default {
|
||||
],
|
||||
linkDispatchVisible: false,
|
||||
editDispatchVisible: false,
|
||||
drawerTitle: '',
|
||||
drawerFileVisible: false,
|
||||
drawerConsoleVisible: false,
|
||||
columns: [
|
||||
{title: '分发 ID', dataIndex: 'id', width: 100, ellipsis: true, scopedSlots: {customRender: 'id'}},
|
||||
{title: '分发名称', dataIndex: 'name', width: 150, ellipsis: true, scopedSlots: {customRender: 'name'}},
|
||||
@ -146,7 +171,7 @@ export default {
|
||||
{title: '项目状态', dataIndex: 'status', width: 150, ellipsis: true, scopedSlots: {customRender: 'status'}},
|
||||
{title: '分发状态', dataIndex: 'statusMsg', width: 180},
|
||||
{title: '最后分发时间', dataIndex: 'lastOutGivingTime', width: 180, ellipsis: true, scopedSlots: {customRender: 'lastOutGivingTime'}},
|
||||
{title: '操作', dataIndex: 'operation', scopedSlots: {customRender: 'operation'}, width: 200, align: 'left'}
|
||||
{title: '操作', dataIndex: 'child-operation', scopedSlots: {customRender: 'child-operation'}, width: 200, align: 'left'}
|
||||
],
|
||||
rules: {
|
||||
id: [
|
||||
@ -247,7 +272,7 @@ export default {
|
||||
this.loadData();
|
||||
this.loadNodeProjectList();
|
||||
},
|
||||
// 关联
|
||||
// 关联分发
|
||||
handleLink() {
|
||||
this.temp = {
|
||||
type: 'add'
|
||||
@ -255,8 +280,8 @@ export default {
|
||||
this.loadReqId();
|
||||
this.linkDispatchVisible = true;
|
||||
},
|
||||
// 编辑
|
||||
handleEdit(record) {
|
||||
// 编辑分发
|
||||
handleEditDispatch(record) {
|
||||
this.temp = Object.assign({}, record)
|
||||
this.temp.type = 'edit';
|
||||
this.targetKeys = [];
|
||||
@ -270,7 +295,7 @@ export default {
|
||||
this.loadReqId();
|
||||
this.linkDispatchVisible = true;
|
||||
},
|
||||
// 添加
|
||||
// 添加分发项目
|
||||
handleAdd() {
|
||||
this.temp = {
|
||||
type: 'add'
|
||||
@ -278,6 +303,14 @@ export default {
|
||||
this.loadAccesList();
|
||||
this.editDispatchVisible = true;
|
||||
},
|
||||
// 编辑分发项目
|
||||
handleEditDispatchProject(record) {
|
||||
this.temp = Object.assign({}, record)
|
||||
this.temp.type = 'edit';
|
||||
this.loadAccesList();
|
||||
this.loadReqId();
|
||||
this.editDispatchVisible = true;
|
||||
},
|
||||
// 选择项目
|
||||
selectProject(value) {
|
||||
this.targetKeys = [];
|
||||
@ -367,6 +400,27 @@ export default {
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
// 文件管理
|
||||
handleFile(record) {
|
||||
this.temp = Object.assign(record);
|
||||
this.drawerTitle = `文件管理(${this.temp.projectId})`
|
||||
this.drawerFileVisible = true;
|
||||
},
|
||||
// 关闭文件管理对话框
|
||||
onFileClose() {
|
||||
this.drawerFileVisible = false;
|
||||
},
|
||||
// 控制台
|
||||
handleConsole(record) {
|
||||
this.temp = Object.assign(record);
|
||||
this.drawerTitle = `控制台(${this.temp.projectId})`;
|
||||
this.drawerConsoleVisible = true;
|
||||
},
|
||||
// 关闭控制台
|
||||
onConsoleClose() {
|
||||
this.drawerConsoleVisible = false;
|
||||
this.handleFilter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,15 +44,15 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getProjectLogSize, downloadProjectLogFile, getLogBackList, downloadProjectLogBackFile, deleteProjectLogBackFile } from '../../../../api/node-project';
|
||||
import { getProjectById, getProjectLogSize, downloadProjectLogFile, getLogBackList, downloadProjectLogBackFile, deleteProjectLogBackFile } from '../../../../api/node-project';
|
||||
import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
props: {
|
||||
node: {
|
||||
type: Object
|
||||
nodeId: {
|
||||
type: String
|
||||
},
|
||||
project: {
|
||||
type: Object
|
||||
projectId: {
|
||||
type: String
|
||||
},
|
||||
replica: {
|
||||
type: Object
|
||||
@ -63,6 +63,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
project: {},
|
||||
loading: false,
|
||||
socket: null,
|
||||
// 日志内容
|
||||
@ -83,17 +84,31 @@ export default {
|
||||
]),
|
||||
socketUrl() {
|
||||
const protocol = location.protocol === 'https' ? 'wss://' : 'ws://';
|
||||
return `${protocol}${location.host}/console?userId=${this.getToken}&projectId=${this.project.id}&nodeId=${this.node.id}&type=console©Id=${this.copyId}`;
|
||||
return `${protocol}${location.host}/console?userId=${this.getToken}&projectId=${this.projectId}&nodeId=${this.nodeId}&type=console©Id=${this.copyId}`;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadProject();
|
||||
this.initWebSocket();
|
||||
this.loadFileSize();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.socket.close();
|
||||
},
|
||||
methods: {
|
||||
// 加载项目
|
||||
loadProject() {
|
||||
const params = {
|
||||
id: this.projectId,
|
||||
nodeId: this.nodeId
|
||||
}
|
||||
getProjectById(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.project = res.data;
|
||||
// 加载日志文件大小
|
||||
this.loadFileSize();
|
||||
}
|
||||
})
|
||||
},
|
||||
// 初始化
|
||||
initWebSocket() {
|
||||
this.logContext = '';
|
||||
@ -142,7 +157,7 @@ export default {
|
||||
sendMsg(op) {
|
||||
const data = {
|
||||
op: op,
|
||||
projectId: this.project.id,
|
||||
projectId: this.projectId,
|
||||
copyId: this.copyId
|
||||
}
|
||||
this.socket.send(JSON.stringify(data));
|
||||
@ -150,8 +165,8 @@ export default {
|
||||
// 加载日志文件大小
|
||||
loadFileSize() {
|
||||
const params = {
|
||||
nodeId: this.node.id,
|
||||
id: this.project.id,
|
||||
nodeId: this.nodeId,
|
||||
id: this.projectId,
|
||||
copyId: this.copyId
|
||||
}
|
||||
getProjectLogSize(params).then(res => {
|
||||
@ -196,8 +211,8 @@ export default {
|
||||
});
|
||||
// 请求参数
|
||||
const params = {
|
||||
nodeId: this.node.id,
|
||||
id: this.project.id,
|
||||
nodeId: this.nodeId,
|
||||
id: this.projectId,
|
||||
copyId: this.copyId
|
||||
}
|
||||
// 请求接口拿到 blob
|
||||
@ -222,8 +237,8 @@ export default {
|
||||
this.detailData = [];
|
||||
this.lobbackVisible = true;
|
||||
const params = {
|
||||
nodeId: this.node.id,
|
||||
id: this.project.id
|
||||
nodeId: this.nodeId,
|
||||
id: this.projectId
|
||||
}
|
||||
getLogBackList(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
@ -240,8 +255,8 @@ export default {
|
||||
});
|
||||
// 请求参数
|
||||
const params = {
|
||||
nodeId: this.node.id,
|
||||
id: this.project.id,
|
||||
nodeId: this.nodeId,
|
||||
id: this.projectId,
|
||||
copyId: this.copyId,
|
||||
key: record.filename
|
||||
}
|
||||
@ -266,8 +281,8 @@ export default {
|
||||
onOk: () => {
|
||||
// 请求参数
|
||||
const params = {
|
||||
nodeId: this.node.id,
|
||||
id: this.project.id,
|
||||
nodeId: this.nodeId,
|
||||
id: this.projectId,
|
||||
copyId: this.copyId,
|
||||
name: record.filename
|
||||
}
|
||||
|
@ -44,11 +44,11 @@
|
||||
import { getFileList, downloadProjectFile, deleteProjectFile, uploadProjectFile } from '../../../../api/node-project';
|
||||
export default {
|
||||
props: {
|
||||
node: {
|
||||
type: Object
|
||||
nodeId: {
|
||||
type: String
|
||||
},
|
||||
project: {
|
||||
type: Object
|
||||
projectId: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -120,8 +120,8 @@ export default {
|
||||
this.uploadFileList.forEach(file => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('nodeId', this.node.id);
|
||||
formData.append('id', this.project.id);
|
||||
formData.append('nodeId', this.nodeId);
|
||||
formData.append('id', this.projectId);
|
||||
formData.append('levelName', this.tempNode.path);
|
||||
// 上传文件
|
||||
uploadProjectFile(formData).then(res => {
|
||||
@ -148,8 +148,8 @@ export default {
|
||||
}
|
||||
// 请求参数
|
||||
const params = {
|
||||
nodeId: this.node.id,
|
||||
id: this.project.id,
|
||||
nodeId: this.nodeId,
|
||||
id: this.projectId,
|
||||
path: node.dataRef.path
|
||||
}
|
||||
this.fileList = [];
|
||||
@ -194,8 +194,8 @@ export default {
|
||||
}
|
||||
// 请求参数
|
||||
const params = {
|
||||
nodeId: this.node.id,
|
||||
id: this.project.id,
|
||||
nodeId: this.nodeId,
|
||||
id: this.projectId,
|
||||
path: this.tempNode.path
|
||||
}
|
||||
this.fileList = [];
|
||||
@ -226,8 +226,8 @@ export default {
|
||||
onOk: () => {
|
||||
// 请求参数
|
||||
const params = {
|
||||
nodeId: this.node.id,
|
||||
id: this.project.id,
|
||||
nodeId: this.nodeId,
|
||||
id: this.projectId,
|
||||
type: 'clear'
|
||||
}
|
||||
// 删除
|
||||
@ -251,8 +251,8 @@ export default {
|
||||
});
|
||||
// 请求参数
|
||||
const params = {
|
||||
nodeId: this.node.id,
|
||||
id: this.project.id,
|
||||
nodeId: this.nodeId,
|
||||
id: this.projectId,
|
||||
levelName: record.levelName,
|
||||
filename: record.filename
|
||||
}
|
||||
@ -277,8 +277,8 @@ export default {
|
||||
onOk: () => {
|
||||
// 请求参数
|
||||
const params = {
|
||||
nodeId: this.node.id,
|
||||
id: this.project.id,
|
||||
nodeId: this.nodeId,
|
||||
id: this.projectId,
|
||||
levelName: record.levelName,
|
||||
filename: record.filename
|
||||
}
|
||||
|
@ -119,12 +119,12 @@
|
||||
<!-- 项目文件组件 -->
|
||||
<a-drawer :title="drawerTitle" placement="right" width="85vw"
|
||||
:visible="drawerFileVisible" @close="onFileClose">
|
||||
<file v-if="drawerFileVisible" :node="node" :project="temp" />
|
||||
<file v-if="drawerFileVisible" :nodeId="node.id" :projectId="temp.id" />
|
||||
</a-drawer>
|
||||
<!-- 项目控制台组件 -->
|
||||
<a-drawer :title="drawerTitle" placement="right" width="85vw"
|
||||
:visible="drawerConsoleVisible" @close="onConsoleClose">
|
||||
<console v-if="drawerConsoleVisible" :node="node" :project="temp" />
|
||||
<console v-if="drawerConsoleVisible" :nodeId="node.id" :projectId="temp.id" />
|
||||
</a-drawer>
|
||||
<!-- 项目监控组件 -->
|
||||
<a-drawer :title="drawerTitle" placement="right" width="85vw"
|
||||
@ -292,8 +292,16 @@ export default {
|
||||
}
|
||||
getProjectById(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.temp = res.data;
|
||||
this.temp.type = 'edit';
|
||||
this.temp = {
|
||||
...res.data,
|
||||
type: 'edit'
|
||||
};
|
||||
if (!this.temp.javaCopyItemList) {
|
||||
this.temp = {
|
||||
...this.temp,
|
||||
javaCopyItemList: []
|
||||
};
|
||||
}
|
||||
this.editProjectVisible = true;
|
||||
}
|
||||
})
|
||||
@ -313,6 +321,7 @@ export default {
|
||||
args: '',
|
||||
deleteAble: true
|
||||
})
|
||||
console.log(this.temp)
|
||||
},
|
||||
// 移除副本
|
||||
handleDeleteReplica(reeplica) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
<!-- 项目控制台组件 -->
|
||||
<a-drawer :title="drawerTitle" placement="right" width="85vw"
|
||||
:visible="drawerConsoleVisible" @close="onConsoleClose">
|
||||
<console v-if="drawerConsoleVisible" :node="node" :project="project" :replica="temp" :copyId="temp.id" />
|
||||
<console v-if="drawerConsoleVisible" :nodeId="node.id" :projectId="project.id" :replica="temp" :copyId="temp.id" />
|
||||
</a-drawer>
|
||||
<!-- 项目监控组件 -->
|
||||
<a-drawer :title="drawerTitle" placement="right" width="85vw"
|
||||
|
Loading…
Reference in New Issue
Block a user