Compare commits

...

2 Commits

Author SHA1 Message Date
胡川虎 41df3aaf82 Merge remote-tracking branch 'origin/master'
3 months ago
胡川虎 eacb9dedca 第一次提交
3 months ago

@ -70,9 +70,9 @@ spring:
# redis单机模式
redis:
database: 1 #缓存库编号
host: 127.0.0.1
host: 222.71.165.188
port: 6379
# password: 123456 # 密码为空时,请将本行注释
password: qweasd,.123 # 密码为空时,请将本行注释
timeout: 3000 #超时时间(单位:秒)
lettuce: #Lettuce为Redis的Java驱动包
pool:

@ -0,0 +1,209 @@
<template>
<div class="popupSelect-container">
<el-dialog title="日志详情" :close-on-click-modal="false" :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center log-detail-modal" lock-scroll append-to-body
width="800px">
<div class="log-detail-board" v-loading="listLoading">
<div class="log-left-board">
<div class="item-box" :class="{ active: activeItem.id == item.id }"
v-for="(item, index) in list" @click="handleClick(item,index)" :key='item.id'>
<div class="top">
<span class="fullName">{{ item.nodeName }}</span>
<i class="icon icon-ym icon-ym-fail" v-if="!item.resultType" />
<i class="icon icon-ym icon-ym-success" v-else />
</div>
<div class="bottom">
<i class="icon-ym icon-ym-clock pr-4px" v-if="item.type == 1" />
<i class="icon-ym icon-ym-btn-refresh pr-4px" v-else />
{{ item.endTime|toDate('yyyy-MM-dd HH:mm') }}
</div>
</div>
</div>
<div class="log-center-board">
<div class="top">
<span>{{ activeItem.nodeName }}</span>
<div v-if="!activeItem.resultType">
<el-button @click="handleUpdateNodes"></el-button>
<el-button @click="handleRedoNodes" :disabled="!activeItem.isRetry"
:loading="redoNodesLoading">
{{ redoNodesLoading ? '正在修复中...' : '节点重试' }}</el-button>
</div>
</div>
<div class="time-box">
<span>开始时间{{ activeItem.startTime|toDate('yyyy-MM-dd HH:mm') }}</span>
<span>结束时间{{ activeItem.endTime|toDate('yyyy-MM-dd HH:mm') }}</span>
</div>
<el-radio-group v-model="activeKey" class="mb-10px">
<el-radio-button :label="1">输入</el-radio-button>
<el-radio-button :label="2" v-if="!activeItem.resultType"></el-radio-button>
</el-radio-group>
<el-input v-model="getTextareaValue" type="textarea"
:autosize="{ minRows: 19, maxRows: 19}" readonly />
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { getTaskInfo, nodeRetryTask } from '@/api/onlineDev/integrate'
export default {
name: 'LogDetail',
model: {
prop: 'value',
event: 'input'
},
data() {
return {
list: [],
activeKey: 1,
activeItem: {},
visible: false,
msgInfo: '',
id: '',
listLoading: false,
redoNodesLoading: false,
activeIndex: 0
}
},
computed: {
getTextareaValue() {
return this.activeKey === 1 ? this.msgInfo : this.activeItem.errorMsg
}
},
methods: {
openDialog(id) {
this.visible = true
this.id = id || ''
this.isInit = false
this.activeKey = 1
this.initData(true)
},
handleClick(item, index) {
this.activeItem = item;
this.activeIndex = index;
this.activeKey = 1;
},
handleUpdateNodes() {
this.$emit('updateNodes')
},
handleRedoNodes() {
this.$confirm('确定将本节点进行重试?', this.$t('common.tipTitle'), {
type: 'warning'
}).then(() => {
const query = {
id: this.id,
nodeId: this.activeItem.id,
};
this.redoNodesLoading = true;
nodeRetryTask(query).then(res => {
this.$message({
type: 'success',
message: res.msg,
duration: 1000,
onClose: () => {
this.initData()
this.redoNodesLoading = false;
}
});
})
}).catch(() => {
this.redoNodesLoading = false;
});
},
initData(isInit) {
this.listLoading = true
getTaskInfo(this.id).then(res => {
this.msgInfo = res.data.data
this.list = res.data.list || []
if (this.list.length) this.activeItem = this.list[isInit ? 0 : this.activeIndex]
this.listLoading = false
}).catch()
}
}
}
</script>
<style lang="scss" scoped>
.log-detail-modal {
>>> .el-dialog__body {
padding: 0 !important;
}
.log-detail-board {
display: flex;
height: 550px;
.log-left-board {
width: 270px;
height: 100%;
overflow-y: auto;
border-right: 1px solid #d9d9d9;
.active {
background-color: #bae7ff !important;
}
.item-box {
padding: 8px 20px;
cursor: pointer;
&:hover {
background-color: #f5f5f5;
}
.top {
display: flex;
align-items: center;
.fullName {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 16px;
}
.icon {
width: 28px;
height: 28px;
border-radius: 50%;
padding: 5px;
text-align: center;
color: #fff;
transform: scale(0.65);
}
.icon-ym-fail {
background-color: #ff4d4d;
}
.icon-ym-success {
background-color: #55d187;
}
}
.bottom {
display: flex;
align-items: center;
.icon-ym-btn-refresh {
color: #1890ff;
}
}
.pr-4px {
padding-right: 4px;
}
}
}
.log-center-board {
width: 100%;
padding: 15px 20px;
.top {
display: flex;
align-items: center;
justify-content: space-between;
}
.time-box {
padding: 20px 0;
display: flex;
span {
flex: 1;
}
}
.mb-10px {
margin-bottom: 10px !important;
}
}
}
}
</style>

@ -0,0 +1,235 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack()" :content="title" />
<div class="options">
<el-button @click="goBack()">{{$t('common.cancelButton')}}</el-button>
</div>
</div>
<div class="main">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="执行时间">
<el-date-picker v-model="pickerVal" type="daterange" start-placeholder=""
end-placeholder="结束日期" :picker-options="pickerOptions" value-format="timestamp"
clearable :editable="false" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="执行结果">
<el-select v-model="listQuery.resultType" placeholder="请选择执行结果" clearable>
<el-option label="成功" :value="1" />
<el-option label="失败" :value="0" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">
{{$t('common.search')}}</el-button>
<el-button icon="el-icon-refresh-right" @click="reset()">{{$t('common.reset')}}
</el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<JNPF-table v-loading="listLoading" :data="list">
<el-table-column prop="processId" label="实例ID" min-width="300" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.isRetry">
<span>{{ scope.row.processId }}</span><span>{{'&nbsp;'}}</span><el-tag
type="primary" disable-transitions>
重试</el-tag><span>{{'&nbsp;'}}</span><span>
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content">
原实例ID{{ scope.row.parentId }}<br />原实例执行时间{{ scope.row.parentTime|toDate('yyyy-MM-dd HH:mm')}}
</div>
<i class="icon-ym icon-ym-generator-link cursor-pointer" />
</el-tooltip>
</span>
</template>
<template v-else>{{ scope.row.processId }}</template>
</template>
</el-table-column>
<el-table-column prop="resultType" label="执行结果" width="150">
<template slot-scope="scope">
<el-tag :type="scope.row.resultType == 1 ? 'success':'danger'" disable-transitions>
{{scope.row.resultType==1?'成功':'失败'}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="executionTime" label="执行时间 " :formatter="jnpf.tableDateFormat"
width="200" />
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="Detail(scope.row.id)">
详情</el-button>
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="handleDetail(scope.row.id)">
删除</el-button>
<el-button size="mini" type="text" v-if="scope.row.resultType!=1"
@click="handleRedo(scope.row.id)">
重试</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize" @pagination="initData" />
</div>
<Detail v-if="detailVisible" ref="Detail" @updateNodes='updateNodes'></Detail>
</div>
</transition>
</template>
<script>
import { getTaskList, retryTask, delTask } from '@/api/onlineDev/integrate'
import Detail from './Detail'
export default {
components: { Detail },
data() {
return {
integrateId: '',
title: '',
list: [],
total: 0,
listLoading: false,
listQuery: {
resultType: '',
startTime: '',
endTime: '',
currentPage: 1,
pageSize: 20,
sort: 'desc',
},
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const start = new Date()
const end = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
}
}, {
text: '最近一个月',
onClick(picker) {
const start = new Date()
const end = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
}
}, {
text: '最近三个月',
onClick(picker) {
const start = new Date()
const end = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
}
}]
},
pickerVal: [],
detailVisible: false
}
},
methods: {
goBack() {
this.$emit('close')
},
Detail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.openDialog(id)
})
},
updateNodes() {
this.$emit('updateNodes', this.integrateId);
this.goBack()
},
handleDetail(id) {
this.$confirm('确定将本实例进行删除?', this.$t('common.tipTitle'), {
type: 'warning'
}).then(() => {
delTask(id).then(res => {
this.$message({
type: 'success',
message: res.msg,
duration: 1000,
onClose: () => {
this.initData()
}
});
})
}).catch(() => { });
},
handleRedo(id) {
this.$confirm('确定将本实例进行重试?', this.$t('common.tipTitle'), {
type: 'warning'
}).then(() => {
retryTask(id).then(res => {
this.$message({
type: 'success',
message: res.msg,
duration: 1000,
onClose: () => {
this.initData()
}
});
})
}).catch(() => { });
},
init(data) {
this.integrateId = data.id
this.title = data.fullName
this.initData()
},
initData() {
this.listLoading = true
let query = {
...this.listQuery,
integrateId: this.integrateId
}
getTaskList(query).then(res => {
this.list = res.data.list
this.total = res.data.pagination.total
})
this.listLoading = false
},
search() {
if (this.pickerVal && this.pickerVal.length) {
this.listQuery.startTime = this.pickerVal[0]
this.listQuery.endTime = this.pickerVal[1]
} else {
this.listQuery.startTime = ''
this.listQuery.endTime = ''
}
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = 'desc'
this.initData()
},
reset() {
this.pickerVal = []
this.listQuery.resultType = ''
this.search()
},
}
}
</script>
<style lang="scss" scoped>
.main {
overflow: hidden;
display: flex;
flex-direction: column;
padding: 0 0 10px;
>>> .el-table {
flex: 1;
border-top: none;
}
}
.cursor-pointer {
cursor: pointer;
}
</style>
Loading…
Cancel
Save