mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 13:55:21 +02:00
Whitespace diff, ran everything through the formatter.
This commit is contained in:
parent
b7daf91723
commit
8a7f8f7c37
39 changed files with 1926 additions and 1566 deletions
|
@ -1,12 +1,12 @@
|
|||
angular.module('dockerui.filters', [])
|
||||
.filter('truncate', function() {
|
||||
.filter('truncate', function () {
|
||||
'use strict';
|
||||
return function(text, length, end) {
|
||||
return function (text, length, end) {
|
||||
if (isNaN(length)) {
|
||||
length = 10;
|
||||
}
|
||||
|
||||
if (end === undefined){
|
||||
if (end === undefined) {
|
||||
end = '...';
|
||||
}
|
||||
|
||||
|
@ -18,9 +18,9 @@ angular.module('dockerui.filters', [])
|
|||
}
|
||||
};
|
||||
})
|
||||
.filter('statusbadge', function() {
|
||||
.filter('statusbadge', function () {
|
||||
'use strict';
|
||||
return function(text) {
|
||||
return function (text) {
|
||||
if (text === 'Ghost') {
|
||||
return 'important';
|
||||
} else if (text.indexOf('Exit') !== -1 && text !== 'Exit 0') {
|
||||
|
@ -29,9 +29,9 @@ angular.module('dockerui.filters', [])
|
|||
return 'success';
|
||||
};
|
||||
})
|
||||
.filter('getstatetext', function() {
|
||||
.filter('getstatetext', function () {
|
||||
'use strict';
|
||||
return function(state) {
|
||||
return function (state) {
|
||||
if (state === undefined) {
|
||||
return '';
|
||||
}
|
||||
|
@ -47,9 +47,9 @@ angular.module('dockerui.filters', [])
|
|||
return 'Stopped';
|
||||
};
|
||||
})
|
||||
.filter('getstatelabel', function() {
|
||||
.filter('getstatelabel', function () {
|
||||
'use strict';
|
||||
return function(state) {
|
||||
return function (state) {
|
||||
if (state === undefined) {
|
||||
return '';
|
||||
}
|
||||
|
@ -63,45 +63,47 @@ angular.module('dockerui.filters', [])
|
|||
return '';
|
||||
};
|
||||
})
|
||||
.filter('humansize', function() {
|
||||
.filter('humansize', function () {
|
||||
'use strict';
|
||||
return function(bytes) {
|
||||
return function (bytes) {
|
||||
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
||||
if (bytes === 0) {
|
||||
return 'n/a';
|
||||
}
|
||||
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10);
|
||||
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[[i]];
|
||||
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[[i]];
|
||||
};
|
||||
})
|
||||
.filter('containername', function() {
|
||||
.filter('containername', function () {
|
||||
'use strict';
|
||||
return function(container) {
|
||||
return function (container) {
|
||||
var name = container.Names[0];
|
||||
return name.substring(1, name.length);
|
||||
};
|
||||
})
|
||||
.filter('repotag', function() {
|
||||
.filter('repotag', function () {
|
||||
'use strict';
|
||||
return function(image) {
|
||||
return function (image) {
|
||||
if (image.RepoTags && image.RepoTags.length > 0) {
|
||||
var tag = image.RepoTags[0];
|
||||
if (tag === '<none>:<none>') { tag = ''; }
|
||||
if (tag === '<none>:<none>') {
|
||||
tag = '';
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
return '';
|
||||
return '';
|
||||
};
|
||||
})
|
||||
.filter('getdate', function() {
|
||||
.filter('getdate', function () {
|
||||
'use strict';
|
||||
return function(data) {
|
||||
return function (data) {
|
||||
//Multiply by 1000 for the unix format
|
||||
var date = new Date(data * 1000);
|
||||
return date.toDateString();
|
||||
};
|
||||
})
|
||||
.filter('errorMsg', function() {
|
||||
return function(object) {
|
||||
.filter('errorMsg', function () {
|
||||
return function (object) {
|
||||
var idx = 0;
|
||||
var msg = '';
|
||||
while (object[idx] && typeof(object[idx]) === 'string') {
|
||||
|
|
|
@ -25,16 +25,16 @@ angular.module('dockerui.services', ['ngResource'])
|
|||
'use strict';
|
||||
return {
|
||||
commit: function (params, callback) {
|
||||
$http({
|
||||
method: 'POST',
|
||||
url: Settings.url + '/commit',
|
||||
params: {
|
||||
'container': params.id,
|
||||
'repo': params.repo
|
||||
}
|
||||
}).success(callback).error(function (data, status, headers, config) {
|
||||
console.log(error, data);
|
||||
});
|
||||
$http({
|
||||
method: 'POST',
|
||||
url: Settings.url + '/commit',
|
||||
params: {
|
||||
'container': params.id,
|
||||
'repo': params.repo
|
||||
}
|
||||
}).success(callback).error(function (data, status, headers, config) {
|
||||
console.log(error, data);
|
||||
});
|
||||
}
|
||||
};
|
||||
})
|
||||
|
@ -80,11 +80,13 @@ angular.module('dockerui.services', ['ngResource'])
|
|||
get: {method: 'GET', params: {action: 'json'}},
|
||||
search: {method: 'GET', params: {action: 'search'}},
|
||||
history: {method: 'GET', params: {action: 'history'}, isArray: true},
|
||||
create: {method: 'POST', isArray: true, transformResponse: [function f(data) {
|
||||
var str = data.replace(/\n/g, " ").replace(/\}\W*\{/g, "}, {");
|
||||
return angular.fromJson("[" + str + "]");
|
||||
}],
|
||||
params: {action: 'create', fromImage: '@fromImage', repo: '@repo', tag: '@tag', registry: '@registry'}},
|
||||
create: {
|
||||
method: 'POST', isArray: true, transformResponse: [function f(data) {
|
||||
var str = data.replace(/\n/g, " ").replace(/\}\W*\{/g, "}, {");
|
||||
return angular.fromJson("[" + str + "]");
|
||||
}],
|
||||
params: {action: 'create', fromImage: '@fromImage', repo: '@repo', tag: '@tag', registry: '@registry'}
|
||||
},
|
||||
insert: {method: 'POST', params: {id: '@id', action: 'insert'}},
|
||||
push: {method: 'POST', params: {id: '@id', action: 'push'}},
|
||||
tag: {method: 'POST', params: {id: '@id', action: 'tag', force: 0, repo: '@repo'}},
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
function ImageViewModel(data) {
|
||||
this.Id = data.Id;
|
||||
this.Tag = data.Tag;
|
||||
|
@ -10,12 +9,12 @@ function ImageViewModel(data) {
|
|||
}
|
||||
|
||||
function ContainerViewModel(data) {
|
||||
this.Id = data.Id;
|
||||
this.Image = data.Image;
|
||||
this.Command = data.Command;
|
||||
this.Created = data.Created;
|
||||
this.SizeRw = data.SizeRw;
|
||||
this.Status = data.Status;
|
||||
this.Checked = false;
|
||||
this.Names = data.Names;
|
||||
this.Id = data.Id;
|
||||
this.Image = data.Image;
|
||||
this.Command = data.Command;
|
||||
this.Created = data.Created;
|
||||
this.SizeRw = data.SizeRw;
|
||||
this.Status = data.Status;
|
||||
this.Checked = false;
|
||||
this.Names = data.Names;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue