Commit 2d0fb4fe authored by Matt Strum's avatar Matt Strum

Improved console and log message window

parent 574411a3
......@@ -185,7 +185,7 @@
var op:Operation = start.start();
op.call(complete, failure);
Main.log.setStatus(start.name, false);
Main.log.appendMessage(new LogMessage(op.getUrl(), "Send: " + start.name, op.getSendXml(), false, LogMessage.TYPE_START));
Main.log.appendMessage(new LogMessage(op.getUrl(), start.name, op.getSendXml(), false, LogMessage.TYPE_START));
Main.protogeniHandler.dispatchQueueChanged();
......@@ -286,7 +286,7 @@
Main.log.appendMessage(new LogMessage(node.op.getUrl(), CommunicationUtil.GeniresponseToString(code), node.op.getResponseXml(), true, LogMessage.TYPE_END));
} else {
Main.log.setStatus(node.name + " done", false);
Main.log.appendMessage(new LogMessage(node.op.getUrl(), "Response: " + node.name, node.op.getResponseXml(), false, LogMessage.TYPE_END));
Main.log.appendMessage(new LogMessage(node.op.getUrl(), node.name, node.op.getResponseXml(), false, LogMessage.TYPE_END));
}
next = node.complete(code, response);
}
......
......@@ -98,7 +98,7 @@ package protogeni.communication
var count:int = 0;
var n:RequestQueueNode = head;
while(n != null && n != nextRequest)
while(n != null && n != nextRequest && (n.item as Request).running)
{
count++;
n = n.next;
......
......@@ -106,7 +106,16 @@
var split:Spacer = new Spacer();
logs.addChild(split);
}
logs.addChild(DisplayUtil.getLogMessageButton(msg));
var b:Button = DisplayUtil.getLogMessageButton(msg);
var h:HBox = new HBox();
h.percentWidth = 100;
if(msg.type == LogMessage.TYPE_END)
h.setStyle("horizontalAlign","right");
h.addChild(b);
if(this.oldestRadio.selected)
logs.addChild(h);
else
logs.addChildAt(h, 0);
}
public function clear():void {
......@@ -263,13 +272,20 @@
<mx:HDividedBox width="100%" height="100%">
<mx:VBox height="100%" width="50%" horizontalAlign="center" horizontalScrollPolicy="off">
<mx:Label text="Logs" fontSize="12" fontWeight="bold"/>
<mx:VBox height="100%" width="100%" id="logs">
<mx:Label text="Logs" fontSize="14" fontWeight="bold"/>
<mx:HBox verticalAlign="middle">
<mx:Label text="Sort by" />
<mx:RadioButtonGroup id="sortGroup" selectedValue="newest" itemClick="resetLogView()" />
<mx:RadioButton id="newestRadio" group="{sortGroup}" fontWeight="bold" label="newest" />
<mx:RadioButton id="oldestRadio" group="{sortGroup}" fontWeight="bold" label="oldest" />
<mx:Label text="at top" />
</mx:HBox>
<mx:VBox height="100%" width="100%" id="logs" paddingRight="20">
</mx:VBox>
</mx:VBox>
<mx:VBox height="100%" width="50%" horizontalAlign="center" horizontalScrollPolicy="off">
<mx:Label text="Queued Requests" fontWeight="bold" fontSize="12"/>
<mx:Label text="Queued Requests" fontWeight="bold" fontSize="14"/>
<mx:HBox width="100%" horizontalAlign="center">
<display:ImageButton id="startButton"
source="{DisplayUtil.playIcon}"
......
......@@ -65,6 +65,14 @@
[Embed(source="../../../images/help.png")]
public static var helpIcon:Class;
[Bindable]
[Embed(source="../../../images/arrow_left.png")]
public static var leftIcon:Class;
[Bindable]
[Embed(source="../../../images/arrow_right.png")]
public static var rightIcon:Class;
[Bindable]
[Embed(source="../../../images/user.png")]
public static var userIcon:Class;
......@@ -224,13 +232,21 @@
public static function getLogMessageButton(msg:LogMessage):Button {
var logButton:Button = new Button();
logButton.label = msg.name;
logButton.toolTip = msg.groupId;
if(msg.isError)
{
logButton.setStyle("icon",DisplayUtil.errorIcon);
logButton.styleName = "failedStyle";
}
else
logButton.setStyle("icon",DisplayUtil.availableIcon);
{
if(msg.type == LogMessage.TYPE_START)
logButton.setStyle("icon",DisplayUtil.rightIcon);
else if(msg.type == LogMessage.TYPE_END)
logButton.setStyle("icon",DisplayUtil.leftIcon);
else
logButton.setStyle("icon",DisplayUtil.availableIcon);
}
logButton.addEventListener(MouseEvent.CLICK,
function openLog():void {
var logw:LogMessageWindow = new LogMessageWindow();
......
......@@ -11,11 +11,24 @@
public function setMessage(log:LogMessage):void
{
details.text = log.details;
// image
if(log.isError)
{
nameField.setStyle("color","red");
this.typeImage.source = DisplayUtil.errorIcon;
} else
{
if(log.type == LogMessage.TYPE_START)
this.typeImage.source = DisplayUtil.rightIcon;
else if(log.type == LogMessage.TYPE_END)
this.typeImage.source = DisplayUtil.leftIcon;
else
this.typeImage.source = DisplayUtil.availableIcon;
}
nameField.text = log.name;
groupId.text = log.groupId;
time.text = log.timeStamp.toTimeString();
error.text = log.isError.toString();
time.text = log.timeStamp.toLocaleTimeString();
details.text = log.details;
}
]]>
......@@ -23,19 +36,19 @@
<mx:Grid width="100%">
<mx:GridRow width="100%" height="100%">
<mx:GridItem height="100%">
<mx:Label text="Group ID"/>
<mx:GridItem height="100%" horizontalAlign="right" verticalAlign="middle">
<mx:Image id="typeImage" />
</mx:GridItem>
<mx:GridItem width="100%" height="100%">
<mx:Label text="Error?" id="groupId"/>
<mx:Label id="nameField" fontSize="17" fontWeight="bold" selectable="true" color="green" />
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="100%">
<mx:GridItem height="100%">
<mx:Label text="Name"/>
<mx:Label text="Group ID"/>
</mx:GridItem>
<mx:GridItem width="100%" height="100%">
<mx:Label text="Error?" id="nameField"/>
<mx:Label id="groupId" selectable="true"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="100%">
......@@ -43,15 +56,7 @@
<mx:Label text="Time"/>
</mx:GridItem>
<mx:GridItem width="100%" height="100%">
<mx:Label text="Error?" id="time"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="100%">
<mx:GridItem height="100%">
<mx:Label text="Error?"/>
</mx:GridItem>
<mx:GridItem width="100%" height="100%">
<mx:Label text="Error?" id="error"/>
<mx:Label id="time" selectable="true" />
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
......
......@@ -165,7 +165,10 @@
</mx:Script>
<mx:ApplicationControlBar dock="true">
<mx:Label text="ProtoGENI" fontWeight="bold" fontSize="12"/>
<display:ImageButton id="infoButton"
source="@Embed('../images/protogeni-logo.png')"
click="showAbout()"
toolTip="View more information about ProtoGENI" />
<mx:VRule height="14"/>
<display:ImageButton id="refreshButton"
source="{DisplayUtil.refreshIcon}"
......@@ -213,10 +216,6 @@
source="{DisplayUtil.helpIcon}"
click="Util.showManual()"
toolTip="View more information" />
<display:ImageButton id="infoButton"
source="@Embed('../images/information.png')"
click="showAbout()"
toolTip="View more information" />
</mx:ApplicationControlBar>
<display:ProtogeniMap id="map" />
......
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