1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-28 01:39:39 +02:00

Merge branch 'dev'

This commit is contained in:
Michael Crosby 2013-06-14 16:48:10 -09:00
commit e5dab43f46
11 changed files with 86 additions and 47 deletions

View file

@ -37,6 +37,13 @@ function DashboardController($scope, Container) {
}
function StatusBarController($scope, Settings) {
$scope.template = 'partials/statusbar.html';
$scope.uiVersion = Settings.uiVersion;
$scope.apiVersion = Settings.version;
}
function SideBarController($scope, Container, Settings) {
$scope.template = 'partials/sidebar.html';
$scope.containers = [];
@ -65,7 +72,7 @@ function SettingsController($scope, Auth, System, Docker, Settings) {
Auth.update(
{username: $scope.auth.username, email: $scope.auth.email, password: $scope.auth.password}, function(d) {
console.log(d);
setSuccessfulResponse($scope, 'Auto information updated.', '#response');
setSuccessfulResponse($scope, 'Auth information updated.', '#response');
}, function(e) {
console.log(e);
setFailedResponse($scope, e.data, '#response');
@ -133,6 +140,10 @@ function ContainerController($scope, $routeParams, $location, Container) {
$scope.changes = [];
$scope.hasContent = function(data) {
return data !== null && data !== undefined && data.length > 1;
};
$scope.getChanges = function() {
Container.changes({id: $routeParams.id}, function(d) {
$scope.changes = d;
@ -143,7 +154,10 @@ function ContainerController($scope, $routeParams, $location, Container) {
$scope.container = d;
}, function(e) {
console.log(e);
$location.path('/containers/');
setFailedResponse($scope, e.data, '#response');
if (e.status === 404) {
$('.detail').hide();
}
});
$scope.getChanges();
@ -175,9 +189,14 @@ function ContainersController($scope, Container, Settings) {
function ImagesController($scope, Image) {
$scope.predicate = '-Created';
$('#response').hide();
$scope.alertClass = 'block';
Image.query({}, function(d) {
$scope.images = d;
}, function (e) {
console.log(e);
setFailedResponse($scope, e.data, '#response');
});
}
@ -221,7 +240,10 @@ function ImageController($scope, $routeParams, $location, Image) {
$scope.image = d;
}, function(e) {
console.log(e);
$location.path('/images/');
setFailedResponse($scope, e.data, '#response');
if (e.status === 404) {
$('.detail').hide();
}
});
$scope.getHistory();
@ -229,17 +251,21 @@ function ImageController($scope, $routeParams, $location, Image) {
function StartContainerController($scope, $routeParams, $location, Container) {
$scope.template = 'partials/startcontainer.html';
$scope.memory = 0;
$scope.memorySwap = 0;
$scope.env = '';
$scope.dns = '';
$scope.volumesFrom = '';
$scope.commands = '';
$scope.config = {
memory: 0,
memorySwap: 0,
env: '',
commands: '',
volumesFrom: ''
};
$scope.commandPlaceholder = '["/bin/echo", "Hello world"]';
$scope.launchContainer = function() {
$scope.response = '';
var cmds = null;
if ($scope.commands !== '') {
cmds = $scope.commands.split('\n');
if ($scope.config.commands !== '') {
cmds = angular.fromJson($scope.config.commands);
}
var id = $routeParams.id;
var ctor = Container;
@ -248,10 +274,10 @@ function StartContainerController($scope, $routeParams, $location, Container) {
Container.create({
Image: id,
Memory: $scope.memory,
MemorySwap: $scope.memorySwap,
Memory: $scope.config.memory,
MemorySwap: $scope.config.memorySwap,
Cmd: cmds,
VolumesFrom: $scope.volumesFrom
VolumesFrom: $scope.config.volumesFrom
}, function(d) {
console.log(d);
if (d.Id) {