\n" +
- "
\n" +
- "
\n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
" \n" +
"
\n" +
" \n" +
"");
}]);
+
+angular.module("app/components/stats/stats.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("app/components/stats/stats.html",
+ "
\n" +
+ "
\n" +
+ "
Stats
\n" +
+ "\n" +
+ "
CPU
\n" +
+ "\n" +
+ "
\n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ "
\n" +
+ "\n" +
+ "
Memory
\n" +
+ "\n" +
+ "
\n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ "
\n" +
+ "
\n" +
+ " \n" +
+ " | Max usage | \n" +
+ " {{ data.memory_stats.max_usage | humansize }} | \n" +
+ "
\n" +
+ " \n" +
+ " | Limit | \n" +
+ " {{ data.memory_stats.limit | humansize }} | \n" +
+ "
\n" +
+ " \n" +
+ " | Fail count | \n" +
+ " {{ data.memory_stats.failcnt }} | \n" +
+ "
\n" +
+ "
\n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " | {{ key }} | \n" +
+ " {{ value }} | \n" +
+ "
\n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ "
\n" +
+ "\n" +
+ "
Network
\n" +
+ "
\n" +
+ "
\n" +
+ " \n" +
+ "
\n" +
+ "
\n" +
+ "
\n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " | {{ key }} | \n" +
+ " {{ value }} | \n" +
+ "
\n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ "
\n" +
+ "
\n" +
+ "
\n" +
+ "
\n" +
+ "");
+}]);
diff --git a/dockerui b/dockerui
index 86d58ed2d..125f16315 100755
Binary files a/dockerui and b/dockerui differ
diff --git a/dockerui-checksum.txt b/dockerui-checksum.txt
index 67b6c3a67..685276ec4 100644
--- a/dockerui-checksum.txt
+++ b/dockerui-checksum.txt
@@ -1 +1 @@
-2f09b03e7ec281dff6597424729080a1715e6627 dockerui
+c072c9ed628114262f72f96677a39c134e216d5b dockerui
diff --git a/gruntFile.js b/gruntFile.js
index a81483254..b6f23e378 100644
--- a/gruntFile.js
+++ b/gruntFile.js
@@ -11,19 +11,19 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-html2js');
// Default task.
- grunt.registerTask('default', ['jshint','build','karma:unit']);
- grunt.registerTask('build', ['clean','html2js','concat','recess:build', 'copy']);
- grunt.registerTask('release', ['clean','html2js','uglify','jshint','karma:unit','concat:index', 'recess:min', 'copy']);
+ grunt.registerTask('default', ['jshint', 'build', 'karma:unit']);
+ grunt.registerTask('build', ['clean', 'html2js', 'concat', 'recess:build', 'copy']);
+ grunt.registerTask('release', ['clean', 'html2js', 'uglify', 'jshint', 'karma:unit', 'concat:index', 'recess:min', 'copy']);
grunt.registerTask('test-watch', ['karma:watch']);
// Print a timestamp (useful for when watching)
- grunt.registerTask('timestamp', function() {
+ grunt.registerTask('timestamp', function () {
grunt.log.subhead(Date());
});
- var karmaConfig = function(configFile, customOptions) {
- var options = { configFile: configFile, keepalive: true };
- var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'], reporters: 'dots' };
+ var karmaConfig = function (configFile, customOptions) {
+ var options = {configFile: configFile, keepalive: true};
+ var travisOptions = process.env.TRAVIS && {browsers: ['Firefox'], reporters: 'dots'};
return grunt.util._.extend(options, customOptions, travisOptions);
};
@@ -31,8 +31,8 @@ module.exports = function (grunt) {
grunt.initConfig({
distdir: 'dist',
pkg: grunt.file.readJSON('package.json'),
- banner:
- '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
+ remoteApiVersion: 'v1.20',
+ banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;\n' +
' * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n */\n',
@@ -50,12 +50,12 @@ module.exports = function (grunt) {
clean: ['<%= distdir %>/*'],
copy: {
assets: {
- files: [{ dest: '<%= distdir %>/assets', src : '**', expand: true, cwd: 'assets/' }]
+ files: [{dest: '<%= distdir %>/assets', src: '**', expand: true, cwd: 'assets/'}]
}
},
karma: {
- unit: { options: karmaConfig('test/unit/karma.conf.js') },
- watch: { options: karmaConfig('test/unit/karma.conf.js', { singleRun:false, autoWatch: true}) }
+ unit: {options: karmaConfig('test/unit/karma.conf.js')},
+ watch: {options: karmaConfig('test/unit/karma.conf.js', {singleRun: false, autoWatch: true})}
},
html2js: {
app: {
@@ -67,14 +67,14 @@ module.exports = function (grunt) {
module: '<%= pkg.name %>.templates'
}
},
- concat:{
- dist:{
+ concat: {
+ dist: {
options: {
banner: "<%= banner %>",
process: true
},
- src:['<%= src.js %>', '<%= src.jsTpl %>'],
- dest:'<%= distdir %>/<%= pkg.name %>.js'
+ src: ['<%= src.js %>', '<%= src.jsTpl %>'],
+ dest: '<%= distdir %>/<%= pkg.name %>.js'
},
index: {
src: ['index.html'],
@@ -84,32 +84,32 @@ module.exports = function (grunt) {
}
},
angular: {
- src:['assets/js/angularjs/1.3.15/angular.min.js',
- 'assets/js/angularjs/1.3.15/angular-route.min.js',
- 'assets/js/angularjs/1.3.15/angular-resource.min.js',
- 'assets/js/ui-bootstrap/ui-bootstrap-custom-tpls-0.12.0.min.js',
- 'assets/js/angular-oboe.min.js'],
+ src: ['assets/js/angularjs/1.3.15/angular.min.js',
+ 'assets/js/angularjs/1.3.15/angular-route.min.js',
+ 'assets/js/angularjs/1.3.15/angular-resource.min.js',
+ 'assets/js/ui-bootstrap/ui-bootstrap-custom-tpls-0.12.0.min.js',
+ 'assets/js/angular-oboe.min.js'],
dest: '<%= distdir %>/angular.js'
}
},
uglify: {
- dist:{
+ dist: {
options: {
banner: "<%= banner %>"
},
- src:['<%= src.js %>' ,'<%= src.jsTpl %>'],
- dest:'<%= distdir %>/<%= pkg.name %>.js'
+ src: ['<%= src.js %>', '<%= src.jsTpl %>'],
+ dest: '<%= distdir %>/<%= pkg.name %>.js'
},
angular: {
- src:['<%= concat.angular.src %>'],
+ src: ['<%= concat.angular.src %>'],
dest: '<%= distdir %>/angular.js'
}
},
recess: {
build: {
files: {
- '<%= distdir %>/<%= pkg.name %>.css':
- ['<%= src.css %>'] },
+ '<%= distdir %>/<%= pkg.name %>.css': ['<%= src.css %>']
+ },
options: {
compile: true,
noOverqualifying: false // TODO: Added because of .nav class, rename
@@ -124,29 +124,29 @@ module.exports = function (grunt) {
}
}
},
- watch:{
+ watch: {
all: {
- files:['<%= src.js %>', '<%= src.specs %>', '<%= src.css %>', '<%= src.tpl.app %>', '<%= src.tpl.common %>', '<%= src.html %>'],
- tasks:['default','timestamp']
+ files: ['<%= src.js %>', '<%= src.specs %>', '<%= src.css %>', '<%= src.tpl.app %>', '<%= src.tpl.common %>', '<%= src.html %>'],
+ tasks: ['default', 'timestamp']
},
build: {
- files:['<%= src.js %>', '<%= src.specs %>', '<%= src.css %>', '<%= src.tpl.app %>', '<%= src.tpl.common %>', '<%= src.html %>'],
- tasks:['build','timestamp']
+ files: ['<%= src.js %>', '<%= src.specs %>', '<%= src.css %>', '<%= src.tpl.app %>', '<%= src.tpl.common %>', '<%= src.html %>'],
+ tasks: ['build', 'timestamp']
}
},
- jshint:{
- files:['gruntFile.js', '<%= src.js %>', '<%= src.jsTpl %>', '<%= src.specs %>', '<%= src.scenarios %>'],
- options:{
- curly:true,
- eqeqeq:true,
- immed:true,
- latedef:true,
- newcap:true,
- noarg:true,
- sub:true,
- boss:true,
- eqnull:true,
- globals:{
+ jshint: {
+ files: ['gruntFile.js', '<%= src.js %>', '<%= src.jsTpl %>', '<%= src.specs %>', '<%= src.scenarios %>'],
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ boss: true,
+ eqnull: true,
+ globals: {
angular: false,
'$': false
}
diff --git a/package.json b/package.json
index f91e6a816..d5847847c 100644
--- a/package.json
+++ b/package.json
@@ -1,35 +1,35 @@
{
- "author": "Michael Crosby & Kevan Ahlquist",
- "name": "dockerui",
- "homepage": "https://github.com/crosbymichael/dockerui",
- "version": "0.8.0-beta",
- "repository": {
- "type": "git",
- "url": "git@github.com:crosbymichael/dockerui.git"
- },
- "bugs": {
- "url": "https://github.com/crosbymichael/dockerui/issues"
- },
- "licenses": [
- {
- "type": "MIT",
- "url": "https://raw.githubusercontent.com/crosbymichael/dockerui/master/LICENSE"
- }
- ],
- "engines": {
- "node": ">= 0.8.4"
- },
- "dependencies": {},
- "devDependencies": {
- "grunt": "~0.4.0",
- "grunt-recess": "~0.3",
- "grunt-contrib-clean": "~0.4.0",
- "grunt-contrib-copy": "~0.4.0",
- "grunt-contrib-jshint": "~0.2.0",
- "grunt-contrib-concat": "~0.1.3",
- "grunt-contrib-uglify": "~0.1.1",
- "grunt-karma": "~0.4.4",
- "grunt-html2js": "~0.1.0",
- "grunt-contrib-watch": "~0.3.1"
+ "author": "Michael Crosby & Kevan Ahlquist",
+ "name": "dockerui",
+ "homepage": "https://github.com/crosbymichael/dockerui",
+ "version": "0.8.0",
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:crosbymichael/dockerui.git"
+ },
+ "bugs": {
+ "url": "https://github.com/crosbymichael/dockerui/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://raw.githubusercontent.com/crosbymichael/dockerui/master/LICENSE"
}
+ ],
+ "engines": {
+ "node": ">= 0.8.4"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "grunt": "~0.4.0",
+ "grunt-recess": "~0.3",
+ "grunt-contrib-clean": "~0.4.0",
+ "grunt-contrib-copy": "~0.4.0",
+ "grunt-contrib-jshint": "~0.2.0",
+ "grunt-contrib-concat": "~0.1.3",
+ "grunt-contrib-uglify": "~0.1.1",
+ "grunt-karma": "~0.4.4",
+ "grunt-html2js": "~0.1.0",
+ "grunt-contrib-watch": "~0.3.1"
+ }
}
diff --git a/test/unit/app/components/startContainerController.spec.js b/test/unit/app/components/startContainerController.spec.js
index 5d7b11c2a..57d898de1 100644
--- a/test/unit/app/components/startContainerController.spec.js
+++ b/test/unit/app/components/startContainerController.spec.js
@@ -1,19 +1,19 @@
-describe('startContainerController', function() {
+describe('startContainerController', function () {
var scope, $location, createController, mockContainer, $httpBackend;
beforeEach(angular.mock.module('dockerui'));
- beforeEach(inject(function($rootScope, $controller, _$location_) {
+ beforeEach(inject(function ($rootScope, $controller, _$location_) {
$location = _$location_;
scope = $rootScope.$new();
- createController = function() {
+ createController = function () {
return $controller('StartContainerController', {
'$scope': scope
});
};
- angular.mock.inject(function(_Container_, _$httpBackend_) {
+ angular.mock.inject(function (_Container_, _$httpBackend_) {
mockContainer = _Container_;
$httpBackend = _$httpBackend_;
});
@@ -34,8 +34,9 @@ describe('startContainerController', function() {
'Status': 'Up 2 minutes'
}]);
}
- describe('Create and start a container with port bindings', function() {
- it('should issue a correct create request to the Docker remote API', function() {
+
+ describe('Create and start a container with port bindings', function () {
+ it('should issue a correct create request to the Docker remote API', function () {
var controller = createController();
var id = '6abd8bfba81cf8a05a76a4bdefcb36c4b66cd02265f4bfcd0e236468696ebc6c';
var expectedBody = {
@@ -76,8 +77,8 @@ describe('startContainerController', function() {
});
});
- describe('Create and start a container with environment variables', function() {
- it('should issue a correct create request to the Docker remote API', function() {
+ describe('Create and start a container with environment variables', function () {
+ it('should issue a correct create request to the Docker remote API', function () {
var controller = createController();
var id = '6abd8bfba81cf8a05a76a4bdefcb36c4b66cd02265f4bfcd0e236468696ebc6c';
var expectedBody = {
@@ -110,8 +111,8 @@ describe('startContainerController', function() {
});
});
- describe('Create and start a container with volumesFrom', function() {
- it('should issue a correct create request to the Docker remote API', function() {
+ describe('Create and start a container with volumesFrom', function () {
+ it('should issue a correct create request to the Docker remote API', function () {
var controller = createController();
var id = '6abd8bfba81cf8a05a76a4bdefcb36c4b66cd02265f4bfcd0e236468696ebc6c';
var expectedBody = {
@@ -133,15 +134,15 @@ describe('startContainerController', function() {
});
scope.config.name = 'container-name';
- scope.config.HostConfig.VolumesFrom = [{name: 'parent'}, {name:'other:ro'}];
+ scope.config.HostConfig.VolumesFrom = [{name: 'parent'}, {name: 'other:ro'}];
scope.create();
$httpBackend.flush();
});
});
-
- describe('Create and start a container with multiple options', function() {
- it('should issue a correct create request to the Docker remote API', function() {
+
+ describe('Create and start a container with multiple options', function () {
+ it('should issue a correct create request to the Docker remote API', function () {
var controller = createController();
var id = '6abd8bfba81cf8a05a76a4bdefcb36c4b66cd02265f4bfcd0e236468696ebc6c';
var expectedBody = {
@@ -154,8 +155,12 @@ describe('startContainerController', function() {
DnsSearch: ['example.com'],
CapAdd: ['cap_sys_admin'],
CapDrop: ['cap_foo_bar'],
- Devices: [{ 'PathOnHost': '/dev/deviceName', 'PathInContainer': '/dev/deviceName', 'CgroupPermissions': 'mrw'}],
- LxcConf: {'lxc.utsname':'docker'},
+ Devices: [{
+ 'PathOnHost': '/dev/deviceName',
+ 'PathInContainer': '/dev/deviceName',
+ 'CgroupPermissions': 'mrw'
+ }],
+ LxcConf: {'lxc.utsname': 'docker'},
ExtraHosts: ['hostname:127.0.0.1'],
RestartPolicy: {name: 'always', MaximumRetryCount: 5}
},
@@ -190,7 +195,11 @@ describe('startContainerController', function() {
scope.config.HostConfig.PublishAllPorts = true;
scope.config.HostConfig.Privileged = true;
scope.config.HostConfig.RestartPolicy = {name: 'always', MaximumRetryCount: 5};
- scope.config.HostConfig.Devices = [{ 'PathOnHost': '/dev/deviceName', 'PathInContainer': '/dev/deviceName', 'CgroupPermissions': 'mrw'}];
+ scope.config.HostConfig.Devices = [{
+ 'PathOnHost': '/dev/deviceName',
+ 'PathInContainer': '/dev/deviceName',
+ 'CgroupPermissions': 'mrw'
+ }];
scope.config.HostConfig.LxcConf = [{name: 'lxc.utsname', value: 'docker'}];
scope.config.HostConfig.ExtraHosts = [{host: 'hostname', ip: '127.0.0.1'}];
diff --git a/test/unit/app/components/statsController.spec.js b/test/unit/app/components/statsController.spec.js
new file mode 100644
index 000000000..2cbc138ba
--- /dev/null
+++ b/test/unit/app/components/statsController.spec.js
@@ -0,0 +1,31 @@
+describe("StatsController", function () {
+ var $scope, $httpBackend, $routeParams;
+
+ beforeEach(angular.mock.module('dockerui'));
+
+ beforeEach(inject(function (_$rootScope_, _$httpBackend_, $controller, _$routeParams_) {
+ $scope = _$rootScope_.$new();
+ $httpBackend = _$httpBackend_;
+ $routeParams = _$routeParams_;
+ $routeParams.id = 'b17882378cee8ec0136f482681b764cca430befd52a9bfd1bde031f49b8bba9f';
+ $controller('StatsController', {
+ '$scope': $scope,
+ '$routeParams': $routeParams
+ });
+ }));
+
+ //it("should test controller initialize", function () {
+ // $httpBackend.expectGET('dockerapi/containers/b17882378cee8ec0136f482681b764cca430befd52a9bfd1bde031f49b8bba9f/stats?stream=false').respond(200);
+ // //expect($scope.ps_args).toBeDefined();
+ // $httpBackend.flush();
+ //});
+ //
+ //it("a correct top request to the Docker remote API", function () {
+ // //$httpBackend.expectGET('dockerapi/containers/' + $routeParams.id + '/top?ps_args=').respond(200);
+ // //$routeParams.id = '123456789123456789123456789';
+ // //$scope.ps_args = 'aux';
+ // //$httpBackend.expectGET('dockerapi/containers/' + $routeParams.id + '/top?ps_args=' + $scope.ps_args).respond(200);
+ // //$scope.getTop();
+ // //$httpBackend.flush();
+ //});
+});
\ No newline at end of file
diff --git a/test/unit/app/shared/filters.spec.js b/test/unit/app/shared/filters.spec.js
index f48640783..6ebfabe59 100644
--- a/test/unit/app/shared/filters.spec.js
+++ b/test/unit/app/shared/filters.spec.js
@@ -2,40 +2,40 @@ describe('filters', function () {
beforeEach(module('dockerui.filters'));
describe('truncate', function () {
- it('should truncate the string to 10 characters ending in "..." by default', inject(function(truncateFilter) {
+ it('should truncate the string to 10 characters ending in "..." by default', inject(function (truncateFilter) {
expect(truncateFilter('this is 20 chars long')).toBe('this is...');
}));
- it('should truncate the string to 7 characters ending in "..."', inject(function(truncateFilter) {
+ it('should truncate the string to 7 characters ending in "..."', inject(function (truncateFilter) {
expect(truncateFilter('this is 20 chars long', 7)).toBe('this...');
}));
- it('should truncate the string to 10 characters ending in "???"', inject(function(truncateFilter) {
+ it('should truncate the string to 10 characters ending in "???"', inject(function (truncateFilter) {
expect(truncateFilter('this is 20 chars long', 10, '???')).toBe('this is???');
}));
});
describe('statusbadge', function () {
- it('should be "important" when input is "Ghost"', inject(function(statusbadgeFilter) {
+ it('should be "important" when input is "Ghost"', inject(function (statusbadgeFilter) {
expect(statusbadgeFilter('Ghost')).toBe('important');
}));
- it('should be "success" when input is "Exit 0"', inject(function(statusbadgeFilter) {
+ it('should be "success" when input is "Exit 0"', inject(function (statusbadgeFilter) {
expect(statusbadgeFilter('Exit 0')).toBe('success');
}));
- it('should be "warning" when exit code is non-zero', inject(function(statusbadgeFilter) {
+ it('should be "warning" when exit code is non-zero', inject(function (statusbadgeFilter) {
expect(statusbadgeFilter('Exit 1')).toBe('warning');
}));
});
describe('getstatetext', function () {
- it('should return an empty string when state is undefined', inject(function(getstatetextFilter) {
+ it('should return an empty string when state is undefined', inject(function (getstatetextFilter) {
expect(getstatetextFilter(undefined)).toBe('');
}));
- it('should detect a Ghost state', inject(function(getstatetextFilter) {
+ it('should detect a Ghost state', inject(function (getstatetextFilter) {
var state = {
Ghost: true,
Running: true,
@@ -44,7 +44,7 @@ describe('filters', function () {
expect(getstatetextFilter(state)).toBe('Ghost');
}));
- it('should detect a Paused state', inject(function(getstatetextFilter) {
+ it('should detect a Paused state', inject(function (getstatetextFilter) {
var state = {
Ghost: false,
Running: true,
@@ -53,7 +53,7 @@ describe('filters', function () {
expect(getstatetextFilter(state)).toBe('Running (Paused)');
}));
- it('should detect a Running state', inject(function(getstatetextFilter) {
+ it('should detect a Running state', inject(function (getstatetextFilter) {
var state = {
Ghost: false,
Running: true,
@@ -62,7 +62,7 @@ describe('filters', function () {
expect(getstatetextFilter(state)).toBe('Running');
}));
- it('should detect a Stopped state', inject(function(getstatetextFilter) {
+ it('should detect a Stopped state', inject(function (getstatetextFilter) {
var state = {
Ghost: false,
Running: false,
@@ -73,11 +73,11 @@ describe('filters', function () {
});
describe('getstatelabel', function () {
- it('should return an empty string when state is undefined', inject(function(getstatelabelFilter) {
+ it('should return an empty string when state is undefined', inject(function (getstatelabelFilter) {
expect(getstatelabelFilter(undefined)).toBe('');
}));
- it('should return label-important when a ghost state is detected', inject(function(getstatelabelFilter) {
+ it('should return label-important when a ghost state is detected', inject(function (getstatelabelFilter) {
var state = {
Ghost: true,
Running: true,
@@ -86,7 +86,7 @@ describe('filters', function () {
expect(getstatelabelFilter(state)).toBe('label-important');
}));
- it('should return label-success when a running state is detected', inject(function(getstatelabelFilter) {
+ it('should return label-success when a running state is detected', inject(function (getstatelabelFilter) {
var state = {
Ghost: false,
Running: true,
@@ -97,33 +97,33 @@ describe('filters', function () {
});
describe('humansize', function () {
- it('should return n/a when size is zero', inject(function(humansizeFilter) {
+ it('should return n/a when size is zero', inject(function (humansizeFilter) {
expect(humansizeFilter(0)).toBe('n/a');
}));
- it('should handle Bytes values', inject(function(humansizeFilter) {
+ it('should handle Bytes values', inject(function (humansizeFilter) {
expect(humansizeFilter(512)).toBe('512 Bytes');
}));
- it('should handle KB values', inject(function(humansizeFilter) {
- expect(humansizeFilter(5120)).toBe('5 KB');
+ it('should handle KB values', inject(function (humansizeFilter) {
+ expect(humansizeFilter(5 * 1024)).toBe('5 KB');
}));
- it('should handle MB values', inject(function(humansizeFilter) {
- expect(humansizeFilter(5 * Math.pow(10, 6))).toBe('5 MB');
+ it('should handle MB values', inject(function (humansizeFilter) {
+ expect(humansizeFilter(5 * 1024 * 1024)).toBe('5.0 MB');
}));
- it('should handle GB values', inject(function(humansizeFilter) {
- expect(humansizeFilter(5 * Math.pow(10, 9))).toBe('5 GB');
+ it('should handle GB values', inject(function (humansizeFilter) {
+ expect(humansizeFilter(5 * 1024 * 1024 * 1024)).toBe('5.00 GB');
}));
- it('should handle TB values', inject(function(humansizeFilter) {
- expect(humansizeFilter(5 * Math.pow(10, 12))).toBe('5 TB');
+ it('should handle TB values', inject(function (humansizeFilter) {
+ expect(humansizeFilter(5 * 1024 * 1024 * 1024 * 1024)).toBe('5.000 TB');
}));
});
describe('containername', function () {
- it('should strip the leading slash from container name', inject(function(containernameFilter) {
+ it('should strip the leading slash from container name', inject(function (containernameFilter) {
var container = {
Names: ['/elegant_ardinghelli']
};
@@ -133,14 +133,14 @@ describe('filters', function () {
});
describe('repotag', function () {
- it('should not display empty repo tag', inject(function(repotagFilter) {
+ it('should not display empty repo tag', inject(function (repotagFilter) {
var image = {
RepoTags: ['
:']
};
expect(repotagFilter(image)).toBe('');
}));
- it('should display a normal repo tag', inject(function(repotagFilter) {
+ it('should display a normal repo tag', inject(function (repotagFilter) {
var image = {
RepoTags: ['ubuntu:latest']
};
@@ -149,17 +149,207 @@ describe('filters', function () {
});
describe('getdate', function () {
- it('should convert the Docker date to a human readable form', inject(function(getdateFilter) {
+ it('should convert the Docker date to a human readable form', inject(function (getdateFilter) {
expect(getdateFilter(1420424998)).toBe('Sun Jan 04 2015');
}));
});
- describe('errorMsgFilter', function() {
+ describe('errorMsgFilter', function () {
it('should convert the $resource object to a string message',
- inject(function(errorMsgFilter) {
- var response = {'0':'C','1':'o','2':'n','3':'f','4':'l','5':'i','6':'c','7':'t','8':',','9':' ','10':'T','11':'h','12':'e','13':' ','14':'n','15':'a','16':'m','17':'e','18':' ','19':'u','20':'b','21':'u','22':'n','23':'t','24':'u','25':'-','26':'s','27':'l','28':'e','29':'e','30':'p','31':'-','32':'r','33':'u','34':'n','35':'t','36':'i','37':'m','38':'e','39':' ','40':'i','41':'s','42':' ','43':'a','44':'l','45':'r','46':'e','47':'a','48':'d','49':'y','50':' ','51':'a','52':'s','53':'s','54':'i','55':'g','56':'n','57':'e','58':'d','59':' ','60':'t','61':'o','62':' ','63':'b','64':'6','65':'9','66':'e','67':'5','68':'3','69':'a','70':'6','71':'2','72':'2','73':'c','74':'8','75':'.','76':' ','77':'Y','78':'o','79':'u','80':' ','81':'h','82':'a','83':'v','84':'e','85':' ','86':'t','87':'o','88':' ','89':'d','90':'e','91':'l','92':'e','93':'t','94':'e','95':' ','96':'(','97':'o','98':'r','99':' ','100':'r','101':'e','102':'n','103':'a','104':'m','105':'e','106':')','107':' ','108':'t','109':'h','110':'a','111':'t','112':' ','113':'c','114':'o','115':'n','116':'t','117':'a','118':'i','119':'n','120':'e','121':'r','122':' ','123':'t','124':'o','125':' ','126':'b','127':'e','128':' ','129':'a','130':'b','131':'l','132':'e','133':' ','134':'t','135':'o','136':' ','137':'a','138':'s','139':'s','140':'i','141':'g','142':'n','143':' ','144':'u','145':'b','146':'u','147':'n','148':'t','149':'u','150':'-','151':'s','152':'l','153':'e','154':'e','155':'p','156':'-','157':'r','158':'u','159':'n','160':'t','161':'i','162':'m','163':'e','164':' ','165':'t','166':'o','167':' ','168':'a','169':' ','170':'c','171':'o','172':'n','173':'t','174':'a','175':'i','176':'n','177':'e','178':'r','179':' ','180':'a','181':'g','182':'a','183':'i','184':'n','185':'.','186':'\n','$promise':{},'$resolved':true};
+ inject(function (errorMsgFilter) {
+ var response = {
+ '0': 'C',
+ '1': 'o',
+ '2': 'n',
+ '3': 'f',
+ '4': 'l',
+ '5': 'i',
+ '6': 'c',
+ '7': 't',
+ '8': ',',
+ '9': ' ',
+ '10': 'T',
+ '11': 'h',
+ '12': 'e',
+ '13': ' ',
+ '14': 'n',
+ '15': 'a',
+ '16': 'm',
+ '17': 'e',
+ '18': ' ',
+ '19': 'u',
+ '20': 'b',
+ '21': 'u',
+ '22': 'n',
+ '23': 't',
+ '24': 'u',
+ '25': '-',
+ '26': 's',
+ '27': 'l',
+ '28': 'e',
+ '29': 'e',
+ '30': 'p',
+ '31': '-',
+ '32': 'r',
+ '33': 'u',
+ '34': 'n',
+ '35': 't',
+ '36': 'i',
+ '37': 'm',
+ '38': 'e',
+ '39': ' ',
+ '40': 'i',
+ '41': 's',
+ '42': ' ',
+ '43': 'a',
+ '44': 'l',
+ '45': 'r',
+ '46': 'e',
+ '47': 'a',
+ '48': 'd',
+ '49': 'y',
+ '50': ' ',
+ '51': 'a',
+ '52': 's',
+ '53': 's',
+ '54': 'i',
+ '55': 'g',
+ '56': 'n',
+ '57': 'e',
+ '58': 'd',
+ '59': ' ',
+ '60': 't',
+ '61': 'o',
+ '62': ' ',
+ '63': 'b',
+ '64': '6',
+ '65': '9',
+ '66': 'e',
+ '67': '5',
+ '68': '3',
+ '69': 'a',
+ '70': '6',
+ '71': '2',
+ '72': '2',
+ '73': 'c',
+ '74': '8',
+ '75': '.',
+ '76': ' ',
+ '77': 'Y',
+ '78': 'o',
+ '79': 'u',
+ '80': ' ',
+ '81': 'h',
+ '82': 'a',
+ '83': 'v',
+ '84': 'e',
+ '85': ' ',
+ '86': 't',
+ '87': 'o',
+ '88': ' ',
+ '89': 'd',
+ '90': 'e',
+ '91': 'l',
+ '92': 'e',
+ '93': 't',
+ '94': 'e',
+ '95': ' ',
+ '96': '(',
+ '97': 'o',
+ '98': 'r',
+ '99': ' ',
+ '100': 'r',
+ '101': 'e',
+ '102': 'n',
+ '103': 'a',
+ '104': 'm',
+ '105': 'e',
+ '106': ')',
+ '107': ' ',
+ '108': 't',
+ '109': 'h',
+ '110': 'a',
+ '111': 't',
+ '112': ' ',
+ '113': 'c',
+ '114': 'o',
+ '115': 'n',
+ '116': 't',
+ '117': 'a',
+ '118': 'i',
+ '119': 'n',
+ '120': 'e',
+ '121': 'r',
+ '122': ' ',
+ '123': 't',
+ '124': 'o',
+ '125': ' ',
+ '126': 'b',
+ '127': 'e',
+ '128': ' ',
+ '129': 'a',
+ '130': 'b',
+ '131': 'l',
+ '132': 'e',
+ '133': ' ',
+ '134': 't',
+ '135': 'o',
+ '136': ' ',
+ '137': 'a',
+ '138': 's',
+ '139': 's',
+ '140': 'i',
+ '141': 'g',
+ '142': 'n',
+ '143': ' ',
+ '144': 'u',
+ '145': 'b',
+ '146': 'u',
+ '147': 'n',
+ '148': 't',
+ '149': 'u',
+ '150': '-',
+ '151': 's',
+ '152': 'l',
+ '153': 'e',
+ '154': 'e',
+ '155': 'p',
+ '156': '-',
+ '157': 'r',
+ '158': 'u',
+ '159': 'n',
+ '160': 't',
+ '161': 'i',
+ '162': 'm',
+ '163': 'e',
+ '164': ' ',
+ '165': 't',
+ '166': 'o',
+ '167': ' ',
+ '168': 'a',
+ '169': ' ',
+ '170': 'c',
+ '171': 'o',
+ '172': 'n',
+ '173': 't',
+ '174': 'a',
+ '175': 'i',
+ '176': 'n',
+ '177': 'e',
+ '178': 'r',
+ '179': ' ',
+ '180': 'a',
+ '181': 'g',
+ '182': 'a',
+ '183': 'i',
+ '184': 'n',
+ '185': '.',
+ '186': '\n',
+ '$promise': {},
+ '$resolved': true
+ };
var message = 'Conflict, The name ubuntu-sleep-runtime is already assigned to b69e53a622c8. You have to delete (or rename) that container to be able to assign ubuntu-sleep-runtime to a container again.\n';
expect(errorMsgFilter(response)).toBe(message);
- }));
+ }));
});
});
\ No newline at end of file
diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js
index 31230fda2..038a2d5a5 100644
--- a/test/unit/karma.conf.js
+++ b/test/unit/karma.conf.js
@@ -3,19 +3,20 @@ basePath = '../..';
// list of files / patterns to load in the browser
files = [
- JASMINE,
- JASMINE_ADAPTER,
- 'assets/js/jquery-1.11.1.min.js',
- 'assets/js/jquery.gritter.min.js',
- 'assets/js/bootstrap.min.js',
- 'assets/js/spin.js',
- 'dist/angular.js',
- 'assets/js/ui-bootstrap/ui-bootstrap-custom-tpls-0.12.0.min.js',
- 'assets/js/angular-vis.js',
- 'test/assets/angular/angular-mocks.js',
- 'app/**/*.js',
- 'test/unit/**/*.spec.js',
- 'dist/templates/**/*.js'
+ JASMINE,
+ JASMINE_ADAPTER,
+ 'assets/js/jquery-1.11.1.min.js',
+ 'assets/js/jquery.gritter.min.js',
+ 'assets/js/bootstrap.min.js',
+ 'assets/js/spin.js',
+ 'assets/js/Chart.min.js',
+ 'dist/angular.js',
+ 'assets/js/ui-bootstrap/ui-bootstrap-custom-tpls-0.12.0.min.js',
+ 'assets/js/angular-vis.js',
+ 'test/assets/angular/angular-mocks.js',
+ 'app/**/*.js',
+ 'test/unit/**/*.spec.js',
+ 'dist/templates/**/*.js'
];
// use dots reporter, as travis terminal does not support escaping sequences