A coarse approximation of storage management UI

This commit is contained in:
Ali
2022-12-24 20:25:56 +04:00
parent 808f5b80ff
commit d3f078410d
8 changed files with 614 additions and 100 deletions

View File

@@ -230,6 +230,19 @@ public final class StorageBox {
})
}
func reset() {
self.valueBox.begin()
self.valueBox.removeAllFromTable(self.hashIdToInfoTable)
self.valueBox.removeAllFromTable(self.idToReferenceTable)
self.valueBox.removeAllFromTable(self.peerIdToIdTable)
self.valueBox.removeAllFromTable(self.peerContentTypeStatsTable)
self.valueBox.removeAllFromTable(self.contentTypeStatsTable)
self.valueBox.removeAllFromTable(self.metadataTable)
self.valueBox.commit()
}
private func internalAddSize(contentType: UInt8, delta: Int64) {
let key = ValueBoxKey(length: 1)
key.setUInt8(0, value: contentType)
@@ -893,4 +906,10 @@ public final class StorageBox {
completion(ids)
}
}
public func reset() {
self.impl.with { impl in
impl.reset()
}
}
}