Skip to content

Commit

Permalink
[Fix]Fix the run_time calculation to account for missing days. (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
XIAOKUOAIyang authored Aug 19, 2024
1 parent f45dacd commit faf6969
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions seatunnel-ui/src/locales/en_US/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

export default {
success_tips: 'Success',
day: 'd',
hour: 'h',
min: 'm',
second: 's',
Expand Down
1 change: 1 addition & 0 deletions seatunnel-ui/src/locales/zh_CN/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

export default {
success_tips: '操作成功',
day: '天',
hour: '时',
min: '分',
second: '秒',
Expand Down
4 changes: 3 additions & 1 deletion seatunnel-ui/src/utils/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ import i18n from '@/locales'
const { t } = i18n.global
export const getRemainTime = (remain: number): any => {
if(!remain) return
let d = parseInt(remain / 60 / 60 / 24 + '')
let h = parseInt(remain / 60 / 60 % 24 + '')
let m = parseInt(remain / 60 % 60 + '')
let s = parseInt(remain % 60 + '')
const dText = d > 0 ? `${d}${t('common.day')}` : ''
const hText = h > 0 ? `${h}${t('common.hour')}` : ''
const mText = m > 0 ? `${m}${t('common.min')}` : ''
const sText = s > 0 ? `${s}${t('common.second')}` : ''
return hText + mText + sText
return dText + hText + mText + sText

}

4 changes: 2 additions & 2 deletions seatunnel-ui/src/views/virtual-tables/detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ const VirtualTablesDetail = defineComponent({
<NBreadcrumbItem>
{t(
route.params.id
? t('virtualTables.edit_virtual_tables')
? t('virtual_tables.edit_virtual_tables')
: t('virtual_tables.create_virtual_tables')
)}
</NBreadcrumbItem>
</NBreadcrumb>
<NCard
title={t(
route.params.id
? t('virtualTables.edit_virtual_tables')
? t('virtual_tables.edit_virtual_tables')
: t('virtual_tables.create_virtual_tables')
)}
>
Expand Down
4 changes: 2 additions & 2 deletions seatunnel-ui/src/views/virtual-tables/use-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ export const useDetail = (id: string) => {
state.stepTwo.config = values
const flag = state.stepTwo.list.some((item) => item.isEdit)
if (flag) {
window.$message.error(t('virtualTables.save_data_tips'))
window.$message.error(t('virtual_tables.save_data_tips'))
return
}
if (state.stepTwo.list.length === 0) {
window.$message.error(t('virtualTables.table_data_required_tips'))
window.$message.error(t('virtual_tables.table_data_required_tips'))
return
}
} finally {
Expand Down

0 comments on commit faf6969

Please sign in to comment.