1
0
Fork 0

FIXED - Bandwidth viewer is back

master
Matthieu Lalonde 14 years ago
parent ea4b6002a1
commit 18dedc122f

@ -33,6 +33,7 @@
[AppMenu release]; [AppMenu release];
[_appMenu release]; [_appMenu release];
[ConfigPanel release]; [ConfigPanel release];
[BandwidthViewer release];
[super dealloc]; [super dealloc];
} }
@ -60,6 +61,11 @@
- (void) deinitialize - (void) deinitialize
{ {
if (_updateTimer != nil) {
[_updateTimer invalidate];
_updateTimer = nil;
}
[wrt_update_client release]; [wrt_update_client release];
wrt_update_client = nil; wrt_update_client = nil;
@ -67,6 +73,18 @@
wrt_request_client = nil; wrt_request_client = nil;
} }
- (void) showBandwidthViewer:(id)sender
{
[ [BandwidthViewerWebView mainFrame] loadRequest: [wrt_update_client requestForBandwidthViewerForInterface:[wrt_update_client getWanPort]] ];
// Failed attempt at automagically setting the bit/byte mode in the svg graph
//WebScriptObject *scriptObject = [BandwidthViewerWebView windowScriptObject];
//[scriptObject callWebScriptMethod:@"alert" withArguments:[NSArray arrayWithObject:@"Will"]];
//[scriptObject setValue:@"bits" forKey:@"unit"];
[BandwidthViewer makeKeyAndOrderFront:nil];
}
# pragma mark - # pragma mark -
# pragma mark Menu Methods: # pragma mark Menu Methods:
- (void) showMenubar - (void) showMenubar

@ -1053,7 +1053,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object> </object>
<string key="NSFrameSize">{555, 275}</string> <string key="NSFrameSize">{555, 275}</string>
<reference key="NSSuperview" ref="40768770"/> <reference key="NSSuperview" ref="40768770"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/> <reference key="NSNextKeyView"/>
<bool key="NSViewIsLayerTreeHost">YES</bool> <bool key="NSViewIsLayerTreeHost">YES</bool>
<int key="NSViewLayerContentsRedrawPolicy">2</int> <int key="NSViewLayerContentsRedrawPolicy">2</int>
@ -1087,7 +1086,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object> </object>
<string key="NSFrame">{{7, 11}, {555, 275}}</string> <string key="NSFrame">{{7, 11}, {555, 275}}</string>
<reference key="NSSuperview"/> <reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="519676712"/> <reference key="NSNextKeyView" ref="519676712"/>
<bool key="NSViewIsLayerTreeHost">YES</bool> <bool key="NSViewIsLayerTreeHost">YES</bool>
<int key="NSViewLayerContentsRedrawPolicy">2</int> <int key="NSViewLayerContentsRedrawPolicy">2</int>
@ -1326,14 +1324,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object> </object>
<int key="connectionID">775</int> <int key="connectionID">775</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">refreshClientsMenu:</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="406982965"/>
</object>
<int key="connectionID">778</int>
</object>
<object class="IBConnectionRecord"> <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection"> <object class="IBOutletConnection" key="connection">
<string key="label">AppMenu</string> <string key="label">AppMenu</string>
@ -1342,14 +1332,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object> </object>
<int key="connectionID">779</int> <int key="connectionID">779</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">refreshSystemMenu:</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="148702963"/>
</object>
<int key="connectionID">780</int>
</object>
<object class="IBConnectionRecord"> <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection"> <object class="IBOutletConnection" key="connection">
<string key="label">menuWanUptime</string> <string key="label">menuWanUptime</string>
@ -1358,14 +1340,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object> </object>
<int key="connectionID">782</int> <int key="connectionID">782</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">refreshWanMenu:</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="1061072709"/>
</object>
<int key="connectionID">784</int>
</object>
<object class="IBConnectionRecord"> <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection"> <object class="IBOutletConnection" key="connection">
<string key="label">menuDNS</string> <string key="label">menuDNS</string>
@ -2655,10 +2629,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="NSArray" key="dict.sortedKeys"> <object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<string>copyParentMenuTitle:</string> <string>copyParentMenuTitle:</string>
<string>refreshClientsMenu:</string> <string>hideConfigPanel:</string>
<string>refreshMenu:</string> <string>refreshMenu:</string>
<string>refreshSystemMenu:</string> <string>saveConfig:</string>
<string>refreshWanMenu:</string> <string>setConfigProtocol:</string>
<string>setConfigRefresh:</string>
<string>showConfigPanel:</string>
</object> </object>
<object class="NSMutableArray" key="dict.values"> <object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
@ -2667,6 +2643,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>id</string> <string>id</string>
<string>id</string> <string>id</string>
<string>id</string> <string>id</string>
<string>id</string>
<string>id</string>
</object> </object>
</object> </object>
<object class="NSMutableDictionary" key="actionInfosByName"> <object class="NSMutableDictionary" key="actionInfosByName">
@ -2674,10 +2652,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="NSArray" key="dict.sortedKeys"> <object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<string>copyParentMenuTitle:</string> <string>copyParentMenuTitle:</string>
<string>refreshClientsMenu:</string> <string>hideConfigPanel:</string>
<string>refreshMenu:</string> <string>refreshMenu:</string>
<string>refreshSystemMenu:</string> <string>saveConfig:</string>
<string>refreshWanMenu:</string> <string>setConfigProtocol:</string>
<string>setConfigRefresh:</string>
<string>showConfigPanel:</string>
</object> </object>
<object class="NSMutableArray" key="dict.values"> <object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
@ -2686,7 +2666,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="candidateClassName">id</string> <string key="candidateClassName">id</string>
</object> </object>
<object class="IBActionInfo"> <object class="IBActionInfo">
<string key="name">refreshClientsMenu:</string> <string key="name">hideConfigPanel:</string>
<string key="candidateClassName">id</string> <string key="candidateClassName">id</string>
</object> </object>
<object class="IBActionInfo"> <object class="IBActionInfo">
@ -2694,11 +2674,19 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="candidateClassName">id</string> <string key="candidateClassName">id</string>
</object> </object>
<object class="IBActionInfo"> <object class="IBActionInfo">
<string key="name">refreshSystemMenu:</string> <string key="name">saveConfig:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">setConfigProtocol:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">setConfigRefresh:</string>
<string key="candidateClassName">id</string> <string key="candidateClassName">id</string>
</object> </object>
<object class="IBActionInfo"> <object class="IBActionInfo">
<string key="name">refreshWanMenu:</string> <string key="name">showConfigPanel:</string>
<string key="candidateClassName">id</string> <string key="candidateClassName">id</string>
</object> </object>
</object> </object>

@ -112,10 +112,10 @@
} else { } else {
NSString *stringData = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; NSString *stringData = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
NSRange pageValid = [stringData rangeOfString:@"Bandwidth Monitoring"]; NSRange pageValid = [stringData rangeOfString:@"Bandwidth Monitoring"];
NSRange startRange = [stringData rangeOfString:@"WAN</h2>"];
if (pageValid.location != NSNotFound) { if (pageValid.location != NSNotFound && startRange.location != NSNotFound) {
// grab the wan port name // grab the wan port name
NSRange startRange = [stringData rangeOfString:@"WAN</h2>"];
stringData = [stringData substringFromIndex:startRange.location]; stringData = [stringData substringFromIndex:startRange.location];
NSString *key = @"<iframe src=\"/graph_if.svg?"; NSString *key = @"<iframe src=\"/graph_if.svg?";
startRange = [stringData rangeOfString:key]; startRange = [stringData rangeOfString:key];
@ -126,7 +126,7 @@
[self setWrtReachable:true]; [self setWrtReachable:true];
} else { } else {
[self setWrtReachable:false]; [self setWrtReachable:false];
wanPort = nil; wanPort = nil;
} }
} }
} }

Loading…
Cancel
Save