mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-04 21:08:30 +08:00
add dispatch page for project console feature
This commit is contained in:
parent
b07ce66b97
commit
8ba0768483
@ -116,17 +116,22 @@
|
||||
: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 File from '../node/node-layout/project/project-file';
|
||||
// import Console from '../node/node-layout/project/project-console';
|
||||
import Console from '../node/node-layout/project/project-console';
|
||||
import { getDishPatchList, getReqId, editDispatch, getDispatchWhiteList, deleteDisPatch } from '../../api/dispatch';
|
||||
import { getNodeProjectList } from '../../api/node'
|
||||
export default {
|
||||
components: {
|
||||
File,
|
||||
// Console
|
||||
Console
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -151,6 +156,7 @@ export default {
|
||||
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'}},
|
||||
@ -398,8 +404,13 @@ export default {
|
||||
// 控制台
|
||||
handleConsole(record) {
|
||||
this.temp = Object.assign(record);
|
||||
this.drawerTitle = `控制台(${this.temp.name})`;
|
||||
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
|
||||
}
|
||||
|
@ -124,7 +124,7 @@
|
||||
<!-- 项目控制台组件 -->
|
||||
<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"
|
||||
|
@ -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