Add support for windows containers
This commit is contained in:
@@ -132,7 +132,7 @@ func (d *windows) InstanceDelete(session *types.Session, instance *types.Instanc
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *windows) InstanceResizeTerminal(instance *types.Instance, cols, rows uint) error {
|
||||
func (d *windows) InstanceResizeTerminal(instance *types.Instance, rows, cols uint) error {
|
||||
dockerClient, err := d.factory.GetForSession(instance.SessionId)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -172,7 +172,9 @@ func (d *windows) getWindowsInstanceInfo(sessionId string) (*instanceInfo, error
|
||||
availInstances := make([]string, len(instances))
|
||||
|
||||
for i, inst := range instances {
|
||||
availInstances[i] = *inst.InstanceId
|
||||
if *inst.LifecycleState == "InService" {
|
||||
availInstances[i] = *inst.InstanceId
|
||||
}
|
||||
}
|
||||
|
||||
assignedInstances, err := d.storage.InstanceGetAllWindows()
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
$scope.isAlive = true;
|
||||
$scope.ttl = '--:--:--';
|
||||
$scope.connected = true;
|
||||
$scope.type = {windows: false};
|
||||
$scope.isInstanceBeingCreated = false;
|
||||
$scope.newInstanceBtnText = '+ Add new instance';
|
||||
$scope.deleteInstanceBtnText = 'Delete';
|
||||
@@ -108,10 +109,11 @@
|
||||
|
||||
$scope.newInstance = function() {
|
||||
updateNewInstanceBtnState(true);
|
||||
var instanceType = $scope.type.windows ? 'windows': 'linux';
|
||||
$http({
|
||||
method: 'POST',
|
||||
url: '/sessions/' + $scope.sessionId + '/instances',
|
||||
data : { ImageName : InstanceService.getDesiredImage() }
|
||||
data : { ImageName : InstanceService.getDesiredImage(), type: instanceType }
|
||||
}).then(function(response) {
|
||||
var i = $scope.upsertInstance(response.data);
|
||||
$scope.showInstance(i);
|
||||
|
||||
@@ -48,7 +48,12 @@
|
||||
<div class="md-toolbar-tools">
|
||||
<h1 class="md-toolbar-tools">Instances</h1>
|
||||
<templates-icon></templates-icon>
|
||||
<settings-icon></settings-icon>
|
||||
<settings-icon></settings-icon><br/>
|
||||
</div>
|
||||
<div class="md-toolbar-tools">
|
||||
<md-switch ng-disabled="instances.length > 0" ng-model="type.windows">
|
||||
Windows containers {{windows}}
|
||||
</md-switch>
|
||||
</div>
|
||||
</md-toolbar>
|
||||
<md-content layout-padding>
|
||||
|
||||
Reference in New Issue
Block a user