Skip to content

Commit

Permalink
move front from PR #6228
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeauchamp committed May 17, 2022
1 parent ca5914d commit 026c983
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/xo-web/src/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@
@extend .fa-folder;
}

&-health {
@extend .fa;
@extend .fa-heartbeat;
}

// Jobs
&-jobs {
@extend .fa;
Expand Down
38 changes: 36 additions & 2 deletions packages/xo-web/src/xo-app/logs/backup-ng/log-alert-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,24 @@ const SnapshotTask = ({ className, task }) => (
<TaskError task={task} />
</li>
)
const HealthCheckTask = ({ children, className, task }) => (
<li className={className}>
<Icon icon='health' /> Health check <TaskStateInfos status={task.status} /> <Warnings warnings={task.warnings} />
{children}
<TaskStart task={task} />
<TaskEnd task={task} />
<TaskError task={task} />
</li>
)
const HealthCheckVmStartTask = ({ children, className, task }) => (
<li className={className}>
<Icon icon='run' /> VM start <TaskStateInfos status={task.status} />
<Warnings warnings={task.warnings} />
<TaskStart task={task} />
<TaskEnd task={task} />
<TaskError task={task} />
</li>
)

const RemoteTask = ({ children, className, task }) => (
<li className={className}>
Expand Down Expand Up @@ -234,7 +252,15 @@ const TransferMergeTask = ({ className, task }) => {

return (
<li className={className}>
<Icon icon='task' /> {task.message} <TaskStateInfos status={task.status} />
{task.data?.direction === 'download' ? (
<Icon icon='download' />
) : task.message === 'transfer' ? (
<Icon icon='upload' />
) : (
<Icon icon='task' />
)}{' '}
{task.message}
<TaskStateInfos status={task.status} />
<Warnings warnings={task.warnings} />
<TaskStart task={task} />
<TaskEnd task={task} />
Expand Down Expand Up @@ -263,6 +289,8 @@ const COMPONENT_BY_MESSAGE = {
snapshot: SnapshotTask,
merge: TransferMergeTask,
transfer: TransferMergeTask,
healthcheck: HealthCheckTask,
vmstart: HealthCheckVmStartTask,
}

const TaskLi = ({ task, ...props }) => {
Expand Down Expand Up @@ -469,7 +497,13 @@ export default decorate([
<TaskLi key={subTaskLog.id} task={subTaskLog}>
<ul>
{map(subTaskLog.tasks, subSubTaskLog => (
<TaskLi task={subSubTaskLog} key={subSubTaskLog.id} />
<TaskLi task={subSubTaskLog} key={subSubTaskLog.id}>
<ul>
{map(subSubTaskLog.tasks, subSubTaskLog => (
<TaskLi task={subSubTaskLog} key={subSubTaskLog.id} />
))}
</ul>
</TaskLi>
))}
</ul>
</TaskLi>
Expand Down

0 comments on commit 026c983

Please sign in to comment.