You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
2.7 KiB
106 lines
2.7 KiB
//
|
|
// DDWRT_MonitorAppDelegate.h
|
|
// DDWRT-Monitor
|
|
//
|
|
// Created by Matthieu Lalonde on 11-05-27.
|
|
// Copyright 2011 __MyCompanyName__. All rights reserved.
|
|
//
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
#import<WebKit/WebKit.h>
|
|
#import "WRTStatusClient.h"
|
|
|
|
@interface DDWRT_MonitorAppDelegate : NSObject <NSApplicationDelegate> {
|
|
IBOutlet NSMenu *AppMenu;
|
|
|
|
IBOutlet NSPanel *ConfigPanel;
|
|
IBOutlet NSPanel *BandwidthViewer;
|
|
|
|
IBOutlet WebView* BandwidthViewerWebView;
|
|
|
|
IBOutlet id configFieldHostname;
|
|
IBOutlet id configFieldProtocol;
|
|
IBOutlet id configFieldProtocolHTTP;
|
|
IBOutlet id configFieldProtocolHTTPS;
|
|
IBOutlet id configFieldPort;
|
|
IBOutlet id configFieldRefresh;
|
|
IBOutlet id configLabelRefresh;
|
|
IBOutlet id configFieldUseBytes;
|
|
IBOutlet id configFieldShowIcon;
|
|
IBOutlet id configLabelStatus;
|
|
IBOutlet NSProgressIndicator *configStateStatus;
|
|
IBOutlet id configButtonSave;
|
|
|
|
IBOutlet id menuUptime;
|
|
IBOutlet id menuLoad;
|
|
IBOutlet id menuWanIP;
|
|
IBOutlet id menuConnections;
|
|
|
|
IBOutlet id menuWanStatus;
|
|
IBOutlet id menuWanUptime;
|
|
|
|
IBOutlet id menuWanTrafficIn;
|
|
IBOutlet id menuWanTrafficOut;
|
|
|
|
IBOutlet id menuWanSeparator;
|
|
|
|
IBOutlet id menuWanDNS;
|
|
IBOutlet id menuWanDNSItem0;
|
|
IBOutlet id menuWanDNSItem1;
|
|
IBOutlet id menuWanDNSItem2;
|
|
IBOutlet id menuWanBandwidthGraph;
|
|
|
|
|
|
NSStatusItem *_appMenu;
|
|
NSAlert *modalWindow;
|
|
|
|
NSTimer *_readTimer;
|
|
NSTimeInterval _lastSpeedRead;
|
|
|
|
WRTStatusClient *wrt_client;
|
|
|
|
unsigned long long _lastInThroughput;
|
|
unsigned long long _lastOutThroughput;
|
|
|
|
BOOL _wrtReachable;
|
|
}
|
|
|
|
- (void) terminate:(id)sender;
|
|
- (void) showConfigPanel:(id)sender;
|
|
- (void) hideConfigPanel:(id)sender;
|
|
- (void) showBandwidthViewer:(id)sender;
|
|
- (void) hideBandwidthViewer:(id)sender;
|
|
- (void) showMenubar;
|
|
- (void) hideMenubar;
|
|
- (void) showMenubarIcon:(BOOL)enabled;
|
|
- (void) hideMenubarIcon;
|
|
- (void) setMenubarText:(NSString *)menubarText;
|
|
|
|
- (void) setConfigHostname:(id)sender;
|
|
- (void) setConfigProtocol:(id)sender;
|
|
- (void) setConfigPort:(id)sender;
|
|
- (void) setConfigRefresh:(id)sender;
|
|
- (void) setConfigWan:(id)sender;
|
|
- (void) setConfigBytes:(id)sender;
|
|
- (void) setConfigIcon:(id)sender;
|
|
|
|
- (IBAction) refreshMenu:(id)sender;
|
|
- (IBAction) refreshSystemMenu:(id)sender;
|
|
- (IBAction) refreshWanMenu:(id)sender;
|
|
- (void) wanRequestCallback:(NSData *)data;
|
|
- (IBAction) refreshClientsMenu:(id)sender;
|
|
|
|
- (void) saveConfig:(id)sender;
|
|
- (void) updateThroughput;
|
|
- (void) throughputCallback:(NSData *)data;
|
|
- (void) doUpdateStatus:(NSData *)data;
|
|
- (void) configSaveRequestCallback:(NSData *)data;
|
|
- (NSString *) getKey:(NSString * )data key:(NSString *)key;
|
|
|
|
- (NSString *) stringFromFileSize:(unsigned long long)theSize;
|
|
//@property (assign) IBOutlet NSWindow *window;
|
|
|
|
- (void) connection:(NSURLConnection*)connection didReceiveData:(NSData*)data;
|
|
|
|
@end
|