parent
c7427f8df8
commit
78aeda1a2c
|
@ -1,5 +1,6 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import { icons, kinds } from 'Helpers/Props';
|
||||
import Icon from 'Components/Icon';
|
||||
import IconButton from 'Components/Link/IconButton';
|
||||
|
@ -64,6 +65,7 @@ class BackupRow extends Component {
|
|||
type,
|
||||
name,
|
||||
path,
|
||||
size,
|
||||
time
|
||||
} = this.props;
|
||||
|
||||
|
@ -103,6 +105,10 @@ class BackupRow extends Component {
|
|||
</Link>
|
||||
</TableRowCell>
|
||||
|
||||
<TableRowCell>
|
||||
{formatBytes(size)}
|
||||
</TableRowCell>
|
||||
|
||||
<RelativeDateCellConnector
|
||||
date={time}
|
||||
/>
|
||||
|
@ -146,8 +152,9 @@ BackupRow.propTypes = {
|
|||
type: PropTypes.string.isRequired,
|
||||
name: PropTypes.string.isRequired,
|
||||
path: PropTypes.string.isRequired,
|
||||
size: PropTypes.number.isRequired,
|
||||
time: PropTypes.string.isRequired,
|
||||
onDeleteBackupPress: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default BackupRow;
|
||||
export default BackupRow;
|
|
@ -22,6 +22,11 @@ const columns = [
|
|||
label: 'Name',
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'size',
|
||||
label: 'Size',
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'time',
|
||||
label: 'Time',
|
||||
|
@ -122,6 +127,7 @@ class Backups extends Component {
|
|||
type,
|
||||
name,
|
||||
path,
|
||||
size,
|
||||
time
|
||||
} = item;
|
||||
|
||||
|
@ -132,6 +138,7 @@ class Backups extends Component {
|
|||
type={type}
|
||||
name={name}
|
||||
path={path}
|
||||
size={size}
|
||||
time={time}
|
||||
onDeleteBackupPress={onDeleteBackupPress}
|
||||
/>
|
||||
|
@ -163,4 +170,4 @@ Backups.propTypes = {
|
|||
onDeleteBackupPress: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default Backups;
|
||||
export default Backups;
|
|
@ -6,6 +6,7 @@ namespace NzbDrone.Core.Backup
|
|||
{
|
||||
public string Name { get; set; }
|
||||
public BackupType Type { get; set; }
|
||||
public long Size { get; set; }
|
||||
public DateTime Time { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,6 +107,7 @@ namespace NzbDrone.Core.Backup
|
|||
{
|
||||
Name = Path.GetFileName(b),
|
||||
Type = backupType,
|
||||
Size = _diskProvider.GetFileSize(b),
|
||||
Time = _diskProvider.FileGetLastWrite(b)
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace Sonarr.Api.V3.System.Backup
|
|||
Name = b.Name,
|
||||
Path = $"/backup/{b.Type.ToString().ToLower()}/{b.Name}",
|
||||
Type = b.Type,
|
||||
Size = b.Size,
|
||||
Time = b.Time
|
||||
})
|
||||
.OrderByDescending(b => b.Time)
|
||||
|
|
|
@ -9,6 +9,7 @@ namespace Sonarr.Api.V3.System.Backup
|
|||
public string Name { get; set; }
|
||||
public string Path { get; set; }
|
||||
public BackupType Type { get; set; }
|
||||
public long Size { get; set; }
|
||||
public DateTime Time { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue