Skip to content

Commit

Permalink
Merge pull request #161 from Kabimon/dev-1.0.0
Browse files Browse the repository at this point in the history
LGTM
  • Loading branch information
FinalTarget authored Feb 14, 2022
2 parents 635509d + e6a0430 commit 1afe8cb
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 24 deletions.
7 changes: 5 additions & 2 deletions web/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ export const request = {
if (error.message && error.message.indexOf('timeout of') > -1) {
return message.warning('请求超时')
}
console.log(error, '系统异常')
message.error(error?.response?.data?.message || "系统异常");
if (error?.response?.data?.data?.errorMsg) {
return message.error(error.response.data.data.errorMsg.desc);
}
console.log(error, error?.response)
message.error(error?.response?.data?.message || error?.data?.message || "系统异常");
},
},
};
Expand Down
18 changes: 16 additions & 2 deletions web/src/pages/dataSourceManage/components/datasourceForm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ export default {
required: true,
message: `${this.$t('message.linkis.datasource.pleaseInput')}${this.$t('message.linkis.datasource.sourceName')}`,
trigger: 'blur'
},{
pattern: /^(.){1,250}$/,
message: '最多250字',
trigger: 'change'
}],
},
{
Expand All @@ -128,7 +132,12 @@ export default {
value: "",
props: {
"placeholder": this.$t('message.linkis.datasource.sourceDec'),
}
},
validate: [{
pattern: /^(.){1,250}$/,
message: '最多250字',
trigger: 'change'
}]
},
{
type: "input",
Expand All @@ -137,7 +146,12 @@ export default {
value: "",
props: {
"placeholder": this.$t('message.linkis.datasource.label'),
}
},
validate: [{
pattern: /^(.){1,250}$/,
message: '最多250字',
trigger: 'change'
}]
}
],
Expand Down
11 changes: 11 additions & 0 deletions web/src/pages/dataSourceManage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
:data-source="dataSourceList"
:loading="loading"
rowKey="id"
class="data-source-manage-table"
>
<template #tags="{ text: tags }">
<span>
<a-tag
v-if="tags"
v-for="tag in tags.split(',')"
:title="tag.toUpperCase()"
:key="tag"
:color="
tag === 'loser'
Expand Down Expand Up @@ -349,4 +351,13 @@ export default {
:deep(.ant-table-pagination.ant-pagination) {
float: left;
}
.data-source-manage-table {
:deep(.ant-tag) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 150px;
}
}
</style>
14 changes: 12 additions & 2 deletions web/src/pages/jobManagement/components/bottomLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ import {
import {
getJobTasks,
getProgress,
getMetrics
getMetrics,
getJobStatus
} from "@/common/service";
import { message, notification } from "ant-design-vue";
import executionLog from './executionLog'
Expand Down Expand Up @@ -151,6 +152,7 @@ export default {
},
// 获取tasklist
getTasks() {
clearInterval(this.progressTimer)
getJobTasks(this.jobExecutionId)
.then(res => {
this.tasklist = res.tasks || res.result
Expand All @@ -166,6 +168,15 @@ export default {
}, 1000*5)
},
getJobProgress() {
getJobStatus(this.jobExecutionId)
.then(res => {
if (res.allTaskStatus) {
clearInterval(this.progressTimer)
}
})
.catch(err => {
message.error("查询job状态失败");
})
getProgress(this.jobExecutionId)
.then(res => {
if (res.job && res.job.tasks) {
Expand All @@ -188,7 +199,6 @@ export default {
this.openMetricsId = progress.taskId
getMetrics(progress.taskId, this.jobExecutionId)
.then(res => {
res.task.taskId = 5
this.metricsInfo[res.task.taskId] = res.task?.metrics
})
.catch(err => {
Expand Down
8 changes: 4 additions & 4 deletions web/src/pages/jobManagement/components/dyncRender.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
<template v-if="type === 'MAP'">
<div style="margin-bottom: 5px" v-for="item in partitionArr">
<a-input
style="width: 100px"
style="width: 30%"
disabled
v-model:value = item.label
/>
<a-input
v-if="item.type === 'INPUT'"
v-model:value="item.value"
@change="handleChange"
style="margin-left: 10px;width: 220px"
style="margin-left: 5px;width: 60%"
/>
<a-select
v-if="item.type === 'OPTION'"
Expand All @@ -29,7 +29,7 @@
:maxTagCount="1"
@change="handleChange(item.value, item)"
:options="item.options"
style="margin-left: 10px;width: 220px"
style="margin-left: 5px;width: 60%"
/>
</div>
</template>
Expand Down Expand Up @@ -92,7 +92,7 @@ export default defineComponent({
partitionArr.value.push({
type: 'INPUT',
label: i,
value: value && value[i] ? value[i] : ''//res.render[i]
value: value && value[i] ? value[i] : res.render[i]
})
} else {
let checkOptions = []
Expand Down
24 changes: 11 additions & 13 deletions web/src/pages/jobManagement/components/jobDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,16 @@
<a-spin size="large" :spinning="loading">
<div class="jd_left">
<div class="sub-title">
<!--<DatabaseFilled class="database-icon" />-->
<span>子任务列表</span>
<!--<a-popconfirm
title="是否新增子任务?"
ok-text="确定"
cancel-text="取消"
@confirm="addNewTask"
@cancel="cancel"
>
<PlusSquareOutlined class="ps-icon" />
</a-popconfirm>-->
</div>
<div v-for="(item, idx) in list" :key="idx" :class="getClass(idx)">
<div class="task-title">
<div
class="subjobName"
@click="changeCurTask(idx)"
v-if="
activeIndex !== idx || (activeIndex === idx && !nameEditable)
"
@click="changeCurTask(idx)"
:title="item.subJobName"
>
{{ item.subJobName }}
Expand Down Expand Up @@ -85,6 +75,7 @@
>
<div
class="sub-table"
@click="changeCurTask(idx)"
:title="
item.dataSourceIds.source.db +
'.' +
Expand All @@ -97,9 +88,10 @@
item.dataSourceIds.source.table
}}
</div>
<div class="arrow-down-icon"><ArrowDownOutlined /></div>
<div class="arrow-down-icon" @click="changeCurTask(idx)"><ArrowDownOutlined /></div>
<div
class="sub-table"
@click="changeCurTask(idx)"
:title="
item.dataSourceIds.sink.db + '.' + item.dataSourceIds.sink.table
"
Expand Down Expand Up @@ -505,6 +497,7 @@ export default {
executeId: '',
jobExecutionId: '',
jobStatus: '',
allTaskStatus: '',
jobStatusTimer: null,
tasklist: [],
progressTimer: null,
Expand Down Expand Up @@ -935,11 +928,14 @@ export default {
getJobStatus(jobExecutionId)
.then(res => {
this.jobStatus = res.status
this.allTaskStatus = res.allTaskStatus
if (!this.tasklist.length) {
this.getTasks(jobExecutionId, true)
}
if (unfinishedStatusList.indexOf(this.jobStatus) === -1) {
this.spinning = false
}
if (this.allTaskStatus) {
clearInterval(this.jobStatusTimer)
setTimeout(() => {
clearInterval(this.progressTimer)
Expand Down Expand Up @@ -986,7 +982,7 @@ export default {
this.getTasks(jobExecutionId)
}
res.job.successPercent = res.job.successTasks * 100 / res.job.totalTasks
res.job.percent = (res.job.successTasks + res.job.runningTasks) * 100 / res.job.totalTasks
res.job.percent = res.job.progress * 100 //(res.job.successTasks + res.job.runningTasks) * 100 / res.job.totalTasks
res.job.title = res.job.failedTasks ? `${res.job.failedTasks}失败,${res.job.successTasks}成功,${res.job.runningTasks}正在运行,${res.job.scheduledTasks}正在准备` : `${res.job.successTasks}成功,${res.job.runningTasks}正在运行,${res.job.scheduledTasks}正在准备`
}
this.jobProgress = res.job
Expand Down Expand Up @@ -1187,12 +1183,14 @@ export default {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
cursor: pointer;
}
.arrow-down-icon {
text-align: center;
font-weight: bolder;
font-size: 16px;
color: #677c99;
cursor: pointer;
}
.mask {
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/synchronizationHistory/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export default {
tableData.value = [];
}
pagination.value.total = res["total"];
tableData.value = tableData.value.concat(jobList);
tableData.value = jobList
}
})
.catch((err) => {
Expand Down

0 comments on commit 1afe8cb

Please sign in to comment.