Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
fuziontech committed Aug 16, 2023
1 parent 40ee146 commit 45b0739
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions frontend/src/pages/Backups/Backups.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react'
import { ColumnType } from 'antd/es/table'
import { Table, Button, Col, Row, Tooltip, notification } from 'antd'
import { Table, Button, Tag, Col, Row, Tooltip, notification } from 'antd'

interface BackupRow {
id: string
Expand Down Expand Up @@ -47,22 +47,38 @@ export default function Backups() {
const columns: ColumnType<BackupRow>[] = [
{ title: 'UUID', dataIndex: 'id' },
{ title: 'Name', dataIndex: 'name' },
{ title: 'Status', dataIndex: 'status' },
{
title: 'Status',
dataIndex: 'status',
render: (_, { status }) => {
var color = 'black'
switch (status) {
case 'CREATING_BACKUP' || 'RESTORING':
color = 'black'
break
case 'BACKUP_CREATED' || 'RESTORED':
color = 'green'
break
case 'BACKUP_FAILED' || 'RESTORE_FAILED':
color = 'volcano'
break
}
return (
<Tag color={color} key={status}>
{status.toUpperCase()}
</Tag>
)
},
},
{ title: 'Error', dataIndex: 'error' },
{ title: 'Start', dataIndex: 'start_time' },
{ title: 'End', dataIndex: 'end_time' },
{ title: 'Size', dataIndex: 'total_size' },
{ title: 'Entries', dataIndex: 'num_entries' },
{ title: 'Uncompressed Size', dataIndex: 'uncompressed_size' },
{ title: 'Compressed Size', dataIndex: 'compressed_size' },
{ title: 'Files Read', dataIndex: 'files_read' },
{ title: 'Bytes Read', dataIndex: 'bytes_read' },
]

return (
<div>
<h1 style={{ textAlign: 'left' }}>Backups</h1>
<br />
<Button
onClick={() => {
console.log('hi')
Expand Down

0 comments on commit 45b0739

Please sign in to comment.