Commit 73f7db1c authored by Matt Strum's avatar Matt Strum
Browse files

More updating

parent 33a2471d
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" title="About ProtoGENI Mapper" showCloseButton="true" horizontalAlign="center"
borderAlpha=".9" borderColor="#D2E1F0"
close="PopUpManager.removePopUp(this)">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
]]>
</mx:Script>
<mx:Label text="Displays resources from ProtoGENI"/>
<mx:HRule/>
<mx:Label text="Special thanks to" fontWeight="bold"/>
<mx:HBox width="100%" horizontalAlign="center">
<mx:Label text="Fatcow (CCA3 Icons)"/>
<mx:LinkButton label="Website">
<mx:click>navigateToURL(new URLRequest("http://www.fatcow.com/free-icons/index.bml"), "_blank");</mx:click>
</mx:LinkButton>
</mx:HBox>
<mx:HBox width="100%" horizontalAlign="center">
<mx:Label text="Mattism (LGPL XML-RPC)"/>
<mx:LinkButton label="Website">
<mx:click>navigateToURL(new URLRequest("http://sf.net/projects/xmlrpcflash"), "_blank");</mx:click>
</mx:LinkButton>
</mx:HBox>
</mx:TitleWindow>
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
verticalGap="0" paddingTop="0" paddingRight="0" paddingLeft="0" paddingBottom="0" horizontalGap="0"
creationComplete="main = Common.Main()">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.controls.Spacer;
import mx.containers.HBox;
import mx.collections.ArrayCollection;
[Bindable]
public var link:Link = null;
public var main:pgmap = null;
public function load(l:Link):void {
link = l;
txtBandwidth.text = Common.kbsToString(l.bandwidth);
interface1Button.setStyle("icon",Common.assignAvailabilityIcon(l.interface1.owner));
interface2Button.setStyle("icon",Common.assignAvailabilityIcon(l.interface2.owner));
}
public function viewRspec():void {
var rspecView:XmlWindow = new XmlWindow();
PopUpManager.addPopUp(rspecView, main, false);
PopUpManager.centerPopUp(rspecView);
rspecView.loadXml(link.rspec);
}
]]>
</mx:Script>
<mx:Grid width="100%" height="100%" verticalGap="2" horizontalGap="2">
<mx:GridRow width="100%">
<mx:GridItem rowSpan="2">
<mx:Button label="RSPEC" width="100%" height="100%" click="viewRspec()"/>
</mx:GridItem>
<mx:GridItem width="100%">
<mx:Label text="{link.name}" fontSize="17" fontWeight="bold"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
<mx:GridItem width="100%">
<mx:Label text="Bandwidth" fontWeight="bold"/>
<mx:Label id="txtBandwidth"/>
<mx:VRule height="16"/>
<mx:Label text="Latency" fontWeight="bold"/>
<mx:Label text="{link.latency}"/>
<mx:VRule height="16"/>
<mx:Label text="Packet Loss" fontWeight="bold"/>
<mx:Label text="{link.packetLoss}"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
<mx:GridItem>
<mx:Label text="UUID" fontWeight="bold"/>
</mx:GridItem>
<mx:GridItem width="100%">
<mx:Label text="{link.uuid}"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
<mx:GridItem>
<mx:Label text="Manager" fontWeight="bold"/>
</mx:GridItem>
<mx:GridItem width="100%">
<mx:Label text="{link.manager}"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
<mx:GridItem>
<mx:VBox horizontalAlign="right" width="100%">
<mx:Label text="Connects" fontWeight="bold"/>
</mx:VBox>
</mx:GridItem>
<mx:GridItem width="100%">
<mx:VBox width="100%">
<mx:Button id="interface1Button" label="{link.interface1.owner.name}" click="Common.viewNode(link.interface1.owner);"/>
<mx:Label text="on {link.interface1.id}"/>
</mx:VBox>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
<mx:GridItem>
<mx:VBox horizontalAlign="right" width="100%">
<mx:Label text="to" fontWeight="bold"/>
</mx:VBox>
</mx:GridItem>
<mx:GridItem width="100%">
<mx:VBox width="100%">
<mx:Button id="interface2Button" label="{link.interface2.owner.name}" click="Common.viewNode(link.interface2.owner);"/>
<mx:Label text="on {link.interface2.id}"/>
</mx:VBox>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="100%">
<mx:GridItem>
<mx:Label text="Types" fontWeight="bold"/>
</mx:GridItem>
<mx:GridItem width="100%">
<mx:List width="100%" height="100%" id="listNodes" dataProvider="{link.types}"></mx:List>
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
</mx:VBox>
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
verticalGap="0" paddingTop="0" paddingRight="0" paddingLeft="0" paddingBottom="0" horizontalGap="0"
creationComplete="main = Common.Main()">
<mx:Script>
<![CDATA[
import mx.controls.Spacer;
import mx.containers.HBox;
import mx.collections.ArrayCollection;
import mx.managers.PopUpManager;
[Bindable]
public var node:Node = null;
public var main:pgmap = null;
public function load(n:Node):void {
node = n;
imgAvailable.source = Common.assignAvailabilityIcon(n);
imgExclusive.source = Common.assignIcon(n.exclusive);
linksEndpointVbox.removeAllChildren();
linksStartpointVbox.removeAllChildren();
var endpointArray:ArrayCollection = new ArrayCollection();
var startpointArray:ArrayCollection = new ArrayCollection();
for each(var i:NodeInterface in n.interfaces.collection) {
for each(var l:Link in i.links) {
var n:Node;
var iEnd:NodeInterface;
var iStart:NodeInterface;
if(l.interface1 == i) {
n = l.interface2.owner;
iEnd = l.interface2;
iStart = l.interface1;
} else {
n = l.interface1.owner;
iEnd = l.interface1;
iStart = l.interface2;
}
// Build up endpoint
var nodeFound:Boolean = false;
for each(var na:Object in endpointArray) {
if(na.node == n) {
nodeFound = true;
na.links.addItem({i: iEnd, l: l});
break;
}
}
if(!nodeFound) {
var newLinks:ArrayCollection = new ArrayCollection();
newLinks.addItem({i: iEnd, l: l});
endpointArray.addItem({node: n, links: newLinks});
}
// Build up startpoint
var interfaceFound:Boolean = false;
for each(var ia:Object in startpointArray) {
if(ia.link.i == iStart) {
interfaceFound = true;
if(!ia.nodes.contains(n))
ia.nodes.addItem(n);
break;
}
}
if(!interfaceFound) {
var newNodes:ArrayCollection = new ArrayCollection();
newNodes.addItem(n);
startpointArray.addItem({link: {i: iStart, l: l}, nodes: newNodes});
}
// Build endpoint interface
for each(var nodeInfo:Object in endpointArray) {
linksEndpointVbox.addChild(Common.getNodeButton(nodeInfo.node));
for each(var nodeLink:Object in nodeInfo.links) {
var linkHbox:HBox = new HBox();
var space:Spacer = new Spacer();
space.width = 16;
linkHbox.addChild(space);
linkHbox.addChild(Common.getLinkButton(nodeLink.i, nodeLink.l));
linksEndpointVbox.addChild(linkHbox);
}
}
// Build startpoint interface
for each(var linkInfo:Object in startpointArray) {
linksStartpointVbox.addChild(Common.getLinkButton(linkInfo.link.i, linkInfo.link.l));
for each(var node:Node in linkInfo.nodes) {
var linkHbox2:HBox = new HBox();
var space2:Spacer = new Spacer();
space2.width = 16;
linkHbox2.addChild(space2);
linkHbox2.addChild(Common.getNodeButton(node));
linksStartpointVbox.addChild(linkHbox2);
}
}
}
}
}
public function viewLinks():void {
var lgWindow:LinkGroupAdvancedWindow = new LinkGroupAdvancedWindow();
lgWindow.main = main;
PopUpManager.addPopUp(lgWindow, main, false);
PopUpManager.centerPopUp(lgWindow);
lgWindow.loadCollection(node.GetLinks());
}
public function viewNodes():void {
var hgWindow:NodeGroupAdvancedWindow = new NodeGroupAdvancedWindow();
hgWindow.main = main;
PopUpManager.addPopUp(hgWindow, main, false);
PopUpManager.centerPopUp(hgWindow);
hgWindow.loadCollection(node.GetNodes());
}
public function viewRspec():void {
var rspecView:XmlWindow = new XmlWindow();
PopUpManager.addPopUp(rspecView, main, false);
PopUpManager.centerPopUp(rspecView);
rspecView.loadXml(node.rspec);
}
]]>
</mx:Script>
<mx:Grid width="100%" height="100%" verticalGap="2" horizontalGap="2">
<mx:GridRow width="100%">
<mx:GridItem rowSpan="2">
<mx:Button label="RSPEC" width="100%" height="100%" click="viewRspec()"/>
</mx:GridItem>
<mx:GridItem width="100%">
<mx:Label text="{node.name}" fontSize="17" fontWeight="bold"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
<mx:GridItem width="100%">
<mx:Label text="Exclusive" fontWeight="bold"/>
<mx:Image id="imgExclusive"/>
<mx:VRule height="16"/>
<mx:Label text="Availability" fontWeight="bold"/>
<mx:Image id="imgAvailable"/>
<mx:VRule height="16"/>
<mx:Label text="Status" fontWeight="bold"/>
<mx:Label text="{node.status}" fontWeight="normal"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
<mx:GridItem>
<mx:Label text="UUID" fontWeight="bold"/>
</mx:GridItem>
<mx:GridItem width="100%">
<mx:Label text="{node.uuid}"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
<mx:GridItem>
<mx:Label text="Manager" fontWeight="bold"/>
</mx:GridItem>
<mx:GridItem width="100%">
<mx:Label text="{node.manager}"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="86">
<mx:GridItem>
<mx:Label text="Types" fontWeight="bold"/>
</mx:GridItem>
<mx:GridItem width="100%">
<mx:DataGrid width="100%" height="100%" id="gridTypes" dataProvider="{node.types}">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name"/>
<mx:DataGridColumn headerText="Slots" dataField="slots"/>
<mx:DataGridColumn headerText="Static" dataField="isStatic"/>
</mx:columns>
</mx:DataGrid>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="100%">
<mx:GridItem>
<mx:VBox horizontalAlign="right">
<mx:Label text="Links to" fontWeight="bold"/>
<mx:HRule width="32"/>
<mx:Label text="View all" fontWeight="normal"/>
<mx:Button label="Links" click="viewLinks();" width="100%"/>
<mx:Button label="Nodes" click="viewNodes();" width="100%"/>
</mx:VBox>
</mx:GridItem>
<mx:GridItem width="100%">
<mx:TabNavigator width="100%" height="100%" paddingTop="2" paddingRight="2" paddingLeft="2" paddingBottom="2">
<mx:VBox label="Endpoint" width="100%" height="100%" id="linksEndpointVbox">
</mx:VBox>
<mx:VBox label="Startpoint" width="100%" height="100%" id="linksStartpointVbox">
</mx:VBox>
</mx:TabNavigator>
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
</mx:VBox>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment