1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

Initial commit

This commit is contained in:
Michael Crosby 2013-06-08 15:12:14 -09:00
commit bec8f53386
218 changed files with 55344 additions and 0 deletions

30
js/filters.js Normal file
View file

@ -0,0 +1,30 @@
'use strict';
angular.module('dockerui.filters', []).filter('truncate', function () {
return function (text, length, end) {
if(isNaN(length)) {
length = 10;
}
if(end === undefined) {
end = "...";
}
if(text.length <= length || text.length - end.length <= length) {
return text;
} else {
return String(text).substring(0, length - end.length) + end;
}
};
}).filter('statusbadge', function () {
return function (text) {
if(text === 'Ghost') {
return 'important';
}
return 'success';
};
}).filter('isactive', function ($location) {
return function (text) {
if(text == $location) {
return 'active';
}
return '';
};
});