14 changed files with 382 additions and 53 deletions
@ -1,4 +1,6 @@ |
|||
export default { |
|||
login: 'Login', |
|||
errorLogList: 'Error Log', |
|||
accountSetting: 'Account Setting', |
|||
accountCenter: 'Account Center' |
|||
}; |
|||
|
|||
@ -1,4 +1,6 @@ |
|||
export default { |
|||
login: '登录', |
|||
errorLogList: '错误日志列表', |
|||
accountSetting: '个人设置', |
|||
accountCenter: '个人中心' |
|||
}; |
|||
|
|||
@ -0,0 +1,120 @@ |
|||
<template> |
|||
<PageWrapper> |
|||
<template #title> |
|||
<ArrowLeftOutlined @click="handleBack" /> |
|||
作业详情 |
|||
</template> |
|||
<Skeleton :loading="jobInfo === undefined"> |
|||
<Card class="mt-4" :title="L('BasicInfo')"> |
|||
<Description @register="registerDescription" :data="jobInfo" /> |
|||
</Card> |
|||
<Card class="mt-4" :title="L('BackgroundJobLogs')"> |
|||
<List |
|||
ref="logListElRef" |
|||
item-layout="vertical" |
|||
size="default" |
|||
bordered |
|||
:loading="fetchingLog" |
|||
:pagination="{ |
|||
pageSize: fetchLogCount, |
|||
total: maxLogCount, |
|||
showSizeChanger: true, |
|||
onChange: fetchJobLogs, |
|||
onShowSizeChange: handleSizeChange, |
|||
}" |
|||
:data-source="jobLogs" |
|||
> |
|||
<template #renderItem="{ item }"> |
|||
<ListItem :key="item.id"> |
|||
<ListItemMeta :description="item.message"> |
|||
<template #avatar> |
|||
<Icon v-if="!item.exception" :size="40" icon="grommet-icons:status-good" color="seagreen" /> |
|||
<Icon v-else :size="40" icon="grommet-icons:status-warning" color="orangered" /> |
|||
</template> |
|||
<template #title> |
|||
<span>{{ item.runTime }}</span> |
|||
</template> |
|||
</ListItemMeta> |
|||
{{ item.exception ?? item.message }} |
|||
</ListItem> |
|||
</template> |
|||
</List> |
|||
</Card> |
|||
</Skeleton> |
|||
</PageWrapper> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { onMounted, ref } from 'vue'; |
|||
import { Card, List, Skeleton } from 'ant-design-vue'; |
|||
import { ArrowLeftOutlined } from '@ant-design/icons-vue'; |
|||
import { Icon } from '/@/components/Icon'; |
|||
import { PageWrapper } from '/@/components/Page'; |
|||
import { Description, useDescription } from '/@/components/Description'; |
|||
import { useRoute, useRouter } from 'vue-router'; |
|||
import { useLocalization } from '/@/hooks/abp/useLocalization'; |
|||
import { formatPagedRequest } from '/@/utils/http/abp/helper'; |
|||
import { getById } from '/@/api/task-management/backgroundJobInfo'; |
|||
import { getList as getJobLogs } from '/@/api/task-management/backgroundJobLog'; |
|||
import { BackgroundJobInfo } from '/@/api/task-management/model/backgroundJobInfoModel'; |
|||
import { BackgroundJobLog } from '/@/api/task-management/model/backgroundJobLogModel'; |
|||
import { getDescriptionSchemas } from '../datas/DescriptionData'; |
|||
|
|||
const ListItem = List.Item; |
|||
const ListItemMeta = List.Item.Meta; |
|||
|
|||
const { L } = useLocalization('TaskManagement'); |
|||
const { back } = useRouter(); |
|||
const route = useRoute(); |
|||
const maxLogCount = ref(0); |
|||
const fetchLogCount = ref(10); |
|||
const fetchingLog = ref(false); |
|||
const logListElRef = ref<any>(); |
|||
const jobInfo = ref<BackgroundJobInfo>(); |
|||
const jobLogs = ref<BackgroundJobLog[]>([]); |
|||
|
|||
const [registerDescription] = useDescription({ |
|||
bordered: true, |
|||
column: 3, |
|||
schema: getDescriptionSchemas(), |
|||
}); |
|||
|
|||
onMounted(fetchJob); |
|||
|
|||
function fetchJob() { |
|||
getById(String(route.params.id)).then((res) => { |
|||
jobInfo.value = res; |
|||
jobLogs.value = []; |
|||
fetchJobLogs(1); |
|||
}); |
|||
} |
|||
|
|||
function fetchJobLogs(page: number) { |
|||
const request = { |
|||
skipCount: page, |
|||
maxResultCount: fetchLogCount.value, |
|||
}; |
|||
formatPagedRequest(request); |
|||
fetchingLog.value = true; |
|||
getJobLogs({ |
|||
jobId: String(route.params.id), |
|||
sorting: '', |
|||
skipCount: request.skipCount, |
|||
maxResultCount: request.maxResultCount, |
|||
}).then((res) => { |
|||
jobLogs.value = res.items; |
|||
maxLogCount.value = res.totalCount; |
|||
}).finally(() => { |
|||
fetchingLog.value = false; |
|||
}); |
|||
} |
|||
|
|||
function handleSizeChange(current: number, size: number) { |
|||
fetchLogCount.value = size; |
|||
fetchJobLogs(current); |
|||
} |
|||
|
|||
function handleBack() { |
|||
back(); |
|||
} |
|||
</script> |
|||
@ -0,0 +1,88 @@ |
|||
import { DescItem } from "/@/components/Description"; |
|||
import { useLocalization } from '/@/hooks/abp/useLocalization'; |
|||
|
|||
const { L } = useLocalization('TaskManagement'); |
|||
|
|||
export function getDescriptionSchemas() : DescItem[] { |
|||
return [ |
|||
{ |
|||
label: L('DisplayName:Group'), |
|||
field: 'group', |
|||
}, |
|||
{ |
|||
label: L('DisplayName:Name'), |
|||
field: 'name', |
|||
}, |
|||
{ |
|||
label: L('DisplayName:Type'), |
|||
field: 'type', |
|||
}, |
|||
{ |
|||
label: L('DisplayName:CreationTime'), |
|||
field: 'creationTime', |
|||
}, |
|||
{ |
|||
label: L('DisplayName:BeginTime'), |
|||
field: 'beginTime', |
|||
}, |
|||
{ |
|||
label: L('DisplayName:EndTime'), |
|||
field: 'endTime', |
|||
}, |
|||
{ |
|||
label: L('DisplayName:LockTimeOut'), |
|||
field: 'lockTimeOut', |
|||
span: 1, |
|||
}, |
|||
{ |
|||
label: L('DisplayName:Description'), |
|||
field: 'description', |
|||
span: 2, |
|||
}, |
|||
{ |
|||
label: L('DisplayName:LastRunTime'), |
|||
field: 'lastRunTime', |
|||
span: 1.5, |
|||
}, |
|||
{ |
|||
label: L('DisplayName:NextRunTime'), |
|||
field: 'nextRunTime', |
|||
span: 1.5, |
|||
}, |
|||
{ |
|||
label: L('DisplayName:Status'), |
|||
field: 'status', |
|||
span: 1, |
|||
}, |
|||
{ |
|||
label: L('DisplayName:JobType'), |
|||
field: 'jobType', |
|||
span: 1, |
|||
}, |
|||
{ |
|||
label: L('DisplayName:Priority'), |
|||
field: 'priority', |
|||
span: 1, |
|||
}, |
|||
{ |
|||
label: L('DisplayName:TriggerCount'), |
|||
field: 'triggerCount', |
|||
span: 0.75, |
|||
}, |
|||
{ |
|||
label: L('DisplayName:MaxCount'), |
|||
field: 'maxCount', |
|||
span: 0.75, |
|||
}, |
|||
{ |
|||
label: L('DisplayName:TryCount'), |
|||
field: 'tryCount', |
|||
span: 0.75, |
|||
}, |
|||
{ |
|||
label: L('DisplayName:MaxTryCount'), |
|||
field: 'maxTryCount', |
|||
span: 0.75, |
|||
}, |
|||
]; |
|||
} |
|||
Loading…
Reference in new issue