Commit aac3fc1d authored by Matt Strum's avatar Matt Strum Committed by Gary Wong

Fixed cloning nodes with services and making apply button available when changing services

parent 35b395d1
...@@ -497,25 +497,31 @@ IN THE WORK. ...@@ -497,25 +497,31 @@ IN THE WORK.
private function addInstallService(installService:InstallService = null):void private function addInstallService(installService:InstallService = null):void
{ {
var newInstallComponent:InstallServiceComponent = new InstallServiceComponent(); var newInstallComponent:InstallServiceComponent = new InstallServiceComponent();
newInstallComponent.onChange = onChange;
if(installService != null) if(installService != null)
{ {
newInstallComponent.url = installService.url; newInstallComponent.url = installService.url;
newInstallComponent.path = installService.installPath; newInstallComponent.path = installService.installPath;
} }
installVgroup.addElement(newInstallComponent); installVgroup.addElement(newInstallComponent);
if(!okButton.enabled) onChange();
okButton.enabled = true;
} }
private function addExecuteService(executeService:ExecuteService = null):void private function addExecuteService(executeService:ExecuteService = null):void
{ {
var newExecuteComponent:ExecuteServiceComponent = new ExecuteServiceComponent(); var newExecuteComponent:ExecuteServiceComponent = new ExecuteServiceComponent();
newExecuteComponent.onChange = onChange;
if(executeService != null) if(executeService != null)
{ {
newExecuteComponent.cmd = executeService.command; newExecuteComponent.cmd = executeService.command;
newExecuteComponent.shell = executeService.shell; newExecuteComponent.shell = executeService.shell;
} }
executeVgroup.addElement(newExecuteComponent); executeVgroup.addElement(newExecuteComponent);
onChange();
}
private function onChange():void
{
if(!okButton.enabled) if(!okButton.enabled)
okButton.enabled = true; okButton.enabled = true;
} }
......
...@@ -45,6 +45,8 @@ IN THE WORK. ...@@ -45,6 +45,8 @@ IN THE WORK.
import spark.components.Group; import spark.components.Group;
public var onChange:Function;
[Bindable] [Bindable]
public var cmd:String = ""; public var cmd:String = "";
[Bindable] [Bindable]
...@@ -64,12 +66,14 @@ IN THE WORK. ...@@ -64,12 +66,14 @@ IN THE WORK.
<s:TextInput id="executeCommandText" <s:TextInput id="executeCommandText"
width="90%" width="90%"
text="@{cmd}" text="@{cmd}"
prompt="Command" /> prompt="Command"
change="if(onChange != null) onChange();" />
<s:Label text="using" /> <s:Label text="using" />
<s:TextInput id="executeShellText" <s:TextInput id="executeShellText"
width="10%" width="10%"
text="@{shell}" text="@{shell}"
prompt="Shell? (sh, bash, etc.)" /> prompt="Shell? (sh, bash, etc.)"
change="if(onChange != null) onChange();" />
<components:ImageButton icon="{ImageUtil.deleteIcon}" <components:ImageButton icon="{ImageUtil.deleteIcon}"
click="(parent as Group).removeElement(this)" /> click="if(onChange != null) onChange(); (parent as Group).removeElement(this)" />
</s:HGroup> </s:HGroup>
...@@ -45,6 +45,8 @@ IN THE WORK. ...@@ -45,6 +45,8 @@ IN THE WORK.
import spark.components.Group; import spark.components.Group;
public var onChange:Function;
[Bindable] [Bindable]
public var url:String = ""; public var url:String = "";
[Bindable] [Bindable]
...@@ -64,12 +66,14 @@ IN THE WORK. ...@@ -64,12 +66,14 @@ IN THE WORK.
<s:TextInput id="installUrlText" <s:TextInput id="installUrlText"
width="50%" width="50%"
text="@{url}" text="@{url}"
prompt="Archive URL" /> prompt="Archive URL"
change="if(onChange != null) onChange();" />
<s:Label text="in" /> <s:Label text="in" />
<s:TextInput id="installPathText" <s:TextInput id="installPathText"
width="50%" width="50%"
text="@{path}" text="@{path}"
prompt="Install path" /> prompt="Install path"
change="if(onChange != null) onChange();" />
<components:ImageButton icon="{ImageUtil.deleteIcon}" <components:ImageButton icon="{ImageUtil.deleteIcon}"
click="(parent as Group).removeElement(this)" /> click="if(onChange != null) onChange(); (parent as Group).removeElement(this)" />
</s:HGroup> </s:HGroup>
...@@ -317,18 +317,27 @@ package com.flack.geni.resources.virtual ...@@ -317,18 +317,27 @@ package com.flack.geni.resources.virtual
newClone.hardwareType.name = hardwareType.name; newClone.hardwareType.name = hardwareType.name;
newClone.hardwareType.slots = hardwareType.slots; newClone.hardwareType.slots = hardwareType.slots;
} }
for each(var executeService:ExecuteService in services.executeServices) if(services.executeServices != null)
{ {
var newExecute:ExecuteService = new ExecuteService(executeService.command, executeService.shell); newClone.services.executeServices = new Vector.<ExecuteService>();
newExecute.extensions = executeService.extensions.Clone; for each(var executeService:ExecuteService in services.executeServices)
newClone.services.executeServices.push(newExecute); {
var newExecute:ExecuteService = new ExecuteService(executeService.command, executeService.shell);
newExecute.extensions = executeService.extensions.Clone;
newClone.services.executeServices.push(newExecute);
}
} }
for each(var installService:InstallService in services.installServices) if(services.installServices != null)
{ {
var newInstall:InstallService = new InstallService(installService.url, installService.installPath, installService.fileType); newClone.services.installServices = new Vector.<InstallService>();
newInstall.extensions = installService.extensions.Clone; for each(var installService:InstallService in services.installServices)
newClone.services.installServices.push(newInstall); {
var newInstall:InstallService = new InstallService(installService.url, installService.installPath, installService.fileType);
newInstall.extensions = installService.extensions.Clone;
newClone.services.installServices.push(newInstall);
}
} }
newClone.extensions = extensions.Clone; newClone.extensions = extensions.Clone;
// Remove the emulab extensions, it's just manifest stuff // Remove the emulab extensions, it's just manifest stuff
if(newClone.extensions.spaces != null) if(newClone.extensions.spaces != null)
......
...@@ -51,7 +51,7 @@ package com.flack.shared ...@@ -51,7 +51,7 @@ package com.flack.shared
/** /**
* Flack version * Flack version
*/ */
public static const version:String = "v14.40"; public static const version:String = "v14.41";
public static const MODE_GENI:int = 0; public static const MODE_GENI:int = 0;
public static const MODE_EMULAB:int = 1; public static const MODE_EMULAB:int = 1;
......
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