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