mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
Wire up checkboxes for allowGlobal, allowDefault, allowManaged to set the proper state in zerotier daemon
checkboxes are disabled if the network is not currently connected.
This commit is contained in:
parent
d57e343245
commit
1756e8b0f2
3 changed files with 25 additions and 5 deletions
|
@ -42,14 +42,10 @@ class NetworkInfoCell: NSTableCellView {
|
|||
}
|
||||
|
||||
@IBAction func onConnectCheckStateChanged(sender: NSButton) {
|
||||
NSLog("Checked State Changed")
|
||||
|
||||
if(sender.state == NSOnState) {
|
||||
NSLog("Checked")
|
||||
joinNetwork(networkIdField.stringValue)
|
||||
}
|
||||
else {
|
||||
NSLog("Unchecked")
|
||||
leaveNetwork(networkIdField.stringValue)
|
||||
}
|
||||
}
|
||||
|
@ -60,10 +56,17 @@ class NetworkInfoCell: NSTableCellView {
|
|||
}
|
||||
|
||||
func joinNetwork(nwid: String) {
|
||||
ServiceCom.joinNetwork(nwid)
|
||||
ServiceCom.joinNetwork(nwid,
|
||||
allowManaged: allowManaged.state == NSOnState,
|
||||
allowGlobal: allowGlobal.state == NSOnState,
|
||||
allowDefault: !defaultRouteExists(parent.networkList) && (allowDefault.state == NSOnState))
|
||||
}
|
||||
|
||||
func leaveNetwork(nwid: String) {
|
||||
ServiceCom.leaveNetwork(nwid)
|
||||
}
|
||||
|
||||
@IBAction func onAllowStatusChanged(sender: NSButton) {
|
||||
joinNetwork(networkIdField.stringValue)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue