mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
Pass authtoken in from user, and add a wrapper for web UI on Mac.
This commit is contained in:
parent
e58047eaa0
commit
5b54612d91
68 changed files with 7537 additions and 1 deletions
54
ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m
Normal file
54
ext/mac-ui-macgap1-wrapper/MacGap/WindowController.m
Normal file
|
@ -0,0 +1,54 @@
|
|||
#import "WindowController.h"
|
||||
|
||||
|
||||
@interface WindowController() {
|
||||
|
||||
}
|
||||
|
||||
-(void) notificationCenter;
|
||||
|
||||
@end
|
||||
|
||||
@implementation WindowController
|
||||
|
||||
@synthesize contentView, url;
|
||||
|
||||
- (id) initWithURL:(NSString *) relativeURL{
|
||||
self = [super initWithWindowNibName:@"Window"];
|
||||
self.url = [NSURL URLWithString:relativeURL relativeToURL:[[NSBundle mainBundle] resourceURL]];
|
||||
|
||||
[self.window setFrameAutosaveName:@"MacGapWindow"];
|
||||
[self notificationCenter];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id) initWithRequest: (NSURLRequest *)request{
|
||||
self = [super initWithWindowNibName:@"Window"];
|
||||
[self notificationCenter];
|
||||
[[self.contentView.webView mainFrame] loadRequest:request];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void) notificationCenter{
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self.contentView
|
||||
selector:@selector(windowResized:)
|
||||
name:NSWindowDidResizeNotification
|
||||
object:[self window]];
|
||||
}
|
||||
|
||||
- (void)windowDidLoad
|
||||
{
|
||||
[super windowDidLoad];
|
||||
|
||||
if (self.url != nil) {
|
||||
[self.contentView.webView setMainFrameURL:[self.url absoluteString]];
|
||||
}
|
||||
|
||||
|
||||
// Implement this method to handle any initialization after your
|
||||
// window controller's window has been loaded from its nib file.
|
||||
}
|
||||
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue