|
|
@ -2,30 +2,50 @@ |
|
|
<div class="app-container"> |
|
|
<div class="app-container"> |
|
|
<!--搜索条件--> |
|
|
<!--搜索条件--> |
|
|
<div class="filter-container"> |
|
|
<div class="filter-container"> |
|
|
<el-input v-model="listQuery.jobName" placeholder="任务名称" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" /> |
|
|
<el-input |
|
|
<el-input v-model="listQuery.jobGroupName" placeholder="任务组名称" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" /> |
|
|
v-model="listQuery.jobName" |
|
|
<el-input v-model="listQuery.triggerName" placeholder="触发器名称" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" /> |
|
|
class="filter-item" |
|
|
<el-input v-model="listQuery.triggerGroupName" placeholder="触发器组名" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" /> |
|
|
placeholder="任务名称" |
|
|
<el-date-picker v-model="listQuery.startTime" type="datetime" placeholder="开始时间" @change="changeTime($event, 0)" /> |
|
|
style="width: 200px;" |
|
|
<el-date-picker v-model="listQuery.endTime" type="datetime" placeholder="结束时间" @change="changeTime($event, 1)" /> |
|
|
@keyup.enter.native="handleFilter" |
|
|
<el-select v-model="listQuery.misfirePolicy" placeholder="失火策略" clearable style="width: 130px" class="filter-item"> |
|
|
/> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="listQuery.jobGroupName" |
|
|
|
|
|
class="filter-item" |
|
|
|
|
|
placeholder="任务组名称" |
|
|
|
|
|
style="width: 200px;" |
|
|
|
|
|
@keyup.enter.native="handleFilter" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="listQuery.triggerName" |
|
|
|
|
|
class="filter-item" |
|
|
|
|
|
placeholder="触发器名称" |
|
|
|
|
|
style="width: 200px;" |
|
|
|
|
|
@keyup.enter.native="handleFilter" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="listQuery.triggerGroupName" |
|
|
|
|
|
class="filter-item" |
|
|
|
|
|
placeholder="触发器组名" |
|
|
|
|
|
style="width: 200px;" |
|
|
|
|
|
@keyup.enter.native="handleFilter" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-date-picker v-model="listQuery.startTime" placeholder="开始时间" type="datetime" @change="changeTime($event, 0)" /> |
|
|
|
|
|
<el-date-picker v-model="listQuery.endTime" placeholder="结束时间" type="datetime" @change="changeTime($event, 1)" /> |
|
|
|
|
|
<el-select v-model="listQuery.misfirePolicy" class="filter-item" clearable placeholder="失火策略" style="width: 130px"> |
|
|
<el-option v-for="item in misfirePolicyArr" :key="item" :label="item.value" :value="item.key" /> |
|
|
<el-option v-for="item in misfirePolicyArr" :key="item" :label="item.value" :value="item.key" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
<el-select v-model="listQuery.job" placeholder="执行任务" clearable class="filter-item" style="width: 130px"> |
|
|
<el-select v-model="listQuery.job" class="filter-item" clearable placeholder="执行任务" style="width: 130px"> |
|
|
<el-option v-for="item in jobArr" :key="item.key" :label="item.value" :value="item.key" /> |
|
|
<el-option v-for="item in jobArr" :key="item.key" :label="item.value" :value="item.key" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
<el-select v-model="listQuery.notifyWay" placeholder="通知方式" clearable style="width: 140px" class="filter-item" @change="handleFilter"> |
|
|
<el-select v-model="listQuery.notifyWay" class="filter-item" clearable placeholder="通知方式" style="width: 140px" @change="handleFilter"> |
|
|
<el-option v-for="item in notifyWayArr" :key="item.key" :label="item.value" :value="item.key" /> |
|
|
<el-option v-for="item in notifyWayArr" :key="item.key" :label="item.value" :value="item.key" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
<el-select v-model="listQuery.appId" placeholder="appId" style="width: 140px" class="filter-item" @change="handleFilter"> |
|
|
<el-select v-model="listQuery.appId" class="filter-item" placeholder="appId" style="width: 140px" @change="handleFilter"> |
|
|
<el-option v-for="item in appIdArr" :key="item.key" :label="item.value" :value="item.key" /> |
|
|
<el-option v-for="item in appIdArr" :key="item.key" :label="item.value" :value="item.key" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter"> |
|
|
<el-button v-waves class="filter-item" icon="el-icon-search" type="primary" @click="handleFilter">Search</el-button> |
|
|
Search |
|
|
<el-button class="filter-item" icon="el-icon-edit" style="margin-left: 10px;" type="primary" @click="handleCreate">Add</el-button> |
|
|
</el-button> |
|
|
|
|
|
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleCreate"> |
|
|
|
|
|
Add |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!--表格--> |
|
|
<!--表格--> |
|
|
@ -39,53 +59,53 @@ |
|
|
style="width: 100%;" |
|
|
style="width: 100%;" |
|
|
@sort-change="sortChange" |
|
|
@sort-change="sortChange" |
|
|
> |
|
|
> |
|
|
<el-table-column fixed label="任务名" align="center" width="150px"> |
|
|
<el-table-column align="center" fixed label="任务名" width="150px"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.jobName }}</span> |
|
|
<span>{{ row.jobName }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column fixed label="状态" width="100px" align="center"> |
|
|
<el-table-column align="center" fixed label="状态" width="100px"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.triggerState }}</span> |
|
|
<span>{{ row.triggerState }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column fixed label="上一次执行时间" width="150px" align="center"> |
|
|
<!-- <el-table-column align="center" fixed label="上一次执行时间" width="150px"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.prevFireTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> |
|
|
<span>{{ row.prevFireTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column fixed label="下一次执行时间" width="150px" align="center"> |
|
|
<el-table-column align="center" fixed label="下一次执行时间" width="150px"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.nextFireTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> |
|
|
<span>{{ row.nextFireTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column>--> |
|
|
<el-table-column label="任务组" width="150px" align="center"> |
|
|
<el-table-column align="center" label="任务组" width="150px"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.jobGroupName }}</span> |
|
|
<span>{{ row.jobGroupName }}</span> |
|
|
<span>{{ row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> |
|
|
<span>{{ row.timestamp | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="触发器名称" align="center" width="150px"> |
|
|
<el-table-column align="center" label="触发器名称" width="150px"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.triggerName }}</span> |
|
|
<span>{{ row.triggerName }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="触发器组名" width="150px" align="center"> |
|
|
<el-table-column align="center" label="触发器组名" width="150px"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.triggerGroupName }}</span> |
|
|
<span>{{ row.triggerGroupName }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="cron" width="150px" align="center"> |
|
|
<el-table-column align="center" label="cron" width="150px"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.cron }}</span> |
|
|
<span>{{ row.cron }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="开始时间" width="150px" align="center"> |
|
|
<el-table-column align="center" label="开始时间" width="150px"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.startTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> |
|
|
<span>{{ row.startTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="结束时间" width="150px" align="center"> |
|
|
<el-table-column align="center" label="结束时间" width="150px"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.endTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> |
|
|
<span>{{ row.endTime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span> |
|
|
</template> |
|
|
</template> |
|
|
@ -100,30 +120,28 @@ |
|
|
<span>{{ row.misfirePolicy }}</span> |
|
|
<span>{{ row.misfirePolicy }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="通知方式" align="center"> |
|
|
<el-table-column align="center" label="通知方式"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ getNotifyWay(row.notifyWay) }}</span> |
|
|
<span>{{ getNotifyWay(row.notifyWay) }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="通知路径" align="center"> |
|
|
<el-table-column align="center" label="通知路径"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.notifyUrl }}</span> |
|
|
<span>{{ row.notifyUrl }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="通知内容" align="center"> |
|
|
<el-table-column align="center" label="通知内容"> |
|
|
<template slot-scope="{row}"> |
|
|
<template slot-scope="{row}"> |
|
|
<span>{{ row.notifyParam }}</span> |
|
|
<span>{{ row.notifyParam }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column fixed="right" label="Actions" align="center" width="230" class-name="small-padding fixed-width"> |
|
|
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="Actions" width="230"> |
|
|
<template slot-scope="{row,$index}"> |
|
|
<template slot-scope="{row,$index}"> |
|
|
<el-button type="primary" size="mini" @click="handleUpdate(row)"> |
|
|
<el-button v-if="row.triggerState !== 'CLOSED'" size="mini" type="primary" @click="handleUpdate(row)">Edit</el-button> |
|
|
Edit |
|
|
<el-popconfirm v-if="row.recStatus === 1 && row.triggerState !== 'CLOSED'" title="确定重启任务吗?" @onConfirm="handleResume(row,$index)"> |
|
|
</el-button> |
|
|
|
|
|
<el-popconfirm v-if="row.recStatus === 1" title="确定重启任务吗?" @onConfirm="handleResume(row,$index)"> |
|
|
|
|
|
<el-button slot="reference" size="mini" type="success">resume</el-button> |
|
|
<el-button slot="reference" size="mini" type="success">resume</el-button> |
|
|
</el-popconfirm> |
|
|
</el-popconfirm> |
|
|
<el-popconfirm v-else title="确定停止任务吗?" @onConfirm="handlePause(row,$index)"> |
|
|
<el-popconfirm v-if="row.recStatus === 0 && row.triggerState !== 'CLOSED'" title="确定停止任务吗?" @onConfirm="handlePause(row,$index)"> |
|
|
<el-button slot="reference" size="mini" type="warning">pause</el-button> |
|
|
<el-button slot="reference" size="mini" type="warning">pause</el-button> |
|
|
</el-popconfirm> |
|
|
</el-popconfirm> |
|
|
<el-popconfirm title="删除后任务不可恢复,确定删除吗?" @onConfirm="handleDelete(row,$index)"> |
|
|
<el-popconfirm title="删除后任务不可恢复,确定删除吗?" @onConfirm="handleDelete(row,$index)"> |
|
|
@ -133,19 +151,19 @@ |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
|
|
|
|
|
|
<pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" /> |
|
|
<pagination v-show="total>0" :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNum" :total="total" @pagination="getList" /> |
|
|
|
|
|
|
|
|
<!--添加/编辑界面--> |
|
|
<!--添加/编辑界面--> |
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible"> |
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible"> |
|
|
<el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="90px" style="width: 90%; margin-left:30px;"> |
|
|
<el-form ref="dataForm" :model="temp" :rules="rules" label-position="left" label-width="90px" style="width: 90%; margin-left:30px;"> |
|
|
<el-form-item label="cron" prop="cron"> |
|
|
<el-form-item label="cron" prop="cron"> |
|
|
<el-input v-model="temp.cron" /> |
|
|
<el-input v-model="temp.cron" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="开始时间" prop="startTime"> |
|
|
<el-form-item label="开始时间" prop="startTime"> |
|
|
<el-date-picker v-model="date.start" type="datetime" placeholder="开始时间" style="width: 100%;" @change="changeTime($event, 2)" /> |
|
|
<el-date-picker v-model="date.start" placeholder="开始时间" style="width: 100%;" type="datetime" @change="changeTime($event, 2)" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="结束时间" prop="endTime"> |
|
|
<el-form-item label="结束时间" prop="endTime"> |
|
|
<el-date-picker v-model="date.end" type="datetime" placeholder="结束时间" style="width: 100%;" @change="changeTime($event, 3)" /> |
|
|
<el-date-picker v-model="date.end" placeholder="结束时间" style="width: 100%;" type="datetime" @change="changeTime($event, 3)" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="通知方式" prop="notifyWay"> |
|
|
<el-form-item label="通知方式" prop="notifyWay"> |
|
|
<el-select v-model="temp.notifyWay" placeholder="通知方式" style="width: 100%;"> |
|
|
<el-select v-model="temp.notifyWay" placeholder="通知方式" style="width: 100%;"> |
|
|
@ -169,7 +187,7 @@ |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="appId" prop="appId"> |
|
|
<el-form-item label="appId" prop="appId"> |
|
|
<el-select v-model="temp.appId" placeholder="appId" style="width: 100%;" :disabled="dialogStatus !== 'create'"> |
|
|
<el-select v-model="temp.appId" :disabled="dialogStatus !== 'create'" placeholder="appId" style="width: 100%;"> |
|
|
<el-option v-for="item in appIdArr" :key="item.key" :label="item.value" :value="item.key" /> |
|
|
<el-option v-for="item in appIdArr" :key="item.key" :label="item.value" :value="item.key" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
@ -187,18 +205,14 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button @click="dialogFormVisible = false"> |
|
|
<el-button @click="dialogFormVisible = false">Cancel</el-button> |
|
|
Cancel |
|
|
<el-button type="primary" @click="dialogStatus==='create'?createData():updateData()">Confirm</el-button> |
|
|
</el-button> |
|
|
|
|
|
<el-button type="primary" @click="dialogStatus==='create'?createData():updateData()"> |
|
|
|
|
|
Confirm |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
<el-dialog :visible.sync="dialogPvVisible" title="Reading statistics"> |
|
|
<el-dialog :visible.sync="dialogPvVisible" title="Reading statistics"> |
|
|
<el-table :data="pvData" border fit highlight-current-row style="width: 100%"> |
|
|
<el-table :data="pvData" border fit highlight-current-row style="width: 100%"> |
|
|
<el-table-column prop="key" label="Channel" /> |
|
|
<el-table-column label="Channel" prop="key" /> |
|
|
<el-table-column prop="pv" label="Pv" /> |
|
|
<el-table-column label="Pv" prop="pv" /> |
|
|
</el-table> |
|
|
</el-table> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" @click="dialogPvVisible = false">Confirm</el-button> |
|
|
<el-button type="primary" @click="dialogPvVisible = false">Confirm</el-button> |
|
|
@ -208,7 +222,15 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { fetchList, fetchPv, createJob, updateJob, pauseJob, resumeJob, removeJob } from '@/api/task' |
|
|
import { |
|
|
|
|
|
fetchList, |
|
|
|
|
|
fetchPv, |
|
|
|
|
|
createJob, |
|
|
|
|
|
updateJob, |
|
|
|
|
|
pauseJob, |
|
|
|
|
|
resumeJob, |
|
|
|
|
|
removeJob |
|
|
|
|
|
} from '@/api/task' |
|
|
import waves from '@/directive/waves' // waves directive |
|
|
import waves from '@/directive/waves' // waves directive |
|
|
import { parseTime } from '@/utils' |
|
|
import { parseTime } from '@/utils' |
|
|
import Pagination from '@/components/Pagination' // secondary package based on el-pagination |
|
|
import Pagination from '@/components/Pagination' // secondary package based on el-pagination |
|
|
@ -275,18 +297,14 @@ export default { |
|
|
value: 'withMisfireHandlingInstructionDoNothing' |
|
|
value: 'withMisfireHandlingInstructionDoNothing' |
|
|
} |
|
|
} |
|
|
], |
|
|
], |
|
|
jobArr: [ |
|
|
jobArr: [{ key: 0, value: '任务通知' }], |
|
|
{ key: 0, value: '任务通知' } |
|
|
|
|
|
], |
|
|
|
|
|
notifyWayArr: [ |
|
|
notifyWayArr: [ |
|
|
{ key: 0, value: 'http' }, |
|
|
{ key: 0, value: 'http' }, |
|
|
{ key: 1, value: 'mq' }, |
|
|
{ key: 1, value: 'mq' }, |
|
|
{ key: 2, value: '邮件' }, |
|
|
{ key: 2, value: '邮件' }, |
|
|
{ key: 3, value: '短信' } |
|
|
{ key: 3, value: '短信' } |
|
|
], |
|
|
], |
|
|
appIdArr: [ |
|
|
appIdArr: [{ key: '0', value: '0' }], |
|
|
{ key: '0', value: '0' } |
|
|
|
|
|
], |
|
|
|
|
|
statusOptions: ['published', 'draft', 'deleted'], |
|
|
statusOptions: ['published', 'draft', 'deleted'], |
|
|
showReviewer: false, |
|
|
showReviewer: false, |
|
|
temp: { |
|
|
temp: { |
|
|
@ -319,7 +337,9 @@ export default { |
|
|
rules: { |
|
|
rules: { |
|
|
cron: [{ required: true, message: 'cron是必填的', trigger: 'blur' }], |
|
|
cron: [{ required: true, message: 'cron是必填的', trigger: 'blur' }], |
|
|
// timestamp: [{ type: 'date', required: true, message: 'timestamp is required', trigger: 'change' }], |
|
|
// timestamp: [{ type: 'date', required: true, message: 'timestamp is required', trigger: 'change' }], |
|
|
notifyUrl: [{ required: true, message: '通知路径是必填的', trigger: 'blur' }] |
|
|
notifyUrl: [ |
|
|
|
|
|
{ required: true, message: '通知路径是必填的', trigger: 'blur' } |
|
|
|
|
|
] |
|
|
}, |
|
|
}, |
|
|
downloadLoading: false |
|
|
downloadLoading: false |
|
|
} |
|
|
} |
|
|
@ -428,7 +448,7 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
createData() { |
|
|
createData() { |
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
this.$refs['dataForm'].validate(valid => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
createJob(this.temp).then(() => { |
|
|
createJob(this.temp).then(() => { |
|
|
// this.list.unshift(this.temp) |
|
|
// this.list.unshift(this.temp) |
|
|
@ -466,7 +486,7 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
updateData() { |
|
|
updateData() { |
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
this.$refs['dataForm'].validate(valid => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
const tempData = Object.assign({}, this.temp) |
|
|
const tempData = Object.assign({}, this.temp) |
|
|
tempData.timestamp = +new Date(tempData.timestamp) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464 |
|
|
tempData.timestamp = +new Date(tempData.timestamp) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464 |
|
|
@ -486,68 +506,74 @@ export default { |
|
|
handleDelete(row, index) { |
|
|
handleDelete(row, index) { |
|
|
const { jobName, jobGroupName, triggerName, triggerGroupName } = row |
|
|
const { jobName, jobGroupName, triggerName, triggerGroupName } = row |
|
|
this.listLoading = true |
|
|
this.listLoading = true |
|
|
removeJob({ jobName, jobGroupName, triggerName, triggerGroupName }).then(response => { |
|
|
removeJob({ jobName, jobGroupName, triggerName, triggerGroupName }) |
|
|
this.listLoading = false |
|
|
.then(response => { |
|
|
this.handleFilter() |
|
|
this.listLoading = false |
|
|
this.$notify({ |
|
|
this.handleFilter() |
|
|
title: 'Success', |
|
|
this.$notify({ |
|
|
message: 'Delete Successfully', |
|
|
title: 'Success', |
|
|
type: 'success', |
|
|
message: 'Delete Successfully', |
|
|
duration: 2000 |
|
|
type: 'success', |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}).catch(e => { |
|
|
.catch(e => { |
|
|
this.listLoading = false |
|
|
this.listLoading = false |
|
|
this.$notify({ |
|
|
this.$notify({ |
|
|
title: 'Fail', |
|
|
title: 'Fail', |
|
|
message: 'Delete FAIL', |
|
|
message: 'Delete FAIL', |
|
|
type: 'error', |
|
|
type: 'error', |
|
|
duration: 2000 |
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
handleResume(row, index) { |
|
|
handleResume(row, index) { |
|
|
const { jobName, jobGroupName } = row |
|
|
const { jobName, jobGroupName } = row |
|
|
this.listLoading = true |
|
|
this.listLoading = true |
|
|
resumeJob({ jobName, jobGroupName }).then(response => { |
|
|
resumeJob({ jobName, jobGroupName }) |
|
|
this.listLoading = false |
|
|
.then(response => { |
|
|
this.handleFilter() |
|
|
this.listLoading = false |
|
|
this.$notify({ |
|
|
this.handleFilter() |
|
|
title: 'Success', |
|
|
this.$notify({ |
|
|
message: 'Resume Successfully', |
|
|
title: 'Success', |
|
|
type: 'success', |
|
|
message: 'Resume Successfully', |
|
|
duration: 2000 |
|
|
type: 'success', |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}).catch(e => { |
|
|
.catch(e => { |
|
|
this.listLoading = false |
|
|
this.listLoading = false |
|
|
this.$notify({ |
|
|
this.$notify({ |
|
|
title: 'Fail', |
|
|
title: 'Fail', |
|
|
message: 'Resume FAIL', |
|
|
message: 'Resume FAIL', |
|
|
type: 'error', |
|
|
type: 'error', |
|
|
duration: 2000 |
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
handlePause(row, index) { |
|
|
handlePause(row, index) { |
|
|
const { jobName, jobGroupName } = row |
|
|
const { jobName, jobGroupName } = row |
|
|
this.listLoading = true |
|
|
this.listLoading = true |
|
|
pauseJob({ jobName, jobGroupName }).then(response => { |
|
|
pauseJob({ jobName, jobGroupName }) |
|
|
this.listLoading = false |
|
|
.then(response => { |
|
|
this.handleFilter() |
|
|
this.listLoading = false |
|
|
this.$notify({ |
|
|
this.handleFilter() |
|
|
title: 'Success', |
|
|
this.$notify({ |
|
|
message: 'Pause Successfully', |
|
|
title: 'Success', |
|
|
type: 'success', |
|
|
message: 'Pause Successfully', |
|
|
duration: 2000 |
|
|
type: 'success', |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}).catch(e => { |
|
|
.catch(e => { |
|
|
this.listLoading = false |
|
|
this.listLoading = false |
|
|
this.$notify({ |
|
|
this.$notify({ |
|
|
title: 'Fail', |
|
|
title: 'Fail', |
|
|
message: 'Pause FAIL', |
|
|
message: 'Pause FAIL', |
|
|
type: 'error', |
|
|
type: 'error', |
|
|
duration: 2000 |
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
handleDownload() { |
|
|
handleDownload() { |
|
|
this.downloadLoading = true |
|
|
this.downloadLoading = true |
|
|
@ -564,13 +590,15 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
formatJson(filterVal) { |
|
|
formatJson(filterVal) { |
|
|
return this.list.map(v => filterVal.map(j => { |
|
|
return this.list.map(v => |
|
|
if (j === 'timestamp') { |
|
|
filterVal.map(j => { |
|
|
return parseTime(v[j]) |
|
|
if (j === 'timestamp') { |
|
|
} else { |
|
|
return parseTime(v[j]) |
|
|
return v[j] |
|
|
} else { |
|
|
} |
|
|
return v[j] |
|
|
})) |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
) |
|
|
}, |
|
|
}, |
|
|
getSortClass: function(key) { |
|
|
getSortClass: function(key) { |
|
|
const sort = this.listQuery.sort |
|
|
const sort = this.listQuery.sort |
|
|
|