show size in about repository
This commit is contained in:
parent
c00f13cd42
commit
b63b9e152c
1 changed files with 9 additions and 0 deletions
|
|
@ -14,9 +14,18 @@ class AboutRepositoryTableViewController: BasicStaticTableViewController {
|
||||||
navigationItemTitle = "About Repository"
|
navigationItemTitle = "About Repository"
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
let passwordEntities = PasswordStore.shared.fetchPasswordEntityCoreData()
|
let passwordEntities = PasswordStore.shared.fetchPasswordEntityCoreData()
|
||||||
|
let fm = FileManager.default
|
||||||
|
var size = UInt64(0)
|
||||||
|
do {
|
||||||
|
size = try fm.allocatedSizeOfDirectoryAtURL(directoryURL: PasswordStore.shared.storeURL)
|
||||||
|
} catch {
|
||||||
|
print(error)
|
||||||
|
}
|
||||||
|
let formatted = ByteCountFormatter.string(fromByteCount: Int64(size), countStyle: ByteCountFormatter.CountStyle.file)
|
||||||
tableData = [
|
tableData = [
|
||||||
// section 0
|
// section 0
|
||||||
[[.type: CellDataType.detail, .title: "Passwords", .detailText: String(passwordEntities.count)],
|
[[.type: CellDataType.detail, .title: "Passwords", .detailText: String(passwordEntities.count)],
|
||||||
|
[.type: CellDataType.detail, .title: "Size", .detailText: formatted],
|
||||||
[.type: CellDataType.detail, .title: "Last Updated", .detailText: Utils.getLastUpdatedTimeString()],
|
[.type: CellDataType.detail, .title: "Last Updated", .detailText: Utils.getLastUpdatedTimeString()],
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue