Fix handling of 'PersistentKeepalive: every n seconds'
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
f292a0ec7a
commit
1189b3d700
|
@ -93,7 +93,7 @@
|
||||||
"tunnelEditPlaceholderTextStronglyRecommended" = "Strongly recommended";
|
"tunnelEditPlaceholderTextStronglyRecommended" = "Strongly recommended";
|
||||||
"tunnelEditPlaceholderTextOff" = "Off";
|
"tunnelEditPlaceholderTextOff" = "Off";
|
||||||
|
|
||||||
"tunnelPeerPersistentKeepaliveValue (%d)" = "every %d seconds";
|
"tunnelPeerPersistentKeepaliveValue (%@)" = "every %@ seconds";
|
||||||
"tunnelHandshakeTimestampNow" = "Now";
|
"tunnelHandshakeTimestampNow" = "Now";
|
||||||
"tunnelHandshakeTimestampSystemClockBackward" = "(System clock is backward)";
|
"tunnelHandshakeTimestampSystemClockBackward" = "(System clock is backward)";
|
||||||
"tunnelHandshakeTimestampAgo (%@)" = "%@ ago";
|
"tunnelHandshakeTimestampAgo (%@)" = "%@ ago";
|
||||||
|
|
|
@ -252,7 +252,7 @@ class TunnelViewModel {
|
||||||
scratchpad[.endpoint] = endpoint.stringRepresentation
|
scratchpad[.endpoint] = endpoint.stringRepresentation
|
||||||
}
|
}
|
||||||
if let persistentKeepAlive = config.persistentKeepAlive {
|
if let persistentKeepAlive = config.persistentKeepAlive {
|
||||||
scratchpad[.persistentKeepAlive] = tr(format: "tunnelPeerPersistentKeepaliveValue (%d)", persistentKeepAlive)
|
scratchpad[.persistentKeepAlive] = String(persistentKeepAlive)
|
||||||
}
|
}
|
||||||
if let rxBytes = config.rxBytes {
|
if let rxBytes = config.rxBytes {
|
||||||
scratchpad[.rxBytes] = prettyBytes(rxBytes)
|
scratchpad[.rxBytes] = prettyBytes(rxBytes)
|
||||||
|
|
|
@ -211,7 +211,11 @@ extension TunnelDetailTableViewController {
|
||||||
let field = peerData.filterFieldsWithValueOrControl(peerFields: peerFields)[indexPath.row]
|
let field = peerData.filterFieldsWithValueOrControl(peerFields: peerFields)[indexPath.row]
|
||||||
let cell: KeyValueCell = tableView.dequeueReusableCell(for: indexPath)
|
let cell: KeyValueCell = tableView.dequeueReusableCell(for: indexPath)
|
||||||
cell.key = field.localizedUIString
|
cell.key = field.localizedUIString
|
||||||
cell.value = peerData[field]
|
if field == .persistentKeepAlive {
|
||||||
|
cell.value = tr(format: "tunnelPeerPersistentKeepaliveValue (%@)", peerData[field])
|
||||||
|
} else {
|
||||||
|
cell.value = peerData[field]
|
||||||
|
}
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -286,7 +286,11 @@ extension TunnelDetailTableViewController: NSTableViewDelegate {
|
||||||
let cell: KeyValueRow = tableView.dequeueReusableCell()
|
let cell: KeyValueRow = tableView.dequeueReusableCell()
|
||||||
let localizedKeyString = modelRow.isTitleRow() ? modelRow.localizedSectionKeyString() : field.localizedUIString
|
let localizedKeyString = modelRow.isTitleRow() ? modelRow.localizedSectionKeyString() : field.localizedUIString
|
||||||
cell.key = tr(format: "macFieldKey (%@)", localizedKeyString)
|
cell.key = tr(format: "macFieldKey (%@)", localizedKeyString)
|
||||||
cell.value = peerData[field]
|
if field == .persistentKeepAlive {
|
||||||
|
cell.value = tr(format: "tunnelPeerPersistentKeepaliveValue (%@)", peerData[field])
|
||||||
|
} else {
|
||||||
|
cell.value = peerData[field]
|
||||||
|
}
|
||||||
cell.isKeyInBold = modelRow.isTitleRow()
|
cell.isKeyInBold = modelRow.isTitleRow()
|
||||||
return cell
|
return cell
|
||||||
case .spacerRow:
|
case .spacerRow:
|
||||||
|
|
Loading…
Reference in New Issue