2016-05-27 20:28:32 +00:00
|
|
|
//
|
|
|
|
// NetworkInfoCell.swift
|
|
|
|
// ZeroTier One
|
|
|
|
//
|
|
|
|
// Created by Grant Limberg on 5/24/16.
|
|
|
|
// Copyright © 2016 ZeroTier, Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Cocoa
|
|
|
|
|
|
|
|
class NetworkInfoCell: NSTableCellView {
|
|
|
|
|
2016-06-10 02:59:05 +00:00
|
|
|
weak var parent: ShowNetworksViewController!
|
|
|
|
|
2016-05-27 20:28:32 +00:00
|
|
|
@IBOutlet var networkIdField: NSTextField!
|
|
|
|
@IBOutlet var networkNameField: NSTextField!
|
|
|
|
|
2016-05-27 20:48:22 +00:00
|
|
|
@IBOutlet var statusField: NSTextField!
|
|
|
|
@IBOutlet var typeField: NSTextField!
|
|
|
|
@IBOutlet var macField: NSTextField!
|
|
|
|
@IBOutlet var mtuField: NSTextField!
|
|
|
|
@IBOutlet var broadcastField: NSTextField!
|
|
|
|
@IBOutlet var bridgingField: NSTextField!
|
|
|
|
@IBOutlet var deviceField: NSTextField!
|
|
|
|
@IBOutlet var addressesField: NSTextField!
|
|
|
|
|
2016-06-27 00:21:45 +00:00
|
|
|
@IBOutlet var allowManaged: NSButton!
|
|
|
|
@IBOutlet var allowGlobal: NSButton!
|
|
|
|
@IBOutlet var allowDefault: NSButton!
|
|
|
|
|
2016-06-10 02:59:05 +00:00
|
|
|
@IBOutlet var connectedCheckbox: NSButton!
|
|
|
|
@IBOutlet var deleteButton: NSButton!
|
|
|
|
|
2016-05-27 22:25:32 +00:00
|
|
|
override func awakeFromNib() {
|
|
|
|
super.awakeFromNib()
|
|
|
|
|
|
|
|
}
|
2016-05-27 20:28:32 +00:00
|
|
|
override func drawRect(dirtyRect: NSRect) {
|
|
|
|
super.drawRect(dirtyRect)
|
|
|
|
|
|
|
|
// Drawing code here.
|
|
|
|
}
|
2016-06-10 02:59:05 +00:00
|
|
|
|
|
|
|
@IBAction func onConnectCheckStateChanged(sender: NSButton) {
|
|
|
|
NSLog("Checked State Changed")
|
|
|
|
|
|
|
|
if(sender.state == NSOnState) {
|
|
|
|
NSLog("Checked")
|
|
|
|
joinNetwork(networkIdField.stringValue)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
NSLog("Unchecked")
|
|
|
|
leaveNetwork(networkIdField.stringValue)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@IBAction func deleteNetwork(sender: NSButton) {
|
|
|
|
leaveNetwork(networkIdField.stringValue)
|
|
|
|
parent.deleteNetworkFromList(networkIdField.stringValue)
|
|
|
|
}
|
|
|
|
|
|
|
|
func joinNetwork(nwid: String) {
|
|
|
|
ServiceCom.joinNetwork(nwid)
|
|
|
|
}
|
|
|
|
|
|
|
|
func leaveNetwork(nwid: String) {
|
|
|
|
ServiceCom.leaveNetwork(nwid)
|
|
|
|
}
|
2016-05-27 20:28:32 +00:00
|
|
|
}
|