feat(xo-web/tasks): remove empty message and let SortedTable handle it (#3305)
This commit is contained in:
parent
ececbaf201
commit
11bd75d2fe
@ -5,6 +5,7 @@
|
|||||||
### Enhancements
|
### Enhancements
|
||||||
|
|
||||||
- [Tables] Filter input now always shows up even if the table is empty [#3295](https://github.com/vatesfr/xen-orchestra/issues/3295) (PR [#3296](https://github.com/vatesfr/xen-orchestra/pull/3296))
|
- [Tables] Filter input now always shows up even if the table is empty [#3295](https://github.com/vatesfr/xen-orchestra/issues/3295) (PR [#3296](https://github.com/vatesfr/xen-orchestra/pull/3296))
|
||||||
|
- [Tasks] The table is now still shown when there are no tasks (PR [#3305](https://github.com/vatesfr/xen-orchestra/pull/3305))
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
|
@ -1271,8 +1271,6 @@ const messages = {
|
|||||||
vmImportConfigAlert: 'Please check and/or modify the VM configuration.',
|
vmImportConfigAlert: 'Please check and/or modify the VM configuration.',
|
||||||
|
|
||||||
// ---- Tasks ---
|
// ---- Tasks ---
|
||||||
noTasks: 'No pending tasks',
|
|
||||||
xsTasks: 'Currently, there are not any pending XenServer tasks',
|
|
||||||
cancelTask: 'Cancel',
|
cancelTask: 'Cancel',
|
||||||
destroyTask: 'Destroy',
|
destroyTask: 'Destroy',
|
||||||
cancelTasks: 'Cancel selected tasks',
|
cancelTasks: 'Cancel selected tasks',
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import _, { messages } from 'intl'
|
import _, { messages } from 'intl'
|
||||||
import CenterPanel from 'center-panel'
|
|
||||||
import Component from 'base-component'
|
import Component from 'base-component'
|
||||||
import Icon from 'icon'
|
import Icon from 'icon'
|
||||||
import Link from 'link'
|
import Link from 'link'
|
||||||
@ -8,7 +7,6 @@ import SortedTable from 'sorted-table'
|
|||||||
import { injectIntl } from 'react-intl'
|
import { injectIntl } from 'react-intl'
|
||||||
import { SelectPool } from 'select-objects'
|
import { SelectPool } from 'select-objects'
|
||||||
import { connectStore, resolveIds } from 'utils'
|
import { connectStore, resolveIds } from 'utils'
|
||||||
import { Card, CardBlock, CardHeader } from 'card'
|
|
||||||
import { Col, Container, Row } from 'grid'
|
import { Col, Container, Row } from 'grid'
|
||||||
import { flatMap, flatten, isEmpty, keys, some, toArray } from 'lodash'
|
import { flatMap, flatten, isEmpty, keys, some, toArray } from 'lodash'
|
||||||
import {
|
import {
|
||||||
@ -45,14 +43,15 @@ export class TaskItem extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{task.name_label} ({task.name_description &&
|
{task.name_label} (
|
||||||
`${task.name_description} `}on{' '}
|
{task.name_description && `${task.name_description} `}
|
||||||
|
on{' '}
|
||||||
{host ? (
|
{host ? (
|
||||||
<Link to={`/hosts/${host.id}`}>{host.name_label}</Link>
|
<Link to={`/hosts/${host.id}`}>{host.name_label}</Link>
|
||||||
) : (
|
) : (
|
||||||
`unknown host − ${task.$host}`
|
`unknown host − ${task.$host}`
|
||||||
)})
|
)}
|
||||||
{' ' + Math.round(task.progress * 100)}%
|
){' ' + Math.round(task.progress * 100)}%
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -163,27 +162,7 @@ export default class Tasks extends Component {
|
|||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { props } = this
|
const { props } = this
|
||||||
const { intl, nTasks, pendingTasksByPool, pools } = props
|
const { intl, nTasks, pools } = props
|
||||||
|
|
||||||
if (isEmpty(pendingTasksByPool)) {
|
|
||||||
return (
|
|
||||||
<Page header={HEADER} title='taskPage' formatTitle>
|
|
||||||
<CenterPanel>
|
|
||||||
<Card>
|
|
||||||
<CardHeader>{_('noTasks')}</CardHeader>
|
|
||||||
<CardBlock>
|
|
||||||
<Row>
|
|
||||||
<Col>
|
|
||||||
<p className='text-muted'>{_('xsTasks')}</p>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
</CardBlock>
|
|
||||||
</Card>
|
|
||||||
</CenterPanel>
|
|
||||||
</Page>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const { formatMessage } = intl
|
const { formatMessage } = intl
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user