|
|
@ -15,12 +15,12 @@ function ($scope, $q, $state, $filter, Config, Container, ContainerHelper, Image
|
|
|
|
Container.create(config, function (d) {
|
|
|
|
Container.create(config, function (d) {
|
|
|
|
if (d.message) {
|
|
|
|
if (d.message) {
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
Messages.error('Error', d.message);
|
|
|
|
Messages.error('Error', {}, d.message);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Container.start({id: d.Id}, {}, function (cd) {
|
|
|
|
Container.start({id: d.Id}, {}, function (cd) {
|
|
|
|
if (cd.message) {
|
|
|
|
if (cd.message) {
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
Messages.error('Error', cd.message);
|
|
|
|
Messages.error('Error', {}, cd.message);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
Messages.send('Container Started', d.Id);
|
|
|
|
Messages.send('Container Started', d.Id);
|
|
|
@ -28,20 +28,12 @@ function ($scope, $q, $state, $filter, Config, Container, ContainerHelper, Image
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, function (e) {
|
|
|
|
}, function (e) {
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
if (e.data.message) {
|
|
|
|
Messages.error("Failure", e, 'Unable to start container');
|
|
|
|
Messages.error("Failure", e.data.message);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Messages.error("Failure", 'Unable to start container');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, function (e) {
|
|
|
|
}, function (e) {
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
if (e.data.message) {
|
|
|
|
Messages.error("Failure", e, 'Unable to create container');
|
|
|
|
Messages.error("Failure", e.data.message);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Messages.error("Failure", 'Unable to create container');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -53,13 +45,13 @@ function ($scope, $q, $state, $filter, Config, Container, ContainerHelper, Image
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|
var detail = data[data.length - 1];
|
|
|
|
var detail = data[data.length - 1];
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
Messages.error('Error', detail.error);
|
|
|
|
Messages.error("Error", {}, detail.error);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
createContainer(containerConfig);
|
|
|
|
createContainer(containerConfig);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, function (e) {
|
|
|
|
}, function (e) {
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
$('#createContainerSpinner').hide();
|
|
|
|
Messages.error('Error', 'Unable to pull image ' + image);
|
|
|
|
Messages.error("Failure", e, "Unable to pull image");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -120,18 +112,14 @@ function ($scope, $q, $state, $filter, Config, Container, ContainerHelper, Image
|
|
|
|
volumeQueries.push(
|
|
|
|
volumeQueries.push(
|
|
|
|
Volume.create({}, function (d) {
|
|
|
|
Volume.create({}, function (d) {
|
|
|
|
if (d.message) {
|
|
|
|
if (d.message) {
|
|
|
|
Messages.error('Unable to create volume', d.message);
|
|
|
|
Messages.error("Unable to create volume", {}, d.message);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Messages.send("Volume created", d.Name);
|
|
|
|
Messages.send("Volume created", d.Name);
|
|
|
|
containerConfig.Volumes[vol] = {};
|
|
|
|
containerConfig.Volumes[vol] = {};
|
|
|
|
containerConfig.HostConfig.Binds.push(d.Name + ':' + vol);
|
|
|
|
containerConfig.HostConfig.Binds.push(d.Name + ':' + vol);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, function (e) {
|
|
|
|
}, function (e) {
|
|
|
|
if (e.data.message) {
|
|
|
|
Messages.error("Failure", e, "Unable to create volume");
|
|
|
|
Messages.error("Failure", e.data.message);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Messages.error("Failure", 'Unable to create volume');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).$promise
|
|
|
|
}).$promise
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -171,7 +159,7 @@ function ($scope, $q, $state, $filter, Config, Container, ContainerHelper, Image
|
|
|
|
$('#loadTemplatesSpinner').hide();
|
|
|
|
$('#loadTemplatesSpinner').hide();
|
|
|
|
}, function (e) {
|
|
|
|
}, function (e) {
|
|
|
|
$('#loadTemplatesSpinner').hide();
|
|
|
|
$('#loadTemplatesSpinner').hide();
|
|
|
|
Messages.error("Unable to retrieve apps list", e.data);
|
|
|
|
Messages.error("Failure", e, "Unable to retrieve apps list");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -195,7 +183,7 @@ function ($scope, $q, $state, $filter, Config, Container, ContainerHelper, Image
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$scope.availableNetworks = networks;
|
|
|
|
$scope.availableNetworks = networks;
|
|
|
|
}, function (e) {
|
|
|
|
}, function (e) {
|
|
|
|
Messages.error("Unable to retrieve available networks", e.data);
|
|
|
|
Messages.error("Failure", e, "Unable to retrieve networks");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
Container.query({all: 0}, function (d) {
|
|
|
|
Container.query({all: 0}, function (d) {
|
|
|
|
var containers = d;
|
|
|
|
var containers = d;
|
|
|
@ -204,7 +192,7 @@ function ($scope, $q, $state, $filter, Config, Container, ContainerHelper, Image
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$scope.runningContainers = containers;
|
|
|
|
$scope.runningContainers = containers;
|
|
|
|
}, function (e) {
|
|
|
|
}, function (e) {
|
|
|
|
Messages.error("Unable to retrieve running containers", e.data);
|
|
|
|
Messages.error("Failure", e, "Unable to retrieve running containers");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
initTemplates();
|
|
|
|
initTemplates();
|
|
|
|
});
|
|
|
|
});
|
|
|
|